diff --git a/src/cli/AI21.CLI/Commands/AgentCreateOptionSet.g.cs b/src/cli/AI21.CLI/Commands/AgentCreateOptionSet.g.cs new file mode 100644 index 00000000..516bce1a --- /dev/null +++ b/src/cli/AI21.CLI/Commands/AgentCreateOptionSet.g.cs @@ -0,0 +1,45 @@ +#nullable enable + +using System.CommandLine; + +namespace AI21.CLI.Commands; + +internal sealed record AgentCreateOptionSet( + Option AgentId, + Option Kind, + Option NameOption, + Option DescriptionOption, + Option ConfigId, + Option Enabled) +{ + public static AgentCreateOptionSet Create(string? prefix = null) + { + var normalizedPrefix = string.IsNullOrWhiteSpace(prefix) + ? string.Empty + : prefix.Trim().Trim('-') + "-"; + return new AgentCreateOptionSet( + AgentId: new Option($"--{normalizedPrefix}agent-id") + { + Description = @"", + Required = true, + }, + Kind: new Option($"--{normalizedPrefix}kind") + { + Description = @"", + }, + NameOption: new Option($"--{normalizedPrefix}name") + { + Description = @"", + }, + DescriptionOption: new Option($"--{normalizedPrefix}description") + { + Description = @"", + }, + ConfigId: new Option($"--{normalizedPrefix}config-id") + { + Description = @"", + }, + Enabled: CliRuntime.CreateNullableBoolOption(name: $"--{normalizedPrefix}enabled", description: @"") + ); + } +} \ No newline at end of file diff --git a/src/cli/AI21.CLI/Commands/AgentUpdateOptionSet.g.cs b/src/cli/AI21.CLI/Commands/AgentUpdateOptionSet.g.cs new file mode 100644 index 00000000..d7f614bc --- /dev/null +++ b/src/cli/AI21.CLI/Commands/AgentUpdateOptionSet.g.cs @@ -0,0 +1,39 @@ +#nullable enable + +using System.CommandLine; + +namespace AI21.CLI.Commands; + +internal sealed record AgentUpdateOptionSet( + Option NameOption, + Option Kind, + Option DescriptionOption, + Option ConfigId, + Option Enabled) +{ + public static AgentUpdateOptionSet Create(string? prefix = null) + { + var normalizedPrefix = string.IsNullOrWhiteSpace(prefix) + ? string.Empty + : prefix.Trim().Trim('-') + "-"; + return new AgentUpdateOptionSet( + NameOption: new Option($"--{normalizedPrefix}name") + { + Description = @"", + }, + Kind: new Option($"--{normalizedPrefix}kind") + { + Description = @"", + }, + DescriptionOption: new Option($"--{normalizedPrefix}description") + { + Description = @"", + }, + ConfigId: new Option($"--{normalizedPrefix}config-id") + { + Description = @"", + }, + Enabled: CliRuntime.CreateNullableBoolOption(name: $"--{normalizedPrefix}enabled", description: @"") + ); + } +} \ No newline at end of file diff --git a/src/cli/AI21.CLI/Commands/AnalyticsAgentsGatewayAnalyticsV1AgentsGetCommandApiCommand.g.cs b/src/cli/AI21.CLI/Commands/AnalyticsAgentsGatewayAnalyticsV1AgentsGetCommandApiCommand.g.cs new file mode 100644 index 00000000..45cb06c6 --- /dev/null +++ b/src/cli/AI21.CLI/Commands/AnalyticsAgentsGatewayAnalyticsV1AgentsGetCommandApiCommand.g.cs @@ -0,0 +1,59 @@ +#nullable enable +#pragma warning disable CS0618 + +using System.CommandLine; + +namespace AI21.CLI.Commands; + +internal static partial class AnalyticsAgentsGatewayAnalyticsV1AgentsGetCommandApiCommand +{ + + + 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(@"analytics-agents-gateway-analytics-v1-agents-get", @"Analytics Agents"); + + + + 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.AnalyticsAgentsGatewayAnalyticsV1AgentsGetAsync( + + cancellationToken: cancellationToken).ConfigureAwait(false); + + + await CliRuntime.WriteResponseAsync( + parseResult, + response, + global::AI21.SourceGenerationContext.Default, + FormatResponse, + cancellationToken).ConfigureAwait(false); + }, cancellationToken).ConfigureAwait(false)); + return command; + } +} \ No newline at end of file diff --git a/src/cli/AI21.CLI/Commands/AnalyticsAgentsTokenwiseAnalyticsV1AgentsGetCommandApiCommand.g.cs b/src/cli/AI21.CLI/Commands/AnalyticsAgentsTokenwiseAnalyticsV1AgentsGetCommandApiCommand.g.cs new file mode 100644 index 00000000..c0e8df1b --- /dev/null +++ b/src/cli/AI21.CLI/Commands/AnalyticsAgentsTokenwiseAnalyticsV1AgentsGetCommandApiCommand.g.cs @@ -0,0 +1,59 @@ +#nullable enable +#pragma warning disable CS0618 + +using System.CommandLine; + +namespace AI21.CLI.Commands; + +internal static partial class AnalyticsAgentsTokenwiseAnalyticsV1AgentsGetCommandApiCommand +{ + + + 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(@"analytics-agents-tokenwise-analytics-v1-agents-get", @"Analytics Agents"); + + + + 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.AnalyticsAgentsTokenwiseAnalyticsV1AgentsGetAsync( + + cancellationToken: cancellationToken).ConfigureAwait(false); + + + await CliRuntime.WriteResponseAsync( + parseResult, + response, + global::AI21.SourceGenerationContext.Default, + FormatResponse, + cancellationToken).ConfigureAwait(false); + }, cancellationToken).ConfigureAwait(false)); + return command; + } +} \ No newline at end of file diff --git a/src/cli/AI21.CLI/Commands/AnalyticsContextBashGatewayAnalyticsV1ContextBashGetCommandApiCommand.g.cs b/src/cli/AI21.CLI/Commands/AnalyticsContextBashGatewayAnalyticsV1ContextBashGetCommandApiCommand.g.cs new file mode 100644 index 00000000..8bcd9334 --- /dev/null +++ b/src/cli/AI21.CLI/Commands/AnalyticsContextBashGatewayAnalyticsV1ContextBashGetCommandApiCommand.g.cs @@ -0,0 +1,59 @@ +#nullable enable +#pragma warning disable CS0618 + +using System.CommandLine; + +namespace AI21.CLI.Commands; + +internal static partial class AnalyticsContextBashGatewayAnalyticsV1ContextBashGetCommandApiCommand +{ + + + 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(@"analytics-context-bash-gateway-analytics-v1-context-bash-get", @"Analytics Context Bash"); + + + + 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.AnalyticsContextBashGatewayAnalyticsV1ContextBashGetAsync( + + cancellationToken: cancellationToken).ConfigureAwait(false); + + + await CliRuntime.WriteResponseAsync( + parseResult, + response, + global::AI21.SourceGenerationContext.Default, + FormatResponse, + cancellationToken).ConfigureAwait(false); + }, cancellationToken).ConfigureAwait(false)); + return command; + } +} \ No newline at end of file diff --git a/src/cli/AI21.CLI/Commands/AnalyticsContextBashTokenwiseAnalyticsV1ContextBashGetCommandApiCommand.g.cs b/src/cli/AI21.CLI/Commands/AnalyticsContextBashTokenwiseAnalyticsV1ContextBashGetCommandApiCommand.g.cs new file mode 100644 index 00000000..7b548a1e --- /dev/null +++ b/src/cli/AI21.CLI/Commands/AnalyticsContextBashTokenwiseAnalyticsV1ContextBashGetCommandApiCommand.g.cs @@ -0,0 +1,59 @@ +#nullable enable +#pragma warning disable CS0618 + +using System.CommandLine; + +namespace AI21.CLI.Commands; + +internal static partial class AnalyticsContextBashTokenwiseAnalyticsV1ContextBashGetCommandApiCommand +{ + + + 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(@"analytics-context-bash-tokenwise-analytics-v1-context-bash-get", @"Analytics Context Bash"); + + + + 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.AnalyticsContextBashTokenwiseAnalyticsV1ContextBashGetAsync( + + cancellationToken: cancellationToken).ConfigureAwait(false); + + + await CliRuntime.WriteResponseAsync( + parseResult, + response, + global::AI21.SourceGenerationContext.Default, + FormatResponse, + cancellationToken).ConfigureAwait(false); + }, cancellationToken).ConfigureAwait(false)); + return command; + } +} \ No newline at end of file diff --git a/src/cli/AI21.CLI/Commands/AnalyticsContextBlocksGatewayAnalyticsV1ContextBlocksGetCommandApiCommand.g.cs b/src/cli/AI21.CLI/Commands/AnalyticsContextBlocksGatewayAnalyticsV1ContextBlocksGetCommandApiCommand.g.cs new file mode 100644 index 00000000..26a5e538 --- /dev/null +++ b/src/cli/AI21.CLI/Commands/AnalyticsContextBlocksGatewayAnalyticsV1ContextBlocksGetCommandApiCommand.g.cs @@ -0,0 +1,59 @@ +#nullable enable +#pragma warning disable CS0618 + +using System.CommandLine; + +namespace AI21.CLI.Commands; + +internal static partial class AnalyticsContextBlocksGatewayAnalyticsV1ContextBlocksGetCommandApiCommand +{ + + + 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(@"analytics-context-blocks-gateway-analytics-v1-context-blocks-get", @"Analytics Context Blocks"); + + + + 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.AnalyticsContextBlocksGatewayAnalyticsV1ContextBlocksGetAsync( + + cancellationToken: cancellationToken).ConfigureAwait(false); + + + await CliRuntime.WriteResponseAsync( + parseResult, + response, + global::AI21.SourceGenerationContext.Default, + FormatResponse, + cancellationToken).ConfigureAwait(false); + }, cancellationToken).ConfigureAwait(false)); + return command; + } +} \ No newline at end of file diff --git a/src/cli/AI21.CLI/Commands/AnalyticsContextBlocksTokenwiseAnalyticsV1ContextBlocksGetCommandApiCommand.g.cs b/src/cli/AI21.CLI/Commands/AnalyticsContextBlocksTokenwiseAnalyticsV1ContextBlocksGetCommandApiCommand.g.cs new file mode 100644 index 00000000..79239b8c --- /dev/null +++ b/src/cli/AI21.CLI/Commands/AnalyticsContextBlocksTokenwiseAnalyticsV1ContextBlocksGetCommandApiCommand.g.cs @@ -0,0 +1,59 @@ +#nullable enable +#pragma warning disable CS0618 + +using System.CommandLine; + +namespace AI21.CLI.Commands; + +internal static partial class AnalyticsContextBlocksTokenwiseAnalyticsV1ContextBlocksGetCommandApiCommand +{ + + + 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(@"analytics-context-blocks-tokenwise-analytics-v1-context-blocks-get", @"Analytics Context Blocks"); + + + + 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.AnalyticsContextBlocksTokenwiseAnalyticsV1ContextBlocksGetAsync( + + cancellationToken: cancellationToken).ConfigureAwait(false); + + + await CliRuntime.WriteResponseAsync( + parseResult, + response, + global::AI21.SourceGenerationContext.Default, + FormatResponse, + cancellationToken).ConfigureAwait(false); + }, cancellationToken).ConfigureAwait(false)); + return command; + } +} \ No newline at end of file diff --git a/src/cli/AI21.CLI/Commands/AnalyticsContextPrefixGatewayAnalyticsV1ContextPrefixGetCommandApiCommand.g.cs b/src/cli/AI21.CLI/Commands/AnalyticsContextPrefixGatewayAnalyticsV1ContextPrefixGetCommandApiCommand.g.cs new file mode 100644 index 00000000..4dcd88a8 --- /dev/null +++ b/src/cli/AI21.CLI/Commands/AnalyticsContextPrefixGatewayAnalyticsV1ContextPrefixGetCommandApiCommand.g.cs @@ -0,0 +1,59 @@ +#nullable enable +#pragma warning disable CS0618 + +using System.CommandLine; + +namespace AI21.CLI.Commands; + +internal static partial class AnalyticsContextPrefixGatewayAnalyticsV1ContextPrefixGetCommandApiCommand +{ + + + 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(@"analytics-context-prefix-gateway-analytics-v1-context-prefix-get", @"Analytics Context Prefix"); + + + + 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.AnalyticsContextPrefixGatewayAnalyticsV1ContextPrefixGetAsync( + + cancellationToken: cancellationToken).ConfigureAwait(false); + + + await CliRuntime.WriteResponseAsync( + parseResult, + response, + global::AI21.SourceGenerationContext.Default, + FormatResponse, + cancellationToken).ConfigureAwait(false); + }, cancellationToken).ConfigureAwait(false)); + return command; + } +} \ No newline at end of file diff --git a/src/cli/AI21.CLI/Commands/AnalyticsContextPrefixTokenwiseAnalyticsV1ContextPrefixGetCommandApiCommand.g.cs b/src/cli/AI21.CLI/Commands/AnalyticsContextPrefixTokenwiseAnalyticsV1ContextPrefixGetCommandApiCommand.g.cs new file mode 100644 index 00000000..38c78b79 --- /dev/null +++ b/src/cli/AI21.CLI/Commands/AnalyticsContextPrefixTokenwiseAnalyticsV1ContextPrefixGetCommandApiCommand.g.cs @@ -0,0 +1,59 @@ +#nullable enable +#pragma warning disable CS0618 + +using System.CommandLine; + +namespace AI21.CLI.Commands; + +internal static partial class AnalyticsContextPrefixTokenwiseAnalyticsV1ContextPrefixGetCommandApiCommand +{ + + + 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(@"analytics-context-prefix-tokenwise-analytics-v1-context-prefix-get", @"Analytics Context Prefix"); + + + + 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.AnalyticsContextPrefixTokenwiseAnalyticsV1ContextPrefixGetAsync( + + cancellationToken: cancellationToken).ConfigureAwait(false); + + + await CliRuntime.WriteResponseAsync( + parseResult, + response, + global::AI21.SourceGenerationContext.Default, + FormatResponse, + cancellationToken).ConfigureAwait(false); + }, cancellationToken).ConfigureAwait(false)); + return command; + } +} \ No newline at end of file diff --git a/src/cli/AI21.CLI/Commands/AnalyticsContextToolsGatewayAnalyticsV1ContextToolsGetCommandApiCommand.g.cs b/src/cli/AI21.CLI/Commands/AnalyticsContextToolsGatewayAnalyticsV1ContextToolsGetCommandApiCommand.g.cs new file mode 100644 index 00000000..e0dd5489 --- /dev/null +++ b/src/cli/AI21.CLI/Commands/AnalyticsContextToolsGatewayAnalyticsV1ContextToolsGetCommandApiCommand.g.cs @@ -0,0 +1,59 @@ +#nullable enable +#pragma warning disable CS0618 + +using System.CommandLine; + +namespace AI21.CLI.Commands; + +internal static partial class AnalyticsContextToolsGatewayAnalyticsV1ContextToolsGetCommandApiCommand +{ + + + 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(@"analytics-context-tools-gateway-analytics-v1-context-tools-get", @"Analytics Context Tools"); + + + + 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.AnalyticsContextToolsGatewayAnalyticsV1ContextToolsGetAsync( + + cancellationToken: cancellationToken).ConfigureAwait(false); + + + await CliRuntime.WriteResponseAsync( + parseResult, + response, + global::AI21.SourceGenerationContext.Default, + FormatResponse, + cancellationToken).ConfigureAwait(false); + }, cancellationToken).ConfigureAwait(false)); + return command; + } +} \ No newline at end of file diff --git a/src/cli/AI21.CLI/Commands/AnalyticsContextToolsTokenwiseAnalyticsV1ContextToolsGetCommandApiCommand.g.cs b/src/cli/AI21.CLI/Commands/AnalyticsContextToolsTokenwiseAnalyticsV1ContextToolsGetCommandApiCommand.g.cs new file mode 100644 index 00000000..1454ee98 --- /dev/null +++ b/src/cli/AI21.CLI/Commands/AnalyticsContextToolsTokenwiseAnalyticsV1ContextToolsGetCommandApiCommand.g.cs @@ -0,0 +1,59 @@ +#nullable enable +#pragma warning disable CS0618 + +using System.CommandLine; + +namespace AI21.CLI.Commands; + +internal static partial class AnalyticsContextToolsTokenwiseAnalyticsV1ContextToolsGetCommandApiCommand +{ + + + 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(@"analytics-context-tools-tokenwise-analytics-v1-context-tools-get", @"Analytics Context Tools"); + + + + 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.AnalyticsContextToolsTokenwiseAnalyticsV1ContextToolsGetAsync( + + cancellationToken: cancellationToken).ConfigureAwait(false); + + + await CliRuntime.WriteResponseAsync( + parseResult, + response, + global::AI21.SourceGenerationContext.Default, + FormatResponse, + cancellationToken).ConfigureAwait(false); + }, cancellationToken).ConfigureAwait(false)); + return command; + } +} \ No newline at end of file diff --git a/src/cli/AI21.CLI/Commands/AnalyticsErrorsGatewayAnalyticsV1ErrorsGetCommandApiCommand.g.cs b/src/cli/AI21.CLI/Commands/AnalyticsErrorsGatewayAnalyticsV1ErrorsGetCommandApiCommand.g.cs new file mode 100644 index 00000000..fdae9246 --- /dev/null +++ b/src/cli/AI21.CLI/Commands/AnalyticsErrorsGatewayAnalyticsV1ErrorsGetCommandApiCommand.g.cs @@ -0,0 +1,59 @@ +#nullable enable +#pragma warning disable CS0618 + +using System.CommandLine; + +namespace AI21.CLI.Commands; + +internal static partial class AnalyticsErrorsGatewayAnalyticsV1ErrorsGetCommandApiCommand +{ + + + 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(@"analytics-errors-gateway-analytics-v1-errors-get", @"Analytics Errors"); + + + + 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.AnalyticsErrorsGatewayAnalyticsV1ErrorsGetAsync( + + cancellationToken: cancellationToken).ConfigureAwait(false); + + + await CliRuntime.WriteResponseAsync( + parseResult, + response, + global::AI21.SourceGenerationContext.Default, + FormatResponse, + cancellationToken).ConfigureAwait(false); + }, cancellationToken).ConfigureAwait(false)); + return command; + } +} \ No newline at end of file diff --git a/src/cli/AI21.CLI/Commands/AnalyticsErrorsTokenwiseAnalyticsV1ErrorsGetCommandApiCommand.g.cs b/src/cli/AI21.CLI/Commands/AnalyticsErrorsTokenwiseAnalyticsV1ErrorsGetCommandApiCommand.g.cs new file mode 100644 index 00000000..e86ac5d7 --- /dev/null +++ b/src/cli/AI21.CLI/Commands/AnalyticsErrorsTokenwiseAnalyticsV1ErrorsGetCommandApiCommand.g.cs @@ -0,0 +1,59 @@ +#nullable enable +#pragma warning disable CS0618 + +using System.CommandLine; + +namespace AI21.CLI.Commands; + +internal static partial class AnalyticsErrorsTokenwiseAnalyticsV1ErrorsGetCommandApiCommand +{ + + + 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(@"analytics-errors-tokenwise-analytics-v1-errors-get", @"Analytics Errors"); + + + + 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.AnalyticsErrorsTokenwiseAnalyticsV1ErrorsGetAsync( + + cancellationToken: cancellationToken).ConfigureAwait(false); + + + await CliRuntime.WriteResponseAsync( + parseResult, + response, + global::AI21.SourceGenerationContext.Default, + FormatResponse, + cancellationToken).ConfigureAwait(false); + }, cancellationToken).ConfigureAwait(false)); + return command; + } +} \ No newline at end of file diff --git a/src/cli/AI21.CLI/Commands/AnalyticsFiltersGatewayAnalyticsV1FiltersGetCommandApiCommand.g.cs b/src/cli/AI21.CLI/Commands/AnalyticsFiltersGatewayAnalyticsV1FiltersGetCommandApiCommand.g.cs new file mode 100644 index 00000000..6df4968d --- /dev/null +++ b/src/cli/AI21.CLI/Commands/AnalyticsFiltersGatewayAnalyticsV1FiltersGetCommandApiCommand.g.cs @@ -0,0 +1,59 @@ +#nullable enable +#pragma warning disable CS0618 + +using System.CommandLine; + +namespace AI21.CLI.Commands; + +internal static partial class AnalyticsFiltersGatewayAnalyticsV1FiltersGetCommandApiCommand +{ + + + 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(@"analytics-filters-gateway-analytics-v1-filters-get", @"Analytics Filters"); + + + + 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.AnalyticsFiltersGatewayAnalyticsV1FiltersGetAsync( + + cancellationToken: cancellationToken).ConfigureAwait(false); + + + await CliRuntime.WriteResponseAsync( + parseResult, + response, + global::AI21.SourceGenerationContext.Default, + FormatResponse, + cancellationToken).ConfigureAwait(false); + }, cancellationToken).ConfigureAwait(false)); + return command; + } +} \ No newline at end of file diff --git a/src/cli/AI21.CLI/Commands/AnalyticsFiltersTokenwiseAnalyticsV1FiltersGetCommandApiCommand.g.cs b/src/cli/AI21.CLI/Commands/AnalyticsFiltersTokenwiseAnalyticsV1FiltersGetCommandApiCommand.g.cs new file mode 100644 index 00000000..09a5db07 --- /dev/null +++ b/src/cli/AI21.CLI/Commands/AnalyticsFiltersTokenwiseAnalyticsV1FiltersGetCommandApiCommand.g.cs @@ -0,0 +1,59 @@ +#nullable enable +#pragma warning disable CS0618 + +using System.CommandLine; + +namespace AI21.CLI.Commands; + +internal static partial class AnalyticsFiltersTokenwiseAnalyticsV1FiltersGetCommandApiCommand +{ + + + 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(@"analytics-filters-tokenwise-analytics-v1-filters-get", @"Analytics Filters"); + + + + 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.AnalyticsFiltersTokenwiseAnalyticsV1FiltersGetAsync( + + cancellationToken: cancellationToken).ConfigureAwait(false); + + + await CliRuntime.WriteResponseAsync( + parseResult, + response, + global::AI21.SourceGenerationContext.Default, + FormatResponse, + cancellationToken).ConfigureAwait(false); + }, cancellationToken).ConfigureAwait(false)); + return command; + } +} \ No newline at end of file diff --git a/src/cli/AI21.CLI/Commands/AnalyticsSessionDetailGatewayAnalyticsV1SessionsSessionIdGetCommandApiCommand.g.cs b/src/cli/AI21.CLI/Commands/AnalyticsSessionDetailGatewayAnalyticsV1SessionsSessionIdGetCommandApiCommand.g.cs new file mode 100644 index 00000000..89a79c1e --- /dev/null +++ b/src/cli/AI21.CLI/Commands/AnalyticsSessionDetailGatewayAnalyticsV1SessionsSessionIdGetCommandApiCommand.g.cs @@ -0,0 +1,63 @@ +#nullable enable +#pragma warning disable CS0618 + +using System.CommandLine; + +namespace AI21.CLI.Commands; + +internal static partial class AnalyticsSessionDetailGatewayAnalyticsV1SessionsSessionIdGetCommandApiCommand +{ + private static Argument SessionId { get; } = new( + name: @"session-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(@"analytics-session-detail-gateway-analytics-v1-sessions-session-id-get", @"Analytics Session Detail"); + command.Arguments.Add(SessionId); + + + command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => + await CliRuntime.RunAsync(async () => + { + var sessionId = parseResult.GetRequiredValue(SessionId); + using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); + + + var response = await client.AnalyticsSessionDetailGatewayAnalyticsV1SessionsSessionIdGetAsync( + sessionId: sessionId, + cancellationToken: cancellationToken).ConfigureAwait(false); + + + await CliRuntime.WriteResponseAsync( + parseResult, + response, + global::AI21.SourceGenerationContext.Default, + FormatResponse, + cancellationToken).ConfigureAwait(false); + }, cancellationToken).ConfigureAwait(false)); + return command; + } +} \ No newline at end of file diff --git a/src/cli/AI21.CLI/Commands/AnalyticsSessionDetailTokenwiseAnalyticsV1SessionsSessionIdGetCommandApiCommand.g.cs b/src/cli/AI21.CLI/Commands/AnalyticsSessionDetailTokenwiseAnalyticsV1SessionsSessionIdGetCommandApiCommand.g.cs new file mode 100644 index 00000000..ee6084fb --- /dev/null +++ b/src/cli/AI21.CLI/Commands/AnalyticsSessionDetailTokenwiseAnalyticsV1SessionsSessionIdGetCommandApiCommand.g.cs @@ -0,0 +1,63 @@ +#nullable enable +#pragma warning disable CS0618 + +using System.CommandLine; + +namespace AI21.CLI.Commands; + +internal static partial class AnalyticsSessionDetailTokenwiseAnalyticsV1SessionsSessionIdGetCommandApiCommand +{ + private static Argument SessionId { get; } = new( + name: @"session-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(@"analytics-session-detail-tokenwise-analytics-v1-sessions-session-id-get", @"Analytics Session Detail"); + command.Arguments.Add(SessionId); + + + command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => + await CliRuntime.RunAsync(async () => + { + var sessionId = parseResult.GetRequiredValue(SessionId); + using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); + + + var response = await client.AnalyticsSessionDetailTokenwiseAnalyticsV1SessionsSessionIdGetAsync( + sessionId: sessionId, + cancellationToken: cancellationToken).ConfigureAwait(false); + + + await CliRuntime.WriteResponseAsync( + parseResult, + response, + global::AI21.SourceGenerationContext.Default, + FormatResponse, + cancellationToken).ConfigureAwait(false); + }, cancellationToken).ConfigureAwait(false)); + return command; + } +} \ No newline at end of file diff --git a/src/cli/AI21.CLI/Commands/AnalyticsSessionsGatewayAnalyticsV1SessionsGetCommandApiCommand.g.cs b/src/cli/AI21.CLI/Commands/AnalyticsSessionsGatewayAnalyticsV1SessionsGetCommandApiCommand.g.cs new file mode 100644 index 00000000..c743f68d --- /dev/null +++ b/src/cli/AI21.CLI/Commands/AnalyticsSessionsGatewayAnalyticsV1SessionsGetCommandApiCommand.g.cs @@ -0,0 +1,59 @@ +#nullable enable +#pragma warning disable CS0618 + +using System.CommandLine; + +namespace AI21.CLI.Commands; + +internal static partial class AnalyticsSessionsGatewayAnalyticsV1SessionsGetCommandApiCommand +{ + + + 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(@"analytics-sessions-gateway-analytics-v1-sessions-get", @"Analytics Sessions"); + + + + 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.AnalyticsSessionsGatewayAnalyticsV1SessionsGetAsync( + + cancellationToken: cancellationToken).ConfigureAwait(false); + + + await CliRuntime.WriteResponseAsync( + parseResult, + response, + global::AI21.SourceGenerationContext.Default, + FormatResponse, + cancellationToken).ConfigureAwait(false); + }, cancellationToken).ConfigureAwait(false)); + return command; + } +} \ No newline at end of file diff --git a/src/cli/AI21.CLI/Commands/AnalyticsSessionsTokenwiseAnalyticsV1SessionsGetCommandApiCommand.g.cs b/src/cli/AI21.CLI/Commands/AnalyticsSessionsTokenwiseAnalyticsV1SessionsGetCommandApiCommand.g.cs new file mode 100644 index 00000000..0257325b --- /dev/null +++ b/src/cli/AI21.CLI/Commands/AnalyticsSessionsTokenwiseAnalyticsV1SessionsGetCommandApiCommand.g.cs @@ -0,0 +1,59 @@ +#nullable enable +#pragma warning disable CS0618 + +using System.CommandLine; + +namespace AI21.CLI.Commands; + +internal static partial class AnalyticsSessionsTokenwiseAnalyticsV1SessionsGetCommandApiCommand +{ + + + 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(@"analytics-sessions-tokenwise-analytics-v1-sessions-get", @"Analytics Sessions"); + + + + 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.AnalyticsSessionsTokenwiseAnalyticsV1SessionsGetAsync( + + cancellationToken: cancellationToken).ConfigureAwait(false); + + + await CliRuntime.WriteResponseAsync( + parseResult, + response, + global::AI21.SourceGenerationContext.Default, + FormatResponse, + cancellationToken).ConfigureAwait(false); + }, cancellationToken).ConfigureAwait(false)); + return command; + } +} \ No newline at end of file diff --git a/src/cli/AI21.CLI/Commands/AnalyticsSummaryGatewayAnalyticsV1SummaryGetCommandApiCommand.g.cs b/src/cli/AI21.CLI/Commands/AnalyticsSummaryGatewayAnalyticsV1SummaryGetCommandApiCommand.g.cs new file mode 100644 index 00000000..2a5e6d35 --- /dev/null +++ b/src/cli/AI21.CLI/Commands/AnalyticsSummaryGatewayAnalyticsV1SummaryGetCommandApiCommand.g.cs @@ -0,0 +1,59 @@ +#nullable enable +#pragma warning disable CS0618 + +using System.CommandLine; + +namespace AI21.CLI.Commands; + +internal static partial class AnalyticsSummaryGatewayAnalyticsV1SummaryGetCommandApiCommand +{ + + + 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(@"analytics-summary-gateway-analytics-v1-summary-get", @"Analytics Summary"); + + + + 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.AnalyticsSummaryGatewayAnalyticsV1SummaryGetAsync( + + cancellationToken: cancellationToken).ConfigureAwait(false); + + + await CliRuntime.WriteResponseAsync( + parseResult, + response, + global::AI21.SourceGenerationContext.Default, + FormatResponse, + cancellationToken).ConfigureAwait(false); + }, cancellationToken).ConfigureAwait(false)); + return command; + } +} \ No newline at end of file diff --git a/src/cli/AI21.CLI/Commands/AnalyticsSummaryTokenwiseAnalyticsV1SummaryGetCommandApiCommand.g.cs b/src/cli/AI21.CLI/Commands/AnalyticsSummaryTokenwiseAnalyticsV1SummaryGetCommandApiCommand.g.cs new file mode 100644 index 00000000..fa20d87e --- /dev/null +++ b/src/cli/AI21.CLI/Commands/AnalyticsSummaryTokenwiseAnalyticsV1SummaryGetCommandApiCommand.g.cs @@ -0,0 +1,59 @@ +#nullable enable +#pragma warning disable CS0618 + +using System.CommandLine; + +namespace AI21.CLI.Commands; + +internal static partial class AnalyticsSummaryTokenwiseAnalyticsV1SummaryGetCommandApiCommand +{ + + + 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(@"analytics-summary-tokenwise-analytics-v1-summary-get", @"Analytics Summary"); + + + + 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.AnalyticsSummaryTokenwiseAnalyticsV1SummaryGetAsync( + + cancellationToken: cancellationToken).ConfigureAwait(false); + + + await CliRuntime.WriteResponseAsync( + parseResult, + response, + global::AI21.SourceGenerationContext.Default, + FormatResponse, + cancellationToken).ConfigureAwait(false); + }, cancellationToken).ConfigureAwait(false)); + return command; + } +} \ No newline at end of file diff --git a/src/cli/AI21.CLI/Commands/AnalyticsTransformersGatewayAnalyticsV1TransformersGetCommandApiCommand.g.cs b/src/cli/AI21.CLI/Commands/AnalyticsTransformersGatewayAnalyticsV1TransformersGetCommandApiCommand.g.cs new file mode 100644 index 00000000..882b80cb --- /dev/null +++ b/src/cli/AI21.CLI/Commands/AnalyticsTransformersGatewayAnalyticsV1TransformersGetCommandApiCommand.g.cs @@ -0,0 +1,59 @@ +#nullable enable +#pragma warning disable CS0618 + +using System.CommandLine; + +namespace AI21.CLI.Commands; + +internal static partial class AnalyticsTransformersGatewayAnalyticsV1TransformersGetCommandApiCommand +{ + + + 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(@"analytics-transformers-gateway-analytics-v1-transformers-get", @"Analytics Transformers"); + + + + 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.AnalyticsTransformersGatewayAnalyticsV1TransformersGetAsync( + + cancellationToken: cancellationToken).ConfigureAwait(false); + + + await CliRuntime.WriteResponseAsync( + parseResult, + response, + global::AI21.SourceGenerationContext.Default, + FormatResponse, + cancellationToken).ConfigureAwait(false); + }, cancellationToken).ConfigureAwait(false)); + return command; + } +} \ No newline at end of file diff --git a/src/cli/AI21.CLI/Commands/AnalyticsTransformersTokenwiseAnalyticsV1TransformersGetCommandApiCommand.g.cs b/src/cli/AI21.CLI/Commands/AnalyticsTransformersTokenwiseAnalyticsV1TransformersGetCommandApiCommand.g.cs new file mode 100644 index 00000000..b1523b14 --- /dev/null +++ b/src/cli/AI21.CLI/Commands/AnalyticsTransformersTokenwiseAnalyticsV1TransformersGetCommandApiCommand.g.cs @@ -0,0 +1,59 @@ +#nullable enable +#pragma warning disable CS0618 + +using System.CommandLine; + +namespace AI21.CLI.Commands; + +internal static partial class AnalyticsTransformersTokenwiseAnalyticsV1TransformersGetCommandApiCommand +{ + + + 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(@"analytics-transformers-tokenwise-analytics-v1-transformers-get", @"Analytics Transformers"); + + + + 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.AnalyticsTransformersTokenwiseAnalyticsV1TransformersGetAsync( + + cancellationToken: cancellationToken).ConfigureAwait(false); + + + await CliRuntime.WriteResponseAsync( + parseResult, + response, + global::AI21.SourceGenerationContext.Default, + FormatResponse, + cancellationToken).ConfigureAwait(false); + }, cancellationToken).ConfigureAwait(false)); + return command; + } +} \ No newline at end of file diff --git a/src/cli/AI21.CLI/Commands/AnalyticsTrendsGatewayAnalyticsV1TrendsGetCommandApiCommand.g.cs b/src/cli/AI21.CLI/Commands/AnalyticsTrendsGatewayAnalyticsV1TrendsGetCommandApiCommand.g.cs new file mode 100644 index 00000000..690b793b --- /dev/null +++ b/src/cli/AI21.CLI/Commands/AnalyticsTrendsGatewayAnalyticsV1TrendsGetCommandApiCommand.g.cs @@ -0,0 +1,59 @@ +#nullable enable +#pragma warning disable CS0618 + +using System.CommandLine; + +namespace AI21.CLI.Commands; + +internal static partial class AnalyticsTrendsGatewayAnalyticsV1TrendsGetCommandApiCommand +{ + + + 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(@"analytics-trends-gateway-analytics-v1-trends-get", @"Analytics Trends"); + + + + 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.AnalyticsTrendsGatewayAnalyticsV1TrendsGetAsync( + + cancellationToken: cancellationToken).ConfigureAwait(false); + + + await CliRuntime.WriteResponseAsync( + parseResult, + response, + global::AI21.SourceGenerationContext.Default, + FormatResponse, + cancellationToken).ConfigureAwait(false); + }, cancellationToken).ConfigureAwait(false)); + return command; + } +} \ No newline at end of file diff --git a/src/cli/AI21.CLI/Commands/AnalyticsTrendsTokenwiseAnalyticsV1TrendsGetCommandApiCommand.g.cs b/src/cli/AI21.CLI/Commands/AnalyticsTrendsTokenwiseAnalyticsV1TrendsGetCommandApiCommand.g.cs new file mode 100644 index 00000000..7c3e3047 --- /dev/null +++ b/src/cli/AI21.CLI/Commands/AnalyticsTrendsTokenwiseAnalyticsV1TrendsGetCommandApiCommand.g.cs @@ -0,0 +1,59 @@ +#nullable enable +#pragma warning disable CS0618 + +using System.CommandLine; + +namespace AI21.CLI.Commands; + +internal static partial class AnalyticsTrendsTokenwiseAnalyticsV1TrendsGetCommandApiCommand +{ + + + 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(@"analytics-trends-tokenwise-analytics-v1-trends-get", @"Analytics Trends"); + + + + 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.AnalyticsTrendsTokenwiseAnalyticsV1TrendsGetAsync( + + cancellationToken: cancellationToken).ConfigureAwait(false); + + + await CliRuntime.WriteResponseAsync( + parseResult, + response, + global::AI21.SourceGenerationContext.Default, + FormatResponse, + cancellationToken).ConfigureAwait(false); + }, cancellationToken).ConfigureAwait(false)); + return command; + } +} \ No newline at end of file diff --git a/src/cli/AI21.CLI/Commands/ClarotyProductLookupSolutionsClarotyProductLookupPostCommandApiCommand.g.cs b/src/cli/AI21.CLI/Commands/ClarotyProductLookupSolutionsClarotyProductLookupPostCommandApiCommand.g.cs deleted file mode 100644 index fb2ca91e..00000000 --- a/src/cli/AI21.CLI/Commands/ClarotyProductLookupSolutionsClarotyProductLookupPostCommandApiCommand.g.cs +++ /dev/null @@ -1,59 +0,0 @@ -#nullable enable -#pragma warning disable CS0618 - -using System.CommandLine; - -namespace AI21.CLI.Commands; - -internal static partial class ClarotyProductLookupSolutionsClarotyProductLookupPostCommandApiCommand -{ - - - 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(@"claroty-product-lookup-solutions-claroty-product-lookup-post", @"Claroty Product Lookup"); - - - - 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.ClarotyProductLookupSolutionsClarotyProductLookupPostAsync( - - cancellationToken: cancellationToken).ConfigureAwait(false); - - - await CliRuntime.WriteResponseAsync( - parseResult, - response, - global::AI21.SourceGenerationContext.Default, - FormatResponse, - cancellationToken).ConfigureAwait(false); - }, cancellationToken).ConfigureAwait(false)); - return command; - } -} \ No newline at end of file diff --git a/src/cli/AI21.CLI/Commands/ClarotyScrapeUrlSolutionsClarotyScrapeUrlPostCommandApiCommand.g.cs b/src/cli/AI21.CLI/Commands/ClarotyScrapeUrlSolutionsClarotyScrapeUrlPostCommandApiCommand.g.cs deleted file mode 100644 index f99e4ac2..00000000 --- a/src/cli/AI21.CLI/Commands/ClarotyScrapeUrlSolutionsClarotyScrapeUrlPostCommandApiCommand.g.cs +++ /dev/null @@ -1,59 +0,0 @@ -#nullable enable -#pragma warning disable CS0618 - -using System.CommandLine; - -namespace AI21.CLI.Commands; - -internal static partial class ClarotyScrapeUrlSolutionsClarotyScrapeUrlPostCommandApiCommand -{ - - - 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(@"claroty-scrape-url-solutions-claroty-scrape-url-post", @"Claroty Scrape Url"); - - - - 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.ClarotyScrapeUrlSolutionsClarotyScrapeUrlPostAsync( - - cancellationToken: cancellationToken).ConfigureAwait(false); - - - await CliRuntime.WriteResponseAsync( - parseResult, - response, - global::AI21.SourceGenerationContext.Default, - FormatResponse, - cancellationToken).ConfigureAwait(false); - }, cancellationToken).ConfigureAwait(false)); - return command; - } -} \ No newline at end of file diff --git a/src/cli/AI21.CLI/Commands/ClarotySuggestVendorModelSolutionsClarotySuggestVendorModelPostCommandApiCommand.g.cs b/src/cli/AI21.CLI/Commands/ClarotySuggestVendorModelSolutionsClarotySuggestVendorModelPostCommandApiCommand.g.cs deleted file mode 100644 index b037979a..00000000 --- a/src/cli/AI21.CLI/Commands/ClarotySuggestVendorModelSolutionsClarotySuggestVendorModelPostCommandApiCommand.g.cs +++ /dev/null @@ -1,59 +0,0 @@ -#nullable enable -#pragma warning disable CS0618 - -using System.CommandLine; - -namespace AI21.CLI.Commands; - -internal static partial class ClarotySuggestVendorModelSolutionsClarotySuggestVendorModelPostCommandApiCommand -{ - - - 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(@"claroty-suggest-vendor-model-solutions-claroty-suggest-vendor-model-post", @"Claroty Suggest Vendor Model"); - - - - 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.ClarotySuggestVendorModelSolutionsClarotySuggestVendorModelPostAsync( - - cancellationToken: cancellationToken).ConfigureAwait(false); - - - await CliRuntime.WriteResponseAsync( - parseResult, - response, - global::AI21.SourceGenerationContext.Default, - FormatResponse, - cancellationToken).ConfigureAwait(false); - }, cancellationToken).ConfigureAwait(false)); - return command; - } -} \ No newline at end of file diff --git a/src/cli/AI21.CLI/Commands/ConfigProfileCreateOptionSet.g.cs b/src/cli/AI21.CLI/Commands/ConfigProfileCreateOptionSet.g.cs new file mode 100644 index 00000000..f2d5ab56 --- /dev/null +++ b/src/cli/AI21.CLI/Commands/ConfigProfileCreateOptionSet.g.cs @@ -0,0 +1,35 @@ +#nullable enable + +using System.CommandLine; + +namespace AI21.CLI.Commands; + +internal sealed record ConfigProfileCreateOptionSet( + Option ConfigId, + Option NameOption, + Option DescriptionOption, + Option Enabled) +{ + public static ConfigProfileCreateOptionSet Create(string? prefix = null) + { + var normalizedPrefix = string.IsNullOrWhiteSpace(prefix) + ? string.Empty + : prefix.Trim().Trim('-') + "-"; + return new ConfigProfileCreateOptionSet( + ConfigId: new Option($"--{normalizedPrefix}config-id") + { + Description = @"", + Required = true, + }, + NameOption: new Option($"--{normalizedPrefix}name") + { + Description = @"", + }, + DescriptionOption: new Option($"--{normalizedPrefix}description") + { + Description = @"", + }, + Enabled: CliRuntime.CreateNullableBoolOption(name: $"--{normalizedPrefix}enabled", description: @"") + ); + } +} \ No newline at end of file diff --git a/src/cli/AI21.CLI/Commands/ConfigProfileUpdateOptionSet.g.cs b/src/cli/AI21.CLI/Commands/ConfigProfileUpdateOptionSet.g.cs new file mode 100644 index 00000000..6148a6c0 --- /dev/null +++ b/src/cli/AI21.CLI/Commands/ConfigProfileUpdateOptionSet.g.cs @@ -0,0 +1,29 @@ +#nullable enable + +using System.CommandLine; + +namespace AI21.CLI.Commands; + +internal sealed record ConfigProfileUpdateOptionSet( + Option NameOption, + Option DescriptionOption, + Option Enabled) +{ + public static ConfigProfileUpdateOptionSet Create(string? prefix = null) + { + var normalizedPrefix = string.IsNullOrWhiteSpace(prefix) + ? string.Empty + : prefix.Trim().Trim('-') + "-"; + return new ConfigProfileUpdateOptionSet( + NameOption: new Option($"--{normalizedPrefix}name") + { + Description = @"", + }, + DescriptionOption: new Option($"--{normalizedPrefix}description") + { + Description = @"", + }, + Enabled: CliRuntime.CreateNullableBoolOption(name: $"--{normalizedPrefix}enabled", description: @"") + ); + } +} \ No newline at end of file diff --git a/src/cli/AI21.CLI/Commands/CreateAgentGatewaySettingsAgentsPostCommandApiCommand.g.cs b/src/cli/AI21.CLI/Commands/CreateAgentGatewaySettingsAgentsPostCommandApiCommand.g.cs new file mode 100644 index 00000000..0e0e9ae1 --- /dev/null +++ b/src/cli/AI21.CLI/Commands/CreateAgentGatewaySettingsAgentsPostCommandApiCommand.g.cs @@ -0,0 +1,109 @@ +#nullable enable +#pragma warning disable CS0618 + +using System.CommandLine; + +namespace AI21.CLI.Commands; + +internal static partial class CreateAgentGatewaySettingsAgentsPostCommandApiCommand +{ + private static readonly AgentCreateOptionSet AgentCreateOptionSetOptions = AgentCreateOptionSet.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::AI21.AgentOut value, global::System.Text.Json.Serialization.JsonSerializerContext context, bool truncateLongStrings) + { + string? text = null; + CustomizeResponseText(parseResult, value, ref text); + if (!string.IsNullOrWhiteSpace(text)) + { + return text; + } + + var hints = new Dictionary(StringComparer.OrdinalIgnoreCase) + { + }; + CustomizeResponseFormatHints(hints); + return CliRuntime.FormatHumanReadable(value, context, truncateLongStrings, hints); + } + + static partial void CustomizeResponseText(ParseResult parseResult, global::AI21.AgentOut value, ref string? text); + static partial void CustomizeResponseFormatHints(Dictionary hints); + + + public static Command Create() + { + var command = new Command(@"create-agent-gateway-settings-agents-post", @"Create Agent"); + command.Options.Add(AgentCreateOptionSetOptions.AgentId); + command.Options.Add(AgentCreateOptionSetOptions.Kind); + command.Options.Add(AgentCreateOptionSetOptions.NameOption); + command.Options.Add(AgentCreateOptionSetOptions.DescriptionOption); + command.Options.Add(AgentCreateOptionSetOptions.ConfigId); + command.Options.Add(AgentCreateOptionSetOptions.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::AI21.SourceGenerationContext.Default, + cancellationToken).ConfigureAwait(false); var agentId = parseResult.GetRequiredValue(AgentCreateOptionSetOptions.AgentId); + var kind = CliRuntime.WasSpecified(parseResult, AgentCreateOptionSetOptions.Kind) ? parseResult.GetValue(AgentCreateOptionSetOptions.Kind) : (__requestBase is { } __KindBaseValue ? __KindBaseValue.Kind : default); + var name = CliRuntime.WasSpecified(parseResult, AgentCreateOptionSetOptions.NameOption) ? parseResult.GetValue(AgentCreateOptionSetOptions.NameOption) : (__requestBase is { } __NameBaseValue ? __NameBaseValue.Name : default); + var description = CliRuntime.WasSpecified(parseResult, AgentCreateOptionSetOptions.DescriptionOption) ? parseResult.GetValue(AgentCreateOptionSetOptions.DescriptionOption) : (__requestBase is { } __DescriptionBaseValue ? __DescriptionBaseValue.Description : default); + var configId = CliRuntime.WasSpecified(parseResult, AgentCreateOptionSetOptions.ConfigId) ? parseResult.GetValue(AgentCreateOptionSetOptions.ConfigId) : (__requestBase is { } __ConfigIdBaseValue ? __ConfigIdBaseValue.ConfigId : default); + var enabled = CliRuntime.WasSpecified(parseResult, AgentCreateOptionSetOptions.Enabled) ? parseResult.GetValue(AgentCreateOptionSetOptions.Enabled) : (__requestBase is { } __EnabledBaseValue ? __EnabledBaseValue.Enabled : default); + using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); + + + var response = await client.CreateAgentGatewaySettingsAgentsPostAsync( + agentId: agentId, + kind: kind, + name: name, + description: description, + configId: configId, + enabled: enabled, + cancellationToken: cancellationToken).ConfigureAwait(false); + + + await CliRuntime.WriteResponseAsync( + parseResult, + response, + global::AI21.SourceGenerationContext.Default, + FormatResponse, + cancellationToken).ConfigureAwait(false); + }, cancellationToken).ConfigureAwait(false)); + return command; + } +} \ No newline at end of file diff --git a/src/cli/AI21.CLI/Commands/CreateAgentTokenwiseSettingsAgentsPostCommandApiCommand.g.cs b/src/cli/AI21.CLI/Commands/CreateAgentTokenwiseSettingsAgentsPostCommandApiCommand.g.cs new file mode 100644 index 00000000..71719f32 --- /dev/null +++ b/src/cli/AI21.CLI/Commands/CreateAgentTokenwiseSettingsAgentsPostCommandApiCommand.g.cs @@ -0,0 +1,109 @@ +#nullable enable +#pragma warning disable CS0618 + +using System.CommandLine; + +namespace AI21.CLI.Commands; + +internal static partial class CreateAgentTokenwiseSettingsAgentsPostCommandApiCommand +{ + private static readonly AgentCreateOptionSet AgentCreateOptionSetOptions = AgentCreateOptionSet.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::AI21.AgentOut value, global::System.Text.Json.Serialization.JsonSerializerContext context, bool truncateLongStrings) + { + string? text = null; + CustomizeResponseText(parseResult, value, ref text); + if (!string.IsNullOrWhiteSpace(text)) + { + return text; + } + + var hints = new Dictionary(StringComparer.OrdinalIgnoreCase) + { + }; + CustomizeResponseFormatHints(hints); + return CliRuntime.FormatHumanReadable(value, context, truncateLongStrings, hints); + } + + static partial void CustomizeResponseText(ParseResult parseResult, global::AI21.AgentOut value, ref string? text); + static partial void CustomizeResponseFormatHints(Dictionary hints); + + + public static Command Create() + { + var command = new Command(@"create-agent-tokenwise-settings-agents-post", @"Create Agent"); + command.Options.Add(AgentCreateOptionSetOptions.AgentId); + command.Options.Add(AgentCreateOptionSetOptions.Kind); + command.Options.Add(AgentCreateOptionSetOptions.NameOption); + command.Options.Add(AgentCreateOptionSetOptions.DescriptionOption); + command.Options.Add(AgentCreateOptionSetOptions.ConfigId); + command.Options.Add(AgentCreateOptionSetOptions.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::AI21.SourceGenerationContext.Default, + cancellationToken).ConfigureAwait(false); var agentId = parseResult.GetRequiredValue(AgentCreateOptionSetOptions.AgentId); + var kind = CliRuntime.WasSpecified(parseResult, AgentCreateOptionSetOptions.Kind) ? parseResult.GetValue(AgentCreateOptionSetOptions.Kind) : (__requestBase is { } __KindBaseValue ? __KindBaseValue.Kind : default); + var name = CliRuntime.WasSpecified(parseResult, AgentCreateOptionSetOptions.NameOption) ? parseResult.GetValue(AgentCreateOptionSetOptions.NameOption) : (__requestBase is { } __NameBaseValue ? __NameBaseValue.Name : default); + var description = CliRuntime.WasSpecified(parseResult, AgentCreateOptionSetOptions.DescriptionOption) ? parseResult.GetValue(AgentCreateOptionSetOptions.DescriptionOption) : (__requestBase is { } __DescriptionBaseValue ? __DescriptionBaseValue.Description : default); + var configId = CliRuntime.WasSpecified(parseResult, AgentCreateOptionSetOptions.ConfigId) ? parseResult.GetValue(AgentCreateOptionSetOptions.ConfigId) : (__requestBase is { } __ConfigIdBaseValue ? __ConfigIdBaseValue.ConfigId : default); + var enabled = CliRuntime.WasSpecified(parseResult, AgentCreateOptionSetOptions.Enabled) ? parseResult.GetValue(AgentCreateOptionSetOptions.Enabled) : (__requestBase is { } __EnabledBaseValue ? __EnabledBaseValue.Enabled : default); + using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); + + + var response = await client.CreateAgentTokenwiseSettingsAgentsPostAsync( + agentId: agentId, + kind: kind, + name: name, + description: description, + configId: configId, + enabled: enabled, + cancellationToken: cancellationToken).ConfigureAwait(false); + + + await CliRuntime.WriteResponseAsync( + parseResult, + response, + global::AI21.SourceGenerationContext.Default, + FormatResponse, + cancellationToken).ConfigureAwait(false); + }, cancellationToken).ConfigureAwait(false)); + return command; + } +} \ No newline at end of file diff --git a/src/cli/AI21.CLI/Commands/CreateConfigGatewaySettingsConfigsPostCommandApiCommand.g.cs b/src/cli/AI21.CLI/Commands/CreateConfigGatewaySettingsConfigsPostCommandApiCommand.g.cs new file mode 100644 index 00000000..543ddba0 --- /dev/null +++ b/src/cli/AI21.CLI/Commands/CreateConfigGatewaySettingsConfigsPostCommandApiCommand.g.cs @@ -0,0 +1,110 @@ +#nullable enable +#pragma warning disable CS0618 + +using System.CommandLine; + +namespace AI21.CLI.Commands; + +internal static partial class CreateConfigGatewaySettingsConfigsPostCommandApiCommand +{ + private static Option Overrides { get; } = new( + name: @"--overrides") + { + Description = @"", + }; + private static readonly ConfigProfileCreateOptionSet ConfigProfileCreateOptionSetOptions = ConfigProfileCreateOptionSet.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::AI21.ConfigProfileOut value, global::System.Text.Json.Serialization.JsonSerializerContext context, bool truncateLongStrings) + { + string? text = null; + CustomizeResponseText(parseResult, value, ref text); + if (!string.IsNullOrWhiteSpace(text)) + { + return text; + } + + var hints = new Dictionary(StringComparer.OrdinalIgnoreCase) + { + }; + CustomizeResponseFormatHints(hints); + return CliRuntime.FormatHumanReadable(value, context, truncateLongStrings, hints); + } + + static partial void CustomizeResponseText(ParseResult parseResult, global::AI21.ConfigProfileOut value, ref string? text); + static partial void CustomizeResponseFormatHints(Dictionary hints); + + + public static Command Create() + { + var command = new Command(@"create-config-gateway-settings-configs-post", @"Create Config"); + command.Options.Add(Overrides); command.Options.Add(ConfigProfileCreateOptionSetOptions.ConfigId); + command.Options.Add(ConfigProfileCreateOptionSetOptions.NameOption); + command.Options.Add(ConfigProfileCreateOptionSetOptions.DescriptionOption); + command.Options.Add(ConfigProfileCreateOptionSetOptions.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::AI21.SourceGenerationContext.Default, + cancellationToken).ConfigureAwait(false); + var overrides = CliRuntime.WasSpecified(parseResult, Overrides) ? parseResult.GetValue(Overrides) : (__requestBase is { } __OverridesBaseValue ? __OverridesBaseValue.Overrides : default); var configId = parseResult.GetRequiredValue(ConfigProfileCreateOptionSetOptions.ConfigId); + var name = CliRuntime.WasSpecified(parseResult, ConfigProfileCreateOptionSetOptions.NameOption) ? parseResult.GetValue(ConfigProfileCreateOptionSetOptions.NameOption) : (__requestBase is { } __NameBaseValue ? __NameBaseValue.Name : default); + var description = CliRuntime.WasSpecified(parseResult, ConfigProfileCreateOptionSetOptions.DescriptionOption) ? parseResult.GetValue(ConfigProfileCreateOptionSetOptions.DescriptionOption) : (__requestBase is { } __DescriptionBaseValue ? __DescriptionBaseValue.Description : default); + var enabled = CliRuntime.WasSpecified(parseResult, ConfigProfileCreateOptionSetOptions.Enabled) ? parseResult.GetValue(ConfigProfileCreateOptionSetOptions.Enabled) : (__requestBase is { } __EnabledBaseValue ? __EnabledBaseValue.Enabled : default); + using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); + + + var response = await client.CreateConfigGatewaySettingsConfigsPostAsync( + overrides: overrides, + configId: configId, + name: name, + description: description, + enabled: enabled, + cancellationToken: cancellationToken).ConfigureAwait(false); + + + await CliRuntime.WriteResponseAsync( + parseResult, + response, + global::AI21.SourceGenerationContext.Default, + FormatResponse, + cancellationToken).ConfigureAwait(false); + }, cancellationToken).ConfigureAwait(false)); + return command; + } +} \ No newline at end of file diff --git a/src/cli/AI21.CLI/Commands/CreateConfigTokenwiseSettingsConfigsPostCommandApiCommand.g.cs b/src/cli/AI21.CLI/Commands/CreateConfigTokenwiseSettingsConfigsPostCommandApiCommand.g.cs new file mode 100644 index 00000000..ec7edd12 --- /dev/null +++ b/src/cli/AI21.CLI/Commands/CreateConfigTokenwiseSettingsConfigsPostCommandApiCommand.g.cs @@ -0,0 +1,110 @@ +#nullable enable +#pragma warning disable CS0618 + +using System.CommandLine; + +namespace AI21.CLI.Commands; + +internal static partial class CreateConfigTokenwiseSettingsConfigsPostCommandApiCommand +{ + private static Option Overrides { get; } = new( + name: @"--overrides") + { + Description = @"", + }; + private static readonly ConfigProfileCreateOptionSet ConfigProfileCreateOptionSetOptions = ConfigProfileCreateOptionSet.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::AI21.ConfigProfileOut value, global::System.Text.Json.Serialization.JsonSerializerContext context, bool truncateLongStrings) + { + string? text = null; + CustomizeResponseText(parseResult, value, ref text); + if (!string.IsNullOrWhiteSpace(text)) + { + return text; + } + + var hints = new Dictionary(StringComparer.OrdinalIgnoreCase) + { + }; + CustomizeResponseFormatHints(hints); + return CliRuntime.FormatHumanReadable(value, context, truncateLongStrings, hints); + } + + static partial void CustomizeResponseText(ParseResult parseResult, global::AI21.ConfigProfileOut value, ref string? text); + static partial void CustomizeResponseFormatHints(Dictionary hints); + + + public static Command Create() + { + var command = new Command(@"create-config-tokenwise-settings-configs-post", @"Create Config"); + command.Options.Add(Overrides); command.Options.Add(ConfigProfileCreateOptionSetOptions.ConfigId); + command.Options.Add(ConfigProfileCreateOptionSetOptions.NameOption); + command.Options.Add(ConfigProfileCreateOptionSetOptions.DescriptionOption); + command.Options.Add(ConfigProfileCreateOptionSetOptions.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::AI21.SourceGenerationContext.Default, + cancellationToken).ConfigureAwait(false); + var overrides = CliRuntime.WasSpecified(parseResult, Overrides) ? parseResult.GetValue(Overrides) : (__requestBase is { } __OverridesBaseValue ? __OverridesBaseValue.Overrides : default); var configId = parseResult.GetRequiredValue(ConfigProfileCreateOptionSetOptions.ConfigId); + var name = CliRuntime.WasSpecified(parseResult, ConfigProfileCreateOptionSetOptions.NameOption) ? parseResult.GetValue(ConfigProfileCreateOptionSetOptions.NameOption) : (__requestBase is { } __NameBaseValue ? __NameBaseValue.Name : default); + var description = CliRuntime.WasSpecified(parseResult, ConfigProfileCreateOptionSetOptions.DescriptionOption) ? parseResult.GetValue(ConfigProfileCreateOptionSetOptions.DescriptionOption) : (__requestBase is { } __DescriptionBaseValue ? __DescriptionBaseValue.Description : default); + var enabled = CliRuntime.WasSpecified(parseResult, ConfigProfileCreateOptionSetOptions.Enabled) ? parseResult.GetValue(ConfigProfileCreateOptionSetOptions.Enabled) : (__requestBase is { } __EnabledBaseValue ? __EnabledBaseValue.Enabled : default); + using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); + + + var response = await client.CreateConfigTokenwiseSettingsConfigsPostAsync( + overrides: overrides, + configId: configId, + name: name, + description: description, + enabled: enabled, + cancellationToken: cancellationToken).ConfigureAwait(false); + + + await CliRuntime.WriteResponseAsync( + parseResult, + response, + global::AI21.SourceGenerationContext.Default, + FormatResponse, + cancellationToken).ConfigureAwait(false); + }, cancellationToken).ConfigureAwait(false)); + return command; + } +} \ No newline at end of file diff --git a/src/cli/AI21.CLI/Commands/DefaultApiGroupCommand.g.cs b/src/cli/AI21.CLI/Commands/DefaultApiGroupCommand.g.cs index 38921014..b2165bda 100644 --- a/src/cli/AI21.CLI/Commands/DefaultApiGroupCommand.g.cs +++ b/src/cli/AI21.CLI/Commands/DefaultApiGroupCommand.g.cs @@ -9,90 +9,117 @@ internal static class DefaultApiGroupCommand public static Command Create() { var command = new Command(@"default", @"default endpoint commands."); + command.Subcommands.Add(AnalyticsAgentsGatewayAnalyticsV1AgentsGetCommandApiCommand.Create()); + command.Subcommands.Add(AnalyticsAgentsTokenwiseAnalyticsV1AgentsGetCommandApiCommand.Create()); + command.Subcommands.Add(AnalyticsContextBashGatewayAnalyticsV1ContextBashGetCommandApiCommand.Create()); + command.Subcommands.Add(AnalyticsContextBashTokenwiseAnalyticsV1ContextBashGetCommandApiCommand.Create()); + command.Subcommands.Add(AnalyticsContextBlocksGatewayAnalyticsV1ContextBlocksGetCommandApiCommand.Create()); + command.Subcommands.Add(AnalyticsContextBlocksTokenwiseAnalyticsV1ContextBlocksGetCommandApiCommand.Create()); + command.Subcommands.Add(AnalyticsContextPrefixGatewayAnalyticsV1ContextPrefixGetCommandApiCommand.Create()); + command.Subcommands.Add(AnalyticsContextPrefixTokenwiseAnalyticsV1ContextPrefixGetCommandApiCommand.Create()); + command.Subcommands.Add(AnalyticsContextToolsGatewayAnalyticsV1ContextToolsGetCommandApiCommand.Create()); + command.Subcommands.Add(AnalyticsContextToolsTokenwiseAnalyticsV1ContextToolsGetCommandApiCommand.Create()); + command.Subcommands.Add(AnalyticsErrorsGatewayAnalyticsV1ErrorsGetCommandApiCommand.Create()); + command.Subcommands.Add(AnalyticsErrorsTokenwiseAnalyticsV1ErrorsGetCommandApiCommand.Create()); + command.Subcommands.Add(AnalyticsFiltersGatewayAnalyticsV1FiltersGetCommandApiCommand.Create()); + command.Subcommands.Add(AnalyticsFiltersTokenwiseAnalyticsV1FiltersGetCommandApiCommand.Create()); + command.Subcommands.Add(AnalyticsSessionDetailGatewayAnalyticsV1SessionsSessionIdGetCommandApiCommand.Create()); + command.Subcommands.Add(AnalyticsSessionDetailTokenwiseAnalyticsV1SessionsSessionIdGetCommandApiCommand.Create()); + command.Subcommands.Add(AnalyticsSessionsGatewayAnalyticsV1SessionsGetCommandApiCommand.Create()); + command.Subcommands.Add(AnalyticsSessionsTokenwiseAnalyticsV1SessionsGetCommandApiCommand.Create()); + command.Subcommands.Add(AnalyticsSummaryGatewayAnalyticsV1SummaryGetCommandApiCommand.Create()); + command.Subcommands.Add(AnalyticsSummaryTokenwiseAnalyticsV1SummaryGetCommandApiCommand.Create()); + command.Subcommands.Add(AnalyticsTransformersGatewayAnalyticsV1TransformersGetCommandApiCommand.Create()); + command.Subcommands.Add(AnalyticsTransformersTokenwiseAnalyticsV1TransformersGetCommandApiCommand.Create()); + command.Subcommands.Add(AnalyticsTrendsGatewayAnalyticsV1TrendsGetCommandApiCommand.Create()); + command.Subcommands.Add(AnalyticsTrendsTokenwiseAnalyticsV1TrendsGetCommandApiCommand.Create()); command.Subcommands.Add(CanIframeStudioV1DemosScraperCanIframeGetCommandApiCommand.Create()); - command.Subcommands.Add(ClarotyProductLookupSolutionsClarotyProductLookupPostCommandApiCommand.Create()); - command.Subcommands.Add(ClarotyScrapeUrlSolutionsClarotyScrapeUrlPostCommandApiCommand.Create()); - command.Subcommands.Add(ClarotySuggestVendorModelSolutionsClarotySuggestVendorModelPostCommandApiCommand.Create()); command.Subcommands.Add(CompareTextStudioV1DemosDocumentModifierCompareTextPostCommandApiCommand.Create()); command.Subcommands.Add(ConvertDocumentFileStudioV1ChatFilesConvertPostCommandApiCommand.Create()); + command.Subcommands.Add(CreateAgentGatewaySettingsAgentsPostCommandApiCommand.Create()); + command.Subcommands.Add(CreateAgentTokenwiseSettingsAgentsPostCommandApiCommand.Create()); + command.Subcommands.Add(CreateConfigGatewaySettingsConfigsPostCommandApiCommand.Create()); + command.Subcommands.Add(CreateConfigTokenwiseSettingsConfigsPostCommandApiCommand.Create()); command.Subcommands.Add(CreateDemoStudioV1DemosPostCommandApiCommand.Create()); command.Subcommands.Add(CreateMcpStorageStudioV1McpStoragePostCommandApiCommand.Create()); command.Subcommands.Add(CreateOrganizationSchemaStudioV1StructuredRagOrganizationsOrganizationIdSchemasPostCommandApiCommand.Create()); + command.Subcommands.Add(DeleteAgentGatewaySettingsAgentsAgentIdDeleteCommandApiCommand.Create()); + command.Subcommands.Add(DeleteAgentTokenwiseSettingsAgentsAgentIdDeleteCommandApiCommand.Create()); + command.Subcommands.Add(DeleteConfigGatewaySettingsConfigsConfigIdDeleteCommandApiCommand.Create()); + command.Subcommands.Add(DeleteConfigTokenwiseSettingsConfigsConfigIdDeleteCommandApiCommand.Create()); command.Subcommands.Add(DeleteDemoStudioV1DemosDemoIdDeleteCommandApiCommand.Create()); command.Subcommands.Add(DeleteMcpStorageStudioV1McpStorageMcpIdDeleteCommandApiCommand.Create()); command.Subcommands.Add(DeleteOrganizationSchemaStudioV1StructuredRagOrganizationsOrganizationIdSchemasSchemaNameDeleteCommandApiCommand.Create()); - command.Subcommands.Add(DeleteWebsiteConnectorStudioV1ConnectorsWebsiteConnectorIdDeleteCommandApiCommand.Create()); - command.Subcommands.Add(DeleteWorkspaceModelEndpointStudioV1SettingsModelsNameDeleteCommandApiCommand.Create()); command.Subcommands.Add(DetectSchemaStudioV1StructuredRagOrganizationsOrganizationIdSchemaDetectionPostCommandApiCommand.Create()); command.Subcommands.Add(DownloadModifiedDocumentStudioV1DemosDocumentModifierDownloadPostCommandApiCommand.Create()); - command.Subcommands.Add(FnacAftersalesBatchPredictPrefixPreviewSolutionsPreviewFdAftersalesPartsClassificationBatchPostCommandApiCommand.Create()); - command.Subcommands.Add(FnacAftersalesBatchPredictSolutionsFdAftersalesPartsClassificationBatchPostCommandApiCommand.Create()); - command.Subcommands.Add(FnacAftersalesBatchPredictStatusPrefixPreviewSolutionsPreviewFdAftersalesPartsClassificationBatchBatchIdStatusGetCommandApiCommand.Create()); - command.Subcommands.Add(FnacAftersalesBatchPredictStatusSolutionsFdAftersalesPartsClassificationBatchBatchIdStatusGetCommandApiCommand.Create()); - command.Subcommands.Add(FnacBatchClassificationsPrefixPreviewSolutionsPreviewFdBatchesV1ClassificationsPostCommandApiCommand.Create()); - command.Subcommands.Add(FnacBatchClassificationsResultsPrefixPreviewSolutionsPreviewFdBatchesV1ClassificationsBatchIdResultsPostCommandApiCommand.Create()); - command.Subcommands.Add(FnacBatchClassificationsResultsSolutionsFdBatchesV1ClassificationsBatchIdResultsPostCommandApiCommand.Create()); - command.Subcommands.Add(FnacBatchClassificationsSolutionsFdBatchesV1ClassificationsPostCommandApiCommand.Create()); - command.Subcommands.Add(FnacBatchClassificationsStatusPrefixPreviewSolutionsPreviewFdBatchesV1ClassificationsBatchIdStatusPostCommandApiCommand.Create()); - command.Subcommands.Add(FnacBatchClassificationsStatusSolutionsFdBatchesV1ClassificationsBatchIdStatusPostCommandApiCommand.Create()); - command.Subcommands.Add(FnacBatchDescriptionsPrefixPreviewSolutionsPreviewFdBatchesV1DescriptionsPostCommandApiCommand.Create()); - command.Subcommands.Add(FnacBatchDescriptionsResultsPrefixPreviewSolutionsPreviewFdBatchesV1DescriptionsBatchIdResultsPostCommandApiCommand.Create()); - command.Subcommands.Add(FnacBatchDescriptionsResultsSolutionsFdBatchesV1DescriptionsBatchIdResultsPostCommandApiCommand.Create()); - command.Subcommands.Add(FnacBatchDescriptionsSolutionsFdBatchesV1DescriptionsPostCommandApiCommand.Create()); - command.Subcommands.Add(FnacBatchDescriptionsStatusPrefixPreviewSolutionsPreviewFdBatchesV1DescriptionsBatchIdStatusPostCommandApiCommand.Create()); - command.Subcommands.Add(FnacBatchDescriptionsStatusSolutionsFdBatchesV1DescriptionsBatchIdStatusPostCommandApiCommand.Create()); - command.Subcommands.Add(FnacV1ClassificationsPrefixPreviewSolutionsPreviewFnacV1ClassificationsPostCommandApiCommand.Create()); - command.Subcommands.Add(FnacV1ClassificationsSolutionsFnacV1ClassificationsPostCommandApiCommand.Create()); - command.Subcommands.Add(FnacV1DeprecatedClassificationsPrefixPreviewSolutionsPreviewFnacV1DeprecatedClassificationsPostCommandApiCommand.Create()); - command.Subcommands.Add(FnacV1DeprecatedClassificationsSolutionsFnacV1DeprecatedClassificationsPostCommandApiCommand.Create()); - command.Subcommands.Add(FnacV1DeprecatedDescriptionsPrefixPreviewSolutionsPreviewFnacV1DeprecatedDescriptionsPostCommandApiCommand.Create()); - command.Subcommands.Add(FnacV1DeprecatedDescriptionsSolutionsFnacV1DeprecatedDescriptionsPostCommandApiCommand.Create()); - command.Subcommands.Add(FnacV1DescriptionsPrefixPreviewSolutionsPreviewFnacV1DescriptionsPostCommandApiCommand.Create()); - command.Subcommands.Add(FnacV1DescriptionsSolutionsFnacV1DescriptionsPostCommandApiCommand.Create()); - command.Subcommands.Add(ForwardParagonWebhookStudioV1ConnectorsParagonWebhookPostCommandApiCommand.Create()); - command.Subcommands.Add(GenerateOrgTokenStudioV1ConnectorsConnectedUsersEntityIdTokensPostCommandApiCommand.Create()); command.Subcommands.Add(GenerateResponsePdfStudioV1DemosRfiGenerateResponsePdfPostCommandApiCommand.Create()); + command.Subcommands.Add(GetAgentGatewaySettingsAgentsAgentIdGetCommandApiCommand.Create()); + command.Subcommands.Add(GetAgentOptimizationsGatewaySettingsAgentsAgentIdOptimizationsGetCommandApiCommand.Create()); + command.Subcommands.Add(GetAgentOptimizationsTokenwiseSettingsAgentsAgentIdOptimizationsGetCommandApiCommand.Create()); + command.Subcommands.Add(GetAgentTokenwiseSettingsAgentsAgentIdGetCommandApiCommand.Create()); command.Subcommands.Add(GetAssistantsByMcpStudioV1McpStorageMcpIdAssistantsGetCommandApiCommand.Create()); command.Subcommands.Add(GetAvailableModelsEndpointStudioV1SettingsModelsAvailableGetCommandApiCommand.Create()); - command.Subcommands.Add(GetConnectorConnectionStatusStudioV1ConnectorsConnectedUsersEntityIdDataSourcesDataSourceConnectionStatusGetCommandApiCommand.Create()); - command.Subcommands.Add(GetDataSourceStatusStudioV1ConnectorsConnectedUsersEntityIdDataSourcesDataSourceStatusGetCommandApiCommand.Create()); + command.Subcommands.Add(GetConfigGatewaySettingsConfigsConfigIdGetCommandApiCommand.Create()); + command.Subcommands.Add(GetConfigSchemaGatewaySettingsConfigsSchemaGetCommandApiCommand.Create()); + command.Subcommands.Add(GetConfigSchemaTokenwiseSettingsConfigsSchemaGetCommandApiCommand.Create()); + command.Subcommands.Add(GetConfigTokenwiseSettingsConfigsConfigIdGetCommandApiCommand.Create()); command.Subcommands.Add(GetDemoStudioV1DemosDemoIdGetCommandApiCommand.Create()); command.Subcommands.Add(GetFileUrlStudioV1DemosScraperFileUrlFileIdGetCommandApiCommand.Create()); command.Subcommands.Add(GetMcpStorageStudioV1McpStorageMcpIdGetCommandApiCommand.Create()); - command.Subcommands.Add(GetOrgDataSourcesInfoStudioV1ConnectorsConnectedUsersEntityIdDataSourcesGetCommandApiCommand.Create()); command.Subcommands.Add(GetOrganizationSchemasStudioV1StructuredRagOrganizationsOrganizationIdSchemasGetCommandApiCommand.Create()); - command.Subcommands.Add(GetOutputExplanationStudioV1ExecutionsExecutionIdExplanationsOutputGetCommandApiCommand.Create()); command.Subcommands.Add(GetParsedFileStudioV1DemosDocumentModifierGetParsedFileGetCommandApiCommand.Create()); - command.Subcommands.Add(GetStepExplanationsStudioV1ExecutionsExecutionIdExplanationsStepsGetCommandApiCommand.Create()); command.Subcommands.Add(GetVectorStoreStudioV1DemosRegulationsVectorStoreVectorStoreIdGetCommandApiCommand.Create()); - command.Subcommands.Add(GetWebsiteConnectorByIdStudioV1ConnectorsWebsiteConnectorIdGetCommandApiCommand.Create()); - command.Subcommands.Add(GetWebsiteConnectorStudioV1ConnectorsWebsiteGetCommandApiCommand.Create()); command.Subcommands.Add(GetWorkspaceModelSecretEndpointStudioV1SettingsModelsNameSecretsGetCommandApiCommand.Create()); command.Subcommands.Add(GetWorkspaceModelsByOrganizationEndpointStudioV1SettingsModelsGetCommandApiCommand.Create()); command.Subcommands.Add(JambaExecuteStudioV1DemosDocumentModifierJambaExecutePostCommandApiCommand.Create()); - command.Subcommands.Add(KirshDocumentUploadProcessPrefixPreviewSolutionsPreviewKirshDocumentUploadProcessPostCommandApiCommand.Create()); - command.Subcommands.Add(KirshDocumentUploadProcessSolutionsKirshDocumentUploadProcessPostCommandApiCommand.Create()); - command.Subcommands.Add(KirshEmailAssistantPrefixPreviewSolutionsPreviewKirshEmailAssistantPostCommandApiCommand.Create()); - command.Subcommands.Add(KirshEmailAssistantSolutionsKirshEmailAssistantPostCommandApiCommand.Create()); - command.Subcommands.Add(KirshFundingAndCategorizationCheckPrefixPreviewSolutionsPreviewKirshFundingAndCategorizationCheckPostCommandApiCommand.Create()); - command.Subcommands.Add(KirshFundingAndCategorizationCheckSolutionsKirshFundingAndCategorizationCheckPostCommandApiCommand.Create()); - command.Subcommands.Add(KirshGrantCompliancePrefixPreviewSolutionsPreviewKirshGrantCompliancePostCommandApiCommand.Create()); - command.Subcommands.Add(KirshGrantComplianceSolutionsKirshGrantCompliancePostCommandApiCommand.Create()); - command.Subcommands.Add(KirshGrantMetadataPrefixPreviewSolutionsPreviewKirshGrantMetadataPostCommandApiCommand.Create()); - command.Subcommands.Add(KirshGrantMetadataSolutionsKirshGrantMetadataPostCommandApiCommand.Create()); - command.Subcommands.Add(KirshPublicInformationCheckPrefixPreviewSolutionsPreviewKirshPublicInformationCheckPostCommandApiCommand.Create()); - command.Subcommands.Add(KirshPublicInformationCheckSolutionsKirshPublicInformationCheckPostCommandApiCommand.Create()); + command.Subcommands.Add(ListAgentsGatewaySettingsAgentsGetCommandApiCommand.Create()); + command.Subcommands.Add(ListAgentsTokenwiseSettingsAgentsGetCommandApiCommand.Create()); + command.Subcommands.Add(ListConfigsGatewaySettingsConfigsGetCommandApiCommand.Create()); + command.Subcommands.Add(ListConfigsTokenwiseSettingsConfigsGetCommandApiCommand.Create()); command.Subcommands.Add(ListDemosStudioV1DemosGetCommandApiCommand.Create()); command.Subcommands.Add(ListMcpStorageStudioV1McpStorageGetCommandApiCommand.Create()); - command.Subcommands.Add(McpToolDiscoveryStudioV1McpDiscoverPostCommandApiCommand.Create()); command.Subcommands.Add(ParsePdfStudioV1DemosDocumentModifierParsePdfPostCommandApiCommand.Create()); - command.Subcommands.Add(PostWebsiteConnectorStudioV1ConnectorsWebsitePostCommandApiCommand.Create()); command.Subcommands.Add(ProcessRfiDocumentStudioV1DemosRfiProcessRfiPostCommandApiCommand.Create()); - command.Subcommands.Add(RunSyncStudioV1ConnectorsConnectedUsersDataSourcesSyncsPostCommandApiCommand.Create()); - command.Subcommands.Add(RunWorkflowStudioV1ConnectorsConnectedUsersEntityIdDataSourcesDataSourceWorkflowsWorkflowNameRunPostCommandApiCommand.Create()); - command.Subcommands.Add(SyncWebsiteStudioV1ConnectorsWebsiteConnectorIdSyncPostCommandApiCommand.Create()); - command.Subcommands.Add(TlvConvragPrefixPreviewSolutionsPreviewTlvMunicipalityConvragPostCommandApiCommand.Create()); - command.Subcommands.Add(TlvConvragSolutionsTlvMunicipalityConvragPostCommandApiCommand.Create()); + command.Subcommands.Add(ProxyOffV1GatewayOffV1PathGetCommandApiCommand.Create()); + command.Subcommands.Add(ProxyOffV1GatewayOffV1PathGet2CommandApiCommand.Create()); + command.Subcommands.Add(ProxyOffV1GatewayOffV1PathGet3CommandApiCommand.Create()); + command.Subcommands.Add(ProxyOffV1GatewayOffV1PathGet4CommandApiCommand.Create()); + command.Subcommands.Add(ProxyOffV1GatewayOffV1PathGet5CommandApiCommand.Create()); + command.Subcommands.Add(ProxyOffV1GatewayOffV1PathGet6CommandApiCommand.Create()); + command.Subcommands.Add(ProxyOffV1TokenwiseOffV1PathGetCommandApiCommand.Create()); + command.Subcommands.Add(ProxyOffV1TokenwiseOffV1PathGet2CommandApiCommand.Create()); + command.Subcommands.Add(ProxyOffV1TokenwiseOffV1PathGet3CommandApiCommand.Create()); + command.Subcommands.Add(ProxyOffV1TokenwiseOffV1PathGet4CommandApiCommand.Create()); + command.Subcommands.Add(ProxyOffV1TokenwiseOffV1PathGet5CommandApiCommand.Create()); + command.Subcommands.Add(ProxyOffV1TokenwiseOffV1PathGet6CommandApiCommand.Create()); + command.Subcommands.Add(ProxyOnV1GatewayOnV1PathGetCommandApiCommand.Create()); + command.Subcommands.Add(ProxyOnV1GatewayOnV1PathGet2CommandApiCommand.Create()); + command.Subcommands.Add(ProxyOnV1GatewayOnV1PathGet3CommandApiCommand.Create()); + command.Subcommands.Add(ProxyOnV1GatewayOnV1PathGet4CommandApiCommand.Create()); + command.Subcommands.Add(ProxyOnV1GatewayOnV1PathGet5CommandApiCommand.Create()); + command.Subcommands.Add(ProxyOnV1GatewayOnV1PathGet6CommandApiCommand.Create()); + command.Subcommands.Add(ProxyOnV1TokenwiseOnV1PathGetCommandApiCommand.Create()); + command.Subcommands.Add(ProxyOnV1TokenwiseOnV1PathGet2CommandApiCommand.Create()); + command.Subcommands.Add(ProxyOnV1TokenwiseOnV1PathGet3CommandApiCommand.Create()); + command.Subcommands.Add(ProxyOnV1TokenwiseOnV1PathGet4CommandApiCommand.Create()); + command.Subcommands.Add(ProxyOnV1TokenwiseOnV1PathGet5CommandApiCommand.Create()); + command.Subcommands.Add(ProxyOnV1TokenwiseOnV1PathGet6CommandApiCommand.Create()); + command.Subcommands.Add(ProxyV1GatewayV1PathGetCommandApiCommand.Create()); + command.Subcommands.Add(ProxyV1GatewayV1PathGet2CommandApiCommand.Create()); + command.Subcommands.Add(ProxyV1GatewayV1PathGet3CommandApiCommand.Create()); + command.Subcommands.Add(ProxyV1GatewayV1PathGet4CommandApiCommand.Create()); + command.Subcommands.Add(ProxyV1GatewayV1PathGet5CommandApiCommand.Create()); + command.Subcommands.Add(ProxyV1GatewayV1PathGet6CommandApiCommand.Create()); + command.Subcommands.Add(ProxyV1TokenwiseV1PathGetCommandApiCommand.Create()); + command.Subcommands.Add(ProxyV1TokenwiseV1PathGet2CommandApiCommand.Create()); + command.Subcommands.Add(ProxyV1TokenwiseV1PathGet3CommandApiCommand.Create()); + command.Subcommands.Add(ProxyV1TokenwiseV1PathGet4CommandApiCommand.Create()); + command.Subcommands.Add(ProxyV1TokenwiseV1PathGet5CommandApiCommand.Create()); + command.Subcommands.Add(ProxyV1TokenwiseV1PathGet6CommandApiCommand.Create()); + command.Subcommands.Add(UpdateAgentGatewaySettingsAgentsAgentIdPutCommandApiCommand.Create()); + command.Subcommands.Add(UpdateAgentTokenwiseSettingsAgentsAgentIdPutCommandApiCommand.Create()); + command.Subcommands.Add(UpdateConfigGatewaySettingsConfigsConfigIdPutCommandApiCommand.Create()); + command.Subcommands.Add(UpdateConfigTokenwiseSettingsConfigsConfigIdPutCommandApiCommand.Create()); command.Subcommands.Add(UpdateDemoStudioV1DemosDemoIdPutCommandApiCommand.Create()); command.Subcommands.Add(UpdateMcpStorageStudioV1McpStorageMcpIdPatchCommandApiCommand.Create()); command.Subcommands.Add(UpdateWorkspaceModelEndpointStudioV1SettingsModelsNamePatchCommandApiCommand.Create()); @@ -116,33 +143,34 @@ public static Command Create() command.Subcommands.Add(V1ModifyPlanCommandApiCommand.Create()); command.Subcommands.Add(V1ModifyRouteCommandApiCommand.Create()); command.Subcommands.Add(V1RunAssistantCommandApiCommand.Create()); + command.Subcommands.Add(V1SolutionsFdBatchesV1ClassificationsCommandApiCommand.Create()); + command.Subcommands.Add(V1SolutionsFdBatchesV1ClassificationsResultsCommandApiCommand.Create()); + command.Subcommands.Add(V1SolutionsFdBatchesV1ClassificationsStatusCommandApiCommand.Create()); + command.Subcommands.Add(V1SolutionsFdBatchesV1DescriptionsCommandApiCommand.Create()); + command.Subcommands.Add(V1SolutionsFdBatchesV1DescriptionsResultsCommandApiCommand.Create()); + command.Subcommands.Add(V1SolutionsFdBatchesV1DescriptionsStatusCommandApiCommand.Create()); + command.Subcommands.Add(V1SolutionsFdPreviewBatchesV1ClassificationsCommandApiCommand.Create()); + command.Subcommands.Add(V1SolutionsFdPreviewBatchesV1ClassificationsResultsCommandApiCommand.Create()); + command.Subcommands.Add(V1SolutionsFdPreviewBatchesV1ClassificationsStatusCommandApiCommand.Create()); + command.Subcommands.Add(V1SolutionsFdPreviewBatchesV1DescriptionsCommandApiCommand.Create()); + command.Subcommands.Add(V1SolutionsFdPreviewBatchesV1DescriptionsResultsCommandApiCommand.Create()); + command.Subcommands.Add(V1SolutionsFdPreviewBatchesV1DescriptionsStatusCommandApiCommand.Create()); + command.Subcommands.Add(V1SolutionsFnacAftersalesBatchPredictCommandApiCommand.Create()); + command.Subcommands.Add(V1SolutionsFnacAftersalesBatchPredictStatusCommandApiCommand.Create()); + command.Subcommands.Add(V1SolutionsFnacAftersalesPreviewBatchPredictCommandApiCommand.Create()); + command.Subcommands.Add(V1SolutionsFnacAftersalesPreviewBatchPredictStatusCommandApiCommand.Create()); + command.Subcommands.Add(V1SolutionsFnacPreviewV1ClassificationsCommandApiCommand.Create()); + command.Subcommands.Add(V1SolutionsFnacPreviewV1DeprecatedClassificationsCommandApiCommand.Create()); + command.Subcommands.Add(V1SolutionsFnacPreviewV1DeprecatedDescriptionsCommandApiCommand.Create()); + command.Subcommands.Add(V1SolutionsFnacPreviewV1DescriptionsCommandApiCommand.Create()); + command.Subcommands.Add(V1SolutionsFnacV1ClassificationsCommandApiCommand.Create()); + command.Subcommands.Add(V1SolutionsFnacV1DeprecatedClassificationsCommandApiCommand.Create()); + command.Subcommands.Add(V1SolutionsFnacV1DeprecatedDescriptionsCommandApiCommand.Create()); + command.Subcommands.Add(V1SolutionsFnacV1DescriptionsCommandApiCommand.Create()); + command.Subcommands.Add(V1SolutionsTlvMunicipalityConvragCommandApiCommand.Create()); + command.Subcommands.Add(V1SolutionsTlvMunicipalityPreviewConvragCommandApiCommand.Create()); command.Subcommands.Add(V1StudioApiGenerationRequirementsCommandApiCommand.Create()); - command.Subcommands.Add(V1StudioApiGenerationThreadNameCommandApiCommand.Create()); command.Subcommands.Add(V1ValidatePlanCommandApiCommand.Create()); - command.Subcommands.Add(VidaaActionItemsPreviewSolutionsPreviewVidaaActionItemsPostCommandApiCommand.Create()); - command.Subcommands.Add(VidaaActionItemsSolutionsVidaaActionItemsPostCommandApiCommand.Create()); - command.Subcommands.Add(VidaaFeedItemsPreviewSolutionsPreviewVidaaFeedItemsGetCommandApiCommand.Create()); - command.Subcommands.Add(VidaaFeedItemsSolutionsVidaaFeedItemsGetCommandApiCommand.Create()); - command.Subcommands.Add(VidaaMessagesPreviewSolutionsPreviewVidaaApiMessagesPostCommandApiCommand.Create()); - command.Subcommands.Add(VidaaMessagesSolutionsVidaaApiMessagesPostCommandApiCommand.Create()); - command.Subcommands.Add(VidaaSchedulerStatsPreviewSolutionsPreviewVidaaSchedulerStatsGetCommandApiCommand.Create()); - command.Subcommands.Add(VidaaSchedulerStatsSolutionsVidaaSchedulerStatsGetCommandApiCommand.Create()); - command.Subcommands.Add(VidaaSourcesPreviewSolutionsPreviewVidaaSourcesGetCommandApiCommand.Create()); - command.Subcommands.Add(VidaaSourcesSolutionsVidaaSourcesGetCommandApiCommand.Create()); - command.Subcommands.Add(VidaaSubscribePreviewSolutionsPreviewVidaaSubscribePostCommandApiCommand.Create()); - command.Subcommands.Add(VidaaSubscribeSolutionsVidaaSubscribePostCommandApiCommand.Create()); - command.Subcommands.Add(VidaaSubscriptionsPreviewSolutionsPreviewVidaaSubscriptionsGetCommandApiCommand.Create()); - command.Subcommands.Add(VidaaSubscriptionsSolutionsVidaaSubscriptionsGetCommandApiCommand.Create()); - command.Subcommands.Add(VidaaSummarizePreviewSolutionsPreviewVidaaSummarizePostCommandApiCommand.Create()); - command.Subcommands.Add(VidaaSummarizeSolutionsVidaaSummarizePostCommandApiCommand.Create()); - command.Subcommands.Add(VidaaTriggerPollPreviewSolutionsPreviewVidaaTriggerPollPostCommandApiCommand.Create()); - command.Subcommands.Add(VidaaTriggerPollSolutionsVidaaTriggerPollPostCommandApiCommand.Create()); - command.Subcommands.Add(VidaaUnsubscribePreviewSolutionsPreviewVidaaUnsubscribePostCommandApiCommand.Create()); - command.Subcommands.Add(VidaaUnsubscribeSolutionsVidaaUnsubscribePostCommandApiCommand.Create()); - command.Subcommands.Add(WppFeedbackPrefixPreviewSolutionsPreviewWppFeedbackPostCommandApiCommand.Create()); - command.Subcommands.Add(WppFeedbackSolutionsWppFeedbackPostCommandApiCommand.Create()); - command.Subcommands.Add(WppQueryPrefixPreviewSolutionsPreviewWppQueryPostCommandApiCommand.Create()); - command.Subcommands.Add(WppQuerySolutionsWppQueryPostCommandApiCommand.Create()); return command; } } \ No newline at end of file diff --git a/src/cli/AI21.CLI/Commands/DeleteAgentGatewaySettingsAgentsAgentIdDeleteCommandApiCommand.g.cs b/src/cli/AI21.CLI/Commands/DeleteAgentGatewaySettingsAgentsAgentIdDeleteCommandApiCommand.g.cs new file mode 100644 index 00000000..241dea90 --- /dev/null +++ b/src/cli/AI21.CLI/Commands/DeleteAgentGatewaySettingsAgentsAgentIdDeleteCommandApiCommand.g.cs @@ -0,0 +1,37 @@ +#nullable enable +#pragma warning disable CS0618 + +using System.CommandLine; + +namespace AI21.CLI.Commands; + +internal static partial class DeleteAgentGatewaySettingsAgentsAgentIdDeleteCommandApiCommand +{ + private static Argument AgentId { get; } = new( + name: @"agent-id") + { + Description = @"", + }; + + public static Command Create() + { + var command = new Command(@"delete-agent-gateway-settings-agents-agent-id-delete", @"Delete Agent"); + command.Arguments.Add(AgentId); + + + command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => + await CliRuntime.RunAsync(async () => + { + var agentId = parseResult.GetRequiredValue(AgentId); + using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); + + + await client.DeleteAgentGatewaySettingsAgentsAgentIdDeleteAsync( + agentId: agentId, + cancellationToken: cancellationToken).ConfigureAwait(false); + + await CliRuntime.WriteSuccessAsync(parseResult, cancellationToken).ConfigureAwait(false); + }, cancellationToken).ConfigureAwait(false)); + return command; + } +} \ No newline at end of file diff --git a/src/cli/AI21.CLI/Commands/DeleteAgentTokenwiseSettingsAgentsAgentIdDeleteCommandApiCommand.g.cs b/src/cli/AI21.CLI/Commands/DeleteAgentTokenwiseSettingsAgentsAgentIdDeleteCommandApiCommand.g.cs new file mode 100644 index 00000000..77b7e322 --- /dev/null +++ b/src/cli/AI21.CLI/Commands/DeleteAgentTokenwiseSettingsAgentsAgentIdDeleteCommandApiCommand.g.cs @@ -0,0 +1,37 @@ +#nullable enable +#pragma warning disable CS0618 + +using System.CommandLine; + +namespace AI21.CLI.Commands; + +internal static partial class DeleteAgentTokenwiseSettingsAgentsAgentIdDeleteCommandApiCommand +{ + private static Argument AgentId { get; } = new( + name: @"agent-id") + { + Description = @"", + }; + + public static Command Create() + { + var command = new Command(@"delete-agent-tokenwise-settings-agents-agent-id-delete", @"Delete Agent"); + command.Arguments.Add(AgentId); + + + command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => + await CliRuntime.RunAsync(async () => + { + var agentId = parseResult.GetRequiredValue(AgentId); + using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); + + + await client.DeleteAgentTokenwiseSettingsAgentsAgentIdDeleteAsync( + agentId: agentId, + cancellationToken: cancellationToken).ConfigureAwait(false); + + await CliRuntime.WriteSuccessAsync(parseResult, cancellationToken).ConfigureAwait(false); + }, cancellationToken).ConfigureAwait(false)); + return command; + } +} \ No newline at end of file diff --git a/src/cli/AI21.CLI/Commands/DeleteConfigGatewaySettingsConfigsConfigIdDeleteCommandApiCommand.g.cs b/src/cli/AI21.CLI/Commands/DeleteConfigGatewaySettingsConfigsConfigIdDeleteCommandApiCommand.g.cs new file mode 100644 index 00000000..db645768 --- /dev/null +++ b/src/cli/AI21.CLI/Commands/DeleteConfigGatewaySettingsConfigsConfigIdDeleteCommandApiCommand.g.cs @@ -0,0 +1,37 @@ +#nullable enable +#pragma warning disable CS0618 + +using System.CommandLine; + +namespace AI21.CLI.Commands; + +internal static partial class DeleteConfigGatewaySettingsConfigsConfigIdDeleteCommandApiCommand +{ + private static Argument ConfigId { get; } = new( + name: @"config-id") + { + Description = @"", + }; + + public static Command Create() + { + var command = new Command(@"delete-config-gateway-settings-configs-config-id-delete", @"Delete Config"); + command.Arguments.Add(ConfigId); + + + command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => + await CliRuntime.RunAsync(async () => + { + var configId = parseResult.GetRequiredValue(ConfigId); + using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); + + + await client.DeleteConfigGatewaySettingsConfigsConfigIdDeleteAsync( + configId: configId, + cancellationToken: cancellationToken).ConfigureAwait(false); + + await CliRuntime.WriteSuccessAsync(parseResult, cancellationToken).ConfigureAwait(false); + }, cancellationToken).ConfigureAwait(false)); + return command; + } +} \ No newline at end of file diff --git a/src/cli/AI21.CLI/Commands/DeleteConfigTokenwiseSettingsConfigsConfigIdDeleteCommandApiCommand.g.cs b/src/cli/AI21.CLI/Commands/DeleteConfigTokenwiseSettingsConfigsConfigIdDeleteCommandApiCommand.g.cs new file mode 100644 index 00000000..7709190c --- /dev/null +++ b/src/cli/AI21.CLI/Commands/DeleteConfigTokenwiseSettingsConfigsConfigIdDeleteCommandApiCommand.g.cs @@ -0,0 +1,37 @@ +#nullable enable +#pragma warning disable CS0618 + +using System.CommandLine; + +namespace AI21.CLI.Commands; + +internal static partial class DeleteConfigTokenwiseSettingsConfigsConfigIdDeleteCommandApiCommand +{ + private static Argument ConfigId { get; } = new( + name: @"config-id") + { + Description = @"", + }; + + public static Command Create() + { + var command = new Command(@"delete-config-tokenwise-settings-configs-config-id-delete", @"Delete Config"); + command.Arguments.Add(ConfigId); + + + command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => + await CliRuntime.RunAsync(async () => + { + var configId = parseResult.GetRequiredValue(ConfigId); + using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); + + + await client.DeleteConfigTokenwiseSettingsConfigsConfigIdDeleteAsync( + configId: configId, + cancellationToken: cancellationToken).ConfigureAwait(false); + + await CliRuntime.WriteSuccessAsync(parseResult, cancellationToken).ConfigureAwait(false); + }, cancellationToken).ConfigureAwait(false)); + return command; + } +} \ No newline at end of file diff --git a/src/cli/AI21.CLI/Commands/DeleteWebsiteConnectorStudioV1ConnectorsWebsiteConnectorIdDeleteCommandApiCommand.g.cs b/src/cli/AI21.CLI/Commands/DeleteWebsiteConnectorStudioV1ConnectorsWebsiteConnectorIdDeleteCommandApiCommand.g.cs deleted file mode 100644 index cd44500a..00000000 --- a/src/cli/AI21.CLI/Commands/DeleteWebsiteConnectorStudioV1ConnectorsWebsiteConnectorIdDeleteCommandApiCommand.g.cs +++ /dev/null @@ -1,63 +0,0 @@ -#nullable enable -#pragma warning disable CS0618 - -using System.CommandLine; - -namespace AI21.CLI.Commands; - -internal static partial class DeleteWebsiteConnectorStudioV1ConnectorsWebsiteConnectorIdDeleteCommandApiCommand -{ - private static Argument ConnectorId { get; } = new( - name: @"connector-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(@"delete-website-connector-studio-v1-connectors-website-connector-id-delete", @"Delete Website Connector"); - command.Arguments.Add(ConnectorId); - - - command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => - await CliRuntime.RunAsync(async () => - { - var connectorId = parseResult.GetRequiredValue(ConnectorId); - using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); - - - var response = await client.DeleteWebsiteConnectorStudioV1ConnectorsWebsiteConnectorIdDeleteAsync( - connectorId: connectorId, - cancellationToken: cancellationToken).ConfigureAwait(false); - - - await CliRuntime.WriteResponseAsync( - parseResult, - response, - global::AI21.SourceGenerationContext.Default, - FormatResponse, - cancellationToken).ConfigureAwait(false); - }, cancellationToken).ConfigureAwait(false)); - return command; - } -} \ No newline at end of file diff --git a/src/cli/AI21.CLI/Commands/DeleteWorkspaceModelEndpointStudioV1SettingsModelsNameDeleteCommandApiCommand.g.cs b/src/cli/AI21.CLI/Commands/DeleteWorkspaceModelEndpointStudioV1SettingsModelsNameDeleteCommandApiCommand.g.cs deleted file mode 100644 index d3dbdf07..00000000 --- a/src/cli/AI21.CLI/Commands/DeleteWorkspaceModelEndpointStudioV1SettingsModelsNameDeleteCommandApiCommand.g.cs +++ /dev/null @@ -1,63 +0,0 @@ -#nullable enable -#pragma warning disable CS0618 - -using System.CommandLine; - -namespace AI21.CLI.Commands; - -internal static partial class DeleteWorkspaceModelEndpointStudioV1SettingsModelsNameDeleteCommandApiCommand -{ - private static Argument NameOption { get; } = new( - name: @"name") - { - 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-workspace-model-endpoint-studio-v1-settings-models-name-delete", @"Delete Workspace Model Endpoint"); - command.Arguments.Add(NameOption); - - - command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => - await CliRuntime.RunAsync(async () => - { - var name = parseResult.GetRequiredValue(NameOption); - using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); - - - var response = await client.DeleteWorkspaceModelEndpointStudioV1SettingsModelsNameDeleteAsync( - name: name, - cancellationToken: cancellationToken).ConfigureAwait(false); - - - await CliRuntime.WriteResponseAsync( - parseResult, - response, - global::AI21.SourceGenerationContext.Default, - FormatResponse, - cancellationToken).ConfigureAwait(false); - }, cancellationToken).ConfigureAwait(false)); - return command; - } -} \ No newline at end of file diff --git a/src/cli/AI21.CLI/Commands/FnacAftersalesBatchPredictPrefixPreviewSolutionsPreviewFdAftersalesPartsClassificationBatchPostCommandApiCommand.g.cs b/src/cli/AI21.CLI/Commands/FnacAftersalesBatchPredictPrefixPreviewSolutionsPreviewFdAftersalesPartsClassificationBatchPostCommandApiCommand.g.cs deleted file mode 100644 index 0eca4368..00000000 --- a/src/cli/AI21.CLI/Commands/FnacAftersalesBatchPredictPrefixPreviewSolutionsPreviewFdAftersalesPartsClassificationBatchPostCommandApiCommand.g.cs +++ /dev/null @@ -1,59 +0,0 @@ -#nullable enable -#pragma warning disable CS0618 - -using System.CommandLine; - -namespace AI21.CLI.Commands; - -internal static partial class FnacAftersalesBatchPredictPrefixPreviewSolutionsPreviewFdAftersalesPartsClassificationBatchPostCommandApiCommand -{ - - - 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(@"fnac-aftersales-batch-predict-prefix-preview-solutions-preview-fd-aftersales-parts-classification-batch-post", @"Fnac Aftersales Batch Predict Prefix Preview"); - - - - 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.FnacAftersalesBatchPredictPrefixPreviewSolutionsPreviewFdAftersalesPartsClassificationBatchPostAsync( - - cancellationToken: cancellationToken).ConfigureAwait(false); - - - await CliRuntime.WriteResponseAsync( - parseResult, - response, - global::AI21.SourceGenerationContext.Default, - FormatResponse, - cancellationToken).ConfigureAwait(false); - }, cancellationToken).ConfigureAwait(false)); - return command; - } -} \ No newline at end of file diff --git a/src/cli/AI21.CLI/Commands/FnacAftersalesBatchPredictSolutionsFdAftersalesPartsClassificationBatchPostCommandApiCommand.g.cs b/src/cli/AI21.CLI/Commands/FnacAftersalesBatchPredictSolutionsFdAftersalesPartsClassificationBatchPostCommandApiCommand.g.cs deleted file mode 100644 index 4089c565..00000000 --- a/src/cli/AI21.CLI/Commands/FnacAftersalesBatchPredictSolutionsFdAftersalesPartsClassificationBatchPostCommandApiCommand.g.cs +++ /dev/null @@ -1,59 +0,0 @@ -#nullable enable -#pragma warning disable CS0618 - -using System.CommandLine; - -namespace AI21.CLI.Commands; - -internal static partial class FnacAftersalesBatchPredictSolutionsFdAftersalesPartsClassificationBatchPostCommandApiCommand -{ - - - 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(@"fnac-aftersales-batch-predict-solutions-fd-aftersales-parts-classification-batch-post", @"Fnac Aftersales Batch Predict"); - - - - 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.FnacAftersalesBatchPredictSolutionsFdAftersalesPartsClassificationBatchPostAsync( - - cancellationToken: cancellationToken).ConfigureAwait(false); - - - await CliRuntime.WriteResponseAsync( - parseResult, - response, - global::AI21.SourceGenerationContext.Default, - FormatResponse, - cancellationToken).ConfigureAwait(false); - }, cancellationToken).ConfigureAwait(false)); - return command; - } -} \ No newline at end of file diff --git a/src/cli/AI21.CLI/Commands/FnacAftersalesBatchPredictStatusPrefixPreviewSolutionsPreviewFdAftersalesPartsClassificationBatchBatchIdStatusGetCommandApiCommand.g.cs b/src/cli/AI21.CLI/Commands/FnacAftersalesBatchPredictStatusPrefixPreviewSolutionsPreviewFdAftersalesPartsClassificationBatchBatchIdStatusGetCommandApiCommand.g.cs deleted file mode 100644 index f9c249ad..00000000 --- a/src/cli/AI21.CLI/Commands/FnacAftersalesBatchPredictStatusPrefixPreviewSolutionsPreviewFdAftersalesPartsClassificationBatchBatchIdStatusGetCommandApiCommand.g.cs +++ /dev/null @@ -1,63 +0,0 @@ -#nullable enable -#pragma warning disable CS0618 - -using System.CommandLine; - -namespace AI21.CLI.Commands; - -internal static partial class FnacAftersalesBatchPredictStatusPrefixPreviewSolutionsPreviewFdAftersalesPartsClassificationBatchBatchIdStatusGetCommandApiCommand -{ - private static Argument BatchId { get; } = new( - name: @"batch-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(@"fnac-aftersales-batch-predict-status-prefix-preview-solutions-preview-fd-aftersales-parts-classification-batch-batch-id-status-get", @"Fnac Aftersales Batch Predict Status Prefix Preview"); - command.Arguments.Add(BatchId); - - - command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => - await CliRuntime.RunAsync(async () => - { - var batchId = parseResult.GetRequiredValue(BatchId); - using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); - - - var response = await client.FnacAftersalesBatchPredictStatusPrefixPreviewSolutionsPreviewFdAftersalesPartsClassificationBatchBatchIdStatusGetAsync( - batchId: batchId, - cancellationToken: cancellationToken).ConfigureAwait(false); - - - await CliRuntime.WriteResponseAsync( - parseResult, - response, - global::AI21.SourceGenerationContext.Default, - FormatResponse, - cancellationToken).ConfigureAwait(false); - }, cancellationToken).ConfigureAwait(false)); - return command; - } -} \ No newline at end of file diff --git a/src/cli/AI21.CLI/Commands/FnacAftersalesBatchPredictStatusSolutionsFdAftersalesPartsClassificationBatchBatchIdStatusGetCommandApiCommand.g.cs b/src/cli/AI21.CLI/Commands/FnacAftersalesBatchPredictStatusSolutionsFdAftersalesPartsClassificationBatchBatchIdStatusGetCommandApiCommand.g.cs deleted file mode 100644 index e17cb876..00000000 --- a/src/cli/AI21.CLI/Commands/FnacAftersalesBatchPredictStatusSolutionsFdAftersalesPartsClassificationBatchBatchIdStatusGetCommandApiCommand.g.cs +++ /dev/null @@ -1,63 +0,0 @@ -#nullable enable -#pragma warning disable CS0618 - -using System.CommandLine; - -namespace AI21.CLI.Commands; - -internal static partial class FnacAftersalesBatchPredictStatusSolutionsFdAftersalesPartsClassificationBatchBatchIdStatusGetCommandApiCommand -{ - private static Argument BatchId { get; } = new( - name: @"batch-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(@"fnac-aftersales-batch-predict-status-solutions-fd-aftersales-parts-classification-batch-batch-id-status-get", @"Fnac Aftersales Batch Predict Status"); - command.Arguments.Add(BatchId); - - - command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => - await CliRuntime.RunAsync(async () => - { - var batchId = parseResult.GetRequiredValue(BatchId); - using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); - - - var response = await client.FnacAftersalesBatchPredictStatusSolutionsFdAftersalesPartsClassificationBatchBatchIdStatusGetAsync( - batchId: batchId, - cancellationToken: cancellationToken).ConfigureAwait(false); - - - await CliRuntime.WriteResponseAsync( - parseResult, - response, - global::AI21.SourceGenerationContext.Default, - FormatResponse, - cancellationToken).ConfigureAwait(false); - }, cancellationToken).ConfigureAwait(false)); - return command; - } -} \ No newline at end of file diff --git a/src/cli/AI21.CLI/Commands/FnacBatchClassificationsPrefixPreviewSolutionsPreviewFdBatchesV1ClassificationsPostCommandApiCommand.g.cs b/src/cli/AI21.CLI/Commands/FnacBatchClassificationsPrefixPreviewSolutionsPreviewFdBatchesV1ClassificationsPostCommandApiCommand.g.cs deleted file mode 100644 index 61a5d17f..00000000 --- a/src/cli/AI21.CLI/Commands/FnacBatchClassificationsPrefixPreviewSolutionsPreviewFdBatchesV1ClassificationsPostCommandApiCommand.g.cs +++ /dev/null @@ -1,59 +0,0 @@ -#nullable enable -#pragma warning disable CS0618 - -using System.CommandLine; - -namespace AI21.CLI.Commands; - -internal static partial class FnacBatchClassificationsPrefixPreviewSolutionsPreviewFdBatchesV1ClassificationsPostCommandApiCommand -{ - - - 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(@"fnac-batch-classifications-prefix-preview-solutions-preview-fd-batches-v1-classifications-post", @"Fnac Batch Classifications Prefix Preview"); - - - - 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.FnacBatchClassificationsPrefixPreviewSolutionsPreviewFdBatchesV1ClassificationsPostAsync( - - cancellationToken: cancellationToken).ConfigureAwait(false); - - - await CliRuntime.WriteResponseAsync( - parseResult, - response, - global::AI21.SourceGenerationContext.Default, - FormatResponse, - cancellationToken).ConfigureAwait(false); - }, cancellationToken).ConfigureAwait(false)); - return command; - } -} \ No newline at end of file diff --git a/src/cli/AI21.CLI/Commands/FnacBatchClassificationsResultsPrefixPreviewSolutionsPreviewFdBatchesV1ClassificationsBatchIdResultsPostCommandApiCommand.g.cs b/src/cli/AI21.CLI/Commands/FnacBatchClassificationsResultsPrefixPreviewSolutionsPreviewFdBatchesV1ClassificationsBatchIdResultsPostCommandApiCommand.g.cs deleted file mode 100644 index b7044180..00000000 --- a/src/cli/AI21.CLI/Commands/FnacBatchClassificationsResultsPrefixPreviewSolutionsPreviewFdBatchesV1ClassificationsBatchIdResultsPostCommandApiCommand.g.cs +++ /dev/null @@ -1,63 +0,0 @@ -#nullable enable -#pragma warning disable CS0618 - -using System.CommandLine; - -namespace AI21.CLI.Commands; - -internal static partial class FnacBatchClassificationsResultsPrefixPreviewSolutionsPreviewFdBatchesV1ClassificationsBatchIdResultsPostCommandApiCommand -{ - private static Argument BatchId { get; } = new( - name: @"batch-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(@"fnac-batch-classifications-results-prefix-preview-solutions-preview-fd-batches-v1-classifications-batch-id-results-post", @"Fnac Batch Classifications Results Prefix Preview"); - command.Arguments.Add(BatchId); - - - command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => - await CliRuntime.RunAsync(async () => - { - var batchId = parseResult.GetRequiredValue(BatchId); - using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); - - - var response = await client.FnacBatchClassificationsResultsPrefixPreviewSolutionsPreviewFdBatchesV1ClassificationsBatchIdResultsPostAsync( - batchId: batchId, - cancellationToken: cancellationToken).ConfigureAwait(false); - - - await CliRuntime.WriteResponseAsync( - parseResult, - response, - global::AI21.SourceGenerationContext.Default, - FormatResponse, - cancellationToken).ConfigureAwait(false); - }, cancellationToken).ConfigureAwait(false)); - return command; - } -} \ No newline at end of file diff --git a/src/cli/AI21.CLI/Commands/FnacBatchClassificationsResultsSolutionsFdBatchesV1ClassificationsBatchIdResultsPostCommandApiCommand.g.cs b/src/cli/AI21.CLI/Commands/FnacBatchClassificationsResultsSolutionsFdBatchesV1ClassificationsBatchIdResultsPostCommandApiCommand.g.cs deleted file mode 100644 index 44e622df..00000000 --- a/src/cli/AI21.CLI/Commands/FnacBatchClassificationsResultsSolutionsFdBatchesV1ClassificationsBatchIdResultsPostCommandApiCommand.g.cs +++ /dev/null @@ -1,63 +0,0 @@ -#nullable enable -#pragma warning disable CS0618 - -using System.CommandLine; - -namespace AI21.CLI.Commands; - -internal static partial class FnacBatchClassificationsResultsSolutionsFdBatchesV1ClassificationsBatchIdResultsPostCommandApiCommand -{ - private static Argument BatchId { get; } = new( - name: @"batch-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(@"fnac-batch-classifications-results-solutions-fd-batches-v1-classifications-batch-id-results-post", @"Fnac Batch Classifications Results"); - command.Arguments.Add(BatchId); - - - command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => - await CliRuntime.RunAsync(async () => - { - var batchId = parseResult.GetRequiredValue(BatchId); - using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); - - - var response = await client.FnacBatchClassificationsResultsSolutionsFdBatchesV1ClassificationsBatchIdResultsPostAsync( - batchId: batchId, - cancellationToken: cancellationToken).ConfigureAwait(false); - - - await CliRuntime.WriteResponseAsync( - parseResult, - response, - global::AI21.SourceGenerationContext.Default, - FormatResponse, - cancellationToken).ConfigureAwait(false); - }, cancellationToken).ConfigureAwait(false)); - return command; - } -} \ No newline at end of file diff --git a/src/cli/AI21.CLI/Commands/FnacBatchClassificationsSolutionsFdBatchesV1ClassificationsPostCommandApiCommand.g.cs b/src/cli/AI21.CLI/Commands/FnacBatchClassificationsSolutionsFdBatchesV1ClassificationsPostCommandApiCommand.g.cs deleted file mode 100644 index d7730963..00000000 --- a/src/cli/AI21.CLI/Commands/FnacBatchClassificationsSolutionsFdBatchesV1ClassificationsPostCommandApiCommand.g.cs +++ /dev/null @@ -1,59 +0,0 @@ -#nullable enable -#pragma warning disable CS0618 - -using System.CommandLine; - -namespace AI21.CLI.Commands; - -internal static partial class FnacBatchClassificationsSolutionsFdBatchesV1ClassificationsPostCommandApiCommand -{ - - - 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(@"fnac-batch-classifications-solutions-fd-batches-v1-classifications-post", @"Fnac Batch Classifications"); - - - - 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.FnacBatchClassificationsSolutionsFdBatchesV1ClassificationsPostAsync( - - cancellationToken: cancellationToken).ConfigureAwait(false); - - - await CliRuntime.WriteResponseAsync( - parseResult, - response, - global::AI21.SourceGenerationContext.Default, - FormatResponse, - cancellationToken).ConfigureAwait(false); - }, cancellationToken).ConfigureAwait(false)); - return command; - } -} \ No newline at end of file diff --git a/src/cli/AI21.CLI/Commands/FnacBatchClassificationsStatusPrefixPreviewSolutionsPreviewFdBatchesV1ClassificationsBatchIdStatusPostCommandApiCommand.g.cs b/src/cli/AI21.CLI/Commands/FnacBatchClassificationsStatusPrefixPreviewSolutionsPreviewFdBatchesV1ClassificationsBatchIdStatusPostCommandApiCommand.g.cs deleted file mode 100644 index 21f8eb84..00000000 --- a/src/cli/AI21.CLI/Commands/FnacBatchClassificationsStatusPrefixPreviewSolutionsPreviewFdBatchesV1ClassificationsBatchIdStatusPostCommandApiCommand.g.cs +++ /dev/null @@ -1,63 +0,0 @@ -#nullable enable -#pragma warning disable CS0618 - -using System.CommandLine; - -namespace AI21.CLI.Commands; - -internal static partial class FnacBatchClassificationsStatusPrefixPreviewSolutionsPreviewFdBatchesV1ClassificationsBatchIdStatusPostCommandApiCommand -{ - private static Argument BatchId { get; } = new( - name: @"batch-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(@"fnac-batch-classifications-status-prefix-preview-solutions-preview-fd-batches-v1-classifications-batch-id-status-post", @"Fnac Batch Classifications Status Prefix Preview"); - command.Arguments.Add(BatchId); - - - command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => - await CliRuntime.RunAsync(async () => - { - var batchId = parseResult.GetRequiredValue(BatchId); - using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); - - - var response = await client.FnacBatchClassificationsStatusPrefixPreviewSolutionsPreviewFdBatchesV1ClassificationsBatchIdStatusPostAsync( - batchId: batchId, - cancellationToken: cancellationToken).ConfigureAwait(false); - - - await CliRuntime.WriteResponseAsync( - parseResult, - response, - global::AI21.SourceGenerationContext.Default, - FormatResponse, - cancellationToken).ConfigureAwait(false); - }, cancellationToken).ConfigureAwait(false)); - return command; - } -} \ No newline at end of file diff --git a/src/cli/AI21.CLI/Commands/FnacBatchClassificationsStatusSolutionsFdBatchesV1ClassificationsBatchIdStatusPostCommandApiCommand.g.cs b/src/cli/AI21.CLI/Commands/FnacBatchClassificationsStatusSolutionsFdBatchesV1ClassificationsBatchIdStatusPostCommandApiCommand.g.cs deleted file mode 100644 index a697f15c..00000000 --- a/src/cli/AI21.CLI/Commands/FnacBatchClassificationsStatusSolutionsFdBatchesV1ClassificationsBatchIdStatusPostCommandApiCommand.g.cs +++ /dev/null @@ -1,63 +0,0 @@ -#nullable enable -#pragma warning disable CS0618 - -using System.CommandLine; - -namespace AI21.CLI.Commands; - -internal static partial class FnacBatchClassificationsStatusSolutionsFdBatchesV1ClassificationsBatchIdStatusPostCommandApiCommand -{ - private static Argument BatchId { get; } = new( - name: @"batch-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(@"fnac-batch-classifications-status-solutions-fd-batches-v1-classifications-batch-id-status-post", @"Fnac Batch Classifications Status"); - command.Arguments.Add(BatchId); - - - command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => - await CliRuntime.RunAsync(async () => - { - var batchId = parseResult.GetRequiredValue(BatchId); - using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); - - - var response = await client.FnacBatchClassificationsStatusSolutionsFdBatchesV1ClassificationsBatchIdStatusPostAsync( - batchId: batchId, - cancellationToken: cancellationToken).ConfigureAwait(false); - - - await CliRuntime.WriteResponseAsync( - parseResult, - response, - global::AI21.SourceGenerationContext.Default, - FormatResponse, - cancellationToken).ConfigureAwait(false); - }, cancellationToken).ConfigureAwait(false)); - return command; - } -} \ No newline at end of file diff --git a/src/cli/AI21.CLI/Commands/FnacBatchDescriptionsPrefixPreviewSolutionsPreviewFdBatchesV1DescriptionsPostCommandApiCommand.g.cs b/src/cli/AI21.CLI/Commands/FnacBatchDescriptionsPrefixPreviewSolutionsPreviewFdBatchesV1DescriptionsPostCommandApiCommand.g.cs deleted file mode 100644 index c2aaf20b..00000000 --- a/src/cli/AI21.CLI/Commands/FnacBatchDescriptionsPrefixPreviewSolutionsPreviewFdBatchesV1DescriptionsPostCommandApiCommand.g.cs +++ /dev/null @@ -1,59 +0,0 @@ -#nullable enable -#pragma warning disable CS0618 - -using System.CommandLine; - -namespace AI21.CLI.Commands; - -internal static partial class FnacBatchDescriptionsPrefixPreviewSolutionsPreviewFdBatchesV1DescriptionsPostCommandApiCommand -{ - - - 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(@"fnac-batch-descriptions-prefix-preview-solutions-preview-fd-batches-v1-descriptions-post", @"Fnac Batch Descriptions Prefix Preview"); - - - - 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.FnacBatchDescriptionsPrefixPreviewSolutionsPreviewFdBatchesV1DescriptionsPostAsync( - - cancellationToken: cancellationToken).ConfigureAwait(false); - - - await CliRuntime.WriteResponseAsync( - parseResult, - response, - global::AI21.SourceGenerationContext.Default, - FormatResponse, - cancellationToken).ConfigureAwait(false); - }, cancellationToken).ConfigureAwait(false)); - return command; - } -} \ No newline at end of file diff --git a/src/cli/AI21.CLI/Commands/FnacBatchDescriptionsResultsPrefixPreviewSolutionsPreviewFdBatchesV1DescriptionsBatchIdResultsPostCommandApiCommand.g.cs b/src/cli/AI21.CLI/Commands/FnacBatchDescriptionsResultsPrefixPreviewSolutionsPreviewFdBatchesV1DescriptionsBatchIdResultsPostCommandApiCommand.g.cs deleted file mode 100644 index 863e875d..00000000 --- a/src/cli/AI21.CLI/Commands/FnacBatchDescriptionsResultsPrefixPreviewSolutionsPreviewFdBatchesV1DescriptionsBatchIdResultsPostCommandApiCommand.g.cs +++ /dev/null @@ -1,63 +0,0 @@ -#nullable enable -#pragma warning disable CS0618 - -using System.CommandLine; - -namespace AI21.CLI.Commands; - -internal static partial class FnacBatchDescriptionsResultsPrefixPreviewSolutionsPreviewFdBatchesV1DescriptionsBatchIdResultsPostCommandApiCommand -{ - private static Argument BatchId { get; } = new( - name: @"batch-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(@"fnac-batch-descriptions-results-prefix-preview-solutions-preview-fd-batches-v1-descriptions-batch-id-results-post", @"Fnac Batch Descriptions Results Prefix Preview"); - command.Arguments.Add(BatchId); - - - command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => - await CliRuntime.RunAsync(async () => - { - var batchId = parseResult.GetRequiredValue(BatchId); - using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); - - - var response = await client.FnacBatchDescriptionsResultsPrefixPreviewSolutionsPreviewFdBatchesV1DescriptionsBatchIdResultsPostAsync( - batchId: batchId, - cancellationToken: cancellationToken).ConfigureAwait(false); - - - await CliRuntime.WriteResponseAsync( - parseResult, - response, - global::AI21.SourceGenerationContext.Default, - FormatResponse, - cancellationToken).ConfigureAwait(false); - }, cancellationToken).ConfigureAwait(false)); - return command; - } -} \ No newline at end of file diff --git a/src/cli/AI21.CLI/Commands/FnacBatchDescriptionsResultsSolutionsFdBatchesV1DescriptionsBatchIdResultsPostCommandApiCommand.g.cs b/src/cli/AI21.CLI/Commands/FnacBatchDescriptionsResultsSolutionsFdBatchesV1DescriptionsBatchIdResultsPostCommandApiCommand.g.cs deleted file mode 100644 index f09f8511..00000000 --- a/src/cli/AI21.CLI/Commands/FnacBatchDescriptionsResultsSolutionsFdBatchesV1DescriptionsBatchIdResultsPostCommandApiCommand.g.cs +++ /dev/null @@ -1,63 +0,0 @@ -#nullable enable -#pragma warning disable CS0618 - -using System.CommandLine; - -namespace AI21.CLI.Commands; - -internal static partial class FnacBatchDescriptionsResultsSolutionsFdBatchesV1DescriptionsBatchIdResultsPostCommandApiCommand -{ - private static Argument BatchId { get; } = new( - name: @"batch-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(@"fnac-batch-descriptions-results-solutions-fd-batches-v1-descriptions-batch-id-results-post", @"Fnac Batch Descriptions Results"); - command.Arguments.Add(BatchId); - - - command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => - await CliRuntime.RunAsync(async () => - { - var batchId = parseResult.GetRequiredValue(BatchId); - using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); - - - var response = await client.FnacBatchDescriptionsResultsSolutionsFdBatchesV1DescriptionsBatchIdResultsPostAsync( - batchId: batchId, - cancellationToken: cancellationToken).ConfigureAwait(false); - - - await CliRuntime.WriteResponseAsync( - parseResult, - response, - global::AI21.SourceGenerationContext.Default, - FormatResponse, - cancellationToken).ConfigureAwait(false); - }, cancellationToken).ConfigureAwait(false)); - return command; - } -} \ No newline at end of file diff --git a/src/cli/AI21.CLI/Commands/FnacBatchDescriptionsSolutionsFdBatchesV1DescriptionsPostCommandApiCommand.g.cs b/src/cli/AI21.CLI/Commands/FnacBatchDescriptionsSolutionsFdBatchesV1DescriptionsPostCommandApiCommand.g.cs deleted file mode 100644 index 2e37a179..00000000 --- a/src/cli/AI21.CLI/Commands/FnacBatchDescriptionsSolutionsFdBatchesV1DescriptionsPostCommandApiCommand.g.cs +++ /dev/null @@ -1,59 +0,0 @@ -#nullable enable -#pragma warning disable CS0618 - -using System.CommandLine; - -namespace AI21.CLI.Commands; - -internal static partial class FnacBatchDescriptionsSolutionsFdBatchesV1DescriptionsPostCommandApiCommand -{ - - - 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(@"fnac-batch-descriptions-solutions-fd-batches-v1-descriptions-post", @"Fnac Batch Descriptions"); - - - - 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.FnacBatchDescriptionsSolutionsFdBatchesV1DescriptionsPostAsync( - - cancellationToken: cancellationToken).ConfigureAwait(false); - - - await CliRuntime.WriteResponseAsync( - parseResult, - response, - global::AI21.SourceGenerationContext.Default, - FormatResponse, - cancellationToken).ConfigureAwait(false); - }, cancellationToken).ConfigureAwait(false)); - return command; - } -} \ No newline at end of file diff --git a/src/cli/AI21.CLI/Commands/FnacBatchDescriptionsStatusPrefixPreviewSolutionsPreviewFdBatchesV1DescriptionsBatchIdStatusPostCommandApiCommand.g.cs b/src/cli/AI21.CLI/Commands/FnacBatchDescriptionsStatusPrefixPreviewSolutionsPreviewFdBatchesV1DescriptionsBatchIdStatusPostCommandApiCommand.g.cs deleted file mode 100644 index f39e0e51..00000000 --- a/src/cli/AI21.CLI/Commands/FnacBatchDescriptionsStatusPrefixPreviewSolutionsPreviewFdBatchesV1DescriptionsBatchIdStatusPostCommandApiCommand.g.cs +++ /dev/null @@ -1,63 +0,0 @@ -#nullable enable -#pragma warning disable CS0618 - -using System.CommandLine; - -namespace AI21.CLI.Commands; - -internal static partial class FnacBatchDescriptionsStatusPrefixPreviewSolutionsPreviewFdBatchesV1DescriptionsBatchIdStatusPostCommandApiCommand -{ - private static Argument BatchId { get; } = new( - name: @"batch-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(@"fnac-batch-descriptions-status-prefix-preview-solutions-preview-fd-batches-v1-descriptions-batch-id-status-post", @"Fnac Batch Descriptions Status Prefix Preview"); - command.Arguments.Add(BatchId); - - - command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => - await CliRuntime.RunAsync(async () => - { - var batchId = parseResult.GetRequiredValue(BatchId); - using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); - - - var response = await client.FnacBatchDescriptionsStatusPrefixPreviewSolutionsPreviewFdBatchesV1DescriptionsBatchIdStatusPostAsync( - batchId: batchId, - cancellationToken: cancellationToken).ConfigureAwait(false); - - - await CliRuntime.WriteResponseAsync( - parseResult, - response, - global::AI21.SourceGenerationContext.Default, - FormatResponse, - cancellationToken).ConfigureAwait(false); - }, cancellationToken).ConfigureAwait(false)); - return command; - } -} \ No newline at end of file diff --git a/src/cli/AI21.CLI/Commands/FnacBatchDescriptionsStatusSolutionsFdBatchesV1DescriptionsBatchIdStatusPostCommandApiCommand.g.cs b/src/cli/AI21.CLI/Commands/FnacBatchDescriptionsStatusSolutionsFdBatchesV1DescriptionsBatchIdStatusPostCommandApiCommand.g.cs deleted file mode 100644 index 9fd1b806..00000000 --- a/src/cli/AI21.CLI/Commands/FnacBatchDescriptionsStatusSolutionsFdBatchesV1DescriptionsBatchIdStatusPostCommandApiCommand.g.cs +++ /dev/null @@ -1,63 +0,0 @@ -#nullable enable -#pragma warning disable CS0618 - -using System.CommandLine; - -namespace AI21.CLI.Commands; - -internal static partial class FnacBatchDescriptionsStatusSolutionsFdBatchesV1DescriptionsBatchIdStatusPostCommandApiCommand -{ - private static Argument BatchId { get; } = new( - name: @"batch-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(@"fnac-batch-descriptions-status-solutions-fd-batches-v1-descriptions-batch-id-status-post", @"Fnac Batch Descriptions Status"); - command.Arguments.Add(BatchId); - - - command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => - await CliRuntime.RunAsync(async () => - { - var batchId = parseResult.GetRequiredValue(BatchId); - using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); - - - var response = await client.FnacBatchDescriptionsStatusSolutionsFdBatchesV1DescriptionsBatchIdStatusPostAsync( - batchId: batchId, - cancellationToken: cancellationToken).ConfigureAwait(false); - - - await CliRuntime.WriteResponseAsync( - parseResult, - response, - global::AI21.SourceGenerationContext.Default, - FormatResponse, - cancellationToken).ConfigureAwait(false); - }, cancellationToken).ConfigureAwait(false)); - return command; - } -} \ No newline at end of file diff --git a/src/cli/AI21.CLI/Commands/FnacV1ClassificationsPrefixPreviewSolutionsPreviewFnacV1ClassificationsPostCommandApiCommand.g.cs b/src/cli/AI21.CLI/Commands/FnacV1ClassificationsPrefixPreviewSolutionsPreviewFnacV1ClassificationsPostCommandApiCommand.g.cs deleted file mode 100644 index 9935e8c9..00000000 --- a/src/cli/AI21.CLI/Commands/FnacV1ClassificationsPrefixPreviewSolutionsPreviewFnacV1ClassificationsPostCommandApiCommand.g.cs +++ /dev/null @@ -1,59 +0,0 @@ -#nullable enable -#pragma warning disable CS0618 - -using System.CommandLine; - -namespace AI21.CLI.Commands; - -internal static partial class FnacV1ClassificationsPrefixPreviewSolutionsPreviewFnacV1ClassificationsPostCommandApiCommand -{ - - - 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(@"fnac-v1-classifications-prefix-preview-solutions-preview-fnac-v1-classifications-post", @"Fnac V1 Classifications Prefix Preview"); - - - - 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.FnacV1ClassificationsPrefixPreviewSolutionsPreviewFnacV1ClassificationsPostAsync( - - cancellationToken: cancellationToken).ConfigureAwait(false); - - - await CliRuntime.WriteResponseAsync( - parseResult, - response, - global::AI21.SourceGenerationContext.Default, - FormatResponse, - cancellationToken).ConfigureAwait(false); - }, cancellationToken).ConfigureAwait(false)); - return command; - } -} \ No newline at end of file diff --git a/src/cli/AI21.CLI/Commands/FnacV1ClassificationsSolutionsFnacV1ClassificationsPostCommandApiCommand.g.cs b/src/cli/AI21.CLI/Commands/FnacV1ClassificationsSolutionsFnacV1ClassificationsPostCommandApiCommand.g.cs deleted file mode 100644 index f88d9c2e..00000000 --- a/src/cli/AI21.CLI/Commands/FnacV1ClassificationsSolutionsFnacV1ClassificationsPostCommandApiCommand.g.cs +++ /dev/null @@ -1,59 +0,0 @@ -#nullable enable -#pragma warning disable CS0618 - -using System.CommandLine; - -namespace AI21.CLI.Commands; - -internal static partial class FnacV1ClassificationsSolutionsFnacV1ClassificationsPostCommandApiCommand -{ - - - 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(@"fnac-v1-classifications-solutions-fnac-v1-classifications-post", @"Fnac V1 Classifications"); - - - - 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.FnacV1ClassificationsSolutionsFnacV1ClassificationsPostAsync( - - cancellationToken: cancellationToken).ConfigureAwait(false); - - - await CliRuntime.WriteResponseAsync( - parseResult, - response, - global::AI21.SourceGenerationContext.Default, - FormatResponse, - cancellationToken).ConfigureAwait(false); - }, cancellationToken).ConfigureAwait(false)); - return command; - } -} \ No newline at end of file diff --git a/src/cli/AI21.CLI/Commands/FnacV1DeprecatedClassificationsPrefixPreviewSolutionsPreviewFnacV1DeprecatedClassificationsPostCommandApiCommand.g.cs b/src/cli/AI21.CLI/Commands/FnacV1DeprecatedClassificationsPrefixPreviewSolutionsPreviewFnacV1DeprecatedClassificationsPostCommandApiCommand.g.cs deleted file mode 100644 index b8f0f59c..00000000 --- a/src/cli/AI21.CLI/Commands/FnacV1DeprecatedClassificationsPrefixPreviewSolutionsPreviewFnacV1DeprecatedClassificationsPostCommandApiCommand.g.cs +++ /dev/null @@ -1,59 +0,0 @@ -#nullable enable -#pragma warning disable CS0618 - -using System.CommandLine; - -namespace AI21.CLI.Commands; - -internal static partial class FnacV1DeprecatedClassificationsPrefixPreviewSolutionsPreviewFnacV1DeprecatedClassificationsPostCommandApiCommand -{ - - - 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(@"fnac-v1-deprecated-classifications-prefix-preview-solutions-preview-fnac-v1-deprecated-classifications-post", @"Fnac V1 Deprecated Classifications Prefix Preview"); - - - - 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.FnacV1DeprecatedClassificationsPrefixPreviewSolutionsPreviewFnacV1DeprecatedClassificationsPostAsync( - - cancellationToken: cancellationToken).ConfigureAwait(false); - - - await CliRuntime.WriteResponseAsync( - parseResult, - response, - global::AI21.SourceGenerationContext.Default, - FormatResponse, - cancellationToken).ConfigureAwait(false); - }, cancellationToken).ConfigureAwait(false)); - return command; - } -} \ No newline at end of file diff --git a/src/cli/AI21.CLI/Commands/FnacV1DeprecatedClassificationsSolutionsFnacV1DeprecatedClassificationsPostCommandApiCommand.g.cs b/src/cli/AI21.CLI/Commands/FnacV1DeprecatedClassificationsSolutionsFnacV1DeprecatedClassificationsPostCommandApiCommand.g.cs deleted file mode 100644 index 1437064e..00000000 --- a/src/cli/AI21.CLI/Commands/FnacV1DeprecatedClassificationsSolutionsFnacV1DeprecatedClassificationsPostCommandApiCommand.g.cs +++ /dev/null @@ -1,59 +0,0 @@ -#nullable enable -#pragma warning disable CS0618 - -using System.CommandLine; - -namespace AI21.CLI.Commands; - -internal static partial class FnacV1DeprecatedClassificationsSolutionsFnacV1DeprecatedClassificationsPostCommandApiCommand -{ - - - 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(@"fnac-v1-deprecated-classifications-solutions-fnac-v1-deprecated-classifications-post", @"Fnac V1 Deprecated Classifications"); - - - - 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.FnacV1DeprecatedClassificationsSolutionsFnacV1DeprecatedClassificationsPostAsync( - - cancellationToken: cancellationToken).ConfigureAwait(false); - - - await CliRuntime.WriteResponseAsync( - parseResult, - response, - global::AI21.SourceGenerationContext.Default, - FormatResponse, - cancellationToken).ConfigureAwait(false); - }, cancellationToken).ConfigureAwait(false)); - return command; - } -} \ No newline at end of file diff --git a/src/cli/AI21.CLI/Commands/FnacV1DeprecatedDescriptionsPrefixPreviewSolutionsPreviewFnacV1DeprecatedDescriptionsPostCommandApiCommand.g.cs b/src/cli/AI21.CLI/Commands/FnacV1DeprecatedDescriptionsPrefixPreviewSolutionsPreviewFnacV1DeprecatedDescriptionsPostCommandApiCommand.g.cs deleted file mode 100644 index 29d319b4..00000000 --- a/src/cli/AI21.CLI/Commands/FnacV1DeprecatedDescriptionsPrefixPreviewSolutionsPreviewFnacV1DeprecatedDescriptionsPostCommandApiCommand.g.cs +++ /dev/null @@ -1,59 +0,0 @@ -#nullable enable -#pragma warning disable CS0618 - -using System.CommandLine; - -namespace AI21.CLI.Commands; - -internal static partial class FnacV1DeprecatedDescriptionsPrefixPreviewSolutionsPreviewFnacV1DeprecatedDescriptionsPostCommandApiCommand -{ - - - 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(@"fnac-v1-deprecated-descriptions-prefix-preview-solutions-preview-fnac-v1-deprecated-descriptions-post", @"Fnac V1 Deprecated Descriptions Prefix Preview"); - - - - 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.FnacV1DeprecatedDescriptionsPrefixPreviewSolutionsPreviewFnacV1DeprecatedDescriptionsPostAsync( - - cancellationToken: cancellationToken).ConfigureAwait(false); - - - await CliRuntime.WriteResponseAsync( - parseResult, - response, - global::AI21.SourceGenerationContext.Default, - FormatResponse, - cancellationToken).ConfigureAwait(false); - }, cancellationToken).ConfigureAwait(false)); - return command; - } -} \ No newline at end of file diff --git a/src/cli/AI21.CLI/Commands/FnacV1DeprecatedDescriptionsSolutionsFnacV1DeprecatedDescriptionsPostCommandApiCommand.g.cs b/src/cli/AI21.CLI/Commands/FnacV1DeprecatedDescriptionsSolutionsFnacV1DeprecatedDescriptionsPostCommandApiCommand.g.cs deleted file mode 100644 index ddd4f16f..00000000 --- a/src/cli/AI21.CLI/Commands/FnacV1DeprecatedDescriptionsSolutionsFnacV1DeprecatedDescriptionsPostCommandApiCommand.g.cs +++ /dev/null @@ -1,59 +0,0 @@ -#nullable enable -#pragma warning disable CS0618 - -using System.CommandLine; - -namespace AI21.CLI.Commands; - -internal static partial class FnacV1DeprecatedDescriptionsSolutionsFnacV1DeprecatedDescriptionsPostCommandApiCommand -{ - - - 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(@"fnac-v1-deprecated-descriptions-solutions-fnac-v1-deprecated-descriptions-post", @"Fnac V1 Deprecated Descriptions"); - - - - 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.FnacV1DeprecatedDescriptionsSolutionsFnacV1DeprecatedDescriptionsPostAsync( - - cancellationToken: cancellationToken).ConfigureAwait(false); - - - await CliRuntime.WriteResponseAsync( - parseResult, - response, - global::AI21.SourceGenerationContext.Default, - FormatResponse, - cancellationToken).ConfigureAwait(false); - }, cancellationToken).ConfigureAwait(false)); - return command; - } -} \ No newline at end of file diff --git a/src/cli/AI21.CLI/Commands/FnacV1DescriptionsPrefixPreviewSolutionsPreviewFnacV1DescriptionsPostCommandApiCommand.g.cs b/src/cli/AI21.CLI/Commands/FnacV1DescriptionsPrefixPreviewSolutionsPreviewFnacV1DescriptionsPostCommandApiCommand.g.cs deleted file mode 100644 index 4f063b3b..00000000 --- a/src/cli/AI21.CLI/Commands/FnacV1DescriptionsPrefixPreviewSolutionsPreviewFnacV1DescriptionsPostCommandApiCommand.g.cs +++ /dev/null @@ -1,59 +0,0 @@ -#nullable enable -#pragma warning disable CS0618 - -using System.CommandLine; - -namespace AI21.CLI.Commands; - -internal static partial class FnacV1DescriptionsPrefixPreviewSolutionsPreviewFnacV1DescriptionsPostCommandApiCommand -{ - - - 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(@"fnac-v1-descriptions-prefix-preview-solutions-preview-fnac-v1-descriptions-post", @"Fnac V1 Descriptions Prefix Preview"); - - - - 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.FnacV1DescriptionsPrefixPreviewSolutionsPreviewFnacV1DescriptionsPostAsync( - - cancellationToken: cancellationToken).ConfigureAwait(false); - - - await CliRuntime.WriteResponseAsync( - parseResult, - response, - global::AI21.SourceGenerationContext.Default, - FormatResponse, - cancellationToken).ConfigureAwait(false); - }, cancellationToken).ConfigureAwait(false)); - return command; - } -} \ No newline at end of file diff --git a/src/cli/AI21.CLI/Commands/FnacV1DescriptionsSolutionsFnacV1DescriptionsPostCommandApiCommand.g.cs b/src/cli/AI21.CLI/Commands/FnacV1DescriptionsSolutionsFnacV1DescriptionsPostCommandApiCommand.g.cs deleted file mode 100644 index 2219add7..00000000 --- a/src/cli/AI21.CLI/Commands/FnacV1DescriptionsSolutionsFnacV1DescriptionsPostCommandApiCommand.g.cs +++ /dev/null @@ -1,59 +0,0 @@ -#nullable enable -#pragma warning disable CS0618 - -using System.CommandLine; - -namespace AI21.CLI.Commands; - -internal static partial class FnacV1DescriptionsSolutionsFnacV1DescriptionsPostCommandApiCommand -{ - - - 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(@"fnac-v1-descriptions-solutions-fnac-v1-descriptions-post", @"Fnac V1 Descriptions"); - - - - 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.FnacV1DescriptionsSolutionsFnacV1DescriptionsPostAsync( - - cancellationToken: cancellationToken).ConfigureAwait(false); - - - await CliRuntime.WriteResponseAsync( - parseResult, - response, - global::AI21.SourceGenerationContext.Default, - FormatResponse, - cancellationToken).ConfigureAwait(false); - }, cancellationToken).ConfigureAwait(false)); - return command; - } -} \ No newline at end of file diff --git a/src/cli/AI21.CLI/Commands/ForwardParagonWebhookStudioV1ConnectorsParagonWebhookPostCommandApiCommand.g.cs b/src/cli/AI21.CLI/Commands/ForwardParagonWebhookStudioV1ConnectorsParagonWebhookPostCommandApiCommand.g.cs deleted file mode 100644 index 89c11aa1..00000000 --- a/src/cli/AI21.CLI/Commands/ForwardParagonWebhookStudioV1ConnectorsParagonWebhookPostCommandApiCommand.g.cs +++ /dev/null @@ -1,59 +0,0 @@ -#nullable enable -#pragma warning disable CS0618 - -using System.CommandLine; - -namespace AI21.CLI.Commands; - -internal static partial class ForwardParagonWebhookStudioV1ConnectorsParagonWebhookPostCommandApiCommand -{ - - - 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(@"forward-paragon-webhook-studio-v1-connectors-paragon-webhook-post", @"Forward Paragon Webhook"); - - - - 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.ForwardParagonWebhookStudioV1ConnectorsParagonWebhookPostAsync( - - cancellationToken: cancellationToken).ConfigureAwait(false); - - - await CliRuntime.WriteResponseAsync( - parseResult, - response, - global::AI21.SourceGenerationContext.Default, - FormatResponse, - cancellationToken).ConfigureAwait(false); - }, cancellationToken).ConfigureAwait(false)); - return command; - } -} \ No newline at end of file diff --git a/src/cli/AI21.CLI/Commands/GenerateOrgTokenStudioV1ConnectorsConnectedUsersEntityIdTokensPostCommandApiCommand.g.cs b/src/cli/AI21.CLI/Commands/GenerateOrgTokenStudioV1ConnectorsConnectedUsersEntityIdTokensPostCommandApiCommand.g.cs deleted file mode 100644 index 3053f20e..00000000 --- a/src/cli/AI21.CLI/Commands/GenerateOrgTokenStudioV1ConnectorsConnectedUsersEntityIdTokensPostCommandApiCommand.g.cs +++ /dev/null @@ -1,63 +0,0 @@ -#nullable enable -#pragma warning disable CS0618 - -using System.CommandLine; - -namespace AI21.CLI.Commands; - -internal static partial class GenerateOrgTokenStudioV1ConnectorsConnectedUsersEntityIdTokensPostCommandApiCommand -{ - private static Argument EntityId { get; } = new( - name: @"entity-id") - { - Description = @"", - }; - - private static string FormatResponse(ParseResult parseResult, global::AI21.ConnectorsToken value, global::System.Text.Json.Serialization.JsonSerializerContext context, bool truncateLongStrings) - { - string? text = null; - CustomizeResponseText(parseResult, value, ref text); - if (!string.IsNullOrWhiteSpace(text)) - { - return text; - } - - var hints = new Dictionary(StringComparer.OrdinalIgnoreCase) - { - }; - CustomizeResponseFormatHints(hints); - return CliRuntime.FormatHumanReadable(value, context, truncateLongStrings, hints); - } - - static partial void CustomizeResponseText(ParseResult parseResult, global::AI21.ConnectorsToken value, ref string? text); - static partial void CustomizeResponseFormatHints(Dictionary hints); - - - public static Command Create() - { - var command = new Command(@"generate-org-token-studio-v1-connectors-connected-users-entity-id-tokens-post", @"Generate Org Token"); - command.Arguments.Add(EntityId); - - - command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => - await CliRuntime.RunAsync(async () => - { - var entityId = parseResult.GetRequiredValue(EntityId); - using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); - - - var response = await client.GenerateOrgTokenStudioV1ConnectorsConnectedUsersEntityIdTokensPostAsync( - entityId: entityId, - cancellationToken: cancellationToken).ConfigureAwait(false); - - - await CliRuntime.WriteResponseAsync( - parseResult, - response, - global::AI21.SourceGenerationContext.Default, - FormatResponse, - cancellationToken).ConfigureAwait(false); - }, cancellationToken).ConfigureAwait(false)); - return command; - } -} \ No newline at end of file diff --git a/src/cli/AI21.CLI/Commands/GetAgentGatewaySettingsAgentsAgentIdGetCommandApiCommand.g.cs b/src/cli/AI21.CLI/Commands/GetAgentGatewaySettingsAgentsAgentIdGetCommandApiCommand.g.cs new file mode 100644 index 00000000..fb2ef7ca --- /dev/null +++ b/src/cli/AI21.CLI/Commands/GetAgentGatewaySettingsAgentsAgentIdGetCommandApiCommand.g.cs @@ -0,0 +1,63 @@ +#nullable enable +#pragma warning disable CS0618 + +using System.CommandLine; + +namespace AI21.CLI.Commands; + +internal static partial class GetAgentGatewaySettingsAgentsAgentIdGetCommandApiCommand +{ + private static Argument AgentId { get; } = new( + name: @"agent-id") + { + Description = @"", + }; + + private static string FormatResponse(ParseResult parseResult, global::AI21.AgentOut value, global::System.Text.Json.Serialization.JsonSerializerContext context, bool truncateLongStrings) + { + string? text = null; + CustomizeResponseText(parseResult, value, ref text); + if (!string.IsNullOrWhiteSpace(text)) + { + return text; + } + + var hints = new Dictionary(StringComparer.OrdinalIgnoreCase) + { + }; + CustomizeResponseFormatHints(hints); + return CliRuntime.FormatHumanReadable(value, context, truncateLongStrings, hints); + } + + static partial void CustomizeResponseText(ParseResult parseResult, global::AI21.AgentOut value, ref string? text); + static partial void CustomizeResponseFormatHints(Dictionary hints); + + + public static Command Create() + { + var command = new Command(@"get-agent-gateway-settings-agents-agent-id-get", @"Get Agent"); + command.Arguments.Add(AgentId); + + + command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => + await CliRuntime.RunAsync(async () => + { + var agentId = parseResult.GetRequiredValue(AgentId); + using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); + + + var response = await client.GetAgentGatewaySettingsAgentsAgentIdGetAsync( + agentId: agentId, + cancellationToken: cancellationToken).ConfigureAwait(false); + + + await CliRuntime.WriteResponseAsync( + parseResult, + response, + global::AI21.SourceGenerationContext.Default, + FormatResponse, + cancellationToken).ConfigureAwait(false); + }, cancellationToken).ConfigureAwait(false)); + return command; + } +} \ No newline at end of file diff --git a/src/cli/AI21.CLI/Commands/GetAgentOptimizationsGatewaySettingsAgentsAgentIdOptimizationsGetCommandApiCommand.g.cs b/src/cli/AI21.CLI/Commands/GetAgentOptimizationsGatewaySettingsAgentsAgentIdOptimizationsGetCommandApiCommand.g.cs new file mode 100644 index 00000000..2cf8da17 --- /dev/null +++ b/src/cli/AI21.CLI/Commands/GetAgentOptimizationsGatewaySettingsAgentsAgentIdOptimizationsGetCommandApiCommand.g.cs @@ -0,0 +1,71 @@ +#nullable enable +#pragma warning disable CS0618 + +using System.CommandLine; + +namespace AI21.CLI.Commands; + +internal static partial class GetAgentOptimizationsGatewaySettingsAgentsAgentIdOptimizationsGetCommandApiCommand +{ + private static Argument AgentId { get; } = new( + name: @"agent-id") + { + 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-agent-optimizations-gateway-settings-agents-agent-id-optimizations-get", @"Get Agent Optimizations"); + command.Arguments.Add(AgentId); + + + command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => + await CliRuntime.RunAsync(async () => + { + var agentId = parseResult.GetRequiredValue(AgentId); + using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); + + + var response = await client.GetAgentOptimizationsGatewaySettingsAgentsAgentIdOptimizationsGetAsync( + agentId: agentId, + cancellationToken: cancellationToken).ConfigureAwait(false); + + + if (!await CliRuntime.TryWriteOutputDirectoryAsync( + parseResult, + response, + global::AI21.SourceGenerationContext.Default, + @"$self", + cancellationToken).ConfigureAwait(false)) + { + await CliRuntime.WriteResponseAsync( + parseResult, + response, + global::AI21.SourceGenerationContext.Default, + FormatResponse, + cancellationToken).ConfigureAwait(false); + } + }, cancellationToken).ConfigureAwait(false)); + return command; + } +} \ No newline at end of file diff --git a/src/cli/AI21.CLI/Commands/GetAgentOptimizationsTokenwiseSettingsAgentsAgentIdOptimizationsGetCommandApiCommand.g.cs b/src/cli/AI21.CLI/Commands/GetAgentOptimizationsTokenwiseSettingsAgentsAgentIdOptimizationsGetCommandApiCommand.g.cs new file mode 100644 index 00000000..0f55144e --- /dev/null +++ b/src/cli/AI21.CLI/Commands/GetAgentOptimizationsTokenwiseSettingsAgentsAgentIdOptimizationsGetCommandApiCommand.g.cs @@ -0,0 +1,71 @@ +#nullable enable +#pragma warning disable CS0618 + +using System.CommandLine; + +namespace AI21.CLI.Commands; + +internal static partial class GetAgentOptimizationsTokenwiseSettingsAgentsAgentIdOptimizationsGetCommandApiCommand +{ + private static Argument AgentId { get; } = new( + name: @"agent-id") + { + 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-agent-optimizations-tokenwise-settings-agents-agent-id-optimizations-get", @"Get Agent Optimizations"); + command.Arguments.Add(AgentId); + + + command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => + await CliRuntime.RunAsync(async () => + { + var agentId = parseResult.GetRequiredValue(AgentId); + using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); + + + var response = await client.GetAgentOptimizationsTokenwiseSettingsAgentsAgentIdOptimizationsGetAsync( + agentId: agentId, + cancellationToken: cancellationToken).ConfigureAwait(false); + + + if (!await CliRuntime.TryWriteOutputDirectoryAsync( + parseResult, + response, + global::AI21.SourceGenerationContext.Default, + @"$self", + cancellationToken).ConfigureAwait(false)) + { + await CliRuntime.WriteResponseAsync( + parseResult, + response, + global::AI21.SourceGenerationContext.Default, + FormatResponse, + cancellationToken).ConfigureAwait(false); + } + }, cancellationToken).ConfigureAwait(false)); + return command; + } +} \ No newline at end of file diff --git a/src/cli/AI21.CLI/Commands/GetAgentTokenwiseSettingsAgentsAgentIdGetCommandApiCommand.g.cs b/src/cli/AI21.CLI/Commands/GetAgentTokenwiseSettingsAgentsAgentIdGetCommandApiCommand.g.cs new file mode 100644 index 00000000..4eb2355b --- /dev/null +++ b/src/cli/AI21.CLI/Commands/GetAgentTokenwiseSettingsAgentsAgentIdGetCommandApiCommand.g.cs @@ -0,0 +1,63 @@ +#nullable enable +#pragma warning disable CS0618 + +using System.CommandLine; + +namespace AI21.CLI.Commands; + +internal static partial class GetAgentTokenwiseSettingsAgentsAgentIdGetCommandApiCommand +{ + private static Argument AgentId { get; } = new( + name: @"agent-id") + { + Description = @"", + }; + + private static string FormatResponse(ParseResult parseResult, global::AI21.AgentOut value, global::System.Text.Json.Serialization.JsonSerializerContext context, bool truncateLongStrings) + { + string? text = null; + CustomizeResponseText(parseResult, value, ref text); + if (!string.IsNullOrWhiteSpace(text)) + { + return text; + } + + var hints = new Dictionary(StringComparer.OrdinalIgnoreCase) + { + }; + CustomizeResponseFormatHints(hints); + return CliRuntime.FormatHumanReadable(value, context, truncateLongStrings, hints); + } + + static partial void CustomizeResponseText(ParseResult parseResult, global::AI21.AgentOut value, ref string? text); + static partial void CustomizeResponseFormatHints(Dictionary hints); + + + public static Command Create() + { + var command = new Command(@"get-agent-tokenwise-settings-agents-agent-id-get", @"Get Agent"); + command.Arguments.Add(AgentId); + + + command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => + await CliRuntime.RunAsync(async () => + { + var agentId = parseResult.GetRequiredValue(AgentId); + using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); + + + var response = await client.GetAgentTokenwiseSettingsAgentsAgentIdGetAsync( + agentId: agentId, + cancellationToken: cancellationToken).ConfigureAwait(false); + + + await CliRuntime.WriteResponseAsync( + parseResult, + response, + global::AI21.SourceGenerationContext.Default, + FormatResponse, + cancellationToken).ConfigureAwait(false); + }, cancellationToken).ConfigureAwait(false)); + return command; + } +} \ No newline at end of file diff --git a/src/cli/AI21.CLI/Commands/GetConfigGatewaySettingsConfigsConfigIdGetCommandApiCommand.g.cs b/src/cli/AI21.CLI/Commands/GetConfigGatewaySettingsConfigsConfigIdGetCommandApiCommand.g.cs new file mode 100644 index 00000000..9581b425 --- /dev/null +++ b/src/cli/AI21.CLI/Commands/GetConfigGatewaySettingsConfigsConfigIdGetCommandApiCommand.g.cs @@ -0,0 +1,63 @@ +#nullable enable +#pragma warning disable CS0618 + +using System.CommandLine; + +namespace AI21.CLI.Commands; + +internal static partial class GetConfigGatewaySettingsConfigsConfigIdGetCommandApiCommand +{ + private static Argument ConfigId { get; } = new( + name: @"config-id") + { + Description = @"", + }; + + private static string FormatResponse(ParseResult parseResult, global::AI21.ConfigProfileOut value, global::System.Text.Json.Serialization.JsonSerializerContext context, bool truncateLongStrings) + { + string? text = null; + CustomizeResponseText(parseResult, value, ref text); + if (!string.IsNullOrWhiteSpace(text)) + { + return text; + } + + var hints = new Dictionary(StringComparer.OrdinalIgnoreCase) + { + }; + CustomizeResponseFormatHints(hints); + return CliRuntime.FormatHumanReadable(value, context, truncateLongStrings, hints); + } + + static partial void CustomizeResponseText(ParseResult parseResult, global::AI21.ConfigProfileOut value, ref string? text); + static partial void CustomizeResponseFormatHints(Dictionary hints); + + + public static Command Create() + { + var command = new Command(@"get-config-gateway-settings-configs-config-id-get", @"Get Config"); + command.Arguments.Add(ConfigId); + + + command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => + await CliRuntime.RunAsync(async () => + { + var configId = parseResult.GetRequiredValue(ConfigId); + using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); + + + var response = await client.GetConfigGatewaySettingsConfigsConfigIdGetAsync( + configId: configId, + cancellationToken: cancellationToken).ConfigureAwait(false); + + + await CliRuntime.WriteResponseAsync( + parseResult, + response, + global::AI21.SourceGenerationContext.Default, + FormatResponse, + cancellationToken).ConfigureAwait(false); + }, cancellationToken).ConfigureAwait(false)); + return command; + } +} \ No newline at end of file diff --git a/src/cli/AI21.CLI/Commands/GetConfigSchemaGatewaySettingsConfigsSchemaGetCommandApiCommand.g.cs b/src/cli/AI21.CLI/Commands/GetConfigSchemaGatewaySettingsConfigsSchemaGetCommandApiCommand.g.cs new file mode 100644 index 00000000..fe261b51 --- /dev/null +++ b/src/cli/AI21.CLI/Commands/GetConfigSchemaGatewaySettingsConfigsSchemaGetCommandApiCommand.g.cs @@ -0,0 +1,67 @@ +#nullable enable +#pragma warning disable CS0618 + +using System.CommandLine; + +namespace AI21.CLI.Commands; + +internal static partial class GetConfigSchemaGatewaySettingsConfigsSchemaGetCommandApiCommand +{ + + + private static string FormatResponse(ParseResult parseResult, global::AI21.ConfigSchemaOut value, global::System.Text.Json.Serialization.JsonSerializerContext context, bool truncateLongStrings) + { + string? text = null; + CustomizeResponseText(parseResult, value, ref text); + if (!string.IsNullOrWhiteSpace(text)) + { + return text; + } + + var hints = new Dictionary(StringComparer.OrdinalIgnoreCase) + { + }; + CustomizeResponseFormatHints(hints); + return CliRuntime.FormatHumanReadable(value, context, truncateLongStrings, hints); + } + + static partial void CustomizeResponseText(ParseResult parseResult, global::AI21.ConfigSchemaOut value, ref string? text); + static partial void CustomizeResponseFormatHints(Dictionary hints); + + + public static Command Create() + { + var command = new Command(@"get-config-schema-gateway-settings-configs-schema-get", @"Get Config Schema"); + + + + 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.GetConfigSchemaGatewaySettingsConfigsSchemaGetAsync( + + cancellationToken: cancellationToken).ConfigureAwait(false); + + + if (!await CliRuntime.TryWriteOutputDirectoryAsync( + parseResult, + response, + global::AI21.SourceGenerationContext.Default, + @"Groups", + cancellationToken).ConfigureAwait(false)) + { + await CliRuntime.WriteResponseAsync( + parseResult, + response, + global::AI21.SourceGenerationContext.Default, + FormatResponse, + cancellationToken).ConfigureAwait(false); + } + }, cancellationToken).ConfigureAwait(false)); + return command; + } +} \ No newline at end of file diff --git a/src/cli/AI21.CLI/Commands/GetConfigSchemaTokenwiseSettingsConfigsSchemaGetCommandApiCommand.g.cs b/src/cli/AI21.CLI/Commands/GetConfigSchemaTokenwiseSettingsConfigsSchemaGetCommandApiCommand.g.cs new file mode 100644 index 00000000..f304dfc1 --- /dev/null +++ b/src/cli/AI21.CLI/Commands/GetConfigSchemaTokenwiseSettingsConfigsSchemaGetCommandApiCommand.g.cs @@ -0,0 +1,67 @@ +#nullable enable +#pragma warning disable CS0618 + +using System.CommandLine; + +namespace AI21.CLI.Commands; + +internal static partial class GetConfigSchemaTokenwiseSettingsConfigsSchemaGetCommandApiCommand +{ + + + private static string FormatResponse(ParseResult parseResult, global::AI21.ConfigSchemaOut value, global::System.Text.Json.Serialization.JsonSerializerContext context, bool truncateLongStrings) + { + string? text = null; + CustomizeResponseText(parseResult, value, ref text); + if (!string.IsNullOrWhiteSpace(text)) + { + return text; + } + + var hints = new Dictionary(StringComparer.OrdinalIgnoreCase) + { + }; + CustomizeResponseFormatHints(hints); + return CliRuntime.FormatHumanReadable(value, context, truncateLongStrings, hints); + } + + static partial void CustomizeResponseText(ParseResult parseResult, global::AI21.ConfigSchemaOut value, ref string? text); + static partial void CustomizeResponseFormatHints(Dictionary hints); + + + public static Command Create() + { + var command = new Command(@"get-config-schema-tokenwise-settings-configs-schema-get", @"Get Config Schema"); + + + + 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.GetConfigSchemaTokenwiseSettingsConfigsSchemaGetAsync( + + cancellationToken: cancellationToken).ConfigureAwait(false); + + + if (!await CliRuntime.TryWriteOutputDirectoryAsync( + parseResult, + response, + global::AI21.SourceGenerationContext.Default, + @"Groups", + cancellationToken).ConfigureAwait(false)) + { + await CliRuntime.WriteResponseAsync( + parseResult, + response, + global::AI21.SourceGenerationContext.Default, + FormatResponse, + cancellationToken).ConfigureAwait(false); + } + }, cancellationToken).ConfigureAwait(false)); + return command; + } +} \ No newline at end of file diff --git a/src/cli/AI21.CLI/Commands/GetConfigTokenwiseSettingsConfigsConfigIdGetCommandApiCommand.g.cs b/src/cli/AI21.CLI/Commands/GetConfigTokenwiseSettingsConfigsConfigIdGetCommandApiCommand.g.cs new file mode 100644 index 00000000..c6aea155 --- /dev/null +++ b/src/cli/AI21.CLI/Commands/GetConfigTokenwiseSettingsConfigsConfigIdGetCommandApiCommand.g.cs @@ -0,0 +1,63 @@ +#nullable enable +#pragma warning disable CS0618 + +using System.CommandLine; + +namespace AI21.CLI.Commands; + +internal static partial class GetConfigTokenwiseSettingsConfigsConfigIdGetCommandApiCommand +{ + private static Argument ConfigId { get; } = new( + name: @"config-id") + { + Description = @"", + }; + + private static string FormatResponse(ParseResult parseResult, global::AI21.ConfigProfileOut value, global::System.Text.Json.Serialization.JsonSerializerContext context, bool truncateLongStrings) + { + string? text = null; + CustomizeResponseText(parseResult, value, ref text); + if (!string.IsNullOrWhiteSpace(text)) + { + return text; + } + + var hints = new Dictionary(StringComparer.OrdinalIgnoreCase) + { + }; + CustomizeResponseFormatHints(hints); + return CliRuntime.FormatHumanReadable(value, context, truncateLongStrings, hints); + } + + static partial void CustomizeResponseText(ParseResult parseResult, global::AI21.ConfigProfileOut value, ref string? text); + static partial void CustomizeResponseFormatHints(Dictionary hints); + + + public static Command Create() + { + var command = new Command(@"get-config-tokenwise-settings-configs-config-id-get", @"Get Config"); + command.Arguments.Add(ConfigId); + + + command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => + await CliRuntime.RunAsync(async () => + { + var configId = parseResult.GetRequiredValue(ConfigId); + using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); + + + var response = await client.GetConfigTokenwiseSettingsConfigsConfigIdGetAsync( + configId: configId, + cancellationToken: cancellationToken).ConfigureAwait(false); + + + await CliRuntime.WriteResponseAsync( + parseResult, + response, + global::AI21.SourceGenerationContext.Default, + FormatResponse, + cancellationToken).ConfigureAwait(false); + }, cancellationToken).ConfigureAwait(false)); + return command; + } +} \ No newline at end of file diff --git a/src/cli/AI21.CLI/Commands/GetConnectorConnectionStatusStudioV1ConnectorsConnectedUsersEntityIdDataSourcesDataSourceConnectionStatusGetCommandApiCommand.g.cs b/src/cli/AI21.CLI/Commands/GetConnectorConnectionStatusStudioV1ConnectorsConnectedUsersEntityIdDataSourcesDataSourceConnectionStatusGetCommandApiCommand.g.cs deleted file mode 100644 index 477a1f0b..00000000 --- a/src/cli/AI21.CLI/Commands/GetConnectorConnectionStatusStudioV1ConnectorsConnectedUsersEntityIdDataSourcesDataSourceConnectionStatusGetCommandApiCommand.g.cs +++ /dev/null @@ -1,82 +0,0 @@ -#nullable enable -#pragma warning disable CS0618 - -using System.CommandLine; - -namespace AI21.CLI.Commands; - -internal static partial class GetConnectorConnectionStatusStudioV1ConnectorsConnectedUsersEntityIdDataSourcesDataSourceConnectionStatusGetCommandApiCommand -{ - private static Argument EntityId { get; } = new( - name: @"entity-id") - { - Description = @"", - }; - - private static Argument DataSource { get; } = new( - name: @"data-source") - { - Description = @"", - }; - - private static Option ParagonToken { get; } = new( - name: @"--paragon-token") - { - Description = @"", - Required = true, - }; - - private static string FormatResponse(ParseResult parseResult, global::AI21.ConnectorConnectionStatus value, global::System.Text.Json.Serialization.JsonSerializerContext context, bool truncateLongStrings) - { - string? text = null; - CustomizeResponseText(parseResult, value, ref text); - if (!string.IsNullOrWhiteSpace(text)) - { - return text; - } - - var hints = new Dictionary(StringComparer.OrdinalIgnoreCase) - { - }; - CustomizeResponseFormatHints(hints); - return CliRuntime.FormatHumanReadable(value, context, truncateLongStrings, hints); - } - - static partial void CustomizeResponseText(ParseResult parseResult, global::AI21.ConnectorConnectionStatus value, ref string? text); - static partial void CustomizeResponseFormatHints(Dictionary hints); - - - public static Command Create() - { - var command = new Command(@"get-connector-connection-status-studio-v1-connectors-connected-users-entity-id-data-sources-data-source-connection-status-get", @"Get Connector Connection Status"); - command.Arguments.Add(EntityId); - command.Arguments.Add(DataSource); - command.Options.Add(ParagonToken); - - - command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => - await CliRuntime.RunAsync(async () => - { - var entityId = parseResult.GetRequiredValue(EntityId); - var dataSource = parseResult.GetRequiredValue(DataSource); - var paragonToken = parseResult.GetRequiredValue(ParagonToken); - using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); - - - var response = await client.GetConnectorConnectionStatusStudioV1ConnectorsConnectedUsersEntityIdDataSourcesDataSourceConnectionStatusGetAsync( - entityId: entityId, - dataSource: dataSource, - paragonToken: paragonToken, - cancellationToken: cancellationToken).ConfigureAwait(false); - - - await CliRuntime.WriteResponseAsync( - parseResult, - response, - global::AI21.SourceGenerationContext.Default, - FormatResponse, - cancellationToken).ConfigureAwait(false); - }, cancellationToken).ConfigureAwait(false)); - return command; - } -} \ No newline at end of file diff --git a/src/cli/AI21.CLI/Commands/GetDataSourceStatusStudioV1ConnectorsConnectedUsersEntityIdDataSourcesDataSourceStatusGetCommandApiCommand.g.cs b/src/cli/AI21.CLI/Commands/GetDataSourceStatusStudioV1ConnectorsConnectedUsersEntityIdDataSourcesDataSourceStatusGetCommandApiCommand.g.cs deleted file mode 100644 index 29e38c9f..00000000 --- a/src/cli/AI21.CLI/Commands/GetDataSourceStatusStudioV1ConnectorsConnectedUsersEntityIdDataSourcesDataSourceStatusGetCommandApiCommand.g.cs +++ /dev/null @@ -1,82 +0,0 @@ -#nullable enable -#pragma warning disable CS0618 - -using System.CommandLine; - -namespace AI21.CLI.Commands; - -internal static partial class GetDataSourceStatusStudioV1ConnectorsConnectedUsersEntityIdDataSourcesDataSourceStatusGetCommandApiCommand -{ - private static Argument EntityId { get; } = new( - name: @"entity-id") - { - Description = @"", - }; - - private static Argument DataSource { get; } = new( - name: @"data-source") - { - Description = @"", - }; - - private static Option ParagonToken { get; } = new( - name: @"--paragon-token") - { - Description = @"", - Required = true, - }; - - private static string FormatResponse(ParseResult parseResult, global::AI21.ConnectorsStatus value, global::System.Text.Json.Serialization.JsonSerializerContext context, bool truncateLongStrings) - { - string? text = null; - CustomizeResponseText(parseResult, value, ref text); - if (!string.IsNullOrWhiteSpace(text)) - { - return text; - } - - var hints = new Dictionary(StringComparer.OrdinalIgnoreCase) - { - }; - CustomizeResponseFormatHints(hints); - return CliRuntime.FormatHumanReadable(value, context, truncateLongStrings, hints); - } - - static partial void CustomizeResponseText(ParseResult parseResult, global::AI21.ConnectorsStatus value, ref string? text); - static partial void CustomizeResponseFormatHints(Dictionary hints); - - - public static Command Create() - { - var command = new Command(@"get-data-source-status-studio-v1-connectors-connected-users-entity-id-data-sources-data-source-status-get", @"Get Data Source Status"); - command.Arguments.Add(EntityId); - command.Arguments.Add(DataSource); - command.Options.Add(ParagonToken); - - - command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => - await CliRuntime.RunAsync(async () => - { - var entityId = parseResult.GetRequiredValue(EntityId); - var dataSource = parseResult.GetRequiredValue(DataSource); - var paragonToken = parseResult.GetRequiredValue(ParagonToken); - using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); - - - var response = await client.GetDataSourceStatusStudioV1ConnectorsConnectedUsersEntityIdDataSourcesDataSourceStatusGetAsync( - entityId: entityId, - dataSource: dataSource, - paragonToken: paragonToken, - cancellationToken: cancellationToken).ConfigureAwait(false); - - - await CliRuntime.WriteResponseAsync( - parseResult, - response, - global::AI21.SourceGenerationContext.Default, - FormatResponse, - cancellationToken).ConfigureAwait(false); - }, cancellationToken).ConfigureAwait(false)); - return command; - } -} \ No newline at end of file diff --git a/src/cli/AI21.CLI/Commands/GetOrgDataSourcesInfoStudioV1ConnectorsConnectedUsersEntityIdDataSourcesGetCommandApiCommand.g.cs b/src/cli/AI21.CLI/Commands/GetOrgDataSourcesInfoStudioV1ConnectorsConnectedUsersEntityIdDataSourcesGetCommandApiCommand.g.cs deleted file mode 100644 index d44f9fd6..00000000 --- a/src/cli/AI21.CLI/Commands/GetOrgDataSourcesInfoStudioV1ConnectorsConnectedUsersEntityIdDataSourcesGetCommandApiCommand.g.cs +++ /dev/null @@ -1,71 +0,0 @@ -#nullable enable -#pragma warning disable CS0618 - -using System.CommandLine; - -namespace AI21.CLI.Commands; - -internal static partial class GetOrgDataSourcesInfoStudioV1ConnectorsConnectedUsersEntityIdDataSourcesGetCommandApiCommand -{ - private static Argument EntityId { get; } = new( - name: @"entity-id") - { - Description = @"", - }; - - private static string FormatResponse(ParseResult parseResult, global::AI21.ConnectorsDataSources value, global::System.Text.Json.Serialization.JsonSerializerContext context, bool truncateLongStrings) - { - string? text = null; - CustomizeResponseText(parseResult, value, ref text); - if (!string.IsNullOrWhiteSpace(text)) - { - return text; - } - - var hints = new Dictionary(StringComparer.OrdinalIgnoreCase) - { - }; - CustomizeResponseFormatHints(hints); - return CliRuntime.FormatHumanReadable(value, context, truncateLongStrings, hints); - } - - static partial void CustomizeResponseText(ParseResult parseResult, global::AI21.ConnectorsDataSources value, ref string? text); - static partial void CustomizeResponseFormatHints(Dictionary hints); - - - public static Command Create() - { - var command = new Command(@"get-org-data-sources-info-studio-v1-connectors-connected-users-entity-id-data-sources-get", @"Get Org Data Sources Info"); - command.Arguments.Add(EntityId); - - - command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => - await CliRuntime.RunAsync(async () => - { - var entityId = parseResult.GetRequiredValue(EntityId); - using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); - - - var response = await client.GetOrgDataSourcesInfoStudioV1ConnectorsConnectedUsersEntityIdDataSourcesGetAsync( - entityId: entityId, - cancellationToken: cancellationToken).ConfigureAwait(false); - - - if (!await CliRuntime.TryWriteOutputDirectoryAsync( - parseResult, - response, - global::AI21.SourceGenerationContext.Default, - @"DataSources", - cancellationToken).ConfigureAwait(false)) - { - await CliRuntime.WriteResponseAsync( - parseResult, - response, - global::AI21.SourceGenerationContext.Default, - FormatResponse, - cancellationToken).ConfigureAwait(false); - } - }, cancellationToken).ConfigureAwait(false)); - return command; - } -} \ No newline at end of file diff --git a/src/cli/AI21.CLI/Commands/GetOutputExplanationStudioV1ExecutionsExecutionIdExplanationsOutputGetCommandApiCommand.g.cs b/src/cli/AI21.CLI/Commands/GetOutputExplanationStudioV1ExecutionsExecutionIdExplanationsOutputGetCommandApiCommand.g.cs deleted file mode 100644 index 93bd943e..00000000 --- a/src/cli/AI21.CLI/Commands/GetOutputExplanationStudioV1ExecutionsExecutionIdExplanationsOutputGetCommandApiCommand.g.cs +++ /dev/null @@ -1,72 +0,0 @@ -#nullable enable -#pragma warning disable CS0618 - -using System.CommandLine; - -namespace AI21.CLI.Commands; - -internal static partial class GetOutputExplanationStudioV1ExecutionsExecutionIdExplanationsOutputGetCommandApiCommand -{ - private static Argument ExecutionId { get; } = new( - name: @"execution-id") - { - Description = @"", - }; - - private static Option ForceRegenerate { get; } = CliRuntime.CreateNullableBoolOption( - name: @"--force-regenerate", - 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-output-explanation-studio-v1-executions-execution-id-explanations-output-get", @"Get Output Explanation -Get output explanation for an execution (cached or generated). -Set force_regenerate=True to regenerate even if cached."); - command.Arguments.Add(ExecutionId); - command.Options.Add(ForceRegenerate); - - - command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => - await CliRuntime.RunAsync(async () => - { - var executionId = parseResult.GetRequiredValue(ExecutionId); - var forceRegenerate = parseResult.GetValue(ForceRegenerate); - using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); - - - var response = await client.GetOutputExplanationStudioV1ExecutionsExecutionIdExplanationsOutputGetAsync( - executionId: executionId, - forceRegenerate: forceRegenerate, - cancellationToken: cancellationToken).ConfigureAwait(false); - - - await CliRuntime.WriteResponseAsync( - parseResult, - response, - global::AI21.SourceGenerationContext.Default, - FormatResponse, - cancellationToken).ConfigureAwait(false); - }, cancellationToken).ConfigureAwait(false)); - return command; - } -} \ No newline at end of file diff --git a/src/cli/AI21.CLI/Commands/GetStepExplanationsStudioV1ExecutionsExecutionIdExplanationsStepsGetCommandApiCommand.g.cs b/src/cli/AI21.CLI/Commands/GetStepExplanationsStudioV1ExecutionsExecutionIdExplanationsStepsGetCommandApiCommand.g.cs deleted file mode 100644 index b89dff1c..00000000 --- a/src/cli/AI21.CLI/Commands/GetStepExplanationsStudioV1ExecutionsExecutionIdExplanationsStepsGetCommandApiCommand.g.cs +++ /dev/null @@ -1,72 +0,0 @@ -#nullable enable -#pragma warning disable CS0618 - -using System.CommandLine; - -namespace AI21.CLI.Commands; - -internal static partial class GetStepExplanationsStudioV1ExecutionsExecutionIdExplanationsStepsGetCommandApiCommand -{ - private static Argument ExecutionId { get; } = new( - name: @"execution-id") - { - Description = @"", - }; - - private static Option ForceRegenerate { get; } = CliRuntime.CreateNullableBoolOption( - name: @"--force-regenerate", - 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-step-explanations-studio-v1-executions-execution-id-explanations-steps-get", @"Get Step Explanations -Get step explanations for an execution (cached or generated). -Set force_regenerate=True to regenerate even if cached."); - command.Arguments.Add(ExecutionId); - command.Options.Add(ForceRegenerate); - - - command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => - await CliRuntime.RunAsync(async () => - { - var executionId = parseResult.GetRequiredValue(ExecutionId); - var forceRegenerate = parseResult.GetValue(ForceRegenerate); - using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); - - - var response = await client.GetStepExplanationsStudioV1ExecutionsExecutionIdExplanationsStepsGetAsync( - executionId: executionId, - forceRegenerate: forceRegenerate, - cancellationToken: cancellationToken).ConfigureAwait(false); - - - await CliRuntime.WriteResponseAsync( - parseResult, - response, - global::AI21.SourceGenerationContext.Default, - FormatResponse, - cancellationToken).ConfigureAwait(false); - }, cancellationToken).ConfigureAwait(false)); - return command; - } -} \ No newline at end of file diff --git a/src/cli/AI21.CLI/Commands/GetWebsiteConnectorByIdStudioV1ConnectorsWebsiteConnectorIdGetCommandApiCommand.g.cs b/src/cli/AI21.CLI/Commands/GetWebsiteConnectorByIdStudioV1ConnectorsWebsiteConnectorIdGetCommandApiCommand.g.cs deleted file mode 100644 index 263af583..00000000 --- a/src/cli/AI21.CLI/Commands/GetWebsiteConnectorByIdStudioV1ConnectorsWebsiteConnectorIdGetCommandApiCommand.g.cs +++ /dev/null @@ -1,63 +0,0 @@ -#nullable enable -#pragma warning disable CS0618 - -using System.CommandLine; - -namespace AI21.CLI.Commands; - -internal static partial class GetWebsiteConnectorByIdStudioV1ConnectorsWebsiteConnectorIdGetCommandApiCommand -{ - private static Argument ConnectorId { get; } = new( - name: @"connector-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(@"get-website-connector-by-id-studio-v1-connectors-website-connector-id-get", @"Get Website Connector By Id"); - command.Arguments.Add(ConnectorId); - - - command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => - await CliRuntime.RunAsync(async () => - { - var connectorId = parseResult.GetRequiredValue(ConnectorId); - using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); - - - var response = await client.GetWebsiteConnectorByIdStudioV1ConnectorsWebsiteConnectorIdGetAsync( - connectorId: connectorId, - cancellationToken: cancellationToken).ConfigureAwait(false); - - - await CliRuntime.WriteResponseAsync( - parseResult, - response, - global::AI21.SourceGenerationContext.Default, - FormatResponse, - cancellationToken).ConfigureAwait(false); - }, cancellationToken).ConfigureAwait(false)); - return command; - } -} \ No newline at end of file diff --git a/src/cli/AI21.CLI/Commands/GetWebsiteConnectorStudioV1ConnectorsWebsiteGetCommandApiCommand.g.cs b/src/cli/AI21.CLI/Commands/GetWebsiteConnectorStudioV1ConnectorsWebsiteGetCommandApiCommand.g.cs deleted file mode 100644 index 05dc9b99..00000000 --- a/src/cli/AI21.CLI/Commands/GetWebsiteConnectorStudioV1ConnectorsWebsiteGetCommandApiCommand.g.cs +++ /dev/null @@ -1,59 +0,0 @@ -#nullable enable -#pragma warning disable CS0618 - -using System.CommandLine; - -namespace AI21.CLI.Commands; - -internal static partial class GetWebsiteConnectorStudioV1ConnectorsWebsiteGetCommandApiCommand -{ - - - 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-website-connector-studio-v1-connectors-website-get", @"Get Website Connector"); - - - - 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.GetWebsiteConnectorStudioV1ConnectorsWebsiteGetAsync( - - cancellationToken: cancellationToken).ConfigureAwait(false); - - - await CliRuntime.WriteResponseAsync( - parseResult, - response, - global::AI21.SourceGenerationContext.Default, - FormatResponse, - cancellationToken).ConfigureAwait(false); - }, cancellationToken).ConfigureAwait(false)); - return command; - } -} \ No newline at end of file diff --git a/src/cli/AI21.CLI/Commands/KirshDocumentUploadProcessPrefixPreviewSolutionsPreviewKirshDocumentUploadProcessPostCommandApiCommand.g.cs b/src/cli/AI21.CLI/Commands/KirshDocumentUploadProcessPrefixPreviewSolutionsPreviewKirshDocumentUploadProcessPostCommandApiCommand.g.cs deleted file mode 100644 index 4344fee7..00000000 --- a/src/cli/AI21.CLI/Commands/KirshDocumentUploadProcessPrefixPreviewSolutionsPreviewKirshDocumentUploadProcessPostCommandApiCommand.g.cs +++ /dev/null @@ -1,59 +0,0 @@ -#nullable enable -#pragma warning disable CS0618 - -using System.CommandLine; - -namespace AI21.CLI.Commands; - -internal static partial class KirshDocumentUploadProcessPrefixPreviewSolutionsPreviewKirshDocumentUploadProcessPostCommandApiCommand -{ - - - 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(@"kirsh-document-upload-process-prefix-preview-solutions-preview-kirsh-document-upload-process-post", @"Kirsh Document Upload Process Prefix Preview"); - - - - 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.KirshDocumentUploadProcessPrefixPreviewSolutionsPreviewKirshDocumentUploadProcessPostAsync( - - cancellationToken: cancellationToken).ConfigureAwait(false); - - - await CliRuntime.WriteResponseAsync( - parseResult, - response, - global::AI21.SourceGenerationContext.Default, - FormatResponse, - cancellationToken).ConfigureAwait(false); - }, cancellationToken).ConfigureAwait(false)); - return command; - } -} \ No newline at end of file diff --git a/src/cli/AI21.CLI/Commands/KirshDocumentUploadProcessSolutionsKirshDocumentUploadProcessPostCommandApiCommand.g.cs b/src/cli/AI21.CLI/Commands/KirshDocumentUploadProcessSolutionsKirshDocumentUploadProcessPostCommandApiCommand.g.cs deleted file mode 100644 index 81590abb..00000000 --- a/src/cli/AI21.CLI/Commands/KirshDocumentUploadProcessSolutionsKirshDocumentUploadProcessPostCommandApiCommand.g.cs +++ /dev/null @@ -1,59 +0,0 @@ -#nullable enable -#pragma warning disable CS0618 - -using System.CommandLine; - -namespace AI21.CLI.Commands; - -internal static partial class KirshDocumentUploadProcessSolutionsKirshDocumentUploadProcessPostCommandApiCommand -{ - - - 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(@"kirsh-document-upload-process-solutions-kirsh-document-upload-process-post", @"Kirsh Document Upload Process"); - - - - 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.KirshDocumentUploadProcessSolutionsKirshDocumentUploadProcessPostAsync( - - cancellationToken: cancellationToken).ConfigureAwait(false); - - - await CliRuntime.WriteResponseAsync( - parseResult, - response, - global::AI21.SourceGenerationContext.Default, - FormatResponse, - cancellationToken).ConfigureAwait(false); - }, cancellationToken).ConfigureAwait(false)); - return command; - } -} \ No newline at end of file diff --git a/src/cli/AI21.CLI/Commands/KirshEmailAssistantPrefixPreviewSolutionsPreviewKirshEmailAssistantPostCommandApiCommand.g.cs b/src/cli/AI21.CLI/Commands/KirshEmailAssistantPrefixPreviewSolutionsPreviewKirshEmailAssistantPostCommandApiCommand.g.cs deleted file mode 100644 index 6db489b2..00000000 --- a/src/cli/AI21.CLI/Commands/KirshEmailAssistantPrefixPreviewSolutionsPreviewKirshEmailAssistantPostCommandApiCommand.g.cs +++ /dev/null @@ -1,59 +0,0 @@ -#nullable enable -#pragma warning disable CS0618 - -using System.CommandLine; - -namespace AI21.CLI.Commands; - -internal static partial class KirshEmailAssistantPrefixPreviewSolutionsPreviewKirshEmailAssistantPostCommandApiCommand -{ - - - 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(@"kirsh-email-assistant-prefix-preview-solutions-preview-kirsh-email-assistant-post", @"Kirsh Email Assistant Prefix Preview"); - - - - 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.KirshEmailAssistantPrefixPreviewSolutionsPreviewKirshEmailAssistantPostAsync( - - cancellationToken: cancellationToken).ConfigureAwait(false); - - - await CliRuntime.WriteResponseAsync( - parseResult, - response, - global::AI21.SourceGenerationContext.Default, - FormatResponse, - cancellationToken).ConfigureAwait(false); - }, cancellationToken).ConfigureAwait(false)); - return command; - } -} \ No newline at end of file diff --git a/src/cli/AI21.CLI/Commands/KirshEmailAssistantSolutionsKirshEmailAssistantPostCommandApiCommand.g.cs b/src/cli/AI21.CLI/Commands/KirshEmailAssistantSolutionsKirshEmailAssistantPostCommandApiCommand.g.cs deleted file mode 100644 index c6f115c9..00000000 --- a/src/cli/AI21.CLI/Commands/KirshEmailAssistantSolutionsKirshEmailAssistantPostCommandApiCommand.g.cs +++ /dev/null @@ -1,59 +0,0 @@ -#nullable enable -#pragma warning disable CS0618 - -using System.CommandLine; - -namespace AI21.CLI.Commands; - -internal static partial class KirshEmailAssistantSolutionsKirshEmailAssistantPostCommandApiCommand -{ - - - 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(@"kirsh-email-assistant-solutions-kirsh-email-assistant-post", @"Kirsh Email Assistant"); - - - - 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.KirshEmailAssistantSolutionsKirshEmailAssistantPostAsync( - - cancellationToken: cancellationToken).ConfigureAwait(false); - - - await CliRuntime.WriteResponseAsync( - parseResult, - response, - global::AI21.SourceGenerationContext.Default, - FormatResponse, - cancellationToken).ConfigureAwait(false); - }, cancellationToken).ConfigureAwait(false)); - return command; - } -} \ No newline at end of file diff --git a/src/cli/AI21.CLI/Commands/KirshFundingAndCategorizationCheckPrefixPreviewSolutionsPreviewKirshFundingAndCategorizationCheckPostCommandApiCommand.g.cs b/src/cli/AI21.CLI/Commands/KirshFundingAndCategorizationCheckPrefixPreviewSolutionsPreviewKirshFundingAndCategorizationCheckPostCommandApiCommand.g.cs deleted file mode 100644 index e2aa572a..00000000 --- a/src/cli/AI21.CLI/Commands/KirshFundingAndCategorizationCheckPrefixPreviewSolutionsPreviewKirshFundingAndCategorizationCheckPostCommandApiCommand.g.cs +++ /dev/null @@ -1,59 +0,0 @@ -#nullable enable -#pragma warning disable CS0618 - -using System.CommandLine; - -namespace AI21.CLI.Commands; - -internal static partial class KirshFundingAndCategorizationCheckPrefixPreviewSolutionsPreviewKirshFundingAndCategorizationCheckPostCommandApiCommand -{ - - - 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(@"kirsh-funding-and-categorization-check-prefix-preview-solutions-preview-kirsh-funding-and-categorization-check-post", @"Kirsh Funding And Categorization Check Prefix Preview"); - - - - 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.KirshFundingAndCategorizationCheckPrefixPreviewSolutionsPreviewKirshFundingAndCategorizationCheckPostAsync( - - cancellationToken: cancellationToken).ConfigureAwait(false); - - - await CliRuntime.WriteResponseAsync( - parseResult, - response, - global::AI21.SourceGenerationContext.Default, - FormatResponse, - cancellationToken).ConfigureAwait(false); - }, cancellationToken).ConfigureAwait(false)); - return command; - } -} \ No newline at end of file diff --git a/src/cli/AI21.CLI/Commands/KirshFundingAndCategorizationCheckSolutionsKirshFundingAndCategorizationCheckPostCommandApiCommand.g.cs b/src/cli/AI21.CLI/Commands/KirshFundingAndCategorizationCheckSolutionsKirshFundingAndCategorizationCheckPostCommandApiCommand.g.cs deleted file mode 100644 index 3de5abcc..00000000 --- a/src/cli/AI21.CLI/Commands/KirshFundingAndCategorizationCheckSolutionsKirshFundingAndCategorizationCheckPostCommandApiCommand.g.cs +++ /dev/null @@ -1,59 +0,0 @@ -#nullable enable -#pragma warning disable CS0618 - -using System.CommandLine; - -namespace AI21.CLI.Commands; - -internal static partial class KirshFundingAndCategorizationCheckSolutionsKirshFundingAndCategorizationCheckPostCommandApiCommand -{ - - - 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(@"kirsh-funding-and-categorization-check-solutions-kirsh-funding-and-categorization-check-post", @"Kirsh Funding And Categorization Check"); - - - - 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.KirshFundingAndCategorizationCheckSolutionsKirshFundingAndCategorizationCheckPostAsync( - - cancellationToken: cancellationToken).ConfigureAwait(false); - - - await CliRuntime.WriteResponseAsync( - parseResult, - response, - global::AI21.SourceGenerationContext.Default, - FormatResponse, - cancellationToken).ConfigureAwait(false); - }, cancellationToken).ConfigureAwait(false)); - return command; - } -} \ No newline at end of file diff --git a/src/cli/AI21.CLI/Commands/KirshGrantCompliancePrefixPreviewSolutionsPreviewKirshGrantCompliancePostCommandApiCommand.g.cs b/src/cli/AI21.CLI/Commands/KirshGrantCompliancePrefixPreviewSolutionsPreviewKirshGrantCompliancePostCommandApiCommand.g.cs deleted file mode 100644 index e6129a37..00000000 --- a/src/cli/AI21.CLI/Commands/KirshGrantCompliancePrefixPreviewSolutionsPreviewKirshGrantCompliancePostCommandApiCommand.g.cs +++ /dev/null @@ -1,59 +0,0 @@ -#nullable enable -#pragma warning disable CS0618 - -using System.CommandLine; - -namespace AI21.CLI.Commands; - -internal static partial class KirshGrantCompliancePrefixPreviewSolutionsPreviewKirshGrantCompliancePostCommandApiCommand -{ - - - 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(@"kirsh-grant-compliance-prefix-preview-solutions-preview-kirsh-grant-compliance-post", @"Kirsh Grant Compliance Prefix Preview"); - - - - 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.KirshGrantCompliancePrefixPreviewSolutionsPreviewKirshGrantCompliancePostAsync( - - cancellationToken: cancellationToken).ConfigureAwait(false); - - - await CliRuntime.WriteResponseAsync( - parseResult, - response, - global::AI21.SourceGenerationContext.Default, - FormatResponse, - cancellationToken).ConfigureAwait(false); - }, cancellationToken).ConfigureAwait(false)); - return command; - } -} \ No newline at end of file diff --git a/src/cli/AI21.CLI/Commands/KirshGrantComplianceSolutionsKirshGrantCompliancePostCommandApiCommand.g.cs b/src/cli/AI21.CLI/Commands/KirshGrantComplianceSolutionsKirshGrantCompliancePostCommandApiCommand.g.cs deleted file mode 100644 index 51bf6d88..00000000 --- a/src/cli/AI21.CLI/Commands/KirshGrantComplianceSolutionsKirshGrantCompliancePostCommandApiCommand.g.cs +++ /dev/null @@ -1,59 +0,0 @@ -#nullable enable -#pragma warning disable CS0618 - -using System.CommandLine; - -namespace AI21.CLI.Commands; - -internal static partial class KirshGrantComplianceSolutionsKirshGrantCompliancePostCommandApiCommand -{ - - - 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(@"kirsh-grant-compliance-solutions-kirsh-grant-compliance-post", @"Kirsh Grant Compliance"); - - - - 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.KirshGrantComplianceSolutionsKirshGrantCompliancePostAsync( - - cancellationToken: cancellationToken).ConfigureAwait(false); - - - await CliRuntime.WriteResponseAsync( - parseResult, - response, - global::AI21.SourceGenerationContext.Default, - FormatResponse, - cancellationToken).ConfigureAwait(false); - }, cancellationToken).ConfigureAwait(false)); - return command; - } -} \ No newline at end of file diff --git a/src/cli/AI21.CLI/Commands/KirshGrantMetadataPrefixPreviewSolutionsPreviewKirshGrantMetadataPostCommandApiCommand.g.cs b/src/cli/AI21.CLI/Commands/KirshGrantMetadataPrefixPreviewSolutionsPreviewKirshGrantMetadataPostCommandApiCommand.g.cs deleted file mode 100644 index 3919fa5e..00000000 --- a/src/cli/AI21.CLI/Commands/KirshGrantMetadataPrefixPreviewSolutionsPreviewKirshGrantMetadataPostCommandApiCommand.g.cs +++ /dev/null @@ -1,59 +0,0 @@ -#nullable enable -#pragma warning disable CS0618 - -using System.CommandLine; - -namespace AI21.CLI.Commands; - -internal static partial class KirshGrantMetadataPrefixPreviewSolutionsPreviewKirshGrantMetadataPostCommandApiCommand -{ - - - 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(@"kirsh-grant-metadata-prefix-preview-solutions-preview-kirsh-grant-metadata-post", @"Kirsh Grant Metadata Prefix Preview"); - - - - 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.KirshGrantMetadataPrefixPreviewSolutionsPreviewKirshGrantMetadataPostAsync( - - cancellationToken: cancellationToken).ConfigureAwait(false); - - - await CliRuntime.WriteResponseAsync( - parseResult, - response, - global::AI21.SourceGenerationContext.Default, - FormatResponse, - cancellationToken).ConfigureAwait(false); - }, cancellationToken).ConfigureAwait(false)); - return command; - } -} \ No newline at end of file diff --git a/src/cli/AI21.CLI/Commands/KirshGrantMetadataSolutionsKirshGrantMetadataPostCommandApiCommand.g.cs b/src/cli/AI21.CLI/Commands/KirshGrantMetadataSolutionsKirshGrantMetadataPostCommandApiCommand.g.cs deleted file mode 100644 index ad24691e..00000000 --- a/src/cli/AI21.CLI/Commands/KirshGrantMetadataSolutionsKirshGrantMetadataPostCommandApiCommand.g.cs +++ /dev/null @@ -1,59 +0,0 @@ -#nullable enable -#pragma warning disable CS0618 - -using System.CommandLine; - -namespace AI21.CLI.Commands; - -internal static partial class KirshGrantMetadataSolutionsKirshGrantMetadataPostCommandApiCommand -{ - - - 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(@"kirsh-grant-metadata-solutions-kirsh-grant-metadata-post", @"Kirsh Grant Metadata"); - - - - 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.KirshGrantMetadataSolutionsKirshGrantMetadataPostAsync( - - cancellationToken: cancellationToken).ConfigureAwait(false); - - - await CliRuntime.WriteResponseAsync( - parseResult, - response, - global::AI21.SourceGenerationContext.Default, - FormatResponse, - cancellationToken).ConfigureAwait(false); - }, cancellationToken).ConfigureAwait(false)); - return command; - } -} \ No newline at end of file diff --git a/src/cli/AI21.CLI/Commands/KirshPublicInformationCheckPrefixPreviewSolutionsPreviewKirshPublicInformationCheckPostCommandApiCommand.g.cs b/src/cli/AI21.CLI/Commands/KirshPublicInformationCheckPrefixPreviewSolutionsPreviewKirshPublicInformationCheckPostCommandApiCommand.g.cs deleted file mode 100644 index 5e756ee2..00000000 --- a/src/cli/AI21.CLI/Commands/KirshPublicInformationCheckPrefixPreviewSolutionsPreviewKirshPublicInformationCheckPostCommandApiCommand.g.cs +++ /dev/null @@ -1,59 +0,0 @@ -#nullable enable -#pragma warning disable CS0618 - -using System.CommandLine; - -namespace AI21.CLI.Commands; - -internal static partial class KirshPublicInformationCheckPrefixPreviewSolutionsPreviewKirshPublicInformationCheckPostCommandApiCommand -{ - - - 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(@"kirsh-public-information-check-prefix-preview-solutions-preview-kirsh-public-information-check-post", @"Kirsh Public Information Check Prefix Preview"); - - - - 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.KirshPublicInformationCheckPrefixPreviewSolutionsPreviewKirshPublicInformationCheckPostAsync( - - cancellationToken: cancellationToken).ConfigureAwait(false); - - - await CliRuntime.WriteResponseAsync( - parseResult, - response, - global::AI21.SourceGenerationContext.Default, - FormatResponse, - cancellationToken).ConfigureAwait(false); - }, cancellationToken).ConfigureAwait(false)); - return command; - } -} \ No newline at end of file diff --git a/src/cli/AI21.CLI/Commands/KirshPublicInformationCheckSolutionsKirshPublicInformationCheckPostCommandApiCommand.g.cs b/src/cli/AI21.CLI/Commands/KirshPublicInformationCheckSolutionsKirshPublicInformationCheckPostCommandApiCommand.g.cs deleted file mode 100644 index d8262ef0..00000000 --- a/src/cli/AI21.CLI/Commands/KirshPublicInformationCheckSolutionsKirshPublicInformationCheckPostCommandApiCommand.g.cs +++ /dev/null @@ -1,59 +0,0 @@ -#nullable enable -#pragma warning disable CS0618 - -using System.CommandLine; - -namespace AI21.CLI.Commands; - -internal static partial class KirshPublicInformationCheckSolutionsKirshPublicInformationCheckPostCommandApiCommand -{ - - - 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(@"kirsh-public-information-check-solutions-kirsh-public-information-check-post", @"Kirsh Public Information Check"); - - - - 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.KirshPublicInformationCheckSolutionsKirshPublicInformationCheckPostAsync( - - cancellationToken: cancellationToken).ConfigureAwait(false); - - - await CliRuntime.WriteResponseAsync( - parseResult, - response, - global::AI21.SourceGenerationContext.Default, - FormatResponse, - cancellationToken).ConfigureAwait(false); - }, cancellationToken).ConfigureAwait(false)); - return command; - } -} \ No newline at end of file diff --git a/src/cli/AI21.CLI/Commands/ListAgentsGatewaySettingsAgentsGetCommandApiCommand.g.cs b/src/cli/AI21.CLI/Commands/ListAgentsGatewaySettingsAgentsGetCommandApiCommand.g.cs new file mode 100644 index 00000000..3138d9bc --- /dev/null +++ b/src/cli/AI21.CLI/Commands/ListAgentsGatewaySettingsAgentsGetCommandApiCommand.g.cs @@ -0,0 +1,67 @@ +#nullable enable +#pragma warning disable CS0618 + +using System.CommandLine; + +namespace AI21.CLI.Commands; + +internal static partial class ListAgentsGatewaySettingsAgentsGetCommandApiCommand +{ + + + 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-agents-gateway-settings-agents-get", @"List Agents"); + + + + 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.ListAgentsGatewaySettingsAgentsGetAsync( + + cancellationToken: cancellationToken).ConfigureAwait(false); + + + if (!await CliRuntime.TryWriteOutputDirectoryAsync( + parseResult, + response, + global::AI21.SourceGenerationContext.Default, + @"$self", + cancellationToken).ConfigureAwait(false)) + { + await CliRuntime.WriteResponseAsync( + parseResult, + response, + global::AI21.SourceGenerationContext.Default, + FormatResponse, + cancellationToken).ConfigureAwait(false); + } + }, cancellationToken).ConfigureAwait(false)); + return command; + } +} \ No newline at end of file diff --git a/src/cli/AI21.CLI/Commands/ListAgentsTokenwiseSettingsAgentsGetCommandApiCommand.g.cs b/src/cli/AI21.CLI/Commands/ListAgentsTokenwiseSettingsAgentsGetCommandApiCommand.g.cs new file mode 100644 index 00000000..66a6ef50 --- /dev/null +++ b/src/cli/AI21.CLI/Commands/ListAgentsTokenwiseSettingsAgentsGetCommandApiCommand.g.cs @@ -0,0 +1,67 @@ +#nullable enable +#pragma warning disable CS0618 + +using System.CommandLine; + +namespace AI21.CLI.Commands; + +internal static partial class ListAgentsTokenwiseSettingsAgentsGetCommandApiCommand +{ + + + 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-agents-tokenwise-settings-agents-get", @"List Agents"); + + + + 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.ListAgentsTokenwiseSettingsAgentsGetAsync( + + cancellationToken: cancellationToken).ConfigureAwait(false); + + + if (!await CliRuntime.TryWriteOutputDirectoryAsync( + parseResult, + response, + global::AI21.SourceGenerationContext.Default, + @"$self", + cancellationToken).ConfigureAwait(false)) + { + await CliRuntime.WriteResponseAsync( + parseResult, + response, + global::AI21.SourceGenerationContext.Default, + FormatResponse, + cancellationToken).ConfigureAwait(false); + } + }, cancellationToken).ConfigureAwait(false)); + return command; + } +} \ No newline at end of file diff --git a/src/cli/AI21.CLI/Commands/ListConfigsGatewaySettingsConfigsGetCommandApiCommand.g.cs b/src/cli/AI21.CLI/Commands/ListConfigsGatewaySettingsConfigsGetCommandApiCommand.g.cs new file mode 100644 index 00000000..ac96bc19 --- /dev/null +++ b/src/cli/AI21.CLI/Commands/ListConfigsGatewaySettingsConfigsGetCommandApiCommand.g.cs @@ -0,0 +1,67 @@ +#nullable enable +#pragma warning disable CS0618 + +using System.CommandLine; + +namespace AI21.CLI.Commands; + +internal static partial class ListConfigsGatewaySettingsConfigsGetCommandApiCommand +{ + + + 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-configs-gateway-settings-configs-get", @"List Configs"); + + + + 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.ListConfigsGatewaySettingsConfigsGetAsync( + + cancellationToken: cancellationToken).ConfigureAwait(false); + + + if (!await CliRuntime.TryWriteOutputDirectoryAsync( + parseResult, + response, + global::AI21.SourceGenerationContext.Default, + @"$self", + cancellationToken).ConfigureAwait(false)) + { + await CliRuntime.WriteResponseAsync( + parseResult, + response, + global::AI21.SourceGenerationContext.Default, + FormatResponse, + cancellationToken).ConfigureAwait(false); + } + }, cancellationToken).ConfigureAwait(false)); + return command; + } +} \ No newline at end of file diff --git a/src/cli/AI21.CLI/Commands/ListConfigsTokenwiseSettingsConfigsGetCommandApiCommand.g.cs b/src/cli/AI21.CLI/Commands/ListConfigsTokenwiseSettingsConfigsGetCommandApiCommand.g.cs new file mode 100644 index 00000000..19c1a8cf --- /dev/null +++ b/src/cli/AI21.CLI/Commands/ListConfigsTokenwiseSettingsConfigsGetCommandApiCommand.g.cs @@ -0,0 +1,67 @@ +#nullable enable +#pragma warning disable CS0618 + +using System.CommandLine; + +namespace AI21.CLI.Commands; + +internal static partial class ListConfigsTokenwiseSettingsConfigsGetCommandApiCommand +{ + + + 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-configs-tokenwise-settings-configs-get", @"List Configs"); + + + + 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.ListConfigsTokenwiseSettingsConfigsGetAsync( + + cancellationToken: cancellationToken).ConfigureAwait(false); + + + if (!await CliRuntime.TryWriteOutputDirectoryAsync( + parseResult, + response, + global::AI21.SourceGenerationContext.Default, + @"$self", + cancellationToken).ConfigureAwait(false)) + { + await CliRuntime.WriteResponseAsync( + parseResult, + response, + global::AI21.SourceGenerationContext.Default, + FormatResponse, + cancellationToken).ConfigureAwait(false); + } + }, cancellationToken).ConfigureAwait(false)); + return command; + } +} \ No newline at end of file diff --git a/src/cli/AI21.CLI/Commands/McpToolDiscoveryStudioV1McpDiscoverPostCommandApiCommand.g.cs b/src/cli/AI21.CLI/Commands/McpToolDiscoveryStudioV1McpDiscoverPostCommandApiCommand.g.cs deleted file mode 100644 index 57f6255e..00000000 --- a/src/cli/AI21.CLI/Commands/McpToolDiscoveryStudioV1McpDiscoverPostCommandApiCommand.g.cs +++ /dev/null @@ -1,126 +0,0 @@ -#nullable enable -#pragma warning disable CS0618 - -using System.CommandLine; - -namespace AI21.CLI.Commands; - -internal static partial class McpToolDiscoveryStudioV1McpDiscoverPostCommandApiCommand -{ - private static Option ServerUrl { get; } = new( - name: @"--server-url") - { - Description = @"", - Required = true, - }; - - private static Option ServerLabel { get; } = new( - name: @"--server-label") - { - Description = @"", - }; - - private static Option Headers { get; } = new( - name: @"--headers") - { - 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::AI21.MCPDiscoveryResponse value, global::System.Text.Json.Serialization.JsonSerializerContext context, bool truncateLongStrings) - { - string? text = null; - CustomizeResponseText(parseResult, value, ref text); - if (!string.IsNullOrWhiteSpace(text)) - { - return text; - } - - var hints = new Dictionary(StringComparer.OrdinalIgnoreCase) - { - }; - CustomizeResponseFormatHints(hints); - return CliRuntime.FormatHumanReadable(value, context, truncateLongStrings, hints); - } - - static partial void CustomizeResponseText(ParseResult parseResult, global::AI21.MCPDiscoveryResponse value, ref string? text); - static partial void CustomizeResponseFormatHints(Dictionary hints); - - - public static Command Create() - { - var command = new Command(@"mcp-tool-discovery-studio-v1-mcp-discover-post", @"Mcp Tool Discovery"); - command.Options.Add(ServerUrl); - command.Options.Add(ServerLabel); - command.Options.Add(Headers); - 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::AI21.SourceGenerationContext.Default, - cancellationToken).ConfigureAwait(false); - var serverUrl = parseResult.GetRequiredValue(ServerUrl); - var serverLabel = CliRuntime.WasSpecified(parseResult, ServerLabel) ? parseResult.GetValue(ServerLabel) : (__requestBase is { } __ServerLabelBaseValue ? __ServerLabelBaseValue.ServerLabel : default); - var headers = CliRuntime.WasSpecified(parseResult, Headers) ? parseResult.GetValue(Headers) : (__requestBase is { } __HeadersBaseValue ? __HeadersBaseValue.Headers : default); - using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); - - - var response = await client.McpToolDiscoveryStudioV1McpDiscoverPostAsync( - serverUrl: serverUrl, - serverLabel: serverLabel, - headers: headers, - cancellationToken: cancellationToken).ConfigureAwait(false); - - - if (!await CliRuntime.TryWriteOutputDirectoryAsync( - parseResult, - response, - global::AI21.SourceGenerationContext.Default, - @"Tools", - cancellationToken).ConfigureAwait(false)) - { - await CliRuntime.WriteResponseAsync( - parseResult, - response, - global::AI21.SourceGenerationContext.Default, - FormatResponse, - cancellationToken).ConfigureAwait(false); - } - }, cancellationToken).ConfigureAwait(false)); - return command; - } -} \ No newline at end of file diff --git a/src/cli/AI21.CLI/Commands/PostWebsiteConnectorStudioV1ConnectorsWebsitePostCommandApiCommand.g.cs b/src/cli/AI21.CLI/Commands/PostWebsiteConnectorStudioV1ConnectorsWebsitePostCommandApiCommand.g.cs deleted file mode 100644 index 787858d5..00000000 --- a/src/cli/AI21.CLI/Commands/PostWebsiteConnectorStudioV1ConnectorsWebsitePostCommandApiCommand.g.cs +++ /dev/null @@ -1,74 +0,0 @@ -#nullable enable -#pragma warning disable CS0618 - -using System.CommandLine; - -namespace AI21.CLI.Commands; - -internal static partial class PostWebsiteConnectorStudioV1ConnectorsWebsitePostCommandApiCommand -{ - private static Option Type { get; } = new( - name: @"--type") - { - Description = @"", - Required = true, - }; - - private static Option>> Value { get; } = new( - name: @"--value") - { - 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(@"post-website-connector-studio-v1-connectors-website-post", @"Post Website Connector"); - command.Options.Add(Type); - command.Options.Add(Value); - - - command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => - await CliRuntime.RunAsync(async () => - { - var type = parseResult.GetRequiredValue(Type); - var value = parseResult.GetRequiredValue(Value); - using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); - - - var response = await client.PostWebsiteConnectorStudioV1ConnectorsWebsitePostAsync( - type: type, - value: value, - cancellationToken: cancellationToken).ConfigureAwait(false); - - - await CliRuntime.WriteResponseAsync( - parseResult, - response, - global::AI21.SourceGenerationContext.Default, - FormatResponse, - cancellationToken).ConfigureAwait(false); - }, cancellationToken).ConfigureAwait(false)); - return command; - } -} \ No newline at end of file diff --git a/src/cli/AI21.CLI/Commands/ProxyOffV1GatewayOffV1PathGet2CommandApiCommand.g.cs b/src/cli/AI21.CLI/Commands/ProxyOffV1GatewayOffV1PathGet2CommandApiCommand.g.cs new file mode 100644 index 00000000..eb2870e0 --- /dev/null +++ b/src/cli/AI21.CLI/Commands/ProxyOffV1GatewayOffV1PathGet2CommandApiCommand.g.cs @@ -0,0 +1,73 @@ +#nullable enable +#pragma warning disable CS0618 + +using System.CommandLine; + +namespace AI21.CLI.Commands; + +internal static partial class ProxyOffV1GatewayOffV1PathGet2CommandApiCommand +{ + private static Argument Path { get; } = new( + name: @"path") + { + Description = @"", + }; + + private static Option XAi21Key { get; } = new( + name: @"--x-ai21-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(@"proxy-off-v1-gateway-off-v1-path-get2", @"Proxy Off V1 +A/B off-arm — forces gateway transformers off for this request only."); + command.Arguments.Add(Path); + command.Options.Add(XAi21Key); + + + command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => + await CliRuntime.RunAsync(async () => + { + var path = parseResult.GetRequiredValue(Path); + var xAi21Key = parseResult.GetValue(XAi21Key); + using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); + + + var response = await client.ProxyOffV1GatewayOffV1PathGet2Async( + path: path, + xAi21Key: xAi21Key, + cancellationToken: cancellationToken).ConfigureAwait(false); + + + await CliRuntime.WriteResponseAsync( + parseResult, + response, + global::AI21.SourceGenerationContext.Default, + FormatResponse, + cancellationToken).ConfigureAwait(false); + }, cancellationToken).ConfigureAwait(false)); + return command; + } +} \ No newline at end of file diff --git a/src/cli/AI21.CLI/Commands/ProxyOffV1GatewayOffV1PathGet3CommandApiCommand.g.cs b/src/cli/AI21.CLI/Commands/ProxyOffV1GatewayOffV1PathGet3CommandApiCommand.g.cs new file mode 100644 index 00000000..fa30bc66 --- /dev/null +++ b/src/cli/AI21.CLI/Commands/ProxyOffV1GatewayOffV1PathGet3CommandApiCommand.g.cs @@ -0,0 +1,73 @@ +#nullable enable +#pragma warning disable CS0618 + +using System.CommandLine; + +namespace AI21.CLI.Commands; + +internal static partial class ProxyOffV1GatewayOffV1PathGet3CommandApiCommand +{ + private static Argument Path { get; } = new( + name: @"path") + { + Description = @"", + }; + + private static Option XAi21Key { get; } = new( + name: @"--x-ai21-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(@"proxy-off-v1-gateway-off-v1-path-get3", @"Proxy Off V1 +A/B off-arm — forces gateway transformers off for this request only."); + command.Arguments.Add(Path); + command.Options.Add(XAi21Key); + + + command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => + await CliRuntime.RunAsync(async () => + { + var path = parseResult.GetRequiredValue(Path); + var xAi21Key = parseResult.GetValue(XAi21Key); + using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); + + + var response = await client.ProxyOffV1GatewayOffV1PathGet3Async( + path: path, + xAi21Key: xAi21Key, + cancellationToken: cancellationToken).ConfigureAwait(false); + + + await CliRuntime.WriteResponseAsync( + parseResult, + response, + global::AI21.SourceGenerationContext.Default, + FormatResponse, + cancellationToken).ConfigureAwait(false); + }, cancellationToken).ConfigureAwait(false)); + return command; + } +} \ No newline at end of file diff --git a/src/cli/AI21.CLI/Commands/ProxyOffV1GatewayOffV1PathGet4CommandApiCommand.g.cs b/src/cli/AI21.CLI/Commands/ProxyOffV1GatewayOffV1PathGet4CommandApiCommand.g.cs new file mode 100644 index 00000000..23c39cf9 --- /dev/null +++ b/src/cli/AI21.CLI/Commands/ProxyOffV1GatewayOffV1PathGet4CommandApiCommand.g.cs @@ -0,0 +1,73 @@ +#nullable enable +#pragma warning disable CS0618 + +using System.CommandLine; + +namespace AI21.CLI.Commands; + +internal static partial class ProxyOffV1GatewayOffV1PathGet4CommandApiCommand +{ + private static Argument Path { get; } = new( + name: @"path") + { + Description = @"", + }; + + private static Option XAi21Key { get; } = new( + name: @"--x-ai21-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(@"proxy-off-v1-gateway-off-v1-path-get4", @"Proxy Off V1 +A/B off-arm — forces gateway transformers off for this request only."); + command.Arguments.Add(Path); + command.Options.Add(XAi21Key); + + + command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => + await CliRuntime.RunAsync(async () => + { + var path = parseResult.GetRequiredValue(Path); + var xAi21Key = parseResult.GetValue(XAi21Key); + using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); + + + var response = await client.ProxyOffV1GatewayOffV1PathGet4Async( + path: path, + xAi21Key: xAi21Key, + cancellationToken: cancellationToken).ConfigureAwait(false); + + + await CliRuntime.WriteResponseAsync( + parseResult, + response, + global::AI21.SourceGenerationContext.Default, + FormatResponse, + cancellationToken).ConfigureAwait(false); + }, cancellationToken).ConfigureAwait(false)); + return command; + } +} \ No newline at end of file diff --git a/src/cli/AI21.CLI/Commands/ProxyOffV1GatewayOffV1PathGet5CommandApiCommand.g.cs b/src/cli/AI21.CLI/Commands/ProxyOffV1GatewayOffV1PathGet5CommandApiCommand.g.cs new file mode 100644 index 00000000..06f4c9e6 --- /dev/null +++ b/src/cli/AI21.CLI/Commands/ProxyOffV1GatewayOffV1PathGet5CommandApiCommand.g.cs @@ -0,0 +1,73 @@ +#nullable enable +#pragma warning disable CS0618 + +using System.CommandLine; + +namespace AI21.CLI.Commands; + +internal static partial class ProxyOffV1GatewayOffV1PathGet5CommandApiCommand +{ + private static Argument Path { get; } = new( + name: @"path") + { + Description = @"", + }; + + private static Option XAi21Key { get; } = new( + name: @"--x-ai21-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(@"proxy-off-v1-gateway-off-v1-path-get5", @"Proxy Off V1 +A/B off-arm — forces gateway transformers off for this request only."); + command.Arguments.Add(Path); + command.Options.Add(XAi21Key); + + + command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => + await CliRuntime.RunAsync(async () => + { + var path = parseResult.GetRequiredValue(Path); + var xAi21Key = parseResult.GetValue(XAi21Key); + using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); + + + var response = await client.ProxyOffV1GatewayOffV1PathGet5Async( + path: path, + xAi21Key: xAi21Key, + cancellationToken: cancellationToken).ConfigureAwait(false); + + + await CliRuntime.WriteResponseAsync( + parseResult, + response, + global::AI21.SourceGenerationContext.Default, + FormatResponse, + cancellationToken).ConfigureAwait(false); + }, cancellationToken).ConfigureAwait(false)); + return command; + } +} \ No newline at end of file diff --git a/src/cli/AI21.CLI/Commands/ProxyOffV1GatewayOffV1PathGet6CommandApiCommand.g.cs b/src/cli/AI21.CLI/Commands/ProxyOffV1GatewayOffV1PathGet6CommandApiCommand.g.cs new file mode 100644 index 00000000..79fe612e --- /dev/null +++ b/src/cli/AI21.CLI/Commands/ProxyOffV1GatewayOffV1PathGet6CommandApiCommand.g.cs @@ -0,0 +1,73 @@ +#nullable enable +#pragma warning disable CS0618 + +using System.CommandLine; + +namespace AI21.CLI.Commands; + +internal static partial class ProxyOffV1GatewayOffV1PathGet6CommandApiCommand +{ + private static Argument Path { get; } = new( + name: @"path") + { + Description = @"", + }; + + private static Option XAi21Key { get; } = new( + name: @"--x-ai21-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(@"proxy-off-v1-gateway-off-v1-path-get6", @"Proxy Off V1 +A/B off-arm — forces gateway transformers off for this request only."); + command.Arguments.Add(Path); + command.Options.Add(XAi21Key); + + + command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => + await CliRuntime.RunAsync(async () => + { + var path = parseResult.GetRequiredValue(Path); + var xAi21Key = parseResult.GetValue(XAi21Key); + using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); + + + var response = await client.ProxyOffV1GatewayOffV1PathGet6Async( + path: path, + xAi21Key: xAi21Key, + cancellationToken: cancellationToken).ConfigureAwait(false); + + + await CliRuntime.WriteResponseAsync( + parseResult, + response, + global::AI21.SourceGenerationContext.Default, + FormatResponse, + cancellationToken).ConfigureAwait(false); + }, cancellationToken).ConfigureAwait(false)); + return command; + } +} \ No newline at end of file diff --git a/src/cli/AI21.CLI/Commands/ProxyOffV1GatewayOffV1PathGetCommandApiCommand.g.cs b/src/cli/AI21.CLI/Commands/ProxyOffV1GatewayOffV1PathGetCommandApiCommand.g.cs new file mode 100644 index 00000000..9d5db881 --- /dev/null +++ b/src/cli/AI21.CLI/Commands/ProxyOffV1GatewayOffV1PathGetCommandApiCommand.g.cs @@ -0,0 +1,73 @@ +#nullable enable +#pragma warning disable CS0618 + +using System.CommandLine; + +namespace AI21.CLI.Commands; + +internal static partial class ProxyOffV1GatewayOffV1PathGetCommandApiCommand +{ + private static Argument Path { get; } = new( + name: @"path") + { + Description = @"", + }; + + private static Option XAi21Key { get; } = new( + name: @"--x-ai21-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(@"proxy-off-v1-gateway-off-v1-path-get", @"Proxy Off V1 +A/B off-arm — forces gateway transformers off for this request only."); + command.Arguments.Add(Path); + command.Options.Add(XAi21Key); + + + command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => + await CliRuntime.RunAsync(async () => + { + var path = parseResult.GetRequiredValue(Path); + var xAi21Key = parseResult.GetValue(XAi21Key); + using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); + + + var response = await client.ProxyOffV1GatewayOffV1PathGetAsync( + path: path, + xAi21Key: xAi21Key, + cancellationToken: cancellationToken).ConfigureAwait(false); + + + await CliRuntime.WriteResponseAsync( + parseResult, + response, + global::AI21.SourceGenerationContext.Default, + FormatResponse, + cancellationToken).ConfigureAwait(false); + }, cancellationToken).ConfigureAwait(false)); + return command; + } +} \ No newline at end of file diff --git a/src/cli/AI21.CLI/Commands/ProxyOffV1TokenwiseOffV1PathGet2CommandApiCommand.g.cs b/src/cli/AI21.CLI/Commands/ProxyOffV1TokenwiseOffV1PathGet2CommandApiCommand.g.cs new file mode 100644 index 00000000..5cfebcd5 --- /dev/null +++ b/src/cli/AI21.CLI/Commands/ProxyOffV1TokenwiseOffV1PathGet2CommandApiCommand.g.cs @@ -0,0 +1,73 @@ +#nullable enable +#pragma warning disable CS0618 + +using System.CommandLine; + +namespace AI21.CLI.Commands; + +internal static partial class ProxyOffV1TokenwiseOffV1PathGet2CommandApiCommand +{ + private static Argument Path { get; } = new( + name: @"path") + { + Description = @"", + }; + + private static Option XAi21Key { get; } = new( + name: @"--x-ai21-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(@"proxy-off-v1-tokenwise-off-v1-path-get2", @"Proxy Off V1 +A/B off-arm — forces gateway transformers off for this request only."); + command.Arguments.Add(Path); + command.Options.Add(XAi21Key); + + + command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => + await CliRuntime.RunAsync(async () => + { + var path = parseResult.GetRequiredValue(Path); + var xAi21Key = parseResult.GetValue(XAi21Key); + using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); + + + var response = await client.ProxyOffV1TokenwiseOffV1PathGet2Async( + path: path, + xAi21Key: xAi21Key, + cancellationToken: cancellationToken).ConfigureAwait(false); + + + await CliRuntime.WriteResponseAsync( + parseResult, + response, + global::AI21.SourceGenerationContext.Default, + FormatResponse, + cancellationToken).ConfigureAwait(false); + }, cancellationToken).ConfigureAwait(false)); + return command; + } +} \ No newline at end of file diff --git a/src/cli/AI21.CLI/Commands/ProxyOffV1TokenwiseOffV1PathGet3CommandApiCommand.g.cs b/src/cli/AI21.CLI/Commands/ProxyOffV1TokenwiseOffV1PathGet3CommandApiCommand.g.cs new file mode 100644 index 00000000..3d3e6620 --- /dev/null +++ b/src/cli/AI21.CLI/Commands/ProxyOffV1TokenwiseOffV1PathGet3CommandApiCommand.g.cs @@ -0,0 +1,73 @@ +#nullable enable +#pragma warning disable CS0618 + +using System.CommandLine; + +namespace AI21.CLI.Commands; + +internal static partial class ProxyOffV1TokenwiseOffV1PathGet3CommandApiCommand +{ + private static Argument Path { get; } = new( + name: @"path") + { + Description = @"", + }; + + private static Option XAi21Key { get; } = new( + name: @"--x-ai21-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(@"proxy-off-v1-tokenwise-off-v1-path-get3", @"Proxy Off V1 +A/B off-arm — forces gateway transformers off for this request only."); + command.Arguments.Add(Path); + command.Options.Add(XAi21Key); + + + command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => + await CliRuntime.RunAsync(async () => + { + var path = parseResult.GetRequiredValue(Path); + var xAi21Key = parseResult.GetValue(XAi21Key); + using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); + + + var response = await client.ProxyOffV1TokenwiseOffV1PathGet3Async( + path: path, + xAi21Key: xAi21Key, + cancellationToken: cancellationToken).ConfigureAwait(false); + + + await CliRuntime.WriteResponseAsync( + parseResult, + response, + global::AI21.SourceGenerationContext.Default, + FormatResponse, + cancellationToken).ConfigureAwait(false); + }, cancellationToken).ConfigureAwait(false)); + return command; + } +} \ No newline at end of file diff --git a/src/cli/AI21.CLI/Commands/ProxyOffV1TokenwiseOffV1PathGet4CommandApiCommand.g.cs b/src/cli/AI21.CLI/Commands/ProxyOffV1TokenwiseOffV1PathGet4CommandApiCommand.g.cs new file mode 100644 index 00000000..e65e0568 --- /dev/null +++ b/src/cli/AI21.CLI/Commands/ProxyOffV1TokenwiseOffV1PathGet4CommandApiCommand.g.cs @@ -0,0 +1,73 @@ +#nullable enable +#pragma warning disable CS0618 + +using System.CommandLine; + +namespace AI21.CLI.Commands; + +internal static partial class ProxyOffV1TokenwiseOffV1PathGet4CommandApiCommand +{ + private static Argument Path { get; } = new( + name: @"path") + { + Description = @"", + }; + + private static Option XAi21Key { get; } = new( + name: @"--x-ai21-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(@"proxy-off-v1-tokenwise-off-v1-path-get4", @"Proxy Off V1 +A/B off-arm — forces gateway transformers off for this request only."); + command.Arguments.Add(Path); + command.Options.Add(XAi21Key); + + + command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => + await CliRuntime.RunAsync(async () => + { + var path = parseResult.GetRequiredValue(Path); + var xAi21Key = parseResult.GetValue(XAi21Key); + using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); + + + var response = await client.ProxyOffV1TokenwiseOffV1PathGet4Async( + path: path, + xAi21Key: xAi21Key, + cancellationToken: cancellationToken).ConfigureAwait(false); + + + await CliRuntime.WriteResponseAsync( + parseResult, + response, + global::AI21.SourceGenerationContext.Default, + FormatResponse, + cancellationToken).ConfigureAwait(false); + }, cancellationToken).ConfigureAwait(false)); + return command; + } +} \ No newline at end of file diff --git a/src/cli/AI21.CLI/Commands/ProxyOffV1TokenwiseOffV1PathGet5CommandApiCommand.g.cs b/src/cli/AI21.CLI/Commands/ProxyOffV1TokenwiseOffV1PathGet5CommandApiCommand.g.cs new file mode 100644 index 00000000..5e8e3a8c --- /dev/null +++ b/src/cli/AI21.CLI/Commands/ProxyOffV1TokenwiseOffV1PathGet5CommandApiCommand.g.cs @@ -0,0 +1,73 @@ +#nullable enable +#pragma warning disable CS0618 + +using System.CommandLine; + +namespace AI21.CLI.Commands; + +internal static partial class ProxyOffV1TokenwiseOffV1PathGet5CommandApiCommand +{ + private static Argument Path { get; } = new( + name: @"path") + { + Description = @"", + }; + + private static Option XAi21Key { get; } = new( + name: @"--x-ai21-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(@"proxy-off-v1-tokenwise-off-v1-path-get5", @"Proxy Off V1 +A/B off-arm — forces gateway transformers off for this request only."); + command.Arguments.Add(Path); + command.Options.Add(XAi21Key); + + + command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => + await CliRuntime.RunAsync(async () => + { + var path = parseResult.GetRequiredValue(Path); + var xAi21Key = parseResult.GetValue(XAi21Key); + using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); + + + var response = await client.ProxyOffV1TokenwiseOffV1PathGet5Async( + path: path, + xAi21Key: xAi21Key, + cancellationToken: cancellationToken).ConfigureAwait(false); + + + await CliRuntime.WriteResponseAsync( + parseResult, + response, + global::AI21.SourceGenerationContext.Default, + FormatResponse, + cancellationToken).ConfigureAwait(false); + }, cancellationToken).ConfigureAwait(false)); + return command; + } +} \ No newline at end of file diff --git a/src/cli/AI21.CLI/Commands/ProxyOffV1TokenwiseOffV1PathGet6CommandApiCommand.g.cs b/src/cli/AI21.CLI/Commands/ProxyOffV1TokenwiseOffV1PathGet6CommandApiCommand.g.cs new file mode 100644 index 00000000..01d68081 --- /dev/null +++ b/src/cli/AI21.CLI/Commands/ProxyOffV1TokenwiseOffV1PathGet6CommandApiCommand.g.cs @@ -0,0 +1,73 @@ +#nullable enable +#pragma warning disable CS0618 + +using System.CommandLine; + +namespace AI21.CLI.Commands; + +internal static partial class ProxyOffV1TokenwiseOffV1PathGet6CommandApiCommand +{ + private static Argument Path { get; } = new( + name: @"path") + { + Description = @"", + }; + + private static Option XAi21Key { get; } = new( + name: @"--x-ai21-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(@"proxy-off-v1-tokenwise-off-v1-path-get6", @"Proxy Off V1 +A/B off-arm — forces gateway transformers off for this request only."); + command.Arguments.Add(Path); + command.Options.Add(XAi21Key); + + + command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => + await CliRuntime.RunAsync(async () => + { + var path = parseResult.GetRequiredValue(Path); + var xAi21Key = parseResult.GetValue(XAi21Key); + using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); + + + var response = await client.ProxyOffV1TokenwiseOffV1PathGet6Async( + path: path, + xAi21Key: xAi21Key, + cancellationToken: cancellationToken).ConfigureAwait(false); + + + await CliRuntime.WriteResponseAsync( + parseResult, + response, + global::AI21.SourceGenerationContext.Default, + FormatResponse, + cancellationToken).ConfigureAwait(false); + }, cancellationToken).ConfigureAwait(false)); + return command; + } +} \ No newline at end of file diff --git a/src/cli/AI21.CLI/Commands/ProxyOffV1TokenwiseOffV1PathGetCommandApiCommand.g.cs b/src/cli/AI21.CLI/Commands/ProxyOffV1TokenwiseOffV1PathGetCommandApiCommand.g.cs new file mode 100644 index 00000000..979731e4 --- /dev/null +++ b/src/cli/AI21.CLI/Commands/ProxyOffV1TokenwiseOffV1PathGetCommandApiCommand.g.cs @@ -0,0 +1,73 @@ +#nullable enable +#pragma warning disable CS0618 + +using System.CommandLine; + +namespace AI21.CLI.Commands; + +internal static partial class ProxyOffV1TokenwiseOffV1PathGetCommandApiCommand +{ + private static Argument Path { get; } = new( + name: @"path") + { + Description = @"", + }; + + private static Option XAi21Key { get; } = new( + name: @"--x-ai21-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(@"proxy-off-v1-tokenwise-off-v1-path-get", @"Proxy Off V1 +A/B off-arm — forces gateway transformers off for this request only."); + command.Arguments.Add(Path); + command.Options.Add(XAi21Key); + + + command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => + await CliRuntime.RunAsync(async () => + { + var path = parseResult.GetRequiredValue(Path); + var xAi21Key = parseResult.GetValue(XAi21Key); + using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); + + + var response = await client.ProxyOffV1TokenwiseOffV1PathGetAsync( + path: path, + xAi21Key: xAi21Key, + cancellationToken: cancellationToken).ConfigureAwait(false); + + + await CliRuntime.WriteResponseAsync( + parseResult, + response, + global::AI21.SourceGenerationContext.Default, + FormatResponse, + cancellationToken).ConfigureAwait(false); + }, cancellationToken).ConfigureAwait(false)); + return command; + } +} \ No newline at end of file diff --git a/src/cli/AI21.CLI/Commands/ProxyOnV1GatewayOnV1PathGet2CommandApiCommand.g.cs b/src/cli/AI21.CLI/Commands/ProxyOnV1GatewayOnV1PathGet2CommandApiCommand.g.cs new file mode 100644 index 00000000..841d56c0 --- /dev/null +++ b/src/cli/AI21.CLI/Commands/ProxyOnV1GatewayOnV1PathGet2CommandApiCommand.g.cs @@ -0,0 +1,73 @@ +#nullable enable +#pragma warning disable CS0618 + +using System.CommandLine; + +namespace AI21.CLI.Commands; + +internal static partial class ProxyOnV1GatewayOnV1PathGet2CommandApiCommand +{ + private static Argument Path { get; } = new( + name: @"path") + { + Description = @"", + }; + + private static Option XAi21Key { get; } = new( + name: @"--x-ai21-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(@"proxy-on-v1-gateway-on-v1-path-get2", @"Proxy On V1 +A/B on-arm — forces gateway transformers on for this request only."); + command.Arguments.Add(Path); + command.Options.Add(XAi21Key); + + + command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => + await CliRuntime.RunAsync(async () => + { + var path = parseResult.GetRequiredValue(Path); + var xAi21Key = parseResult.GetValue(XAi21Key); + using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); + + + var response = await client.ProxyOnV1GatewayOnV1PathGet2Async( + path: path, + xAi21Key: xAi21Key, + cancellationToken: cancellationToken).ConfigureAwait(false); + + + await CliRuntime.WriteResponseAsync( + parseResult, + response, + global::AI21.SourceGenerationContext.Default, + FormatResponse, + cancellationToken).ConfigureAwait(false); + }, cancellationToken).ConfigureAwait(false)); + return command; + } +} \ No newline at end of file diff --git a/src/cli/AI21.CLI/Commands/ProxyOnV1GatewayOnV1PathGet3CommandApiCommand.g.cs b/src/cli/AI21.CLI/Commands/ProxyOnV1GatewayOnV1PathGet3CommandApiCommand.g.cs new file mode 100644 index 00000000..20e5e8a3 --- /dev/null +++ b/src/cli/AI21.CLI/Commands/ProxyOnV1GatewayOnV1PathGet3CommandApiCommand.g.cs @@ -0,0 +1,73 @@ +#nullable enable +#pragma warning disable CS0618 + +using System.CommandLine; + +namespace AI21.CLI.Commands; + +internal static partial class ProxyOnV1GatewayOnV1PathGet3CommandApiCommand +{ + private static Argument Path { get; } = new( + name: @"path") + { + Description = @"", + }; + + private static Option XAi21Key { get; } = new( + name: @"--x-ai21-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(@"proxy-on-v1-gateway-on-v1-path-get3", @"Proxy On V1 +A/B on-arm — forces gateway transformers on for this request only."); + command.Arguments.Add(Path); + command.Options.Add(XAi21Key); + + + command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => + await CliRuntime.RunAsync(async () => + { + var path = parseResult.GetRequiredValue(Path); + var xAi21Key = parseResult.GetValue(XAi21Key); + using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); + + + var response = await client.ProxyOnV1GatewayOnV1PathGet3Async( + path: path, + xAi21Key: xAi21Key, + cancellationToken: cancellationToken).ConfigureAwait(false); + + + await CliRuntime.WriteResponseAsync( + parseResult, + response, + global::AI21.SourceGenerationContext.Default, + FormatResponse, + cancellationToken).ConfigureAwait(false); + }, cancellationToken).ConfigureAwait(false)); + return command; + } +} \ No newline at end of file diff --git a/src/cli/AI21.CLI/Commands/ProxyOnV1GatewayOnV1PathGet4CommandApiCommand.g.cs b/src/cli/AI21.CLI/Commands/ProxyOnV1GatewayOnV1PathGet4CommandApiCommand.g.cs new file mode 100644 index 00000000..b400c733 --- /dev/null +++ b/src/cli/AI21.CLI/Commands/ProxyOnV1GatewayOnV1PathGet4CommandApiCommand.g.cs @@ -0,0 +1,73 @@ +#nullable enable +#pragma warning disable CS0618 + +using System.CommandLine; + +namespace AI21.CLI.Commands; + +internal static partial class ProxyOnV1GatewayOnV1PathGet4CommandApiCommand +{ + private static Argument Path { get; } = new( + name: @"path") + { + Description = @"", + }; + + private static Option XAi21Key { get; } = new( + name: @"--x-ai21-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(@"proxy-on-v1-gateway-on-v1-path-get4", @"Proxy On V1 +A/B on-arm — forces gateway transformers on for this request only."); + command.Arguments.Add(Path); + command.Options.Add(XAi21Key); + + + command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => + await CliRuntime.RunAsync(async () => + { + var path = parseResult.GetRequiredValue(Path); + var xAi21Key = parseResult.GetValue(XAi21Key); + using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); + + + var response = await client.ProxyOnV1GatewayOnV1PathGet4Async( + path: path, + xAi21Key: xAi21Key, + cancellationToken: cancellationToken).ConfigureAwait(false); + + + await CliRuntime.WriteResponseAsync( + parseResult, + response, + global::AI21.SourceGenerationContext.Default, + FormatResponse, + cancellationToken).ConfigureAwait(false); + }, cancellationToken).ConfigureAwait(false)); + return command; + } +} \ No newline at end of file diff --git a/src/cli/AI21.CLI/Commands/ProxyOnV1GatewayOnV1PathGet5CommandApiCommand.g.cs b/src/cli/AI21.CLI/Commands/ProxyOnV1GatewayOnV1PathGet5CommandApiCommand.g.cs new file mode 100644 index 00000000..917a4bcc --- /dev/null +++ b/src/cli/AI21.CLI/Commands/ProxyOnV1GatewayOnV1PathGet5CommandApiCommand.g.cs @@ -0,0 +1,73 @@ +#nullable enable +#pragma warning disable CS0618 + +using System.CommandLine; + +namespace AI21.CLI.Commands; + +internal static partial class ProxyOnV1GatewayOnV1PathGet5CommandApiCommand +{ + private static Argument Path { get; } = new( + name: @"path") + { + Description = @"", + }; + + private static Option XAi21Key { get; } = new( + name: @"--x-ai21-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(@"proxy-on-v1-gateway-on-v1-path-get5", @"Proxy On V1 +A/B on-arm — forces gateway transformers on for this request only."); + command.Arguments.Add(Path); + command.Options.Add(XAi21Key); + + + command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => + await CliRuntime.RunAsync(async () => + { + var path = parseResult.GetRequiredValue(Path); + var xAi21Key = parseResult.GetValue(XAi21Key); + using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); + + + var response = await client.ProxyOnV1GatewayOnV1PathGet5Async( + path: path, + xAi21Key: xAi21Key, + cancellationToken: cancellationToken).ConfigureAwait(false); + + + await CliRuntime.WriteResponseAsync( + parseResult, + response, + global::AI21.SourceGenerationContext.Default, + FormatResponse, + cancellationToken).ConfigureAwait(false); + }, cancellationToken).ConfigureAwait(false)); + return command; + } +} \ No newline at end of file diff --git a/src/cli/AI21.CLI/Commands/ProxyOnV1GatewayOnV1PathGet6CommandApiCommand.g.cs b/src/cli/AI21.CLI/Commands/ProxyOnV1GatewayOnV1PathGet6CommandApiCommand.g.cs new file mode 100644 index 00000000..00e099fc --- /dev/null +++ b/src/cli/AI21.CLI/Commands/ProxyOnV1GatewayOnV1PathGet6CommandApiCommand.g.cs @@ -0,0 +1,73 @@ +#nullable enable +#pragma warning disable CS0618 + +using System.CommandLine; + +namespace AI21.CLI.Commands; + +internal static partial class ProxyOnV1GatewayOnV1PathGet6CommandApiCommand +{ + private static Argument Path { get; } = new( + name: @"path") + { + Description = @"", + }; + + private static Option XAi21Key { get; } = new( + name: @"--x-ai21-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(@"proxy-on-v1-gateway-on-v1-path-get6", @"Proxy On V1 +A/B on-arm — forces gateway transformers on for this request only."); + command.Arguments.Add(Path); + command.Options.Add(XAi21Key); + + + command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => + await CliRuntime.RunAsync(async () => + { + var path = parseResult.GetRequiredValue(Path); + var xAi21Key = parseResult.GetValue(XAi21Key); + using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); + + + var response = await client.ProxyOnV1GatewayOnV1PathGet6Async( + path: path, + xAi21Key: xAi21Key, + cancellationToken: cancellationToken).ConfigureAwait(false); + + + await CliRuntime.WriteResponseAsync( + parseResult, + response, + global::AI21.SourceGenerationContext.Default, + FormatResponse, + cancellationToken).ConfigureAwait(false); + }, cancellationToken).ConfigureAwait(false)); + return command; + } +} \ No newline at end of file diff --git a/src/cli/AI21.CLI/Commands/ProxyOnV1GatewayOnV1PathGetCommandApiCommand.g.cs b/src/cli/AI21.CLI/Commands/ProxyOnV1GatewayOnV1PathGetCommandApiCommand.g.cs new file mode 100644 index 00000000..0dfc274b --- /dev/null +++ b/src/cli/AI21.CLI/Commands/ProxyOnV1GatewayOnV1PathGetCommandApiCommand.g.cs @@ -0,0 +1,73 @@ +#nullable enable +#pragma warning disable CS0618 + +using System.CommandLine; + +namespace AI21.CLI.Commands; + +internal static partial class ProxyOnV1GatewayOnV1PathGetCommandApiCommand +{ + private static Argument Path { get; } = new( + name: @"path") + { + Description = @"", + }; + + private static Option XAi21Key { get; } = new( + name: @"--x-ai21-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(@"proxy-on-v1-gateway-on-v1-path-get", @"Proxy On V1 +A/B on-arm — forces gateway transformers on for this request only."); + command.Arguments.Add(Path); + command.Options.Add(XAi21Key); + + + command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => + await CliRuntime.RunAsync(async () => + { + var path = parseResult.GetRequiredValue(Path); + var xAi21Key = parseResult.GetValue(XAi21Key); + using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); + + + var response = await client.ProxyOnV1GatewayOnV1PathGetAsync( + path: path, + xAi21Key: xAi21Key, + cancellationToken: cancellationToken).ConfigureAwait(false); + + + await CliRuntime.WriteResponseAsync( + parseResult, + response, + global::AI21.SourceGenerationContext.Default, + FormatResponse, + cancellationToken).ConfigureAwait(false); + }, cancellationToken).ConfigureAwait(false)); + return command; + } +} \ No newline at end of file diff --git a/src/cli/AI21.CLI/Commands/ProxyOnV1TokenwiseOnV1PathGet2CommandApiCommand.g.cs b/src/cli/AI21.CLI/Commands/ProxyOnV1TokenwiseOnV1PathGet2CommandApiCommand.g.cs new file mode 100644 index 00000000..4e10df08 --- /dev/null +++ b/src/cli/AI21.CLI/Commands/ProxyOnV1TokenwiseOnV1PathGet2CommandApiCommand.g.cs @@ -0,0 +1,73 @@ +#nullable enable +#pragma warning disable CS0618 + +using System.CommandLine; + +namespace AI21.CLI.Commands; + +internal static partial class ProxyOnV1TokenwiseOnV1PathGet2CommandApiCommand +{ + private static Argument Path { get; } = new( + name: @"path") + { + Description = @"", + }; + + private static Option XAi21Key { get; } = new( + name: @"--x-ai21-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(@"proxy-on-v1-tokenwise-on-v1-path-get2", @"Proxy On V1 +A/B on-arm — forces gateway transformers on for this request only."); + command.Arguments.Add(Path); + command.Options.Add(XAi21Key); + + + command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => + await CliRuntime.RunAsync(async () => + { + var path = parseResult.GetRequiredValue(Path); + var xAi21Key = parseResult.GetValue(XAi21Key); + using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); + + + var response = await client.ProxyOnV1TokenwiseOnV1PathGet2Async( + path: path, + xAi21Key: xAi21Key, + cancellationToken: cancellationToken).ConfigureAwait(false); + + + await CliRuntime.WriteResponseAsync( + parseResult, + response, + global::AI21.SourceGenerationContext.Default, + FormatResponse, + cancellationToken).ConfigureAwait(false); + }, cancellationToken).ConfigureAwait(false)); + return command; + } +} \ No newline at end of file diff --git a/src/cli/AI21.CLI/Commands/ProxyOnV1TokenwiseOnV1PathGet3CommandApiCommand.g.cs b/src/cli/AI21.CLI/Commands/ProxyOnV1TokenwiseOnV1PathGet3CommandApiCommand.g.cs new file mode 100644 index 00000000..78853bc3 --- /dev/null +++ b/src/cli/AI21.CLI/Commands/ProxyOnV1TokenwiseOnV1PathGet3CommandApiCommand.g.cs @@ -0,0 +1,73 @@ +#nullable enable +#pragma warning disable CS0618 + +using System.CommandLine; + +namespace AI21.CLI.Commands; + +internal static partial class ProxyOnV1TokenwiseOnV1PathGet3CommandApiCommand +{ + private static Argument Path { get; } = new( + name: @"path") + { + Description = @"", + }; + + private static Option XAi21Key { get; } = new( + name: @"--x-ai21-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(@"proxy-on-v1-tokenwise-on-v1-path-get3", @"Proxy On V1 +A/B on-arm — forces gateway transformers on for this request only."); + command.Arguments.Add(Path); + command.Options.Add(XAi21Key); + + + command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => + await CliRuntime.RunAsync(async () => + { + var path = parseResult.GetRequiredValue(Path); + var xAi21Key = parseResult.GetValue(XAi21Key); + using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); + + + var response = await client.ProxyOnV1TokenwiseOnV1PathGet3Async( + path: path, + xAi21Key: xAi21Key, + cancellationToken: cancellationToken).ConfigureAwait(false); + + + await CliRuntime.WriteResponseAsync( + parseResult, + response, + global::AI21.SourceGenerationContext.Default, + FormatResponse, + cancellationToken).ConfigureAwait(false); + }, cancellationToken).ConfigureAwait(false)); + return command; + } +} \ No newline at end of file diff --git a/src/cli/AI21.CLI/Commands/ProxyOnV1TokenwiseOnV1PathGet4CommandApiCommand.g.cs b/src/cli/AI21.CLI/Commands/ProxyOnV1TokenwiseOnV1PathGet4CommandApiCommand.g.cs new file mode 100644 index 00000000..297a53ba --- /dev/null +++ b/src/cli/AI21.CLI/Commands/ProxyOnV1TokenwiseOnV1PathGet4CommandApiCommand.g.cs @@ -0,0 +1,73 @@ +#nullable enable +#pragma warning disable CS0618 + +using System.CommandLine; + +namespace AI21.CLI.Commands; + +internal static partial class ProxyOnV1TokenwiseOnV1PathGet4CommandApiCommand +{ + private static Argument Path { get; } = new( + name: @"path") + { + Description = @"", + }; + + private static Option XAi21Key { get; } = new( + name: @"--x-ai21-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(@"proxy-on-v1-tokenwise-on-v1-path-get4", @"Proxy On V1 +A/B on-arm — forces gateway transformers on for this request only."); + command.Arguments.Add(Path); + command.Options.Add(XAi21Key); + + + command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => + await CliRuntime.RunAsync(async () => + { + var path = parseResult.GetRequiredValue(Path); + var xAi21Key = parseResult.GetValue(XAi21Key); + using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); + + + var response = await client.ProxyOnV1TokenwiseOnV1PathGet4Async( + path: path, + xAi21Key: xAi21Key, + cancellationToken: cancellationToken).ConfigureAwait(false); + + + await CliRuntime.WriteResponseAsync( + parseResult, + response, + global::AI21.SourceGenerationContext.Default, + FormatResponse, + cancellationToken).ConfigureAwait(false); + }, cancellationToken).ConfigureAwait(false)); + return command; + } +} \ No newline at end of file diff --git a/src/cli/AI21.CLI/Commands/ProxyOnV1TokenwiseOnV1PathGet5CommandApiCommand.g.cs b/src/cli/AI21.CLI/Commands/ProxyOnV1TokenwiseOnV1PathGet5CommandApiCommand.g.cs new file mode 100644 index 00000000..8190818b --- /dev/null +++ b/src/cli/AI21.CLI/Commands/ProxyOnV1TokenwiseOnV1PathGet5CommandApiCommand.g.cs @@ -0,0 +1,73 @@ +#nullable enable +#pragma warning disable CS0618 + +using System.CommandLine; + +namespace AI21.CLI.Commands; + +internal static partial class ProxyOnV1TokenwiseOnV1PathGet5CommandApiCommand +{ + private static Argument Path { get; } = new( + name: @"path") + { + Description = @"", + }; + + private static Option XAi21Key { get; } = new( + name: @"--x-ai21-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(@"proxy-on-v1-tokenwise-on-v1-path-get5", @"Proxy On V1 +A/B on-arm — forces gateway transformers on for this request only."); + command.Arguments.Add(Path); + command.Options.Add(XAi21Key); + + + command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => + await CliRuntime.RunAsync(async () => + { + var path = parseResult.GetRequiredValue(Path); + var xAi21Key = parseResult.GetValue(XAi21Key); + using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); + + + var response = await client.ProxyOnV1TokenwiseOnV1PathGet5Async( + path: path, + xAi21Key: xAi21Key, + cancellationToken: cancellationToken).ConfigureAwait(false); + + + await CliRuntime.WriteResponseAsync( + parseResult, + response, + global::AI21.SourceGenerationContext.Default, + FormatResponse, + cancellationToken).ConfigureAwait(false); + }, cancellationToken).ConfigureAwait(false)); + return command; + } +} \ No newline at end of file diff --git a/src/cli/AI21.CLI/Commands/ProxyOnV1TokenwiseOnV1PathGet6CommandApiCommand.g.cs b/src/cli/AI21.CLI/Commands/ProxyOnV1TokenwiseOnV1PathGet6CommandApiCommand.g.cs new file mode 100644 index 00000000..1aedea0f --- /dev/null +++ b/src/cli/AI21.CLI/Commands/ProxyOnV1TokenwiseOnV1PathGet6CommandApiCommand.g.cs @@ -0,0 +1,73 @@ +#nullable enable +#pragma warning disable CS0618 + +using System.CommandLine; + +namespace AI21.CLI.Commands; + +internal static partial class ProxyOnV1TokenwiseOnV1PathGet6CommandApiCommand +{ + private static Argument Path { get; } = new( + name: @"path") + { + Description = @"", + }; + + private static Option XAi21Key { get; } = new( + name: @"--x-ai21-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(@"proxy-on-v1-tokenwise-on-v1-path-get6", @"Proxy On V1 +A/B on-arm — forces gateway transformers on for this request only."); + command.Arguments.Add(Path); + command.Options.Add(XAi21Key); + + + command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => + await CliRuntime.RunAsync(async () => + { + var path = parseResult.GetRequiredValue(Path); + var xAi21Key = parseResult.GetValue(XAi21Key); + using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); + + + var response = await client.ProxyOnV1TokenwiseOnV1PathGet6Async( + path: path, + xAi21Key: xAi21Key, + cancellationToken: cancellationToken).ConfigureAwait(false); + + + await CliRuntime.WriteResponseAsync( + parseResult, + response, + global::AI21.SourceGenerationContext.Default, + FormatResponse, + cancellationToken).ConfigureAwait(false); + }, cancellationToken).ConfigureAwait(false)); + return command; + } +} \ No newline at end of file diff --git a/src/cli/AI21.CLI/Commands/ProxyOnV1TokenwiseOnV1PathGetCommandApiCommand.g.cs b/src/cli/AI21.CLI/Commands/ProxyOnV1TokenwiseOnV1PathGetCommandApiCommand.g.cs new file mode 100644 index 00000000..4481484f --- /dev/null +++ b/src/cli/AI21.CLI/Commands/ProxyOnV1TokenwiseOnV1PathGetCommandApiCommand.g.cs @@ -0,0 +1,73 @@ +#nullable enable +#pragma warning disable CS0618 + +using System.CommandLine; + +namespace AI21.CLI.Commands; + +internal static partial class ProxyOnV1TokenwiseOnV1PathGetCommandApiCommand +{ + private static Argument Path { get; } = new( + name: @"path") + { + Description = @"", + }; + + private static Option XAi21Key { get; } = new( + name: @"--x-ai21-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(@"proxy-on-v1-tokenwise-on-v1-path-get", @"Proxy On V1 +A/B on-arm — forces gateway transformers on for this request only."); + command.Arguments.Add(Path); + command.Options.Add(XAi21Key); + + + command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => + await CliRuntime.RunAsync(async () => + { + var path = parseResult.GetRequiredValue(Path); + var xAi21Key = parseResult.GetValue(XAi21Key); + using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); + + + var response = await client.ProxyOnV1TokenwiseOnV1PathGetAsync( + path: path, + xAi21Key: xAi21Key, + cancellationToken: cancellationToken).ConfigureAwait(false); + + + await CliRuntime.WriteResponseAsync( + parseResult, + response, + global::AI21.SourceGenerationContext.Default, + FormatResponse, + cancellationToken).ConfigureAwait(false); + }, cancellationToken).ConfigureAwait(false)); + return command; + } +} \ No newline at end of file diff --git a/src/cli/AI21.CLI/Commands/ProxyV1GatewayV1PathGet2CommandApiCommand.g.cs b/src/cli/AI21.CLI/Commands/ProxyV1GatewayV1PathGet2CommandApiCommand.g.cs new file mode 100644 index 00000000..43766e74 --- /dev/null +++ b/src/cli/AI21.CLI/Commands/ProxyV1GatewayV1PathGet2CommandApiCommand.g.cs @@ -0,0 +1,76 @@ +#nullable enable +#pragma warning disable CS0618 + +using System.CommandLine; + +namespace AI21.CLI.Commands; + +internal static partial class ProxyV1GatewayV1PathGet2CommandApiCommand +{ + private static Argument Path { get; } = new( + name: @"path") + { + Description = @"", + }; + + private static Option XAi21Key { get; } = new( + name: @"--x-ai21-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(@"proxy-v1-gateway-v1-path-get2", @"Proxy V1 +Catch-all for the Anthropic-compatible surface (``/v1/messages``, etc.). + +Gated on a Tokenwise subscription (OPSS-55); the A/B ``/on`` and ``/off`` arms are +intentionally left ungated."); + command.Arguments.Add(Path); + command.Options.Add(XAi21Key); + + + command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => + await CliRuntime.RunAsync(async () => + { + var path = parseResult.GetRequiredValue(Path); + var xAi21Key = parseResult.GetValue(XAi21Key); + using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); + + + var response = await client.ProxyV1GatewayV1PathGet2Async( + path: path, + xAi21Key: xAi21Key, + cancellationToken: cancellationToken).ConfigureAwait(false); + + + await CliRuntime.WriteResponseAsync( + parseResult, + response, + global::AI21.SourceGenerationContext.Default, + FormatResponse, + cancellationToken).ConfigureAwait(false); + }, cancellationToken).ConfigureAwait(false)); + return command; + } +} \ No newline at end of file diff --git a/src/cli/AI21.CLI/Commands/ProxyV1GatewayV1PathGet3CommandApiCommand.g.cs b/src/cli/AI21.CLI/Commands/ProxyV1GatewayV1PathGet3CommandApiCommand.g.cs new file mode 100644 index 00000000..383d88aa --- /dev/null +++ b/src/cli/AI21.CLI/Commands/ProxyV1GatewayV1PathGet3CommandApiCommand.g.cs @@ -0,0 +1,76 @@ +#nullable enable +#pragma warning disable CS0618 + +using System.CommandLine; + +namespace AI21.CLI.Commands; + +internal static partial class ProxyV1GatewayV1PathGet3CommandApiCommand +{ + private static Argument Path { get; } = new( + name: @"path") + { + Description = @"", + }; + + private static Option XAi21Key { get; } = new( + name: @"--x-ai21-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(@"proxy-v1-gateway-v1-path-get3", @"Proxy V1 +Catch-all for the Anthropic-compatible surface (``/v1/messages``, etc.). + +Gated on a Tokenwise subscription (OPSS-55); the A/B ``/on`` and ``/off`` arms are +intentionally left ungated."); + command.Arguments.Add(Path); + command.Options.Add(XAi21Key); + + + command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => + await CliRuntime.RunAsync(async () => + { + var path = parseResult.GetRequiredValue(Path); + var xAi21Key = parseResult.GetValue(XAi21Key); + using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); + + + var response = await client.ProxyV1GatewayV1PathGet3Async( + path: path, + xAi21Key: xAi21Key, + cancellationToken: cancellationToken).ConfigureAwait(false); + + + await CliRuntime.WriteResponseAsync( + parseResult, + response, + global::AI21.SourceGenerationContext.Default, + FormatResponse, + cancellationToken).ConfigureAwait(false); + }, cancellationToken).ConfigureAwait(false)); + return command; + } +} \ No newline at end of file diff --git a/src/cli/AI21.CLI/Commands/ProxyV1GatewayV1PathGet4CommandApiCommand.g.cs b/src/cli/AI21.CLI/Commands/ProxyV1GatewayV1PathGet4CommandApiCommand.g.cs new file mode 100644 index 00000000..6e74542b --- /dev/null +++ b/src/cli/AI21.CLI/Commands/ProxyV1GatewayV1PathGet4CommandApiCommand.g.cs @@ -0,0 +1,76 @@ +#nullable enable +#pragma warning disable CS0618 + +using System.CommandLine; + +namespace AI21.CLI.Commands; + +internal static partial class ProxyV1GatewayV1PathGet4CommandApiCommand +{ + private static Argument Path { get; } = new( + name: @"path") + { + Description = @"", + }; + + private static Option XAi21Key { get; } = new( + name: @"--x-ai21-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(@"proxy-v1-gateway-v1-path-get4", @"Proxy V1 +Catch-all for the Anthropic-compatible surface (``/v1/messages``, etc.). + +Gated on a Tokenwise subscription (OPSS-55); the A/B ``/on`` and ``/off`` arms are +intentionally left ungated."); + command.Arguments.Add(Path); + command.Options.Add(XAi21Key); + + + command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => + await CliRuntime.RunAsync(async () => + { + var path = parseResult.GetRequiredValue(Path); + var xAi21Key = parseResult.GetValue(XAi21Key); + using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); + + + var response = await client.ProxyV1GatewayV1PathGet4Async( + path: path, + xAi21Key: xAi21Key, + cancellationToken: cancellationToken).ConfigureAwait(false); + + + await CliRuntime.WriteResponseAsync( + parseResult, + response, + global::AI21.SourceGenerationContext.Default, + FormatResponse, + cancellationToken).ConfigureAwait(false); + }, cancellationToken).ConfigureAwait(false)); + return command; + } +} \ No newline at end of file diff --git a/src/cli/AI21.CLI/Commands/ProxyV1GatewayV1PathGet5CommandApiCommand.g.cs b/src/cli/AI21.CLI/Commands/ProxyV1GatewayV1PathGet5CommandApiCommand.g.cs new file mode 100644 index 00000000..79b20dbf --- /dev/null +++ b/src/cli/AI21.CLI/Commands/ProxyV1GatewayV1PathGet5CommandApiCommand.g.cs @@ -0,0 +1,76 @@ +#nullable enable +#pragma warning disable CS0618 + +using System.CommandLine; + +namespace AI21.CLI.Commands; + +internal static partial class ProxyV1GatewayV1PathGet5CommandApiCommand +{ + private static Argument Path { get; } = new( + name: @"path") + { + Description = @"", + }; + + private static Option XAi21Key { get; } = new( + name: @"--x-ai21-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(@"proxy-v1-gateway-v1-path-get5", @"Proxy V1 +Catch-all for the Anthropic-compatible surface (``/v1/messages``, etc.). + +Gated on a Tokenwise subscription (OPSS-55); the A/B ``/on`` and ``/off`` arms are +intentionally left ungated."); + command.Arguments.Add(Path); + command.Options.Add(XAi21Key); + + + command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => + await CliRuntime.RunAsync(async () => + { + var path = parseResult.GetRequiredValue(Path); + var xAi21Key = parseResult.GetValue(XAi21Key); + using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); + + + var response = await client.ProxyV1GatewayV1PathGet5Async( + path: path, + xAi21Key: xAi21Key, + cancellationToken: cancellationToken).ConfigureAwait(false); + + + await CliRuntime.WriteResponseAsync( + parseResult, + response, + global::AI21.SourceGenerationContext.Default, + FormatResponse, + cancellationToken).ConfigureAwait(false); + }, cancellationToken).ConfigureAwait(false)); + return command; + } +} \ No newline at end of file diff --git a/src/cli/AI21.CLI/Commands/ProxyV1GatewayV1PathGet6CommandApiCommand.g.cs b/src/cli/AI21.CLI/Commands/ProxyV1GatewayV1PathGet6CommandApiCommand.g.cs new file mode 100644 index 00000000..309d8a28 --- /dev/null +++ b/src/cli/AI21.CLI/Commands/ProxyV1GatewayV1PathGet6CommandApiCommand.g.cs @@ -0,0 +1,76 @@ +#nullable enable +#pragma warning disable CS0618 + +using System.CommandLine; + +namespace AI21.CLI.Commands; + +internal static partial class ProxyV1GatewayV1PathGet6CommandApiCommand +{ + private static Argument Path { get; } = new( + name: @"path") + { + Description = @"", + }; + + private static Option XAi21Key { get; } = new( + name: @"--x-ai21-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(@"proxy-v1-gateway-v1-path-get6", @"Proxy V1 +Catch-all for the Anthropic-compatible surface (``/v1/messages``, etc.). + +Gated on a Tokenwise subscription (OPSS-55); the A/B ``/on`` and ``/off`` arms are +intentionally left ungated."); + command.Arguments.Add(Path); + command.Options.Add(XAi21Key); + + + command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => + await CliRuntime.RunAsync(async () => + { + var path = parseResult.GetRequiredValue(Path); + var xAi21Key = parseResult.GetValue(XAi21Key); + using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); + + + var response = await client.ProxyV1GatewayV1PathGet6Async( + path: path, + xAi21Key: xAi21Key, + cancellationToken: cancellationToken).ConfigureAwait(false); + + + await CliRuntime.WriteResponseAsync( + parseResult, + response, + global::AI21.SourceGenerationContext.Default, + FormatResponse, + cancellationToken).ConfigureAwait(false); + }, cancellationToken).ConfigureAwait(false)); + return command; + } +} \ No newline at end of file diff --git a/src/cli/AI21.CLI/Commands/ProxyV1GatewayV1PathGetCommandApiCommand.g.cs b/src/cli/AI21.CLI/Commands/ProxyV1GatewayV1PathGetCommandApiCommand.g.cs new file mode 100644 index 00000000..fc78f7ae --- /dev/null +++ b/src/cli/AI21.CLI/Commands/ProxyV1GatewayV1PathGetCommandApiCommand.g.cs @@ -0,0 +1,76 @@ +#nullable enable +#pragma warning disable CS0618 + +using System.CommandLine; + +namespace AI21.CLI.Commands; + +internal static partial class ProxyV1GatewayV1PathGetCommandApiCommand +{ + private static Argument Path { get; } = new( + name: @"path") + { + Description = @"", + }; + + private static Option XAi21Key { get; } = new( + name: @"--x-ai21-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(@"proxy-v1-gateway-v1-path-get", @"Proxy V1 +Catch-all for the Anthropic-compatible surface (``/v1/messages``, etc.). + +Gated on a Tokenwise subscription (OPSS-55); the A/B ``/on`` and ``/off`` arms are +intentionally left ungated."); + command.Arguments.Add(Path); + command.Options.Add(XAi21Key); + + + command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => + await CliRuntime.RunAsync(async () => + { + var path = parseResult.GetRequiredValue(Path); + var xAi21Key = parseResult.GetValue(XAi21Key); + using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); + + + var response = await client.ProxyV1GatewayV1PathGetAsync( + path: path, + xAi21Key: xAi21Key, + cancellationToken: cancellationToken).ConfigureAwait(false); + + + await CliRuntime.WriteResponseAsync( + parseResult, + response, + global::AI21.SourceGenerationContext.Default, + FormatResponse, + cancellationToken).ConfigureAwait(false); + }, cancellationToken).ConfigureAwait(false)); + return command; + } +} \ No newline at end of file diff --git a/src/cli/AI21.CLI/Commands/ProxyV1TokenwiseV1PathGet2CommandApiCommand.g.cs b/src/cli/AI21.CLI/Commands/ProxyV1TokenwiseV1PathGet2CommandApiCommand.g.cs new file mode 100644 index 00000000..f66914ab --- /dev/null +++ b/src/cli/AI21.CLI/Commands/ProxyV1TokenwiseV1PathGet2CommandApiCommand.g.cs @@ -0,0 +1,76 @@ +#nullable enable +#pragma warning disable CS0618 + +using System.CommandLine; + +namespace AI21.CLI.Commands; + +internal static partial class ProxyV1TokenwiseV1PathGet2CommandApiCommand +{ + private static Argument Path { get; } = new( + name: @"path") + { + Description = @"", + }; + + private static Option XAi21Key { get; } = new( + name: @"--x-ai21-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(@"proxy-v1-tokenwise-v1-path-get2", @"Proxy V1 +Catch-all for the Anthropic-compatible surface (``/v1/messages``, etc.). + +Gated on a Tokenwise subscription (OPSS-55); the A/B ``/on`` and ``/off`` arms are +intentionally left ungated."); + command.Arguments.Add(Path); + command.Options.Add(XAi21Key); + + + command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => + await CliRuntime.RunAsync(async () => + { + var path = parseResult.GetRequiredValue(Path); + var xAi21Key = parseResult.GetValue(XAi21Key); + using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); + + + var response = await client.ProxyV1TokenwiseV1PathGet2Async( + path: path, + xAi21Key: xAi21Key, + cancellationToken: cancellationToken).ConfigureAwait(false); + + + await CliRuntime.WriteResponseAsync( + parseResult, + response, + global::AI21.SourceGenerationContext.Default, + FormatResponse, + cancellationToken).ConfigureAwait(false); + }, cancellationToken).ConfigureAwait(false)); + return command; + } +} \ No newline at end of file diff --git a/src/cli/AI21.CLI/Commands/ProxyV1TokenwiseV1PathGet3CommandApiCommand.g.cs b/src/cli/AI21.CLI/Commands/ProxyV1TokenwiseV1PathGet3CommandApiCommand.g.cs new file mode 100644 index 00000000..739efc64 --- /dev/null +++ b/src/cli/AI21.CLI/Commands/ProxyV1TokenwiseV1PathGet3CommandApiCommand.g.cs @@ -0,0 +1,76 @@ +#nullable enable +#pragma warning disable CS0618 + +using System.CommandLine; + +namespace AI21.CLI.Commands; + +internal static partial class ProxyV1TokenwiseV1PathGet3CommandApiCommand +{ + private static Argument Path { get; } = new( + name: @"path") + { + Description = @"", + }; + + private static Option XAi21Key { get; } = new( + name: @"--x-ai21-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(@"proxy-v1-tokenwise-v1-path-get3", @"Proxy V1 +Catch-all for the Anthropic-compatible surface (``/v1/messages``, etc.). + +Gated on a Tokenwise subscription (OPSS-55); the A/B ``/on`` and ``/off`` arms are +intentionally left ungated."); + command.Arguments.Add(Path); + command.Options.Add(XAi21Key); + + + command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => + await CliRuntime.RunAsync(async () => + { + var path = parseResult.GetRequiredValue(Path); + var xAi21Key = parseResult.GetValue(XAi21Key); + using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); + + + var response = await client.ProxyV1TokenwiseV1PathGet3Async( + path: path, + xAi21Key: xAi21Key, + cancellationToken: cancellationToken).ConfigureAwait(false); + + + await CliRuntime.WriteResponseAsync( + parseResult, + response, + global::AI21.SourceGenerationContext.Default, + FormatResponse, + cancellationToken).ConfigureAwait(false); + }, cancellationToken).ConfigureAwait(false)); + return command; + } +} \ No newline at end of file diff --git a/src/cli/AI21.CLI/Commands/ProxyV1TokenwiseV1PathGet4CommandApiCommand.g.cs b/src/cli/AI21.CLI/Commands/ProxyV1TokenwiseV1PathGet4CommandApiCommand.g.cs new file mode 100644 index 00000000..9671b327 --- /dev/null +++ b/src/cli/AI21.CLI/Commands/ProxyV1TokenwiseV1PathGet4CommandApiCommand.g.cs @@ -0,0 +1,76 @@ +#nullable enable +#pragma warning disable CS0618 + +using System.CommandLine; + +namespace AI21.CLI.Commands; + +internal static partial class ProxyV1TokenwiseV1PathGet4CommandApiCommand +{ + private static Argument Path { get; } = new( + name: @"path") + { + Description = @"", + }; + + private static Option XAi21Key { get; } = new( + name: @"--x-ai21-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(@"proxy-v1-tokenwise-v1-path-get4", @"Proxy V1 +Catch-all for the Anthropic-compatible surface (``/v1/messages``, etc.). + +Gated on a Tokenwise subscription (OPSS-55); the A/B ``/on`` and ``/off`` arms are +intentionally left ungated."); + command.Arguments.Add(Path); + command.Options.Add(XAi21Key); + + + command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => + await CliRuntime.RunAsync(async () => + { + var path = parseResult.GetRequiredValue(Path); + var xAi21Key = parseResult.GetValue(XAi21Key); + using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); + + + var response = await client.ProxyV1TokenwiseV1PathGet4Async( + path: path, + xAi21Key: xAi21Key, + cancellationToken: cancellationToken).ConfigureAwait(false); + + + await CliRuntime.WriteResponseAsync( + parseResult, + response, + global::AI21.SourceGenerationContext.Default, + FormatResponse, + cancellationToken).ConfigureAwait(false); + }, cancellationToken).ConfigureAwait(false)); + return command; + } +} \ No newline at end of file diff --git a/src/cli/AI21.CLI/Commands/ProxyV1TokenwiseV1PathGet5CommandApiCommand.g.cs b/src/cli/AI21.CLI/Commands/ProxyV1TokenwiseV1PathGet5CommandApiCommand.g.cs new file mode 100644 index 00000000..f7aff360 --- /dev/null +++ b/src/cli/AI21.CLI/Commands/ProxyV1TokenwiseV1PathGet5CommandApiCommand.g.cs @@ -0,0 +1,76 @@ +#nullable enable +#pragma warning disable CS0618 + +using System.CommandLine; + +namespace AI21.CLI.Commands; + +internal static partial class ProxyV1TokenwiseV1PathGet5CommandApiCommand +{ + private static Argument Path { get; } = new( + name: @"path") + { + Description = @"", + }; + + private static Option XAi21Key { get; } = new( + name: @"--x-ai21-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(@"proxy-v1-tokenwise-v1-path-get5", @"Proxy V1 +Catch-all for the Anthropic-compatible surface (``/v1/messages``, etc.). + +Gated on a Tokenwise subscription (OPSS-55); the A/B ``/on`` and ``/off`` arms are +intentionally left ungated."); + command.Arguments.Add(Path); + command.Options.Add(XAi21Key); + + + command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => + await CliRuntime.RunAsync(async () => + { + var path = parseResult.GetRequiredValue(Path); + var xAi21Key = parseResult.GetValue(XAi21Key); + using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); + + + var response = await client.ProxyV1TokenwiseV1PathGet5Async( + path: path, + xAi21Key: xAi21Key, + cancellationToken: cancellationToken).ConfigureAwait(false); + + + await CliRuntime.WriteResponseAsync( + parseResult, + response, + global::AI21.SourceGenerationContext.Default, + FormatResponse, + cancellationToken).ConfigureAwait(false); + }, cancellationToken).ConfigureAwait(false)); + return command; + } +} \ No newline at end of file diff --git a/src/cli/AI21.CLI/Commands/ProxyV1TokenwiseV1PathGet6CommandApiCommand.g.cs b/src/cli/AI21.CLI/Commands/ProxyV1TokenwiseV1PathGet6CommandApiCommand.g.cs new file mode 100644 index 00000000..d301283d --- /dev/null +++ b/src/cli/AI21.CLI/Commands/ProxyV1TokenwiseV1PathGet6CommandApiCommand.g.cs @@ -0,0 +1,76 @@ +#nullable enable +#pragma warning disable CS0618 + +using System.CommandLine; + +namespace AI21.CLI.Commands; + +internal static partial class ProxyV1TokenwiseV1PathGet6CommandApiCommand +{ + private static Argument Path { get; } = new( + name: @"path") + { + Description = @"", + }; + + private static Option XAi21Key { get; } = new( + name: @"--x-ai21-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(@"proxy-v1-tokenwise-v1-path-get6", @"Proxy V1 +Catch-all for the Anthropic-compatible surface (``/v1/messages``, etc.). + +Gated on a Tokenwise subscription (OPSS-55); the A/B ``/on`` and ``/off`` arms are +intentionally left ungated."); + command.Arguments.Add(Path); + command.Options.Add(XAi21Key); + + + command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => + await CliRuntime.RunAsync(async () => + { + var path = parseResult.GetRequiredValue(Path); + var xAi21Key = parseResult.GetValue(XAi21Key); + using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); + + + var response = await client.ProxyV1TokenwiseV1PathGet6Async( + path: path, + xAi21Key: xAi21Key, + cancellationToken: cancellationToken).ConfigureAwait(false); + + + await CliRuntime.WriteResponseAsync( + parseResult, + response, + global::AI21.SourceGenerationContext.Default, + FormatResponse, + cancellationToken).ConfigureAwait(false); + }, cancellationToken).ConfigureAwait(false)); + return command; + } +} \ No newline at end of file diff --git a/src/cli/AI21.CLI/Commands/ProxyV1TokenwiseV1PathGetCommandApiCommand.g.cs b/src/cli/AI21.CLI/Commands/ProxyV1TokenwiseV1PathGetCommandApiCommand.g.cs new file mode 100644 index 00000000..6b5c4f75 --- /dev/null +++ b/src/cli/AI21.CLI/Commands/ProxyV1TokenwiseV1PathGetCommandApiCommand.g.cs @@ -0,0 +1,76 @@ +#nullable enable +#pragma warning disable CS0618 + +using System.CommandLine; + +namespace AI21.CLI.Commands; + +internal static partial class ProxyV1TokenwiseV1PathGetCommandApiCommand +{ + private static Argument Path { get; } = new( + name: @"path") + { + Description = @"", + }; + + private static Option XAi21Key { get; } = new( + name: @"--x-ai21-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(@"proxy-v1-tokenwise-v1-path-get", @"Proxy V1 +Catch-all for the Anthropic-compatible surface (``/v1/messages``, etc.). + +Gated on a Tokenwise subscription (OPSS-55); the A/B ``/on`` and ``/off`` arms are +intentionally left ungated."); + command.Arguments.Add(Path); + command.Options.Add(XAi21Key); + + + command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => + await CliRuntime.RunAsync(async () => + { + var path = parseResult.GetRequiredValue(Path); + var xAi21Key = parseResult.GetValue(XAi21Key); + using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); + + + var response = await client.ProxyV1TokenwiseV1PathGetAsync( + path: path, + xAi21Key: xAi21Key, + cancellationToken: cancellationToken).ConfigureAwait(false); + + + await CliRuntime.WriteResponseAsync( + parseResult, + response, + global::AI21.SourceGenerationContext.Default, + FormatResponse, + cancellationToken).ConfigureAwait(false); + }, cancellationToken).ConfigureAwait(false)); + return command; + } +} \ No newline at end of file diff --git a/src/cli/AI21.CLI/Commands/RAGEngineApiGroupCommand.g.cs b/src/cli/AI21.CLI/Commands/RAGEngineApiGroupCommand.g.cs index 6aaeba81..befea3d1 100644 --- a/src/cli/AI21.CLI/Commands/RAGEngineApiGroupCommand.g.cs +++ b/src/cli/AI21.CLI/Commands/RAGEngineApiGroupCommand.g.cs @@ -12,7 +12,6 @@ public static Command Create() command.Subcommands.Add(RagEngineV1LibraryManagementCommandApiCommand.Create()); command.Subcommands.Add(RagEngineV1LibraryManagement2CommandApiCommand.Create()); command.Subcommands.Add(RagEngineV1LibraryManagement3CommandApiCommand.Create()); - command.Subcommands.Add(RagEngineV1LibrarySearchCommandApiCommand.Create()); return command; } } \ No newline at end of file diff --git a/src/cli/AI21.CLI/Commands/RagEngineV1LibrarySearchCommandApiCommand.g.cs b/src/cli/AI21.CLI/Commands/RagEngineV1LibrarySearchCommandApiCommand.g.cs deleted file mode 100644 index cc4a999e..00000000 --- a/src/cli/AI21.CLI/Commands/RagEngineV1LibrarySearchCommandApiCommand.g.cs +++ /dev/null @@ -1,190 +0,0 @@ -#nullable enable -#pragma warning disable CS0618 - -using System.CommandLine; - -namespace AI21.CLI.Commands; - -internal static partial class RagEngineV1LibrarySearchCommandApiCommand -{ - private static Option Query { get; } = new( - name: @"--query") - { - Description = @"", - Required = true, - }; - - private static Option MaxSegments { get; } = new( - name: @"--max-segments") - { - Description = @"", - }; - - private static Option Path { get; } = new( - name: @"--path") - { - Description = @"", - }; - - private static Option?> Labels { get; } = new( - name: @"--labels") - { - Description = @"", - }; - - private static Option LabelsFilter { get; } = new( - name: @"--labels-filter") - { - Description = @"", - }; - - private static Option LabelsFilterMode { get; } = new( - name: @"--labels-filter-mode") - { - Description = @"", - }; - - private static Option?> FileIds { get; } = new( - name: @"--file-ids") - { - Description = @"", - }; - - private static Option RetrievalStrategy { get; } = new( - name: @"--retrieval-strategy") - { - Description = @"", - }; - - private static Option MaxNeighbors { get; } = new( - name: @"--max-neighbors") - { - Description = @"", - }; - - private static Option RetrievalSimilarityThreshold { get; } = new( - name: @"--retrieval-similarity-threshold") - { - Description = @"", - }; - - private static Option HybridSearchAlpha { get; } = new( - name: @"--hybrid-search-alpha") - { - 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(@"v1-library-search", @"Search"); - command.Options.Add(Query); - command.Options.Add(MaxSegments); - command.Options.Add(Path); - command.Options.Add(Labels); - command.Options.Add(LabelsFilter); - command.Options.Add(LabelsFilterMode); - command.Options.Add(FileIds); - command.Options.Add(RetrievalStrategy); - command.Options.Add(MaxNeighbors); - command.Options.Add(RetrievalSimilarityThreshold); - command.Options.Add(HybridSearchAlpha); - 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::AI21.SourceGenerationContext.Default, - cancellationToken).ConfigureAwait(false); - var query = parseResult.GetRequiredValue(Query); - var maxSegments = CliRuntime.WasSpecified(parseResult, MaxSegments) ? parseResult.GetValue(MaxSegments) : (__requestBase is { } __MaxSegmentsBaseValue ? __MaxSegmentsBaseValue.MaxSegments : default); - var path = CliRuntime.WasSpecified(parseResult, Path) ? parseResult.GetValue(Path) : (__requestBase is { } __PathBaseValue ? __PathBaseValue.Path : default); - var labels = CliRuntime.WasSpecified(parseResult, Labels) ? parseResult.GetValue(Labels) : (__requestBase is { } __LabelsBaseValue ? __LabelsBaseValue.Labels : default); - var labelsFilter = CliRuntime.WasSpecified(parseResult, LabelsFilter) ? parseResult.GetValue(LabelsFilter) : (__requestBase is { } __LabelsFilterBaseValue ? __LabelsFilterBaseValue.LabelsFilter : default); - var labelsFilterMode = CliRuntime.WasSpecified(parseResult, LabelsFilterMode) ? parseResult.GetValue(LabelsFilterMode) : (__requestBase is { } __LabelsFilterModeBaseValue ? __LabelsFilterModeBaseValue.LabelsFilterMode : default); - var fileIds = CliRuntime.WasSpecified(parseResult, FileIds) ? parseResult.GetValue(FileIds) : (__requestBase is { } __FileIdsBaseValue ? __FileIdsBaseValue.FileIds : default); - var retrievalStrategy = CliRuntime.WasSpecified(parseResult, RetrievalStrategy) ? parseResult.GetValue(RetrievalStrategy) : (__requestBase is { } __RetrievalStrategyBaseValue ? __RetrievalStrategyBaseValue.RetrievalStrategy : default); - var maxNeighbors = CliRuntime.WasSpecified(parseResult, MaxNeighbors) ? parseResult.GetValue(MaxNeighbors) : (__requestBase is { } __MaxNeighborsBaseValue ? __MaxNeighborsBaseValue.MaxNeighbors : default); - var retrievalSimilarityThreshold = CliRuntime.WasSpecified(parseResult, RetrievalSimilarityThreshold) ? parseResult.GetValue(RetrievalSimilarityThreshold) : (__requestBase is { } __RetrievalSimilarityThresholdBaseValue ? __RetrievalSimilarityThresholdBaseValue.RetrievalSimilarityThreshold : default); - var hybridSearchAlpha = CliRuntime.WasSpecified(parseResult, HybridSearchAlpha) ? parseResult.GetValue(HybridSearchAlpha) : (__requestBase is { } __HybridSearchAlphaBaseValue ? __HybridSearchAlphaBaseValue.HybridSearchAlpha : default); - using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); - - - var response = await client.RagEngine.V1LibrarySearchAsync( - query: query, - maxSegments: maxSegments, - path: path, - labels: labels, - labelsFilter: labelsFilter, - labelsFilterMode: labelsFilterMode, - fileIds: fileIds, - retrievalStrategy: retrievalStrategy, - maxNeighbors: maxNeighbors, - retrievalSimilarityThreshold: retrievalSimilarityThreshold, - hybridSearchAlpha: hybridSearchAlpha, - cancellationToken: cancellationToken).ConfigureAwait(false); - - - await CliRuntime.WriteResponseAsync( - parseResult, - response, - global::AI21.SourceGenerationContext.Default, - FormatResponse, - cancellationToken).ConfigureAwait(false); - }, cancellationToken).ConfigureAwait(false)); - return command; - } -} \ No newline at end of file diff --git a/src/cli/AI21.CLI/Commands/RunSyncStudioV1ConnectorsConnectedUsersDataSourcesSyncsPostCommandApiCommand.g.cs b/src/cli/AI21.CLI/Commands/RunSyncStudioV1ConnectorsConnectedUsersDataSourcesSyncsPostCommandApiCommand.g.cs deleted file mode 100644 index 46c264b3..00000000 --- a/src/cli/AI21.CLI/Commands/RunSyncStudioV1ConnectorsConnectedUsersDataSourcesSyncsPostCommandApiCommand.g.cs +++ /dev/null @@ -1,148 +0,0 @@ -#nullable enable -#pragma warning disable CS0618 - -using System.CommandLine; - -namespace AI21.CLI.Commands; - -internal static partial class RunSyncStudioV1ConnectorsConnectedUsersDataSourcesSyncsPostCommandApiCommand -{ - private static Option Token { get; } = new( - name: @"--token") - { - Description = @"", - Required = true, - }; - - private static Option DataSource { get; } = new( - name: @"--data-source") - { - Description = @"", - Required = true, - }; - - private static Option OrganizationId { get; } = new( - name: @"--organization-id") - { - Description = @"", - Required = true, - }; - - private static Option Pipeline { get; } = new( - name: @"--pipeline") - { - Description = @"", - Required = true, - }; - - private static Option Configuration { get; } = new( - name: @"--configuration") - { - Description = @"", - }; - - private static Option ConfigurationName { get; } = new( - name: @"--configuration-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, 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(@"run-sync-studio-v1-connectors-connected-users-data-sources-syncs-post", @"Run Sync"); - command.Options.Add(Token); - command.Options.Add(DataSource); - command.Options.Add(OrganizationId); - command.Options.Add(Pipeline); - command.Options.Add(Configuration); - command.Options.Add(ConfigurationName); - 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::AI21.SourceGenerationContext.Default, - cancellationToken).ConfigureAwait(false); - var token = parseResult.GetRequiredValue(Token); - var dataSource = parseResult.GetRequiredValue(DataSource); - var organizationId = parseResult.GetRequiredValue(OrganizationId); - var pipeline = parseResult.GetRequiredValue(Pipeline); - var configuration = CliRuntime.WasSpecified(parseResult, Configuration) ? parseResult.GetValue(Configuration) : (__requestBase is { } __ConfigurationBaseValue ? __ConfigurationBaseValue.Configuration : default); - var configurationName = CliRuntime.WasSpecified(parseResult, ConfigurationName) ? parseResult.GetValue(ConfigurationName) : (__requestBase is { } __ConfigurationNameBaseValue ? __ConfigurationNameBaseValue.ConfigurationName : default); - using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); - - - var response = await client.RunSyncStudioV1ConnectorsConnectedUsersDataSourcesSyncsPostAsync( - token: token, - dataSource: dataSource, - organizationId: organizationId, - pipeline: pipeline, - configuration: configuration, - configurationName: configurationName, - cancellationToken: cancellationToken).ConfigureAwait(false); - - - await CliRuntime.WriteResponseAsync( - parseResult, - response, - global::AI21.SourceGenerationContext.Default, - FormatResponse, - cancellationToken).ConfigureAwait(false); - }, cancellationToken).ConfigureAwait(false)); - return command; - } -} \ No newline at end of file diff --git a/src/cli/AI21.CLI/Commands/RunWorkflowStudioV1ConnectorsConnectedUsersEntityIdDataSourcesDataSourceWorkflowsWorkflowNameRunPostCommandApiCommand.g.cs b/src/cli/AI21.CLI/Commands/RunWorkflowStudioV1ConnectorsConnectedUsersEntityIdDataSourcesDataSourceWorkflowsWorkflowNameRunPostCommandApiCommand.g.cs deleted file mode 100644 index 0b12a7ea..00000000 --- a/src/cli/AI21.CLI/Commands/RunWorkflowStudioV1ConnectorsConnectedUsersEntityIdDataSourcesDataSourceWorkflowsWorkflowNameRunPostCommandApiCommand.g.cs +++ /dev/null @@ -1,81 +0,0 @@ -#nullable enable -#pragma warning disable CS0618 - -using System.CommandLine; - -namespace AI21.CLI.Commands; - -internal static partial class RunWorkflowStudioV1ConnectorsConnectedUsersEntityIdDataSourcesDataSourceWorkflowsWorkflowNameRunPostCommandApiCommand -{ - private static Argument EntityId { get; } = new( - name: @"entity-id") - { - Description = @"", - }; - - private static Argument DataSource { get; } = new( - name: @"data-source") - { - Description = @"", - }; - - private static Argument WorkflowName { get; } = new( - name: @"workflow-name") - { - 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(@"run-workflow-studio-v1-connectors-connected-users-entity-id-data-sources-data-source-workflows-workflow-name-run-post", @"Run Workflow"); - command.Arguments.Add(EntityId); - command.Arguments.Add(DataSource); - command.Arguments.Add(WorkflowName); - - - command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => - await CliRuntime.RunAsync(async () => - { - var entityId = parseResult.GetRequiredValue(EntityId); - var dataSource = parseResult.GetRequiredValue(DataSource); - var workflowName = parseResult.GetRequiredValue(WorkflowName); - using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); - - - var response = await client.RunWorkflowStudioV1ConnectorsConnectedUsersEntityIdDataSourcesDataSourceWorkflowsWorkflowNameRunPostAsync( - entityId: entityId, - dataSource: dataSource, - workflowName: workflowName, - cancellationToken: cancellationToken).ConfigureAwait(false); - - - await CliRuntime.WriteResponseAsync( - parseResult, - response, - global::AI21.SourceGenerationContext.Default, - FormatResponse, - cancellationToken).ConfigureAwait(false); - }, cancellationToken).ConfigureAwait(false)); - return command; - } -} \ No newline at end of file diff --git a/src/cli/AI21.CLI/Commands/SyncWebsiteStudioV1ConnectorsWebsiteConnectorIdSyncPostCommandApiCommand.g.cs b/src/cli/AI21.CLI/Commands/SyncWebsiteStudioV1ConnectorsWebsiteConnectorIdSyncPostCommandApiCommand.g.cs deleted file mode 100644 index b315b1a3..00000000 --- a/src/cli/AI21.CLI/Commands/SyncWebsiteStudioV1ConnectorsWebsiteConnectorIdSyncPostCommandApiCommand.g.cs +++ /dev/null @@ -1,63 +0,0 @@ -#nullable enable -#pragma warning disable CS0618 - -using System.CommandLine; - -namespace AI21.CLI.Commands; - -internal static partial class SyncWebsiteStudioV1ConnectorsWebsiteConnectorIdSyncPostCommandApiCommand -{ - private static Argument ConnectorId { get; } = new( - name: @"connector-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(@"sync-website-studio-v1-connectors-website-connector-id-sync-post", @"Sync Website"); - command.Arguments.Add(ConnectorId); - - - command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => - await CliRuntime.RunAsync(async () => - { - var connectorId = parseResult.GetRequiredValue(ConnectorId); - using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); - - - var response = await client.SyncWebsiteStudioV1ConnectorsWebsiteConnectorIdSyncPostAsync( - connectorId: connectorId, - cancellationToken: cancellationToken).ConfigureAwait(false); - - - await CliRuntime.WriteResponseAsync( - parseResult, - response, - global::AI21.SourceGenerationContext.Default, - FormatResponse, - cancellationToken).ConfigureAwait(false); - }, cancellationToken).ConfigureAwait(false)); - return command; - } -} \ No newline at end of file diff --git a/src/cli/AI21.CLI/Commands/TlvConvragPrefixPreviewSolutionsPreviewTlvMunicipalityConvragPostCommandApiCommand.g.cs b/src/cli/AI21.CLI/Commands/TlvConvragPrefixPreviewSolutionsPreviewTlvMunicipalityConvragPostCommandApiCommand.g.cs deleted file mode 100644 index 30166378..00000000 --- a/src/cli/AI21.CLI/Commands/TlvConvragPrefixPreviewSolutionsPreviewTlvMunicipalityConvragPostCommandApiCommand.g.cs +++ /dev/null @@ -1,59 +0,0 @@ -#nullable enable -#pragma warning disable CS0618 - -using System.CommandLine; - -namespace AI21.CLI.Commands; - -internal static partial class TlvConvragPrefixPreviewSolutionsPreviewTlvMunicipalityConvragPostCommandApiCommand -{ - - - 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(@"tlv-convrag-prefix-preview-solutions-preview-tlv-municipality-convrag-post", @"Tlv Convrag Prefix Preview"); - - - - 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.TlvConvragPrefixPreviewSolutionsPreviewTlvMunicipalityConvragPostAsync( - - cancellationToken: cancellationToken).ConfigureAwait(false); - - - await CliRuntime.WriteResponseAsync( - parseResult, - response, - global::AI21.SourceGenerationContext.Default, - FormatResponse, - cancellationToken).ConfigureAwait(false); - }, cancellationToken).ConfigureAwait(false)); - return command; - } -} \ No newline at end of file diff --git a/src/cli/AI21.CLI/Commands/TlvConvragSolutionsTlvMunicipalityConvragPostCommandApiCommand.g.cs b/src/cli/AI21.CLI/Commands/TlvConvragSolutionsTlvMunicipalityConvragPostCommandApiCommand.g.cs deleted file mode 100644 index c745d6ad..00000000 --- a/src/cli/AI21.CLI/Commands/TlvConvragSolutionsTlvMunicipalityConvragPostCommandApiCommand.g.cs +++ /dev/null @@ -1,59 +0,0 @@ -#nullable enable -#pragma warning disable CS0618 - -using System.CommandLine; - -namespace AI21.CLI.Commands; - -internal static partial class TlvConvragSolutionsTlvMunicipalityConvragPostCommandApiCommand -{ - - - 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(@"tlv-convrag-solutions-tlv-municipality-convrag-post", @"Tlv Convrag"); - - - - 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.TlvConvragSolutionsTlvMunicipalityConvragPostAsync( - - cancellationToken: cancellationToken).ConfigureAwait(false); - - - await CliRuntime.WriteResponseAsync( - parseResult, - response, - global::AI21.SourceGenerationContext.Default, - FormatResponse, - cancellationToken).ConfigureAwait(false); - }, cancellationToken).ConfigureAwait(false)); - return command; - } -} \ No newline at end of file diff --git a/src/cli/AI21.CLI/Commands/UpdateAgentGatewaySettingsAgentsAgentIdPutCommandApiCommand.g.cs b/src/cli/AI21.CLI/Commands/UpdateAgentGatewaySettingsAgentsAgentIdPutCommandApiCommand.g.cs new file mode 100644 index 00000000..abb3655a --- /dev/null +++ b/src/cli/AI21.CLI/Commands/UpdateAgentGatewaySettingsAgentsAgentIdPutCommandApiCommand.g.cs @@ -0,0 +1,113 @@ +#nullable enable +#pragma warning disable CS0618 + +using System.CommandLine; + +namespace AI21.CLI.Commands; + +internal static partial class UpdateAgentGatewaySettingsAgentsAgentIdPutCommandApiCommand +{ + private static Argument AgentId { get; } = new( + name: @"agent-id") + { + Description = @"", + }; + private static readonly AgentUpdateOptionSet AgentUpdateOptionSetOptions = AgentUpdateOptionSet.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::AI21.AgentOut value, global::System.Text.Json.Serialization.JsonSerializerContext context, bool truncateLongStrings) + { + string? text = null; + CustomizeResponseText(parseResult, value, ref text); + if (!string.IsNullOrWhiteSpace(text)) + { + return text; + } + + var hints = new Dictionary(StringComparer.OrdinalIgnoreCase) + { + }; + CustomizeResponseFormatHints(hints); + return CliRuntime.FormatHumanReadable(value, context, truncateLongStrings, hints); + } + + static partial void CustomizeResponseText(ParseResult parseResult, global::AI21.AgentOut value, ref string? text); + static partial void CustomizeResponseFormatHints(Dictionary hints); + + + public static Command Create() + { + var command = new Command(@"update-agent-gateway-settings-agents-agent-id-put", @"Update Agent"); + command.Arguments.Add(AgentId); command.Options.Add(AgentUpdateOptionSetOptions.NameOption); + command.Options.Add(AgentUpdateOptionSetOptions.Kind); + command.Options.Add(AgentUpdateOptionSetOptions.DescriptionOption); + command.Options.Add(AgentUpdateOptionSetOptions.ConfigId); + command.Options.Add(AgentUpdateOptionSetOptions.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::AI21.SourceGenerationContext.Default, + cancellationToken).ConfigureAwait(false); + var agentId = parseResult.GetRequiredValue(AgentId); var name = CliRuntime.WasSpecified(parseResult, AgentUpdateOptionSetOptions.NameOption) ? parseResult.GetValue(AgentUpdateOptionSetOptions.NameOption) : (__requestBase is { } __NameBaseValue ? __NameBaseValue.Name : default); + var kind = CliRuntime.WasSpecified(parseResult, AgentUpdateOptionSetOptions.Kind) ? parseResult.GetValue(AgentUpdateOptionSetOptions.Kind) : (__requestBase is { } __KindBaseValue ? __KindBaseValue.Kind : default); + var description = CliRuntime.WasSpecified(parseResult, AgentUpdateOptionSetOptions.DescriptionOption) ? parseResult.GetValue(AgentUpdateOptionSetOptions.DescriptionOption) : (__requestBase is { } __DescriptionBaseValue ? __DescriptionBaseValue.Description : default); + var configId = CliRuntime.WasSpecified(parseResult, AgentUpdateOptionSetOptions.ConfigId) ? parseResult.GetValue(AgentUpdateOptionSetOptions.ConfigId) : (__requestBase is { } __ConfigIdBaseValue ? __ConfigIdBaseValue.ConfigId : default); + var enabled = CliRuntime.WasSpecified(parseResult, AgentUpdateOptionSetOptions.Enabled) ? parseResult.GetValue(AgentUpdateOptionSetOptions.Enabled) : (__requestBase is { } __EnabledBaseValue ? __EnabledBaseValue.Enabled : default); + using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); + + + var response = await client.UpdateAgentGatewaySettingsAgentsAgentIdPutAsync( + agentId: agentId, + name: name, + kind: kind, + description: description, + configId: configId, + enabled: enabled, + cancellationToken: cancellationToken).ConfigureAwait(false); + + + await CliRuntime.WriteResponseAsync( + parseResult, + response, + global::AI21.SourceGenerationContext.Default, + FormatResponse, + cancellationToken).ConfigureAwait(false); + }, cancellationToken).ConfigureAwait(false)); + return command; + } +} \ No newline at end of file diff --git a/src/cli/AI21.CLI/Commands/UpdateAgentTokenwiseSettingsAgentsAgentIdPutCommandApiCommand.g.cs b/src/cli/AI21.CLI/Commands/UpdateAgentTokenwiseSettingsAgentsAgentIdPutCommandApiCommand.g.cs new file mode 100644 index 00000000..881b8a44 --- /dev/null +++ b/src/cli/AI21.CLI/Commands/UpdateAgentTokenwiseSettingsAgentsAgentIdPutCommandApiCommand.g.cs @@ -0,0 +1,113 @@ +#nullable enable +#pragma warning disable CS0618 + +using System.CommandLine; + +namespace AI21.CLI.Commands; + +internal static partial class UpdateAgentTokenwiseSettingsAgentsAgentIdPutCommandApiCommand +{ + private static Argument AgentId { get; } = new( + name: @"agent-id") + { + Description = @"", + }; + private static readonly AgentUpdateOptionSet AgentUpdateOptionSetOptions = AgentUpdateOptionSet.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::AI21.AgentOut value, global::System.Text.Json.Serialization.JsonSerializerContext context, bool truncateLongStrings) + { + string? text = null; + CustomizeResponseText(parseResult, value, ref text); + if (!string.IsNullOrWhiteSpace(text)) + { + return text; + } + + var hints = new Dictionary(StringComparer.OrdinalIgnoreCase) + { + }; + CustomizeResponseFormatHints(hints); + return CliRuntime.FormatHumanReadable(value, context, truncateLongStrings, hints); + } + + static partial void CustomizeResponseText(ParseResult parseResult, global::AI21.AgentOut value, ref string? text); + static partial void CustomizeResponseFormatHints(Dictionary hints); + + + public static Command Create() + { + var command = new Command(@"update-agent-tokenwise-settings-agents-agent-id-put", @"Update Agent"); + command.Arguments.Add(AgentId); command.Options.Add(AgentUpdateOptionSetOptions.NameOption); + command.Options.Add(AgentUpdateOptionSetOptions.Kind); + command.Options.Add(AgentUpdateOptionSetOptions.DescriptionOption); + command.Options.Add(AgentUpdateOptionSetOptions.ConfigId); + command.Options.Add(AgentUpdateOptionSetOptions.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::AI21.SourceGenerationContext.Default, + cancellationToken).ConfigureAwait(false); + var agentId = parseResult.GetRequiredValue(AgentId); var name = CliRuntime.WasSpecified(parseResult, AgentUpdateOptionSetOptions.NameOption) ? parseResult.GetValue(AgentUpdateOptionSetOptions.NameOption) : (__requestBase is { } __NameBaseValue ? __NameBaseValue.Name : default); + var kind = CliRuntime.WasSpecified(parseResult, AgentUpdateOptionSetOptions.Kind) ? parseResult.GetValue(AgentUpdateOptionSetOptions.Kind) : (__requestBase is { } __KindBaseValue ? __KindBaseValue.Kind : default); + var description = CliRuntime.WasSpecified(parseResult, AgentUpdateOptionSetOptions.DescriptionOption) ? parseResult.GetValue(AgentUpdateOptionSetOptions.DescriptionOption) : (__requestBase is { } __DescriptionBaseValue ? __DescriptionBaseValue.Description : default); + var configId = CliRuntime.WasSpecified(parseResult, AgentUpdateOptionSetOptions.ConfigId) ? parseResult.GetValue(AgentUpdateOptionSetOptions.ConfigId) : (__requestBase is { } __ConfigIdBaseValue ? __ConfigIdBaseValue.ConfigId : default); + var enabled = CliRuntime.WasSpecified(parseResult, AgentUpdateOptionSetOptions.Enabled) ? parseResult.GetValue(AgentUpdateOptionSetOptions.Enabled) : (__requestBase is { } __EnabledBaseValue ? __EnabledBaseValue.Enabled : default); + using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); + + + var response = await client.UpdateAgentTokenwiseSettingsAgentsAgentIdPutAsync( + agentId: agentId, + name: name, + kind: kind, + description: description, + configId: configId, + enabled: enabled, + cancellationToken: cancellationToken).ConfigureAwait(false); + + + await CliRuntime.WriteResponseAsync( + parseResult, + response, + global::AI21.SourceGenerationContext.Default, + FormatResponse, + cancellationToken).ConfigureAwait(false); + }, cancellationToken).ConfigureAwait(false)); + return command; + } +} \ No newline at end of file diff --git a/src/cli/AI21.CLI/Commands/UpdateConfigGatewaySettingsConfigsConfigIdPutCommandApiCommand.g.cs b/src/cli/AI21.CLI/Commands/UpdateConfigGatewaySettingsConfigsConfigIdPutCommandApiCommand.g.cs new file mode 100644 index 00000000..1c8e4c17 --- /dev/null +++ b/src/cli/AI21.CLI/Commands/UpdateConfigGatewaySettingsConfigsConfigIdPutCommandApiCommand.g.cs @@ -0,0 +1,116 @@ +#nullable enable +#pragma warning disable CS0618 + +using System.CommandLine; + +namespace AI21.CLI.Commands; + +internal static partial class UpdateConfigGatewaySettingsConfigsConfigIdPutCommandApiCommand +{ + private static Argument ConfigId { get; } = new( + name: @"config-id") + { + Description = @"", + }; + + private static Option Overrides { get; } = new( + name: @"--overrides") + { + Description = @"", + }; + private static readonly ConfigProfileUpdateOptionSet ConfigProfileUpdateOptionSetOptions = ConfigProfileUpdateOptionSet.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::AI21.ConfigProfileOut value, global::System.Text.Json.Serialization.JsonSerializerContext context, bool truncateLongStrings) + { + string? text = null; + CustomizeResponseText(parseResult, value, ref text); + if (!string.IsNullOrWhiteSpace(text)) + { + return text; + } + + var hints = new Dictionary(StringComparer.OrdinalIgnoreCase) + { + }; + CustomizeResponseFormatHints(hints); + return CliRuntime.FormatHumanReadable(value, context, truncateLongStrings, hints); + } + + static partial void CustomizeResponseText(ParseResult parseResult, global::AI21.ConfigProfileOut value, ref string? text); + static partial void CustomizeResponseFormatHints(Dictionary hints); + + + public static Command Create() + { + var command = new Command(@"update-config-gateway-settings-configs-config-id-put", @"Update Config"); + command.Arguments.Add(ConfigId); + command.Options.Add(Overrides); command.Options.Add(ConfigProfileUpdateOptionSetOptions.NameOption); + command.Options.Add(ConfigProfileUpdateOptionSetOptions.DescriptionOption); + command.Options.Add(ConfigProfileUpdateOptionSetOptions.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::AI21.SourceGenerationContext.Default, + cancellationToken).ConfigureAwait(false); + var configId = parseResult.GetRequiredValue(ConfigId); + var overrides = CliRuntime.WasSpecified(parseResult, Overrides) ? parseResult.GetValue(Overrides) : (__requestBase is { } __OverridesBaseValue ? __OverridesBaseValue.Overrides : default); var name = CliRuntime.WasSpecified(parseResult, ConfigProfileUpdateOptionSetOptions.NameOption) ? parseResult.GetValue(ConfigProfileUpdateOptionSetOptions.NameOption) : (__requestBase is { } __NameBaseValue ? __NameBaseValue.Name : default); + var description = CliRuntime.WasSpecified(parseResult, ConfigProfileUpdateOptionSetOptions.DescriptionOption) ? parseResult.GetValue(ConfigProfileUpdateOptionSetOptions.DescriptionOption) : (__requestBase is { } __DescriptionBaseValue ? __DescriptionBaseValue.Description : default); + var enabled = CliRuntime.WasSpecified(parseResult, ConfigProfileUpdateOptionSetOptions.Enabled) ? parseResult.GetValue(ConfigProfileUpdateOptionSetOptions.Enabled) : (__requestBase is { } __EnabledBaseValue ? __EnabledBaseValue.Enabled : default); + using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); + + + var response = await client.UpdateConfigGatewaySettingsConfigsConfigIdPutAsync( + configId: configId, + overrides: overrides, + name: name, + description: description, + enabled: enabled, + cancellationToken: cancellationToken).ConfigureAwait(false); + + + await CliRuntime.WriteResponseAsync( + parseResult, + response, + global::AI21.SourceGenerationContext.Default, + FormatResponse, + cancellationToken).ConfigureAwait(false); + }, cancellationToken).ConfigureAwait(false)); + return command; + } +} \ No newline at end of file diff --git a/src/cli/AI21.CLI/Commands/UpdateConfigTokenwiseSettingsConfigsConfigIdPutCommandApiCommand.g.cs b/src/cli/AI21.CLI/Commands/UpdateConfigTokenwiseSettingsConfigsConfigIdPutCommandApiCommand.g.cs new file mode 100644 index 00000000..49073b2c --- /dev/null +++ b/src/cli/AI21.CLI/Commands/UpdateConfigTokenwiseSettingsConfigsConfigIdPutCommandApiCommand.g.cs @@ -0,0 +1,116 @@ +#nullable enable +#pragma warning disable CS0618 + +using System.CommandLine; + +namespace AI21.CLI.Commands; + +internal static partial class UpdateConfigTokenwiseSettingsConfigsConfigIdPutCommandApiCommand +{ + private static Argument ConfigId { get; } = new( + name: @"config-id") + { + Description = @"", + }; + + private static Option Overrides { get; } = new( + name: @"--overrides") + { + Description = @"", + }; + private static readonly ConfigProfileUpdateOptionSet ConfigProfileUpdateOptionSetOptions = ConfigProfileUpdateOptionSet.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::AI21.ConfigProfileOut value, global::System.Text.Json.Serialization.JsonSerializerContext context, bool truncateLongStrings) + { + string? text = null; + CustomizeResponseText(parseResult, value, ref text); + if (!string.IsNullOrWhiteSpace(text)) + { + return text; + } + + var hints = new Dictionary(StringComparer.OrdinalIgnoreCase) + { + }; + CustomizeResponseFormatHints(hints); + return CliRuntime.FormatHumanReadable(value, context, truncateLongStrings, hints); + } + + static partial void CustomizeResponseText(ParseResult parseResult, global::AI21.ConfigProfileOut value, ref string? text); + static partial void CustomizeResponseFormatHints(Dictionary hints); + + + public static Command Create() + { + var command = new Command(@"update-config-tokenwise-settings-configs-config-id-put", @"Update Config"); + command.Arguments.Add(ConfigId); + command.Options.Add(Overrides); command.Options.Add(ConfigProfileUpdateOptionSetOptions.NameOption); + command.Options.Add(ConfigProfileUpdateOptionSetOptions.DescriptionOption); + command.Options.Add(ConfigProfileUpdateOptionSetOptions.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::AI21.SourceGenerationContext.Default, + cancellationToken).ConfigureAwait(false); + var configId = parseResult.GetRequiredValue(ConfigId); + var overrides = CliRuntime.WasSpecified(parseResult, Overrides) ? parseResult.GetValue(Overrides) : (__requestBase is { } __OverridesBaseValue ? __OverridesBaseValue.Overrides : default); var name = CliRuntime.WasSpecified(parseResult, ConfigProfileUpdateOptionSetOptions.NameOption) ? parseResult.GetValue(ConfigProfileUpdateOptionSetOptions.NameOption) : (__requestBase is { } __NameBaseValue ? __NameBaseValue.Name : default); + var description = CliRuntime.WasSpecified(parseResult, ConfigProfileUpdateOptionSetOptions.DescriptionOption) ? parseResult.GetValue(ConfigProfileUpdateOptionSetOptions.DescriptionOption) : (__requestBase is { } __DescriptionBaseValue ? __DescriptionBaseValue.Description : default); + var enabled = CliRuntime.WasSpecified(parseResult, ConfigProfileUpdateOptionSetOptions.Enabled) ? parseResult.GetValue(ConfigProfileUpdateOptionSetOptions.Enabled) : (__requestBase is { } __EnabledBaseValue ? __EnabledBaseValue.Enabled : default); + using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); + + + var response = await client.UpdateConfigTokenwiseSettingsConfigsConfigIdPutAsync( + configId: configId, + overrides: overrides, + name: name, + description: description, + enabled: enabled, + cancellationToken: cancellationToken).ConfigureAwait(false); + + + await CliRuntime.WriteResponseAsync( + parseResult, + response, + global::AI21.SourceGenerationContext.Default, + FormatResponse, + cancellationToken).ConfigureAwait(false); + }, cancellationToken).ConfigureAwait(false)); + return command; + } +} \ No newline at end of file diff --git a/src/cli/AI21.CLI/Commands/V1SolutionsFdBatchesV1ClassificationsCommandApiCommand.g.cs b/src/cli/AI21.CLI/Commands/V1SolutionsFdBatchesV1ClassificationsCommandApiCommand.g.cs new file mode 100644 index 00000000..8e11870a --- /dev/null +++ b/src/cli/AI21.CLI/Commands/V1SolutionsFdBatchesV1ClassificationsCommandApiCommand.g.cs @@ -0,0 +1,59 @@ +#nullable enable +#pragma warning disable CS0618 + +using System.CommandLine; + +namespace AI21.CLI.Commands; + +internal static partial class V1SolutionsFdBatchesV1ClassificationsCommandApiCommand +{ + + + 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(@"v1-solutions-fd-batches-v1-classifications", @"Fnac Batch Classifications"); + + + + 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.V1SolutionsFdBatchesV1ClassificationsAsync( + + cancellationToken: cancellationToken).ConfigureAwait(false); + + + await CliRuntime.WriteResponseAsync( + parseResult, + response, + global::AI21.SourceGenerationContext.Default, + FormatResponse, + cancellationToken).ConfigureAwait(false); + }, cancellationToken).ConfigureAwait(false)); + return command; + } +} \ No newline at end of file diff --git a/src/cli/AI21.CLI/Commands/V1SolutionsFdBatchesV1ClassificationsResultsCommandApiCommand.g.cs b/src/cli/AI21.CLI/Commands/V1SolutionsFdBatchesV1ClassificationsResultsCommandApiCommand.g.cs new file mode 100644 index 00000000..41185935 --- /dev/null +++ b/src/cli/AI21.CLI/Commands/V1SolutionsFdBatchesV1ClassificationsResultsCommandApiCommand.g.cs @@ -0,0 +1,63 @@ +#nullable enable +#pragma warning disable CS0618 + +using System.CommandLine; + +namespace AI21.CLI.Commands; + +internal static partial class V1SolutionsFdBatchesV1ClassificationsResultsCommandApiCommand +{ + private static Argument BatchId { get; } = new( + name: @"batch-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(@"v1-solutions-fd-batches-v1-classifications-results", @"Fnac Batch Classifications Results"); + command.Arguments.Add(BatchId); + + + command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => + await CliRuntime.RunAsync(async () => + { + var batchId = parseResult.GetRequiredValue(BatchId); + using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); + + + var response = await client.V1SolutionsFdBatchesV1ClassificationsResultsAsync( + batchId: batchId, + cancellationToken: cancellationToken).ConfigureAwait(false); + + + await CliRuntime.WriteResponseAsync( + parseResult, + response, + global::AI21.SourceGenerationContext.Default, + FormatResponse, + cancellationToken).ConfigureAwait(false); + }, cancellationToken).ConfigureAwait(false)); + return command; + } +} \ No newline at end of file diff --git a/src/cli/AI21.CLI/Commands/V1SolutionsFdBatchesV1ClassificationsStatusCommandApiCommand.g.cs b/src/cli/AI21.CLI/Commands/V1SolutionsFdBatchesV1ClassificationsStatusCommandApiCommand.g.cs new file mode 100644 index 00000000..de762bac --- /dev/null +++ b/src/cli/AI21.CLI/Commands/V1SolutionsFdBatchesV1ClassificationsStatusCommandApiCommand.g.cs @@ -0,0 +1,63 @@ +#nullable enable +#pragma warning disable CS0618 + +using System.CommandLine; + +namespace AI21.CLI.Commands; + +internal static partial class V1SolutionsFdBatchesV1ClassificationsStatusCommandApiCommand +{ + private static Argument BatchId { get; } = new( + name: @"batch-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(@"v1-solutions-fd-batches-v1-classifications-status", @"Fnac Batch Classifications Status"); + command.Arguments.Add(BatchId); + + + command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => + await CliRuntime.RunAsync(async () => + { + var batchId = parseResult.GetRequiredValue(BatchId); + using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); + + + var response = await client.V1SolutionsFdBatchesV1ClassificationsStatusAsync( + batchId: batchId, + cancellationToken: cancellationToken).ConfigureAwait(false); + + + await CliRuntime.WriteResponseAsync( + parseResult, + response, + global::AI21.SourceGenerationContext.Default, + FormatResponse, + cancellationToken).ConfigureAwait(false); + }, cancellationToken).ConfigureAwait(false)); + return command; + } +} \ No newline at end of file diff --git a/src/cli/AI21.CLI/Commands/V1SolutionsFdBatchesV1DescriptionsCommandApiCommand.g.cs b/src/cli/AI21.CLI/Commands/V1SolutionsFdBatchesV1DescriptionsCommandApiCommand.g.cs new file mode 100644 index 00000000..f72fdbea --- /dev/null +++ b/src/cli/AI21.CLI/Commands/V1SolutionsFdBatchesV1DescriptionsCommandApiCommand.g.cs @@ -0,0 +1,59 @@ +#nullable enable +#pragma warning disable CS0618 + +using System.CommandLine; + +namespace AI21.CLI.Commands; + +internal static partial class V1SolutionsFdBatchesV1DescriptionsCommandApiCommand +{ + + + 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(@"v1-solutions-fd-batches-v1-descriptions", @"Fnac Batch Descriptions"); + + + + 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.V1SolutionsFdBatchesV1DescriptionsAsync( + + cancellationToken: cancellationToken).ConfigureAwait(false); + + + await CliRuntime.WriteResponseAsync( + parseResult, + response, + global::AI21.SourceGenerationContext.Default, + FormatResponse, + cancellationToken).ConfigureAwait(false); + }, cancellationToken).ConfigureAwait(false)); + return command; + } +} \ No newline at end of file diff --git a/src/cli/AI21.CLI/Commands/V1SolutionsFdBatchesV1DescriptionsResultsCommandApiCommand.g.cs b/src/cli/AI21.CLI/Commands/V1SolutionsFdBatchesV1DescriptionsResultsCommandApiCommand.g.cs new file mode 100644 index 00000000..a3b80111 --- /dev/null +++ b/src/cli/AI21.CLI/Commands/V1SolutionsFdBatchesV1DescriptionsResultsCommandApiCommand.g.cs @@ -0,0 +1,63 @@ +#nullable enable +#pragma warning disable CS0618 + +using System.CommandLine; + +namespace AI21.CLI.Commands; + +internal static partial class V1SolutionsFdBatchesV1DescriptionsResultsCommandApiCommand +{ + private static Argument BatchId { get; } = new( + name: @"batch-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(@"v1-solutions-fd-batches-v1-descriptions-results", @"Fnac Batch Descriptions Results"); + command.Arguments.Add(BatchId); + + + command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => + await CliRuntime.RunAsync(async () => + { + var batchId = parseResult.GetRequiredValue(BatchId); + using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); + + + var response = await client.V1SolutionsFdBatchesV1DescriptionsResultsAsync( + batchId: batchId, + cancellationToken: cancellationToken).ConfigureAwait(false); + + + await CliRuntime.WriteResponseAsync( + parseResult, + response, + global::AI21.SourceGenerationContext.Default, + FormatResponse, + cancellationToken).ConfigureAwait(false); + }, cancellationToken).ConfigureAwait(false)); + return command; + } +} \ No newline at end of file diff --git a/src/cli/AI21.CLI/Commands/V1SolutionsFdBatchesV1DescriptionsStatusCommandApiCommand.g.cs b/src/cli/AI21.CLI/Commands/V1SolutionsFdBatchesV1DescriptionsStatusCommandApiCommand.g.cs new file mode 100644 index 00000000..cd85b390 --- /dev/null +++ b/src/cli/AI21.CLI/Commands/V1SolutionsFdBatchesV1DescriptionsStatusCommandApiCommand.g.cs @@ -0,0 +1,63 @@ +#nullable enable +#pragma warning disable CS0618 + +using System.CommandLine; + +namespace AI21.CLI.Commands; + +internal static partial class V1SolutionsFdBatchesV1DescriptionsStatusCommandApiCommand +{ + private static Argument BatchId { get; } = new( + name: @"batch-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(@"v1-solutions-fd-batches-v1-descriptions-status", @"Fnac Batch Descriptions Status"); + command.Arguments.Add(BatchId); + + + command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => + await CliRuntime.RunAsync(async () => + { + var batchId = parseResult.GetRequiredValue(BatchId); + using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); + + + var response = await client.V1SolutionsFdBatchesV1DescriptionsStatusAsync( + batchId: batchId, + cancellationToken: cancellationToken).ConfigureAwait(false); + + + await CliRuntime.WriteResponseAsync( + parseResult, + response, + global::AI21.SourceGenerationContext.Default, + FormatResponse, + cancellationToken).ConfigureAwait(false); + }, cancellationToken).ConfigureAwait(false)); + return command; + } +} \ No newline at end of file diff --git a/src/cli/AI21.CLI/Commands/V1SolutionsFdPreviewBatchesV1ClassificationsCommandApiCommand.g.cs b/src/cli/AI21.CLI/Commands/V1SolutionsFdPreviewBatchesV1ClassificationsCommandApiCommand.g.cs new file mode 100644 index 00000000..2300ea7e --- /dev/null +++ b/src/cli/AI21.CLI/Commands/V1SolutionsFdPreviewBatchesV1ClassificationsCommandApiCommand.g.cs @@ -0,0 +1,59 @@ +#nullable enable +#pragma warning disable CS0618 + +using System.CommandLine; + +namespace AI21.CLI.Commands; + +internal static partial class V1SolutionsFdPreviewBatchesV1ClassificationsCommandApiCommand +{ + + + 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(@"v1-solutions-fd-preview-batches-v1-classifications", @"Fnac Batch Classifications Prefix Preview"); + + + + 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.V1SolutionsFdPreviewBatchesV1ClassificationsAsync( + + cancellationToken: cancellationToken).ConfigureAwait(false); + + + await CliRuntime.WriteResponseAsync( + parseResult, + response, + global::AI21.SourceGenerationContext.Default, + FormatResponse, + cancellationToken).ConfigureAwait(false); + }, cancellationToken).ConfigureAwait(false)); + return command; + } +} \ No newline at end of file diff --git a/src/cli/AI21.CLI/Commands/V1SolutionsFdPreviewBatchesV1ClassificationsResultsCommandApiCommand.g.cs b/src/cli/AI21.CLI/Commands/V1SolutionsFdPreviewBatchesV1ClassificationsResultsCommandApiCommand.g.cs new file mode 100644 index 00000000..b120a6c6 --- /dev/null +++ b/src/cli/AI21.CLI/Commands/V1SolutionsFdPreviewBatchesV1ClassificationsResultsCommandApiCommand.g.cs @@ -0,0 +1,63 @@ +#nullable enable +#pragma warning disable CS0618 + +using System.CommandLine; + +namespace AI21.CLI.Commands; + +internal static partial class V1SolutionsFdPreviewBatchesV1ClassificationsResultsCommandApiCommand +{ + private static Argument BatchId { get; } = new( + name: @"batch-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(@"v1-solutions-fd-preview-batches-v1-classifications-results", @"Fnac Batch Classifications Results Prefix Preview"); + command.Arguments.Add(BatchId); + + + command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => + await CliRuntime.RunAsync(async () => + { + var batchId = parseResult.GetRequiredValue(BatchId); + using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); + + + var response = await client.V1SolutionsFdPreviewBatchesV1ClassificationsResultsAsync( + batchId: batchId, + cancellationToken: cancellationToken).ConfigureAwait(false); + + + await CliRuntime.WriteResponseAsync( + parseResult, + response, + global::AI21.SourceGenerationContext.Default, + FormatResponse, + cancellationToken).ConfigureAwait(false); + }, cancellationToken).ConfigureAwait(false)); + return command; + } +} \ No newline at end of file diff --git a/src/cli/AI21.CLI/Commands/V1SolutionsFdPreviewBatchesV1ClassificationsStatusCommandApiCommand.g.cs b/src/cli/AI21.CLI/Commands/V1SolutionsFdPreviewBatchesV1ClassificationsStatusCommandApiCommand.g.cs new file mode 100644 index 00000000..c3fe73db --- /dev/null +++ b/src/cli/AI21.CLI/Commands/V1SolutionsFdPreviewBatchesV1ClassificationsStatusCommandApiCommand.g.cs @@ -0,0 +1,63 @@ +#nullable enable +#pragma warning disable CS0618 + +using System.CommandLine; + +namespace AI21.CLI.Commands; + +internal static partial class V1SolutionsFdPreviewBatchesV1ClassificationsStatusCommandApiCommand +{ + private static Argument BatchId { get; } = new( + name: @"batch-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(@"v1-solutions-fd-preview-batches-v1-classifications-status", @"Fnac Batch Classifications Status Prefix Preview"); + command.Arguments.Add(BatchId); + + + command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => + await CliRuntime.RunAsync(async () => + { + var batchId = parseResult.GetRequiredValue(BatchId); + using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); + + + var response = await client.V1SolutionsFdPreviewBatchesV1ClassificationsStatusAsync( + batchId: batchId, + cancellationToken: cancellationToken).ConfigureAwait(false); + + + await CliRuntime.WriteResponseAsync( + parseResult, + response, + global::AI21.SourceGenerationContext.Default, + FormatResponse, + cancellationToken).ConfigureAwait(false); + }, cancellationToken).ConfigureAwait(false)); + return command; + } +} \ No newline at end of file diff --git a/src/cli/AI21.CLI/Commands/V1SolutionsFdPreviewBatchesV1DescriptionsCommandApiCommand.g.cs b/src/cli/AI21.CLI/Commands/V1SolutionsFdPreviewBatchesV1DescriptionsCommandApiCommand.g.cs new file mode 100644 index 00000000..9a8cb44f --- /dev/null +++ b/src/cli/AI21.CLI/Commands/V1SolutionsFdPreviewBatchesV1DescriptionsCommandApiCommand.g.cs @@ -0,0 +1,59 @@ +#nullable enable +#pragma warning disable CS0618 + +using System.CommandLine; + +namespace AI21.CLI.Commands; + +internal static partial class V1SolutionsFdPreviewBatchesV1DescriptionsCommandApiCommand +{ + + + 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(@"v1-solutions-fd-preview-batches-v1-descriptions", @"Fnac Batch Descriptions Prefix Preview"); + + + + 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.V1SolutionsFdPreviewBatchesV1DescriptionsAsync( + + cancellationToken: cancellationToken).ConfigureAwait(false); + + + await CliRuntime.WriteResponseAsync( + parseResult, + response, + global::AI21.SourceGenerationContext.Default, + FormatResponse, + cancellationToken).ConfigureAwait(false); + }, cancellationToken).ConfigureAwait(false)); + return command; + } +} \ No newline at end of file diff --git a/src/cli/AI21.CLI/Commands/V1SolutionsFdPreviewBatchesV1DescriptionsResultsCommandApiCommand.g.cs b/src/cli/AI21.CLI/Commands/V1SolutionsFdPreviewBatchesV1DescriptionsResultsCommandApiCommand.g.cs new file mode 100644 index 00000000..37ce43cd --- /dev/null +++ b/src/cli/AI21.CLI/Commands/V1SolutionsFdPreviewBatchesV1DescriptionsResultsCommandApiCommand.g.cs @@ -0,0 +1,63 @@ +#nullable enable +#pragma warning disable CS0618 + +using System.CommandLine; + +namespace AI21.CLI.Commands; + +internal static partial class V1SolutionsFdPreviewBatchesV1DescriptionsResultsCommandApiCommand +{ + private static Argument BatchId { get; } = new( + name: @"batch-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(@"v1-solutions-fd-preview-batches-v1-descriptions-results", @"Fnac Batch Descriptions Results Prefix Preview"); + command.Arguments.Add(BatchId); + + + command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => + await CliRuntime.RunAsync(async () => + { + var batchId = parseResult.GetRequiredValue(BatchId); + using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); + + + var response = await client.V1SolutionsFdPreviewBatchesV1DescriptionsResultsAsync( + batchId: batchId, + cancellationToken: cancellationToken).ConfigureAwait(false); + + + await CliRuntime.WriteResponseAsync( + parseResult, + response, + global::AI21.SourceGenerationContext.Default, + FormatResponse, + cancellationToken).ConfigureAwait(false); + }, cancellationToken).ConfigureAwait(false)); + return command; + } +} \ No newline at end of file diff --git a/src/cli/AI21.CLI/Commands/V1SolutionsFdPreviewBatchesV1DescriptionsStatusCommandApiCommand.g.cs b/src/cli/AI21.CLI/Commands/V1SolutionsFdPreviewBatchesV1DescriptionsStatusCommandApiCommand.g.cs new file mode 100644 index 00000000..3e41325e --- /dev/null +++ b/src/cli/AI21.CLI/Commands/V1SolutionsFdPreviewBatchesV1DescriptionsStatusCommandApiCommand.g.cs @@ -0,0 +1,63 @@ +#nullable enable +#pragma warning disable CS0618 + +using System.CommandLine; + +namespace AI21.CLI.Commands; + +internal static partial class V1SolutionsFdPreviewBatchesV1DescriptionsStatusCommandApiCommand +{ + private static Argument BatchId { get; } = new( + name: @"batch-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(@"v1-solutions-fd-preview-batches-v1-descriptions-status", @"Fnac Batch Descriptions Status Prefix Preview"); + command.Arguments.Add(BatchId); + + + command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => + await CliRuntime.RunAsync(async () => + { + var batchId = parseResult.GetRequiredValue(BatchId); + using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); + + + var response = await client.V1SolutionsFdPreviewBatchesV1DescriptionsStatusAsync( + batchId: batchId, + cancellationToken: cancellationToken).ConfigureAwait(false); + + + await CliRuntime.WriteResponseAsync( + parseResult, + response, + global::AI21.SourceGenerationContext.Default, + FormatResponse, + cancellationToken).ConfigureAwait(false); + }, cancellationToken).ConfigureAwait(false)); + return command; + } +} \ No newline at end of file diff --git a/src/cli/AI21.CLI/Commands/V1SolutionsFnacAftersalesBatchPredictCommandApiCommand.g.cs b/src/cli/AI21.CLI/Commands/V1SolutionsFnacAftersalesBatchPredictCommandApiCommand.g.cs new file mode 100644 index 00000000..ecda3113 --- /dev/null +++ b/src/cli/AI21.CLI/Commands/V1SolutionsFnacAftersalesBatchPredictCommandApiCommand.g.cs @@ -0,0 +1,59 @@ +#nullable enable +#pragma warning disable CS0618 + +using System.CommandLine; + +namespace AI21.CLI.Commands; + +internal static partial class V1SolutionsFnacAftersalesBatchPredictCommandApiCommand +{ + + + 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(@"v1-solutions-fnac-aftersales-batch-predict", @"Fnac Aftersales Batch Predict"); + + + + 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.V1SolutionsFnacAftersalesBatchPredictAsync( + + cancellationToken: cancellationToken).ConfigureAwait(false); + + + await CliRuntime.WriteResponseAsync( + parseResult, + response, + global::AI21.SourceGenerationContext.Default, + FormatResponse, + cancellationToken).ConfigureAwait(false); + }, cancellationToken).ConfigureAwait(false)); + return command; + } +} \ No newline at end of file diff --git a/src/cli/AI21.CLI/Commands/V1SolutionsFnacAftersalesBatchPredictStatusCommandApiCommand.g.cs b/src/cli/AI21.CLI/Commands/V1SolutionsFnacAftersalesBatchPredictStatusCommandApiCommand.g.cs new file mode 100644 index 00000000..489cb5ce --- /dev/null +++ b/src/cli/AI21.CLI/Commands/V1SolutionsFnacAftersalesBatchPredictStatusCommandApiCommand.g.cs @@ -0,0 +1,63 @@ +#nullable enable +#pragma warning disable CS0618 + +using System.CommandLine; + +namespace AI21.CLI.Commands; + +internal static partial class V1SolutionsFnacAftersalesBatchPredictStatusCommandApiCommand +{ + private static Argument BatchId { get; } = new( + name: @"batch-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(@"v1-solutions-fnac-aftersales-batch-predict-status", @"Fnac Aftersales Batch Predict Status"); + command.Arguments.Add(BatchId); + + + command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => + await CliRuntime.RunAsync(async () => + { + var batchId = parseResult.GetRequiredValue(BatchId); + using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); + + + var response = await client.V1SolutionsFnacAftersalesBatchPredictStatusAsync( + batchId: batchId, + cancellationToken: cancellationToken).ConfigureAwait(false); + + + await CliRuntime.WriteResponseAsync( + parseResult, + response, + global::AI21.SourceGenerationContext.Default, + FormatResponse, + cancellationToken).ConfigureAwait(false); + }, cancellationToken).ConfigureAwait(false)); + return command; + } +} \ No newline at end of file diff --git a/src/cli/AI21.CLI/Commands/V1SolutionsFnacAftersalesPreviewBatchPredictCommandApiCommand.g.cs b/src/cli/AI21.CLI/Commands/V1SolutionsFnacAftersalesPreviewBatchPredictCommandApiCommand.g.cs new file mode 100644 index 00000000..7bfa812f --- /dev/null +++ b/src/cli/AI21.CLI/Commands/V1SolutionsFnacAftersalesPreviewBatchPredictCommandApiCommand.g.cs @@ -0,0 +1,59 @@ +#nullable enable +#pragma warning disable CS0618 + +using System.CommandLine; + +namespace AI21.CLI.Commands; + +internal static partial class V1SolutionsFnacAftersalesPreviewBatchPredictCommandApiCommand +{ + + + 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(@"v1-solutions-fnac-aftersales-preview-batch-predict", @"Fnac Aftersales Batch Predict Prefix Preview"); + + + + 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.V1SolutionsFnacAftersalesPreviewBatchPredictAsync( + + cancellationToken: cancellationToken).ConfigureAwait(false); + + + await CliRuntime.WriteResponseAsync( + parseResult, + response, + global::AI21.SourceGenerationContext.Default, + FormatResponse, + cancellationToken).ConfigureAwait(false); + }, cancellationToken).ConfigureAwait(false)); + return command; + } +} \ No newline at end of file diff --git a/src/cli/AI21.CLI/Commands/V1SolutionsFnacAftersalesPreviewBatchPredictStatusCommandApiCommand.g.cs b/src/cli/AI21.CLI/Commands/V1SolutionsFnacAftersalesPreviewBatchPredictStatusCommandApiCommand.g.cs new file mode 100644 index 00000000..6de2d04a --- /dev/null +++ b/src/cli/AI21.CLI/Commands/V1SolutionsFnacAftersalesPreviewBatchPredictStatusCommandApiCommand.g.cs @@ -0,0 +1,63 @@ +#nullable enable +#pragma warning disable CS0618 + +using System.CommandLine; + +namespace AI21.CLI.Commands; + +internal static partial class V1SolutionsFnacAftersalesPreviewBatchPredictStatusCommandApiCommand +{ + private static Argument BatchId { get; } = new( + name: @"batch-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(@"v1-solutions-fnac-aftersales-preview-batch-predict-status", @"Fnac Aftersales Batch Predict Status Prefix Preview"); + command.Arguments.Add(BatchId); + + + command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => + await CliRuntime.RunAsync(async () => + { + var batchId = parseResult.GetRequiredValue(BatchId); + using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); + + + var response = await client.V1SolutionsFnacAftersalesPreviewBatchPredictStatusAsync( + batchId: batchId, + cancellationToken: cancellationToken).ConfigureAwait(false); + + + await CliRuntime.WriteResponseAsync( + parseResult, + response, + global::AI21.SourceGenerationContext.Default, + FormatResponse, + cancellationToken).ConfigureAwait(false); + }, cancellationToken).ConfigureAwait(false)); + return command; + } +} \ No newline at end of file diff --git a/src/cli/AI21.CLI/Commands/V1SolutionsFnacPreviewV1ClassificationsCommandApiCommand.g.cs b/src/cli/AI21.CLI/Commands/V1SolutionsFnacPreviewV1ClassificationsCommandApiCommand.g.cs new file mode 100644 index 00000000..fafa87b7 --- /dev/null +++ b/src/cli/AI21.CLI/Commands/V1SolutionsFnacPreviewV1ClassificationsCommandApiCommand.g.cs @@ -0,0 +1,59 @@ +#nullable enable +#pragma warning disable CS0618 + +using System.CommandLine; + +namespace AI21.CLI.Commands; + +internal static partial class V1SolutionsFnacPreviewV1ClassificationsCommandApiCommand +{ + + + 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(@"v1-solutions-fnac-preview-v1-classifications", @"Fnac V1 Classifications Prefix Preview"); + + + + 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.V1SolutionsFnacPreviewV1ClassificationsAsync( + + cancellationToken: cancellationToken).ConfigureAwait(false); + + + await CliRuntime.WriteResponseAsync( + parseResult, + response, + global::AI21.SourceGenerationContext.Default, + FormatResponse, + cancellationToken).ConfigureAwait(false); + }, cancellationToken).ConfigureAwait(false)); + return command; + } +} \ No newline at end of file diff --git a/src/cli/AI21.CLI/Commands/V1SolutionsFnacPreviewV1DeprecatedClassificationsCommandApiCommand.g.cs b/src/cli/AI21.CLI/Commands/V1SolutionsFnacPreviewV1DeprecatedClassificationsCommandApiCommand.g.cs new file mode 100644 index 00000000..f7368314 --- /dev/null +++ b/src/cli/AI21.CLI/Commands/V1SolutionsFnacPreviewV1DeprecatedClassificationsCommandApiCommand.g.cs @@ -0,0 +1,59 @@ +#nullable enable +#pragma warning disable CS0618 + +using System.CommandLine; + +namespace AI21.CLI.Commands; + +internal static partial class V1SolutionsFnacPreviewV1DeprecatedClassificationsCommandApiCommand +{ + + + 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(@"v1-solutions-fnac-preview-v1-deprecated-classifications", @"Fnac V1 Deprecated Classifications Prefix Preview"); + + + + 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.V1SolutionsFnacPreviewV1DeprecatedClassificationsAsync( + + cancellationToken: cancellationToken).ConfigureAwait(false); + + + await CliRuntime.WriteResponseAsync( + parseResult, + response, + global::AI21.SourceGenerationContext.Default, + FormatResponse, + cancellationToken).ConfigureAwait(false); + }, cancellationToken).ConfigureAwait(false)); + return command; + } +} \ No newline at end of file diff --git a/src/cli/AI21.CLI/Commands/V1SolutionsFnacPreviewV1DeprecatedDescriptionsCommandApiCommand.g.cs b/src/cli/AI21.CLI/Commands/V1SolutionsFnacPreviewV1DeprecatedDescriptionsCommandApiCommand.g.cs new file mode 100644 index 00000000..05c509af --- /dev/null +++ b/src/cli/AI21.CLI/Commands/V1SolutionsFnacPreviewV1DeprecatedDescriptionsCommandApiCommand.g.cs @@ -0,0 +1,59 @@ +#nullable enable +#pragma warning disable CS0618 + +using System.CommandLine; + +namespace AI21.CLI.Commands; + +internal static partial class V1SolutionsFnacPreviewV1DeprecatedDescriptionsCommandApiCommand +{ + + + 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(@"v1-solutions-fnac-preview-v1-deprecated-descriptions", @"Fnac V1 Deprecated Descriptions Prefix Preview"); + + + + 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.V1SolutionsFnacPreviewV1DeprecatedDescriptionsAsync( + + cancellationToken: cancellationToken).ConfigureAwait(false); + + + await CliRuntime.WriteResponseAsync( + parseResult, + response, + global::AI21.SourceGenerationContext.Default, + FormatResponse, + cancellationToken).ConfigureAwait(false); + }, cancellationToken).ConfigureAwait(false)); + return command; + } +} \ No newline at end of file diff --git a/src/cli/AI21.CLI/Commands/V1SolutionsFnacPreviewV1DescriptionsCommandApiCommand.g.cs b/src/cli/AI21.CLI/Commands/V1SolutionsFnacPreviewV1DescriptionsCommandApiCommand.g.cs new file mode 100644 index 00000000..09d9e61d --- /dev/null +++ b/src/cli/AI21.CLI/Commands/V1SolutionsFnacPreviewV1DescriptionsCommandApiCommand.g.cs @@ -0,0 +1,59 @@ +#nullable enable +#pragma warning disable CS0618 + +using System.CommandLine; + +namespace AI21.CLI.Commands; + +internal static partial class V1SolutionsFnacPreviewV1DescriptionsCommandApiCommand +{ + + + 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(@"v1-solutions-fnac-preview-v1-descriptions", @"Fnac V1 Descriptions Prefix Preview"); + + + + 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.V1SolutionsFnacPreviewV1DescriptionsAsync( + + cancellationToken: cancellationToken).ConfigureAwait(false); + + + await CliRuntime.WriteResponseAsync( + parseResult, + response, + global::AI21.SourceGenerationContext.Default, + FormatResponse, + cancellationToken).ConfigureAwait(false); + }, cancellationToken).ConfigureAwait(false)); + return command; + } +} \ No newline at end of file diff --git a/src/cli/AI21.CLI/Commands/V1SolutionsFnacV1ClassificationsCommandApiCommand.g.cs b/src/cli/AI21.CLI/Commands/V1SolutionsFnacV1ClassificationsCommandApiCommand.g.cs new file mode 100644 index 00000000..194f3fdc --- /dev/null +++ b/src/cli/AI21.CLI/Commands/V1SolutionsFnacV1ClassificationsCommandApiCommand.g.cs @@ -0,0 +1,59 @@ +#nullable enable +#pragma warning disable CS0618 + +using System.CommandLine; + +namespace AI21.CLI.Commands; + +internal static partial class V1SolutionsFnacV1ClassificationsCommandApiCommand +{ + + + 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(@"v1-solutions-fnac-v1-classifications", @"Fnac V1 Classifications"); + + + + 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.V1SolutionsFnacV1ClassificationsAsync( + + cancellationToken: cancellationToken).ConfigureAwait(false); + + + await CliRuntime.WriteResponseAsync( + parseResult, + response, + global::AI21.SourceGenerationContext.Default, + FormatResponse, + cancellationToken).ConfigureAwait(false); + }, cancellationToken).ConfigureAwait(false)); + return command; + } +} \ No newline at end of file diff --git a/src/cli/AI21.CLI/Commands/V1SolutionsFnacV1DeprecatedClassificationsCommandApiCommand.g.cs b/src/cli/AI21.CLI/Commands/V1SolutionsFnacV1DeprecatedClassificationsCommandApiCommand.g.cs new file mode 100644 index 00000000..618cf52b --- /dev/null +++ b/src/cli/AI21.CLI/Commands/V1SolutionsFnacV1DeprecatedClassificationsCommandApiCommand.g.cs @@ -0,0 +1,59 @@ +#nullable enable +#pragma warning disable CS0618 + +using System.CommandLine; + +namespace AI21.CLI.Commands; + +internal static partial class V1SolutionsFnacV1DeprecatedClassificationsCommandApiCommand +{ + + + 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(@"v1-solutions-fnac-v1-deprecated-classifications", @"Fnac V1 Deprecated Classifications"); + + + + 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.V1SolutionsFnacV1DeprecatedClassificationsAsync( + + cancellationToken: cancellationToken).ConfigureAwait(false); + + + await CliRuntime.WriteResponseAsync( + parseResult, + response, + global::AI21.SourceGenerationContext.Default, + FormatResponse, + cancellationToken).ConfigureAwait(false); + }, cancellationToken).ConfigureAwait(false)); + return command; + } +} \ No newline at end of file diff --git a/src/cli/AI21.CLI/Commands/V1SolutionsFnacV1DeprecatedDescriptionsCommandApiCommand.g.cs b/src/cli/AI21.CLI/Commands/V1SolutionsFnacV1DeprecatedDescriptionsCommandApiCommand.g.cs new file mode 100644 index 00000000..1807fc14 --- /dev/null +++ b/src/cli/AI21.CLI/Commands/V1SolutionsFnacV1DeprecatedDescriptionsCommandApiCommand.g.cs @@ -0,0 +1,59 @@ +#nullable enable +#pragma warning disable CS0618 + +using System.CommandLine; + +namespace AI21.CLI.Commands; + +internal static partial class V1SolutionsFnacV1DeprecatedDescriptionsCommandApiCommand +{ + + + 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(@"v1-solutions-fnac-v1-deprecated-descriptions", @"Fnac V1 Deprecated Descriptions"); + + + + 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.V1SolutionsFnacV1DeprecatedDescriptionsAsync( + + cancellationToken: cancellationToken).ConfigureAwait(false); + + + await CliRuntime.WriteResponseAsync( + parseResult, + response, + global::AI21.SourceGenerationContext.Default, + FormatResponse, + cancellationToken).ConfigureAwait(false); + }, cancellationToken).ConfigureAwait(false)); + return command; + } +} \ No newline at end of file diff --git a/src/cli/AI21.CLI/Commands/V1SolutionsFnacV1DescriptionsCommandApiCommand.g.cs b/src/cli/AI21.CLI/Commands/V1SolutionsFnacV1DescriptionsCommandApiCommand.g.cs new file mode 100644 index 00000000..dd8dfc1d --- /dev/null +++ b/src/cli/AI21.CLI/Commands/V1SolutionsFnacV1DescriptionsCommandApiCommand.g.cs @@ -0,0 +1,59 @@ +#nullable enable +#pragma warning disable CS0618 + +using System.CommandLine; + +namespace AI21.CLI.Commands; + +internal static partial class V1SolutionsFnacV1DescriptionsCommandApiCommand +{ + + + 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(@"v1-solutions-fnac-v1-descriptions", @"Fnac V1 Descriptions"); + + + + 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.V1SolutionsFnacV1DescriptionsAsync( + + cancellationToken: cancellationToken).ConfigureAwait(false); + + + await CliRuntime.WriteResponseAsync( + parseResult, + response, + global::AI21.SourceGenerationContext.Default, + FormatResponse, + cancellationToken).ConfigureAwait(false); + }, cancellationToken).ConfigureAwait(false)); + return command; + } +} \ No newline at end of file diff --git a/src/cli/AI21.CLI/Commands/V1SolutionsTlvMunicipalityConvragCommandApiCommand.g.cs b/src/cli/AI21.CLI/Commands/V1SolutionsTlvMunicipalityConvragCommandApiCommand.g.cs new file mode 100644 index 00000000..21c02e19 --- /dev/null +++ b/src/cli/AI21.CLI/Commands/V1SolutionsTlvMunicipalityConvragCommandApiCommand.g.cs @@ -0,0 +1,59 @@ +#nullable enable +#pragma warning disable CS0618 + +using System.CommandLine; + +namespace AI21.CLI.Commands; + +internal static partial class V1SolutionsTlvMunicipalityConvragCommandApiCommand +{ + + + 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(@"v1-solutions-tlv-municipality-convrag", @"Tlv Convrag"); + + + + 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.V1SolutionsTlvMunicipalityConvragAsync( + + cancellationToken: cancellationToken).ConfigureAwait(false); + + + await CliRuntime.WriteResponseAsync( + parseResult, + response, + global::AI21.SourceGenerationContext.Default, + FormatResponse, + cancellationToken).ConfigureAwait(false); + }, cancellationToken).ConfigureAwait(false)); + return command; + } +} \ No newline at end of file diff --git a/src/cli/AI21.CLI/Commands/V1SolutionsTlvMunicipalityPreviewConvragCommandApiCommand.g.cs b/src/cli/AI21.CLI/Commands/V1SolutionsTlvMunicipalityPreviewConvragCommandApiCommand.g.cs new file mode 100644 index 00000000..9a05e17c --- /dev/null +++ b/src/cli/AI21.CLI/Commands/V1SolutionsTlvMunicipalityPreviewConvragCommandApiCommand.g.cs @@ -0,0 +1,59 @@ +#nullable enable +#pragma warning disable CS0618 + +using System.CommandLine; + +namespace AI21.CLI.Commands; + +internal static partial class V1SolutionsTlvMunicipalityPreviewConvragCommandApiCommand +{ + + + 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(@"v1-solutions-tlv-municipality-preview-convrag", @"Tlv Convrag Prefix Preview"); + + + + 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.V1SolutionsTlvMunicipalityPreviewConvragAsync( + + cancellationToken: cancellationToken).ConfigureAwait(false); + + + await CliRuntime.WriteResponseAsync( + parseResult, + response, + global::AI21.SourceGenerationContext.Default, + FormatResponse, + cancellationToken).ConfigureAwait(false); + }, cancellationToken).ConfigureAwait(false)); + return command; + } +} \ No newline at end of file diff --git a/src/cli/AI21.CLI/Commands/V1StudioApiGenerationThreadNameCommandApiCommand.g.cs b/src/cli/AI21.CLI/Commands/V1StudioApiGenerationThreadNameCommandApiCommand.g.cs deleted file mode 100644 index c1b751a6..00000000 --- a/src/cli/AI21.CLI/Commands/V1StudioApiGenerationThreadNameCommandApiCommand.g.cs +++ /dev/null @@ -1,64 +0,0 @@ -#nullable enable -#pragma warning disable CS0618 - -using System.CommandLine; - -namespace AI21.CLI.Commands; - -internal static partial class V1StudioApiGenerationThreadNameCommandApiCommand -{ - private static Option Query { get; } = new( - name: @"--query") - { - Description = @"", - Required = true, - }; - - private static string FormatResponse(ParseResult parseResult, global::AI21.ThreadNameGenerationResponse value, global::System.Text.Json.Serialization.JsonSerializerContext context, bool truncateLongStrings) - { - string? text = null; - CustomizeResponseText(parseResult, value, ref text); - if (!string.IsNullOrWhiteSpace(text)) - { - return text; - } - - var hints = new Dictionary(StringComparer.OrdinalIgnoreCase) - { - }; - CustomizeResponseFormatHints(hints); - return CliRuntime.FormatHumanReadable(value, context, truncateLongStrings, hints); - } - - static partial void CustomizeResponseText(ParseResult parseResult, global::AI21.ThreadNameGenerationResponse value, ref string? text); - static partial void CustomizeResponseFormatHints(Dictionary hints); - - - public static Command Create() - { - var command = new Command(@"v1-studio-api-generation-thread-name", @"Generate Thread Name"); - command.Options.Add(Query); - - - command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => - await CliRuntime.RunAsync(async () => - { - var query = parseResult.GetRequiredValue(Query); - using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); - - - var response = await client.V1StudioApiGenerationThreadNameAsync( - query: query, - cancellationToken: cancellationToken).ConfigureAwait(false); - - - await CliRuntime.WriteResponseAsync( - parseResult, - response, - global::AI21.SourceGenerationContext.Default, - FormatResponse, - cancellationToken).ConfigureAwait(false); - }, cancellationToken).ConfigureAwait(false)); - return command; - } -} \ No newline at end of file diff --git a/src/cli/AI21.CLI/Commands/VidaaActionItemsPreviewSolutionsPreviewVidaaActionItemsPostCommandApiCommand.g.cs b/src/cli/AI21.CLI/Commands/VidaaActionItemsPreviewSolutionsPreviewVidaaActionItemsPostCommandApiCommand.g.cs deleted file mode 100644 index 1d71ca57..00000000 --- a/src/cli/AI21.CLI/Commands/VidaaActionItemsPreviewSolutionsPreviewVidaaActionItemsPostCommandApiCommand.g.cs +++ /dev/null @@ -1,59 +0,0 @@ -#nullable enable -#pragma warning disable CS0618 - -using System.CommandLine; - -namespace AI21.CLI.Commands; - -internal static partial class VidaaActionItemsPreviewSolutionsPreviewVidaaActionItemsPostCommandApiCommand -{ - - - 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(@"vidaa-action-items-preview-solutions-preview-vidaa-action-items-post", @"Vidaa Action Items Preview"); - - - - 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.VidaaActionItemsPreviewSolutionsPreviewVidaaActionItemsPostAsync( - - cancellationToken: cancellationToken).ConfigureAwait(false); - - - await CliRuntime.WriteResponseAsync( - parseResult, - response, - global::AI21.SourceGenerationContext.Default, - FormatResponse, - cancellationToken).ConfigureAwait(false); - }, cancellationToken).ConfigureAwait(false)); - return command; - } -} \ No newline at end of file diff --git a/src/cli/AI21.CLI/Commands/VidaaActionItemsSolutionsVidaaActionItemsPostCommandApiCommand.g.cs b/src/cli/AI21.CLI/Commands/VidaaActionItemsSolutionsVidaaActionItemsPostCommandApiCommand.g.cs deleted file mode 100644 index 4db39cd7..00000000 --- a/src/cli/AI21.CLI/Commands/VidaaActionItemsSolutionsVidaaActionItemsPostCommandApiCommand.g.cs +++ /dev/null @@ -1,59 +0,0 @@ -#nullable enable -#pragma warning disable CS0618 - -using System.CommandLine; - -namespace AI21.CLI.Commands; - -internal static partial class VidaaActionItemsSolutionsVidaaActionItemsPostCommandApiCommand -{ - - - 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(@"vidaa-action-items-solutions-vidaa-action-items-post", @"Vidaa Action Items"); - - - - 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.VidaaActionItemsSolutionsVidaaActionItemsPostAsync( - - cancellationToken: cancellationToken).ConfigureAwait(false); - - - await CliRuntime.WriteResponseAsync( - parseResult, - response, - global::AI21.SourceGenerationContext.Default, - FormatResponse, - cancellationToken).ConfigureAwait(false); - }, cancellationToken).ConfigureAwait(false)); - return command; - } -} \ No newline at end of file diff --git a/src/cli/AI21.CLI/Commands/VidaaFeedItemsPreviewSolutionsPreviewVidaaFeedItemsGetCommandApiCommand.g.cs b/src/cli/AI21.CLI/Commands/VidaaFeedItemsPreviewSolutionsPreviewVidaaFeedItemsGetCommandApiCommand.g.cs deleted file mode 100644 index 2c1f9ada..00000000 --- a/src/cli/AI21.CLI/Commands/VidaaFeedItemsPreviewSolutionsPreviewVidaaFeedItemsGetCommandApiCommand.g.cs +++ /dev/null @@ -1,59 +0,0 @@ -#nullable enable -#pragma warning disable CS0618 - -using System.CommandLine; - -namespace AI21.CLI.Commands; - -internal static partial class VidaaFeedItemsPreviewSolutionsPreviewVidaaFeedItemsGetCommandApiCommand -{ - - - 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(@"vidaa-feed-items-preview-solutions-preview-vidaa-feed-items-get", @"Vidaa Feed Items Preview"); - - - - 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.VidaaFeedItemsPreviewSolutionsPreviewVidaaFeedItemsGetAsync( - - cancellationToken: cancellationToken).ConfigureAwait(false); - - - await CliRuntime.WriteResponseAsync( - parseResult, - response, - global::AI21.SourceGenerationContext.Default, - FormatResponse, - cancellationToken).ConfigureAwait(false); - }, cancellationToken).ConfigureAwait(false)); - return command; - } -} \ No newline at end of file diff --git a/src/cli/AI21.CLI/Commands/VidaaFeedItemsSolutionsVidaaFeedItemsGetCommandApiCommand.g.cs b/src/cli/AI21.CLI/Commands/VidaaFeedItemsSolutionsVidaaFeedItemsGetCommandApiCommand.g.cs deleted file mode 100644 index 00623bc4..00000000 --- a/src/cli/AI21.CLI/Commands/VidaaFeedItemsSolutionsVidaaFeedItemsGetCommandApiCommand.g.cs +++ /dev/null @@ -1,59 +0,0 @@ -#nullable enable -#pragma warning disable CS0618 - -using System.CommandLine; - -namespace AI21.CLI.Commands; - -internal static partial class VidaaFeedItemsSolutionsVidaaFeedItemsGetCommandApiCommand -{ - - - 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(@"vidaa-feed-items-solutions-vidaa-feed-items-get", @"Vidaa Feed Items"); - - - - 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.VidaaFeedItemsSolutionsVidaaFeedItemsGetAsync( - - cancellationToken: cancellationToken).ConfigureAwait(false); - - - await CliRuntime.WriteResponseAsync( - parseResult, - response, - global::AI21.SourceGenerationContext.Default, - FormatResponse, - cancellationToken).ConfigureAwait(false); - }, cancellationToken).ConfigureAwait(false)); - return command; - } -} \ No newline at end of file diff --git a/src/cli/AI21.CLI/Commands/VidaaMessagesPreviewSolutionsPreviewVidaaApiMessagesPostCommandApiCommand.g.cs b/src/cli/AI21.CLI/Commands/VidaaMessagesPreviewSolutionsPreviewVidaaApiMessagesPostCommandApiCommand.g.cs deleted file mode 100644 index 8738f73d..00000000 --- a/src/cli/AI21.CLI/Commands/VidaaMessagesPreviewSolutionsPreviewVidaaApiMessagesPostCommandApiCommand.g.cs +++ /dev/null @@ -1,59 +0,0 @@ -#nullable enable -#pragma warning disable CS0618 - -using System.CommandLine; - -namespace AI21.CLI.Commands; - -internal static partial class VidaaMessagesPreviewSolutionsPreviewVidaaApiMessagesPostCommandApiCommand -{ - - - 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(@"vidaa-messages-preview-solutions-preview-vidaa-api-messages-post", @"Vidaa Messages Preview"); - - - - 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.VidaaMessagesPreviewSolutionsPreviewVidaaApiMessagesPostAsync( - - cancellationToken: cancellationToken).ConfigureAwait(false); - - - await CliRuntime.WriteResponseAsync( - parseResult, - response, - global::AI21.SourceGenerationContext.Default, - FormatResponse, - cancellationToken).ConfigureAwait(false); - }, cancellationToken).ConfigureAwait(false)); - return command; - } -} \ No newline at end of file diff --git a/src/cli/AI21.CLI/Commands/VidaaMessagesSolutionsVidaaApiMessagesPostCommandApiCommand.g.cs b/src/cli/AI21.CLI/Commands/VidaaMessagesSolutionsVidaaApiMessagesPostCommandApiCommand.g.cs deleted file mode 100644 index 34ac3560..00000000 --- a/src/cli/AI21.CLI/Commands/VidaaMessagesSolutionsVidaaApiMessagesPostCommandApiCommand.g.cs +++ /dev/null @@ -1,59 +0,0 @@ -#nullable enable -#pragma warning disable CS0618 - -using System.CommandLine; - -namespace AI21.CLI.Commands; - -internal static partial class VidaaMessagesSolutionsVidaaApiMessagesPostCommandApiCommand -{ - - - 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(@"vidaa-messages-solutions-vidaa-api-messages-post", @"Vidaa Messages"); - - - - 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.VidaaMessagesSolutionsVidaaApiMessagesPostAsync( - - cancellationToken: cancellationToken).ConfigureAwait(false); - - - await CliRuntime.WriteResponseAsync( - parseResult, - response, - global::AI21.SourceGenerationContext.Default, - FormatResponse, - cancellationToken).ConfigureAwait(false); - }, cancellationToken).ConfigureAwait(false)); - return command; - } -} \ No newline at end of file diff --git a/src/cli/AI21.CLI/Commands/VidaaSchedulerStatsPreviewSolutionsPreviewVidaaSchedulerStatsGetCommandApiCommand.g.cs b/src/cli/AI21.CLI/Commands/VidaaSchedulerStatsPreviewSolutionsPreviewVidaaSchedulerStatsGetCommandApiCommand.g.cs deleted file mode 100644 index 7ef327c5..00000000 --- a/src/cli/AI21.CLI/Commands/VidaaSchedulerStatsPreviewSolutionsPreviewVidaaSchedulerStatsGetCommandApiCommand.g.cs +++ /dev/null @@ -1,59 +0,0 @@ -#nullable enable -#pragma warning disable CS0618 - -using System.CommandLine; - -namespace AI21.CLI.Commands; - -internal static partial class VidaaSchedulerStatsPreviewSolutionsPreviewVidaaSchedulerStatsGetCommandApiCommand -{ - - - 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(@"vidaa-scheduler-stats-preview-solutions-preview-vidaa-scheduler-stats-get", @"Vidaa Scheduler Stats Preview"); - - - - 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.VidaaSchedulerStatsPreviewSolutionsPreviewVidaaSchedulerStatsGetAsync( - - cancellationToken: cancellationToken).ConfigureAwait(false); - - - await CliRuntime.WriteResponseAsync( - parseResult, - response, - global::AI21.SourceGenerationContext.Default, - FormatResponse, - cancellationToken).ConfigureAwait(false); - }, cancellationToken).ConfigureAwait(false)); - return command; - } -} \ No newline at end of file diff --git a/src/cli/AI21.CLI/Commands/VidaaSchedulerStatsSolutionsVidaaSchedulerStatsGetCommandApiCommand.g.cs b/src/cli/AI21.CLI/Commands/VidaaSchedulerStatsSolutionsVidaaSchedulerStatsGetCommandApiCommand.g.cs deleted file mode 100644 index 128a97ed..00000000 --- a/src/cli/AI21.CLI/Commands/VidaaSchedulerStatsSolutionsVidaaSchedulerStatsGetCommandApiCommand.g.cs +++ /dev/null @@ -1,59 +0,0 @@ -#nullable enable -#pragma warning disable CS0618 - -using System.CommandLine; - -namespace AI21.CLI.Commands; - -internal static partial class VidaaSchedulerStatsSolutionsVidaaSchedulerStatsGetCommandApiCommand -{ - - - 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(@"vidaa-scheduler-stats-solutions-vidaa-scheduler-stats-get", @"Vidaa Scheduler Stats"); - - - - 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.VidaaSchedulerStatsSolutionsVidaaSchedulerStatsGetAsync( - - cancellationToken: cancellationToken).ConfigureAwait(false); - - - await CliRuntime.WriteResponseAsync( - parseResult, - response, - global::AI21.SourceGenerationContext.Default, - FormatResponse, - cancellationToken).ConfigureAwait(false); - }, cancellationToken).ConfigureAwait(false)); - return command; - } -} \ No newline at end of file diff --git a/src/cli/AI21.CLI/Commands/VidaaSourcesPreviewSolutionsPreviewVidaaSourcesGetCommandApiCommand.g.cs b/src/cli/AI21.CLI/Commands/VidaaSourcesPreviewSolutionsPreviewVidaaSourcesGetCommandApiCommand.g.cs deleted file mode 100644 index 706fe8e6..00000000 --- a/src/cli/AI21.CLI/Commands/VidaaSourcesPreviewSolutionsPreviewVidaaSourcesGetCommandApiCommand.g.cs +++ /dev/null @@ -1,59 +0,0 @@ -#nullable enable -#pragma warning disable CS0618 - -using System.CommandLine; - -namespace AI21.CLI.Commands; - -internal static partial class VidaaSourcesPreviewSolutionsPreviewVidaaSourcesGetCommandApiCommand -{ - - - 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(@"vidaa-sources-preview-solutions-preview-vidaa-sources-get", @"Vidaa Sources Preview"); - - - - 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.VidaaSourcesPreviewSolutionsPreviewVidaaSourcesGetAsync( - - cancellationToken: cancellationToken).ConfigureAwait(false); - - - await CliRuntime.WriteResponseAsync( - parseResult, - response, - global::AI21.SourceGenerationContext.Default, - FormatResponse, - cancellationToken).ConfigureAwait(false); - }, cancellationToken).ConfigureAwait(false)); - return command; - } -} \ No newline at end of file diff --git a/src/cli/AI21.CLI/Commands/VidaaSourcesSolutionsVidaaSourcesGetCommandApiCommand.g.cs b/src/cli/AI21.CLI/Commands/VidaaSourcesSolutionsVidaaSourcesGetCommandApiCommand.g.cs deleted file mode 100644 index fc9bca89..00000000 --- a/src/cli/AI21.CLI/Commands/VidaaSourcesSolutionsVidaaSourcesGetCommandApiCommand.g.cs +++ /dev/null @@ -1,59 +0,0 @@ -#nullable enable -#pragma warning disable CS0618 - -using System.CommandLine; - -namespace AI21.CLI.Commands; - -internal static partial class VidaaSourcesSolutionsVidaaSourcesGetCommandApiCommand -{ - - - 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(@"vidaa-sources-solutions-vidaa-sources-get", @"Vidaa Sources"); - - - - 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.VidaaSourcesSolutionsVidaaSourcesGetAsync( - - cancellationToken: cancellationToken).ConfigureAwait(false); - - - await CliRuntime.WriteResponseAsync( - parseResult, - response, - global::AI21.SourceGenerationContext.Default, - FormatResponse, - cancellationToken).ConfigureAwait(false); - }, cancellationToken).ConfigureAwait(false)); - return command; - } -} \ No newline at end of file diff --git a/src/cli/AI21.CLI/Commands/VidaaSubscribePreviewSolutionsPreviewVidaaSubscribePostCommandApiCommand.g.cs b/src/cli/AI21.CLI/Commands/VidaaSubscribePreviewSolutionsPreviewVidaaSubscribePostCommandApiCommand.g.cs deleted file mode 100644 index bfc83e1c..00000000 --- a/src/cli/AI21.CLI/Commands/VidaaSubscribePreviewSolutionsPreviewVidaaSubscribePostCommandApiCommand.g.cs +++ /dev/null @@ -1,59 +0,0 @@ -#nullable enable -#pragma warning disable CS0618 - -using System.CommandLine; - -namespace AI21.CLI.Commands; - -internal static partial class VidaaSubscribePreviewSolutionsPreviewVidaaSubscribePostCommandApiCommand -{ - - - 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(@"vidaa-subscribe-preview-solutions-preview-vidaa-subscribe-post", @"Vidaa Subscribe Preview"); - - - - 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.VidaaSubscribePreviewSolutionsPreviewVidaaSubscribePostAsync( - - cancellationToken: cancellationToken).ConfigureAwait(false); - - - await CliRuntime.WriteResponseAsync( - parseResult, - response, - global::AI21.SourceGenerationContext.Default, - FormatResponse, - cancellationToken).ConfigureAwait(false); - }, cancellationToken).ConfigureAwait(false)); - return command; - } -} \ No newline at end of file diff --git a/src/cli/AI21.CLI/Commands/VidaaSubscribeSolutionsVidaaSubscribePostCommandApiCommand.g.cs b/src/cli/AI21.CLI/Commands/VidaaSubscribeSolutionsVidaaSubscribePostCommandApiCommand.g.cs deleted file mode 100644 index dba5914f..00000000 --- a/src/cli/AI21.CLI/Commands/VidaaSubscribeSolutionsVidaaSubscribePostCommandApiCommand.g.cs +++ /dev/null @@ -1,59 +0,0 @@ -#nullable enable -#pragma warning disable CS0618 - -using System.CommandLine; - -namespace AI21.CLI.Commands; - -internal static partial class VidaaSubscribeSolutionsVidaaSubscribePostCommandApiCommand -{ - - - 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(@"vidaa-subscribe-solutions-vidaa-subscribe-post", @"Vidaa Subscribe"); - - - - 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.VidaaSubscribeSolutionsVidaaSubscribePostAsync( - - cancellationToken: cancellationToken).ConfigureAwait(false); - - - await CliRuntime.WriteResponseAsync( - parseResult, - response, - global::AI21.SourceGenerationContext.Default, - FormatResponse, - cancellationToken).ConfigureAwait(false); - }, cancellationToken).ConfigureAwait(false)); - return command; - } -} \ No newline at end of file diff --git a/src/cli/AI21.CLI/Commands/VidaaSubscriptionsPreviewSolutionsPreviewVidaaSubscriptionsGetCommandApiCommand.g.cs b/src/cli/AI21.CLI/Commands/VidaaSubscriptionsPreviewSolutionsPreviewVidaaSubscriptionsGetCommandApiCommand.g.cs deleted file mode 100644 index f1ca645e..00000000 --- a/src/cli/AI21.CLI/Commands/VidaaSubscriptionsPreviewSolutionsPreviewVidaaSubscriptionsGetCommandApiCommand.g.cs +++ /dev/null @@ -1,59 +0,0 @@ -#nullable enable -#pragma warning disable CS0618 - -using System.CommandLine; - -namespace AI21.CLI.Commands; - -internal static partial class VidaaSubscriptionsPreviewSolutionsPreviewVidaaSubscriptionsGetCommandApiCommand -{ - - - 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(@"vidaa-subscriptions-preview-solutions-preview-vidaa-subscriptions-get", @"Vidaa Subscriptions Preview"); - - - - 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.VidaaSubscriptionsPreviewSolutionsPreviewVidaaSubscriptionsGetAsync( - - cancellationToken: cancellationToken).ConfigureAwait(false); - - - await CliRuntime.WriteResponseAsync( - parseResult, - response, - global::AI21.SourceGenerationContext.Default, - FormatResponse, - cancellationToken).ConfigureAwait(false); - }, cancellationToken).ConfigureAwait(false)); - return command; - } -} \ No newline at end of file diff --git a/src/cli/AI21.CLI/Commands/VidaaSubscriptionsSolutionsVidaaSubscriptionsGetCommandApiCommand.g.cs b/src/cli/AI21.CLI/Commands/VidaaSubscriptionsSolutionsVidaaSubscriptionsGetCommandApiCommand.g.cs deleted file mode 100644 index 86e0af9f..00000000 --- a/src/cli/AI21.CLI/Commands/VidaaSubscriptionsSolutionsVidaaSubscriptionsGetCommandApiCommand.g.cs +++ /dev/null @@ -1,59 +0,0 @@ -#nullable enable -#pragma warning disable CS0618 - -using System.CommandLine; - -namespace AI21.CLI.Commands; - -internal static partial class VidaaSubscriptionsSolutionsVidaaSubscriptionsGetCommandApiCommand -{ - - - 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(@"vidaa-subscriptions-solutions-vidaa-subscriptions-get", @"Vidaa Subscriptions"); - - - - 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.VidaaSubscriptionsSolutionsVidaaSubscriptionsGetAsync( - - cancellationToken: cancellationToken).ConfigureAwait(false); - - - await CliRuntime.WriteResponseAsync( - parseResult, - response, - global::AI21.SourceGenerationContext.Default, - FormatResponse, - cancellationToken).ConfigureAwait(false); - }, cancellationToken).ConfigureAwait(false)); - return command; - } -} \ No newline at end of file diff --git a/src/cli/AI21.CLI/Commands/VidaaSummarizePreviewSolutionsPreviewVidaaSummarizePostCommandApiCommand.g.cs b/src/cli/AI21.CLI/Commands/VidaaSummarizePreviewSolutionsPreviewVidaaSummarizePostCommandApiCommand.g.cs deleted file mode 100644 index 0815d7b3..00000000 --- a/src/cli/AI21.CLI/Commands/VidaaSummarizePreviewSolutionsPreviewVidaaSummarizePostCommandApiCommand.g.cs +++ /dev/null @@ -1,59 +0,0 @@ -#nullable enable -#pragma warning disable CS0618 - -using System.CommandLine; - -namespace AI21.CLI.Commands; - -internal static partial class VidaaSummarizePreviewSolutionsPreviewVidaaSummarizePostCommandApiCommand -{ - - - 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(@"vidaa-summarize-preview-solutions-preview-vidaa-summarize-post", @"Vidaa Summarize Preview"); - - - - 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.VidaaSummarizePreviewSolutionsPreviewVidaaSummarizePostAsync( - - cancellationToken: cancellationToken).ConfigureAwait(false); - - - await CliRuntime.WriteResponseAsync( - parseResult, - response, - global::AI21.SourceGenerationContext.Default, - FormatResponse, - cancellationToken).ConfigureAwait(false); - }, cancellationToken).ConfigureAwait(false)); - return command; - } -} \ No newline at end of file diff --git a/src/cli/AI21.CLI/Commands/VidaaSummarizeSolutionsVidaaSummarizePostCommandApiCommand.g.cs b/src/cli/AI21.CLI/Commands/VidaaSummarizeSolutionsVidaaSummarizePostCommandApiCommand.g.cs deleted file mode 100644 index 642352b8..00000000 --- a/src/cli/AI21.CLI/Commands/VidaaSummarizeSolutionsVidaaSummarizePostCommandApiCommand.g.cs +++ /dev/null @@ -1,59 +0,0 @@ -#nullable enable -#pragma warning disable CS0618 - -using System.CommandLine; - -namespace AI21.CLI.Commands; - -internal static partial class VidaaSummarizeSolutionsVidaaSummarizePostCommandApiCommand -{ - - - 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(@"vidaa-summarize-solutions-vidaa-summarize-post", @"Vidaa Summarize"); - - - - 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.VidaaSummarizeSolutionsVidaaSummarizePostAsync( - - cancellationToken: cancellationToken).ConfigureAwait(false); - - - await CliRuntime.WriteResponseAsync( - parseResult, - response, - global::AI21.SourceGenerationContext.Default, - FormatResponse, - cancellationToken).ConfigureAwait(false); - }, cancellationToken).ConfigureAwait(false)); - return command; - } -} \ No newline at end of file diff --git a/src/cli/AI21.CLI/Commands/VidaaTriggerPollPreviewSolutionsPreviewVidaaTriggerPollPostCommandApiCommand.g.cs b/src/cli/AI21.CLI/Commands/VidaaTriggerPollPreviewSolutionsPreviewVidaaTriggerPollPostCommandApiCommand.g.cs deleted file mode 100644 index 66e9a703..00000000 --- a/src/cli/AI21.CLI/Commands/VidaaTriggerPollPreviewSolutionsPreviewVidaaTriggerPollPostCommandApiCommand.g.cs +++ /dev/null @@ -1,59 +0,0 @@ -#nullable enable -#pragma warning disable CS0618 - -using System.CommandLine; - -namespace AI21.CLI.Commands; - -internal static partial class VidaaTriggerPollPreviewSolutionsPreviewVidaaTriggerPollPostCommandApiCommand -{ - - - 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(@"vidaa-trigger-poll-preview-solutions-preview-vidaa-trigger-poll-post", @"Vidaa Trigger Poll Preview"); - - - - 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.VidaaTriggerPollPreviewSolutionsPreviewVidaaTriggerPollPostAsync( - - cancellationToken: cancellationToken).ConfigureAwait(false); - - - await CliRuntime.WriteResponseAsync( - parseResult, - response, - global::AI21.SourceGenerationContext.Default, - FormatResponse, - cancellationToken).ConfigureAwait(false); - }, cancellationToken).ConfigureAwait(false)); - return command; - } -} \ No newline at end of file diff --git a/src/cli/AI21.CLI/Commands/VidaaTriggerPollSolutionsVidaaTriggerPollPostCommandApiCommand.g.cs b/src/cli/AI21.CLI/Commands/VidaaTriggerPollSolutionsVidaaTriggerPollPostCommandApiCommand.g.cs deleted file mode 100644 index ab416e9c..00000000 --- a/src/cli/AI21.CLI/Commands/VidaaTriggerPollSolutionsVidaaTriggerPollPostCommandApiCommand.g.cs +++ /dev/null @@ -1,59 +0,0 @@ -#nullable enable -#pragma warning disable CS0618 - -using System.CommandLine; - -namespace AI21.CLI.Commands; - -internal static partial class VidaaTriggerPollSolutionsVidaaTriggerPollPostCommandApiCommand -{ - - - 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(@"vidaa-trigger-poll-solutions-vidaa-trigger-poll-post", @"Vidaa Trigger Poll"); - - - - 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.VidaaTriggerPollSolutionsVidaaTriggerPollPostAsync( - - cancellationToken: cancellationToken).ConfigureAwait(false); - - - await CliRuntime.WriteResponseAsync( - parseResult, - response, - global::AI21.SourceGenerationContext.Default, - FormatResponse, - cancellationToken).ConfigureAwait(false); - }, cancellationToken).ConfigureAwait(false)); - return command; - } -} \ No newline at end of file diff --git a/src/cli/AI21.CLI/Commands/VidaaUnsubscribePreviewSolutionsPreviewVidaaUnsubscribePostCommandApiCommand.g.cs b/src/cli/AI21.CLI/Commands/VidaaUnsubscribePreviewSolutionsPreviewVidaaUnsubscribePostCommandApiCommand.g.cs deleted file mode 100644 index 3d218555..00000000 --- a/src/cli/AI21.CLI/Commands/VidaaUnsubscribePreviewSolutionsPreviewVidaaUnsubscribePostCommandApiCommand.g.cs +++ /dev/null @@ -1,59 +0,0 @@ -#nullable enable -#pragma warning disable CS0618 - -using System.CommandLine; - -namespace AI21.CLI.Commands; - -internal static partial class VidaaUnsubscribePreviewSolutionsPreviewVidaaUnsubscribePostCommandApiCommand -{ - - - 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(@"vidaa-unsubscribe-preview-solutions-preview-vidaa-unsubscribe-post", @"Vidaa Unsubscribe Preview"); - - - - 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.VidaaUnsubscribePreviewSolutionsPreviewVidaaUnsubscribePostAsync( - - cancellationToken: cancellationToken).ConfigureAwait(false); - - - await CliRuntime.WriteResponseAsync( - parseResult, - response, - global::AI21.SourceGenerationContext.Default, - FormatResponse, - cancellationToken).ConfigureAwait(false); - }, cancellationToken).ConfigureAwait(false)); - return command; - } -} \ No newline at end of file diff --git a/src/cli/AI21.CLI/Commands/VidaaUnsubscribeSolutionsVidaaUnsubscribePostCommandApiCommand.g.cs b/src/cli/AI21.CLI/Commands/VidaaUnsubscribeSolutionsVidaaUnsubscribePostCommandApiCommand.g.cs deleted file mode 100644 index e49a3658..00000000 --- a/src/cli/AI21.CLI/Commands/VidaaUnsubscribeSolutionsVidaaUnsubscribePostCommandApiCommand.g.cs +++ /dev/null @@ -1,59 +0,0 @@ -#nullable enable -#pragma warning disable CS0618 - -using System.CommandLine; - -namespace AI21.CLI.Commands; - -internal static partial class VidaaUnsubscribeSolutionsVidaaUnsubscribePostCommandApiCommand -{ - - - 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(@"vidaa-unsubscribe-solutions-vidaa-unsubscribe-post", @"Vidaa Unsubscribe"); - - - - 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.VidaaUnsubscribeSolutionsVidaaUnsubscribePostAsync( - - cancellationToken: cancellationToken).ConfigureAwait(false); - - - await CliRuntime.WriteResponseAsync( - parseResult, - response, - global::AI21.SourceGenerationContext.Default, - FormatResponse, - cancellationToken).ConfigureAwait(false); - }, cancellationToken).ConfigureAwait(false)); - return command; - } -} \ No newline at end of file diff --git a/src/cli/AI21.CLI/Commands/WppFeedbackPrefixPreviewSolutionsPreviewWppFeedbackPostCommandApiCommand.g.cs b/src/cli/AI21.CLI/Commands/WppFeedbackPrefixPreviewSolutionsPreviewWppFeedbackPostCommandApiCommand.g.cs deleted file mode 100644 index 1e363564..00000000 --- a/src/cli/AI21.CLI/Commands/WppFeedbackPrefixPreviewSolutionsPreviewWppFeedbackPostCommandApiCommand.g.cs +++ /dev/null @@ -1,59 +0,0 @@ -#nullable enable -#pragma warning disable CS0618 - -using System.CommandLine; - -namespace AI21.CLI.Commands; - -internal static partial class WppFeedbackPrefixPreviewSolutionsPreviewWppFeedbackPostCommandApiCommand -{ - - - 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(@"wpp-feedback-prefix-preview-solutions-preview-wpp-feedback-post", @"Wpp Feedback Prefix Preview"); - - - - 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.WppFeedbackPrefixPreviewSolutionsPreviewWppFeedbackPostAsync( - - cancellationToken: cancellationToken).ConfigureAwait(false); - - - await CliRuntime.WriteResponseAsync( - parseResult, - response, - global::AI21.SourceGenerationContext.Default, - FormatResponse, - cancellationToken).ConfigureAwait(false); - }, cancellationToken).ConfigureAwait(false)); - return command; - } -} \ No newline at end of file diff --git a/src/cli/AI21.CLI/Commands/WppFeedbackSolutionsWppFeedbackPostCommandApiCommand.g.cs b/src/cli/AI21.CLI/Commands/WppFeedbackSolutionsWppFeedbackPostCommandApiCommand.g.cs deleted file mode 100644 index 014ce4ac..00000000 --- a/src/cli/AI21.CLI/Commands/WppFeedbackSolutionsWppFeedbackPostCommandApiCommand.g.cs +++ /dev/null @@ -1,59 +0,0 @@ -#nullable enable -#pragma warning disable CS0618 - -using System.CommandLine; - -namespace AI21.CLI.Commands; - -internal static partial class WppFeedbackSolutionsWppFeedbackPostCommandApiCommand -{ - - - 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(@"wpp-feedback-solutions-wpp-feedback-post", @"Wpp Feedback"); - - - - 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.WppFeedbackSolutionsWppFeedbackPostAsync( - - cancellationToken: cancellationToken).ConfigureAwait(false); - - - await CliRuntime.WriteResponseAsync( - parseResult, - response, - global::AI21.SourceGenerationContext.Default, - FormatResponse, - cancellationToken).ConfigureAwait(false); - }, cancellationToken).ConfigureAwait(false)); - return command; - } -} \ No newline at end of file diff --git a/src/cli/AI21.CLI/Commands/WppQueryPrefixPreviewSolutionsPreviewWppQueryPostCommandApiCommand.g.cs b/src/cli/AI21.CLI/Commands/WppQueryPrefixPreviewSolutionsPreviewWppQueryPostCommandApiCommand.g.cs deleted file mode 100644 index 304e74fe..00000000 --- a/src/cli/AI21.CLI/Commands/WppQueryPrefixPreviewSolutionsPreviewWppQueryPostCommandApiCommand.g.cs +++ /dev/null @@ -1,59 +0,0 @@ -#nullable enable -#pragma warning disable CS0618 - -using System.CommandLine; - -namespace AI21.CLI.Commands; - -internal static partial class WppQueryPrefixPreviewSolutionsPreviewWppQueryPostCommandApiCommand -{ - - - 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(@"wpp-query-prefix-preview-solutions-preview-wpp-query-post", @"Wpp Query Prefix Preview"); - - - - 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.WppQueryPrefixPreviewSolutionsPreviewWppQueryPostAsync( - - cancellationToken: cancellationToken).ConfigureAwait(false); - - - await CliRuntime.WriteResponseAsync( - parseResult, - response, - global::AI21.SourceGenerationContext.Default, - FormatResponse, - cancellationToken).ConfigureAwait(false); - }, cancellationToken).ConfigureAwait(false)); - return command; - } -} \ No newline at end of file diff --git a/src/cli/AI21.CLI/Commands/WppQuerySolutionsWppQueryPostCommandApiCommand.g.cs b/src/cli/AI21.CLI/Commands/WppQuerySolutionsWppQueryPostCommandApiCommand.g.cs deleted file mode 100644 index 20682cda..00000000 --- a/src/cli/AI21.CLI/Commands/WppQuerySolutionsWppQueryPostCommandApiCommand.g.cs +++ /dev/null @@ -1,59 +0,0 @@ -#nullable enable -#pragma warning disable CS0618 - -using System.CommandLine; - -namespace AI21.CLI.Commands; - -internal static partial class WppQuerySolutionsWppQueryPostCommandApiCommand -{ - - - 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(@"wpp-query-solutions-wpp-query-post", @"Wpp Query"); - - - - 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.WppQuerySolutionsWppQueryPostAsync( - - cancellationToken: cancellationToken).ConfigureAwait(false); - - - await CliRuntime.WriteResponseAsync( - parseResult, - response, - global::AI21.SourceGenerationContext.Default, - FormatResponse, - cancellationToken).ConfigureAwait(false); - }, cancellationToken).ConfigureAwait(false)); - return command; - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.AnalyticsAgentsGatewayAnalyticsV1AgentsGet.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.AnalyticsAgentsGatewayAnalyticsV1AgentsGet.g.cs new file mode 100644 index 00000000..0a83c0e4 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Ai21Client.AnalyticsAgentsGatewayAnalyticsV1AgentsGet.g.cs @@ -0,0 +1,411 @@ + +#nullable enable + +namespace AI21 +{ + public partial class Ai21Client + { + + + private static readonly global::AI21.EndPointSecurityRequirement s_AnalyticsAgentsGatewayAnalyticsV1AgentsGetSecurityRequirement0 = + new global::AI21.EndPointSecurityRequirement + { + Authorizations = new global::AI21.EndPointAuthorizationRequirement[] + { new global::AI21.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::AI21.EndPointSecurityRequirement[] s_AnalyticsAgentsGatewayAnalyticsV1AgentsGetSecurityRequirements = + new global::AI21.EndPointSecurityRequirement[] + { s_AnalyticsAgentsGatewayAnalyticsV1AgentsGetSecurityRequirement0, + }; + partial void PrepareAnalyticsAgentsGatewayAnalyticsV1AgentsGetArguments( + global::System.Net.Http.HttpClient httpClient); + partial void PrepareAnalyticsAgentsGatewayAnalyticsV1AgentsGetRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage); + partial void ProcessAnalyticsAgentsGatewayAnalyticsV1AgentsGetResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessAnalyticsAgentsGatewayAnalyticsV1AgentsGetResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Analytics Agents + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task AnalyticsAgentsGatewayAnalyticsV1AgentsGetAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await AnalyticsAgentsGatewayAnalyticsV1AgentsGetAsResponseAsync( + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Analytics Agents + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> AnalyticsAgentsGatewayAnalyticsV1AgentsGetAsResponseAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareAnalyticsAgentsGatewayAnalyticsV1AgentsGetArguments( + httpClient: HttpClient); + + + var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_AnalyticsAgentsGatewayAnalyticsV1AgentsGetSecurityRequirements, + operationName: "AnalyticsAgentsGatewayAnalyticsV1AgentsGetAsync"); + + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: "/gateway/analytics/v1/agents", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.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::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareAnalyticsAgentsGatewayAnalyticsV1AgentsGetRequest( + 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::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "AnalyticsAgentsGatewayAnalyticsV1AgentsGet", + methodName: "AnalyticsAgentsGatewayAnalyticsV1AgentsGetAsync", + pathTemplate: "\"/gateway/analytics/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::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "AnalyticsAgentsGatewayAnalyticsV1AgentsGet", + methodName: "AnalyticsAgentsGatewayAnalyticsV1AgentsGetAsync", + pathTemplate: "\"/gateway/analytics/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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "AnalyticsAgentsGatewayAnalyticsV1AgentsGet", + methodName: "AnalyticsAgentsGatewayAnalyticsV1AgentsGetAsync", + pathTemplate: "\"/gateway/analytics/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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessAnalyticsAgentsGatewayAnalyticsV1AgentsGetResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "AnalyticsAgentsGatewayAnalyticsV1AgentsGet", + methodName: "AnalyticsAgentsGatewayAnalyticsV1AgentsGetAsync", + pathTemplate: "\"/gateway/analytics/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::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "AnalyticsAgentsGatewayAnalyticsV1AgentsGet", + methodName: "AnalyticsAgentsGatewayAnalyticsV1AgentsGetAsync", + pathTemplate: "\"/gateway/analytics/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); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessAnalyticsAgentsGatewayAnalyticsV1AgentsGetResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? 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::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.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::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.AnalyticsAgentsTokenwiseAnalyticsV1AgentsGet.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.AnalyticsAgentsTokenwiseAnalyticsV1AgentsGet.g.cs new file mode 100644 index 00000000..d461c327 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Ai21Client.AnalyticsAgentsTokenwiseAnalyticsV1AgentsGet.g.cs @@ -0,0 +1,411 @@ + +#nullable enable + +namespace AI21 +{ + public partial class Ai21Client + { + + + private static readonly global::AI21.EndPointSecurityRequirement s_AnalyticsAgentsTokenwiseAnalyticsV1AgentsGetSecurityRequirement0 = + new global::AI21.EndPointSecurityRequirement + { + Authorizations = new global::AI21.EndPointAuthorizationRequirement[] + { new global::AI21.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::AI21.EndPointSecurityRequirement[] s_AnalyticsAgentsTokenwiseAnalyticsV1AgentsGetSecurityRequirements = + new global::AI21.EndPointSecurityRequirement[] + { s_AnalyticsAgentsTokenwiseAnalyticsV1AgentsGetSecurityRequirement0, + }; + partial void PrepareAnalyticsAgentsTokenwiseAnalyticsV1AgentsGetArguments( + global::System.Net.Http.HttpClient httpClient); + partial void PrepareAnalyticsAgentsTokenwiseAnalyticsV1AgentsGetRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage); + partial void ProcessAnalyticsAgentsTokenwiseAnalyticsV1AgentsGetResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessAnalyticsAgentsTokenwiseAnalyticsV1AgentsGetResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Analytics Agents + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task AnalyticsAgentsTokenwiseAnalyticsV1AgentsGetAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await AnalyticsAgentsTokenwiseAnalyticsV1AgentsGetAsResponseAsync( + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Analytics Agents + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> AnalyticsAgentsTokenwiseAnalyticsV1AgentsGetAsResponseAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareAnalyticsAgentsTokenwiseAnalyticsV1AgentsGetArguments( + httpClient: HttpClient); + + + var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_AnalyticsAgentsTokenwiseAnalyticsV1AgentsGetSecurityRequirements, + operationName: "AnalyticsAgentsTokenwiseAnalyticsV1AgentsGetAsync"); + + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: "/tokenwise/analytics/v1/agents", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.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::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareAnalyticsAgentsTokenwiseAnalyticsV1AgentsGetRequest( + 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::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "AnalyticsAgentsTokenwiseAnalyticsV1AgentsGet", + methodName: "AnalyticsAgentsTokenwiseAnalyticsV1AgentsGetAsync", + pathTemplate: "\"/tokenwise/analytics/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::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "AnalyticsAgentsTokenwiseAnalyticsV1AgentsGet", + methodName: "AnalyticsAgentsTokenwiseAnalyticsV1AgentsGetAsync", + pathTemplate: "\"/tokenwise/analytics/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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "AnalyticsAgentsTokenwiseAnalyticsV1AgentsGet", + methodName: "AnalyticsAgentsTokenwiseAnalyticsV1AgentsGetAsync", + pathTemplate: "\"/tokenwise/analytics/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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessAnalyticsAgentsTokenwiseAnalyticsV1AgentsGetResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "AnalyticsAgentsTokenwiseAnalyticsV1AgentsGet", + methodName: "AnalyticsAgentsTokenwiseAnalyticsV1AgentsGetAsync", + pathTemplate: "\"/tokenwise/analytics/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::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "AnalyticsAgentsTokenwiseAnalyticsV1AgentsGet", + methodName: "AnalyticsAgentsTokenwiseAnalyticsV1AgentsGetAsync", + pathTemplate: "\"/tokenwise/analytics/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); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessAnalyticsAgentsTokenwiseAnalyticsV1AgentsGetResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? 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::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.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::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.AnalyticsContextBashGatewayAnalyticsV1ContextBashGet.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.AnalyticsContextBashGatewayAnalyticsV1ContextBashGet.g.cs new file mode 100644 index 00000000..4f0fe3a6 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Ai21Client.AnalyticsContextBashGatewayAnalyticsV1ContextBashGet.g.cs @@ -0,0 +1,411 @@ + +#nullable enable + +namespace AI21 +{ + public partial class Ai21Client + { + + + private static readonly global::AI21.EndPointSecurityRequirement s_AnalyticsContextBashGatewayAnalyticsV1ContextBashGetSecurityRequirement0 = + new global::AI21.EndPointSecurityRequirement + { + Authorizations = new global::AI21.EndPointAuthorizationRequirement[] + { new global::AI21.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::AI21.EndPointSecurityRequirement[] s_AnalyticsContextBashGatewayAnalyticsV1ContextBashGetSecurityRequirements = + new global::AI21.EndPointSecurityRequirement[] + { s_AnalyticsContextBashGatewayAnalyticsV1ContextBashGetSecurityRequirement0, + }; + partial void PrepareAnalyticsContextBashGatewayAnalyticsV1ContextBashGetArguments( + global::System.Net.Http.HttpClient httpClient); + partial void PrepareAnalyticsContextBashGatewayAnalyticsV1ContextBashGetRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage); + partial void ProcessAnalyticsContextBashGatewayAnalyticsV1ContextBashGetResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessAnalyticsContextBashGatewayAnalyticsV1ContextBashGetResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Analytics Context Bash + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task AnalyticsContextBashGatewayAnalyticsV1ContextBashGetAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await AnalyticsContextBashGatewayAnalyticsV1ContextBashGetAsResponseAsync( + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Analytics Context Bash + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> AnalyticsContextBashGatewayAnalyticsV1ContextBashGetAsResponseAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareAnalyticsContextBashGatewayAnalyticsV1ContextBashGetArguments( + httpClient: HttpClient); + + + var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_AnalyticsContextBashGatewayAnalyticsV1ContextBashGetSecurityRequirements, + operationName: "AnalyticsContextBashGatewayAnalyticsV1ContextBashGetAsync"); + + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: "/gateway/analytics/v1/context/bash", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.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::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareAnalyticsContextBashGatewayAnalyticsV1ContextBashGetRequest( + 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::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "AnalyticsContextBashGatewayAnalyticsV1ContextBashGet", + methodName: "AnalyticsContextBashGatewayAnalyticsV1ContextBashGetAsync", + pathTemplate: "\"/gateway/analytics/v1/context/bash\"", + 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::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "AnalyticsContextBashGatewayAnalyticsV1ContextBashGet", + methodName: "AnalyticsContextBashGatewayAnalyticsV1ContextBashGetAsync", + pathTemplate: "\"/gateway/analytics/v1/context/bash\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "AnalyticsContextBashGatewayAnalyticsV1ContextBashGet", + methodName: "AnalyticsContextBashGatewayAnalyticsV1ContextBashGetAsync", + pathTemplate: "\"/gateway/analytics/v1/context/bash\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessAnalyticsContextBashGatewayAnalyticsV1ContextBashGetResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "AnalyticsContextBashGatewayAnalyticsV1ContextBashGet", + methodName: "AnalyticsContextBashGatewayAnalyticsV1ContextBashGetAsync", + pathTemplate: "\"/gateway/analytics/v1/context/bash\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "AnalyticsContextBashGatewayAnalyticsV1ContextBashGet", + methodName: "AnalyticsContextBashGatewayAnalyticsV1ContextBashGetAsync", + pathTemplate: "\"/gateway/analytics/v1/context/bash\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: __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); + ProcessAnalyticsContextBashGatewayAnalyticsV1ContextBashGetResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? 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::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.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::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.AnalyticsContextBashTokenwiseAnalyticsV1ContextBashGet.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.AnalyticsContextBashTokenwiseAnalyticsV1ContextBashGet.g.cs new file mode 100644 index 00000000..2475cf75 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Ai21Client.AnalyticsContextBashTokenwiseAnalyticsV1ContextBashGet.g.cs @@ -0,0 +1,411 @@ + +#nullable enable + +namespace AI21 +{ + public partial class Ai21Client + { + + + private static readonly global::AI21.EndPointSecurityRequirement s_AnalyticsContextBashTokenwiseAnalyticsV1ContextBashGetSecurityRequirement0 = + new global::AI21.EndPointSecurityRequirement + { + Authorizations = new global::AI21.EndPointAuthorizationRequirement[] + { new global::AI21.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::AI21.EndPointSecurityRequirement[] s_AnalyticsContextBashTokenwiseAnalyticsV1ContextBashGetSecurityRequirements = + new global::AI21.EndPointSecurityRequirement[] + { s_AnalyticsContextBashTokenwiseAnalyticsV1ContextBashGetSecurityRequirement0, + }; + partial void PrepareAnalyticsContextBashTokenwiseAnalyticsV1ContextBashGetArguments( + global::System.Net.Http.HttpClient httpClient); + partial void PrepareAnalyticsContextBashTokenwiseAnalyticsV1ContextBashGetRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage); + partial void ProcessAnalyticsContextBashTokenwiseAnalyticsV1ContextBashGetResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessAnalyticsContextBashTokenwiseAnalyticsV1ContextBashGetResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Analytics Context Bash + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task AnalyticsContextBashTokenwiseAnalyticsV1ContextBashGetAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await AnalyticsContextBashTokenwiseAnalyticsV1ContextBashGetAsResponseAsync( + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Analytics Context Bash + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> AnalyticsContextBashTokenwiseAnalyticsV1ContextBashGetAsResponseAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareAnalyticsContextBashTokenwiseAnalyticsV1ContextBashGetArguments( + httpClient: HttpClient); + + + var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_AnalyticsContextBashTokenwiseAnalyticsV1ContextBashGetSecurityRequirements, + operationName: "AnalyticsContextBashTokenwiseAnalyticsV1ContextBashGetAsync"); + + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: "/tokenwise/analytics/v1/context/bash", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.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::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareAnalyticsContextBashTokenwiseAnalyticsV1ContextBashGetRequest( + 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::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "AnalyticsContextBashTokenwiseAnalyticsV1ContextBashGet", + methodName: "AnalyticsContextBashTokenwiseAnalyticsV1ContextBashGetAsync", + pathTemplate: "\"/tokenwise/analytics/v1/context/bash\"", + 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::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "AnalyticsContextBashTokenwiseAnalyticsV1ContextBashGet", + methodName: "AnalyticsContextBashTokenwiseAnalyticsV1ContextBashGetAsync", + pathTemplate: "\"/tokenwise/analytics/v1/context/bash\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "AnalyticsContextBashTokenwiseAnalyticsV1ContextBashGet", + methodName: "AnalyticsContextBashTokenwiseAnalyticsV1ContextBashGetAsync", + pathTemplate: "\"/tokenwise/analytics/v1/context/bash\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessAnalyticsContextBashTokenwiseAnalyticsV1ContextBashGetResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "AnalyticsContextBashTokenwiseAnalyticsV1ContextBashGet", + methodName: "AnalyticsContextBashTokenwiseAnalyticsV1ContextBashGetAsync", + pathTemplate: "\"/tokenwise/analytics/v1/context/bash\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "AnalyticsContextBashTokenwiseAnalyticsV1ContextBashGet", + methodName: "AnalyticsContextBashTokenwiseAnalyticsV1ContextBashGetAsync", + pathTemplate: "\"/tokenwise/analytics/v1/context/bash\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: __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); + ProcessAnalyticsContextBashTokenwiseAnalyticsV1ContextBashGetResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? 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::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.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::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.AnalyticsContextBlocksGatewayAnalyticsV1ContextBlocksGet.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.AnalyticsContextBlocksGatewayAnalyticsV1ContextBlocksGet.g.cs new file mode 100644 index 00000000..ade90304 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Ai21Client.AnalyticsContextBlocksGatewayAnalyticsV1ContextBlocksGet.g.cs @@ -0,0 +1,411 @@ + +#nullable enable + +namespace AI21 +{ + public partial class Ai21Client + { + + + private static readonly global::AI21.EndPointSecurityRequirement s_AnalyticsContextBlocksGatewayAnalyticsV1ContextBlocksGetSecurityRequirement0 = + new global::AI21.EndPointSecurityRequirement + { + Authorizations = new global::AI21.EndPointAuthorizationRequirement[] + { new global::AI21.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::AI21.EndPointSecurityRequirement[] s_AnalyticsContextBlocksGatewayAnalyticsV1ContextBlocksGetSecurityRequirements = + new global::AI21.EndPointSecurityRequirement[] + { s_AnalyticsContextBlocksGatewayAnalyticsV1ContextBlocksGetSecurityRequirement0, + }; + partial void PrepareAnalyticsContextBlocksGatewayAnalyticsV1ContextBlocksGetArguments( + global::System.Net.Http.HttpClient httpClient); + partial void PrepareAnalyticsContextBlocksGatewayAnalyticsV1ContextBlocksGetRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage); + partial void ProcessAnalyticsContextBlocksGatewayAnalyticsV1ContextBlocksGetResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessAnalyticsContextBlocksGatewayAnalyticsV1ContextBlocksGetResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Analytics Context Blocks + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task AnalyticsContextBlocksGatewayAnalyticsV1ContextBlocksGetAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await AnalyticsContextBlocksGatewayAnalyticsV1ContextBlocksGetAsResponseAsync( + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Analytics Context Blocks + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> AnalyticsContextBlocksGatewayAnalyticsV1ContextBlocksGetAsResponseAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareAnalyticsContextBlocksGatewayAnalyticsV1ContextBlocksGetArguments( + httpClient: HttpClient); + + + var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_AnalyticsContextBlocksGatewayAnalyticsV1ContextBlocksGetSecurityRequirements, + operationName: "AnalyticsContextBlocksGatewayAnalyticsV1ContextBlocksGetAsync"); + + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: "/gateway/analytics/v1/context/blocks", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.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::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareAnalyticsContextBlocksGatewayAnalyticsV1ContextBlocksGetRequest( + 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::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "AnalyticsContextBlocksGatewayAnalyticsV1ContextBlocksGet", + methodName: "AnalyticsContextBlocksGatewayAnalyticsV1ContextBlocksGetAsync", + pathTemplate: "\"/gateway/analytics/v1/context/blocks\"", + 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::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "AnalyticsContextBlocksGatewayAnalyticsV1ContextBlocksGet", + methodName: "AnalyticsContextBlocksGatewayAnalyticsV1ContextBlocksGetAsync", + pathTemplate: "\"/gateway/analytics/v1/context/blocks\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "AnalyticsContextBlocksGatewayAnalyticsV1ContextBlocksGet", + methodName: "AnalyticsContextBlocksGatewayAnalyticsV1ContextBlocksGetAsync", + pathTemplate: "\"/gateway/analytics/v1/context/blocks\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessAnalyticsContextBlocksGatewayAnalyticsV1ContextBlocksGetResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "AnalyticsContextBlocksGatewayAnalyticsV1ContextBlocksGet", + methodName: "AnalyticsContextBlocksGatewayAnalyticsV1ContextBlocksGetAsync", + pathTemplate: "\"/gateway/analytics/v1/context/blocks\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "AnalyticsContextBlocksGatewayAnalyticsV1ContextBlocksGet", + methodName: "AnalyticsContextBlocksGatewayAnalyticsV1ContextBlocksGetAsync", + pathTemplate: "\"/gateway/analytics/v1/context/blocks\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: __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); + ProcessAnalyticsContextBlocksGatewayAnalyticsV1ContextBlocksGetResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? 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::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.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::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.AnalyticsContextBlocksTokenwiseAnalyticsV1ContextBlocksGet.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.AnalyticsContextBlocksTokenwiseAnalyticsV1ContextBlocksGet.g.cs new file mode 100644 index 00000000..4a0d05f5 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Ai21Client.AnalyticsContextBlocksTokenwiseAnalyticsV1ContextBlocksGet.g.cs @@ -0,0 +1,411 @@ + +#nullable enable + +namespace AI21 +{ + public partial class Ai21Client + { + + + private static readonly global::AI21.EndPointSecurityRequirement s_AnalyticsContextBlocksTokenwiseAnalyticsV1ContextBlocksGetSecurityRequirement0 = + new global::AI21.EndPointSecurityRequirement + { + Authorizations = new global::AI21.EndPointAuthorizationRequirement[] + { new global::AI21.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::AI21.EndPointSecurityRequirement[] s_AnalyticsContextBlocksTokenwiseAnalyticsV1ContextBlocksGetSecurityRequirements = + new global::AI21.EndPointSecurityRequirement[] + { s_AnalyticsContextBlocksTokenwiseAnalyticsV1ContextBlocksGetSecurityRequirement0, + }; + partial void PrepareAnalyticsContextBlocksTokenwiseAnalyticsV1ContextBlocksGetArguments( + global::System.Net.Http.HttpClient httpClient); + partial void PrepareAnalyticsContextBlocksTokenwiseAnalyticsV1ContextBlocksGetRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage); + partial void ProcessAnalyticsContextBlocksTokenwiseAnalyticsV1ContextBlocksGetResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessAnalyticsContextBlocksTokenwiseAnalyticsV1ContextBlocksGetResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Analytics Context Blocks + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task AnalyticsContextBlocksTokenwiseAnalyticsV1ContextBlocksGetAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await AnalyticsContextBlocksTokenwiseAnalyticsV1ContextBlocksGetAsResponseAsync( + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Analytics Context Blocks + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> AnalyticsContextBlocksTokenwiseAnalyticsV1ContextBlocksGetAsResponseAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareAnalyticsContextBlocksTokenwiseAnalyticsV1ContextBlocksGetArguments( + httpClient: HttpClient); + + + var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_AnalyticsContextBlocksTokenwiseAnalyticsV1ContextBlocksGetSecurityRequirements, + operationName: "AnalyticsContextBlocksTokenwiseAnalyticsV1ContextBlocksGetAsync"); + + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: "/tokenwise/analytics/v1/context/blocks", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.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::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareAnalyticsContextBlocksTokenwiseAnalyticsV1ContextBlocksGetRequest( + 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::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "AnalyticsContextBlocksTokenwiseAnalyticsV1ContextBlocksGet", + methodName: "AnalyticsContextBlocksTokenwiseAnalyticsV1ContextBlocksGetAsync", + pathTemplate: "\"/tokenwise/analytics/v1/context/blocks\"", + 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::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "AnalyticsContextBlocksTokenwiseAnalyticsV1ContextBlocksGet", + methodName: "AnalyticsContextBlocksTokenwiseAnalyticsV1ContextBlocksGetAsync", + pathTemplate: "\"/tokenwise/analytics/v1/context/blocks\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "AnalyticsContextBlocksTokenwiseAnalyticsV1ContextBlocksGet", + methodName: "AnalyticsContextBlocksTokenwiseAnalyticsV1ContextBlocksGetAsync", + pathTemplate: "\"/tokenwise/analytics/v1/context/blocks\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessAnalyticsContextBlocksTokenwiseAnalyticsV1ContextBlocksGetResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "AnalyticsContextBlocksTokenwiseAnalyticsV1ContextBlocksGet", + methodName: "AnalyticsContextBlocksTokenwiseAnalyticsV1ContextBlocksGetAsync", + pathTemplate: "\"/tokenwise/analytics/v1/context/blocks\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "AnalyticsContextBlocksTokenwiseAnalyticsV1ContextBlocksGet", + methodName: "AnalyticsContextBlocksTokenwiseAnalyticsV1ContextBlocksGetAsync", + pathTemplate: "\"/tokenwise/analytics/v1/context/blocks\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: __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); + ProcessAnalyticsContextBlocksTokenwiseAnalyticsV1ContextBlocksGetResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? 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::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.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::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.AnalyticsContextPrefixGatewayAnalyticsV1ContextPrefixGet.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.AnalyticsContextPrefixGatewayAnalyticsV1ContextPrefixGet.g.cs new file mode 100644 index 00000000..1f53341a --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Ai21Client.AnalyticsContextPrefixGatewayAnalyticsV1ContextPrefixGet.g.cs @@ -0,0 +1,411 @@ + +#nullable enable + +namespace AI21 +{ + public partial class Ai21Client + { + + + private static readonly global::AI21.EndPointSecurityRequirement s_AnalyticsContextPrefixGatewayAnalyticsV1ContextPrefixGetSecurityRequirement0 = + new global::AI21.EndPointSecurityRequirement + { + Authorizations = new global::AI21.EndPointAuthorizationRequirement[] + { new global::AI21.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::AI21.EndPointSecurityRequirement[] s_AnalyticsContextPrefixGatewayAnalyticsV1ContextPrefixGetSecurityRequirements = + new global::AI21.EndPointSecurityRequirement[] + { s_AnalyticsContextPrefixGatewayAnalyticsV1ContextPrefixGetSecurityRequirement0, + }; + partial void PrepareAnalyticsContextPrefixGatewayAnalyticsV1ContextPrefixGetArguments( + global::System.Net.Http.HttpClient httpClient); + partial void PrepareAnalyticsContextPrefixGatewayAnalyticsV1ContextPrefixGetRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage); + partial void ProcessAnalyticsContextPrefixGatewayAnalyticsV1ContextPrefixGetResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessAnalyticsContextPrefixGatewayAnalyticsV1ContextPrefixGetResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Analytics Context Prefix + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task AnalyticsContextPrefixGatewayAnalyticsV1ContextPrefixGetAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await AnalyticsContextPrefixGatewayAnalyticsV1ContextPrefixGetAsResponseAsync( + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Analytics Context Prefix + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> AnalyticsContextPrefixGatewayAnalyticsV1ContextPrefixGetAsResponseAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareAnalyticsContextPrefixGatewayAnalyticsV1ContextPrefixGetArguments( + httpClient: HttpClient); + + + var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_AnalyticsContextPrefixGatewayAnalyticsV1ContextPrefixGetSecurityRequirements, + operationName: "AnalyticsContextPrefixGatewayAnalyticsV1ContextPrefixGetAsync"); + + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: "/gateway/analytics/v1/context/prefix", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.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::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareAnalyticsContextPrefixGatewayAnalyticsV1ContextPrefixGetRequest( + 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::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "AnalyticsContextPrefixGatewayAnalyticsV1ContextPrefixGet", + methodName: "AnalyticsContextPrefixGatewayAnalyticsV1ContextPrefixGetAsync", + pathTemplate: "\"/gateway/analytics/v1/context/prefix\"", + 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::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "AnalyticsContextPrefixGatewayAnalyticsV1ContextPrefixGet", + methodName: "AnalyticsContextPrefixGatewayAnalyticsV1ContextPrefixGetAsync", + pathTemplate: "\"/gateway/analytics/v1/context/prefix\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "AnalyticsContextPrefixGatewayAnalyticsV1ContextPrefixGet", + methodName: "AnalyticsContextPrefixGatewayAnalyticsV1ContextPrefixGetAsync", + pathTemplate: "\"/gateway/analytics/v1/context/prefix\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessAnalyticsContextPrefixGatewayAnalyticsV1ContextPrefixGetResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "AnalyticsContextPrefixGatewayAnalyticsV1ContextPrefixGet", + methodName: "AnalyticsContextPrefixGatewayAnalyticsV1ContextPrefixGetAsync", + pathTemplate: "\"/gateway/analytics/v1/context/prefix\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "AnalyticsContextPrefixGatewayAnalyticsV1ContextPrefixGet", + methodName: "AnalyticsContextPrefixGatewayAnalyticsV1ContextPrefixGetAsync", + pathTemplate: "\"/gateway/analytics/v1/context/prefix\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: __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); + ProcessAnalyticsContextPrefixGatewayAnalyticsV1ContextPrefixGetResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? 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::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.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::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.AnalyticsContextPrefixTokenwiseAnalyticsV1ContextPrefixGet.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.AnalyticsContextPrefixTokenwiseAnalyticsV1ContextPrefixGet.g.cs new file mode 100644 index 00000000..fc2119a9 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Ai21Client.AnalyticsContextPrefixTokenwiseAnalyticsV1ContextPrefixGet.g.cs @@ -0,0 +1,411 @@ + +#nullable enable + +namespace AI21 +{ + public partial class Ai21Client + { + + + private static readonly global::AI21.EndPointSecurityRequirement s_AnalyticsContextPrefixTokenwiseAnalyticsV1ContextPrefixGetSecurityRequirement0 = + new global::AI21.EndPointSecurityRequirement + { + Authorizations = new global::AI21.EndPointAuthorizationRequirement[] + { new global::AI21.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::AI21.EndPointSecurityRequirement[] s_AnalyticsContextPrefixTokenwiseAnalyticsV1ContextPrefixGetSecurityRequirements = + new global::AI21.EndPointSecurityRequirement[] + { s_AnalyticsContextPrefixTokenwiseAnalyticsV1ContextPrefixGetSecurityRequirement0, + }; + partial void PrepareAnalyticsContextPrefixTokenwiseAnalyticsV1ContextPrefixGetArguments( + global::System.Net.Http.HttpClient httpClient); + partial void PrepareAnalyticsContextPrefixTokenwiseAnalyticsV1ContextPrefixGetRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage); + partial void ProcessAnalyticsContextPrefixTokenwiseAnalyticsV1ContextPrefixGetResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessAnalyticsContextPrefixTokenwiseAnalyticsV1ContextPrefixGetResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Analytics Context Prefix + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task AnalyticsContextPrefixTokenwiseAnalyticsV1ContextPrefixGetAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await AnalyticsContextPrefixTokenwiseAnalyticsV1ContextPrefixGetAsResponseAsync( + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Analytics Context Prefix + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> AnalyticsContextPrefixTokenwiseAnalyticsV1ContextPrefixGetAsResponseAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareAnalyticsContextPrefixTokenwiseAnalyticsV1ContextPrefixGetArguments( + httpClient: HttpClient); + + + var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_AnalyticsContextPrefixTokenwiseAnalyticsV1ContextPrefixGetSecurityRequirements, + operationName: "AnalyticsContextPrefixTokenwiseAnalyticsV1ContextPrefixGetAsync"); + + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: "/tokenwise/analytics/v1/context/prefix", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.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::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareAnalyticsContextPrefixTokenwiseAnalyticsV1ContextPrefixGetRequest( + 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::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "AnalyticsContextPrefixTokenwiseAnalyticsV1ContextPrefixGet", + methodName: "AnalyticsContextPrefixTokenwiseAnalyticsV1ContextPrefixGetAsync", + pathTemplate: "\"/tokenwise/analytics/v1/context/prefix\"", + 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::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "AnalyticsContextPrefixTokenwiseAnalyticsV1ContextPrefixGet", + methodName: "AnalyticsContextPrefixTokenwiseAnalyticsV1ContextPrefixGetAsync", + pathTemplate: "\"/tokenwise/analytics/v1/context/prefix\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "AnalyticsContextPrefixTokenwiseAnalyticsV1ContextPrefixGet", + methodName: "AnalyticsContextPrefixTokenwiseAnalyticsV1ContextPrefixGetAsync", + pathTemplate: "\"/tokenwise/analytics/v1/context/prefix\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessAnalyticsContextPrefixTokenwiseAnalyticsV1ContextPrefixGetResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "AnalyticsContextPrefixTokenwiseAnalyticsV1ContextPrefixGet", + methodName: "AnalyticsContextPrefixTokenwiseAnalyticsV1ContextPrefixGetAsync", + pathTemplate: "\"/tokenwise/analytics/v1/context/prefix\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "AnalyticsContextPrefixTokenwiseAnalyticsV1ContextPrefixGet", + methodName: "AnalyticsContextPrefixTokenwiseAnalyticsV1ContextPrefixGetAsync", + pathTemplate: "\"/tokenwise/analytics/v1/context/prefix\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: __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); + ProcessAnalyticsContextPrefixTokenwiseAnalyticsV1ContextPrefixGetResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? 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::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.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::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.AnalyticsContextToolsGatewayAnalyticsV1ContextToolsGet.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.AnalyticsContextToolsGatewayAnalyticsV1ContextToolsGet.g.cs new file mode 100644 index 00000000..8591133f --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Ai21Client.AnalyticsContextToolsGatewayAnalyticsV1ContextToolsGet.g.cs @@ -0,0 +1,411 @@ + +#nullable enable + +namespace AI21 +{ + public partial class Ai21Client + { + + + private static readonly global::AI21.EndPointSecurityRequirement s_AnalyticsContextToolsGatewayAnalyticsV1ContextToolsGetSecurityRequirement0 = + new global::AI21.EndPointSecurityRequirement + { + Authorizations = new global::AI21.EndPointAuthorizationRequirement[] + { new global::AI21.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::AI21.EndPointSecurityRequirement[] s_AnalyticsContextToolsGatewayAnalyticsV1ContextToolsGetSecurityRequirements = + new global::AI21.EndPointSecurityRequirement[] + { s_AnalyticsContextToolsGatewayAnalyticsV1ContextToolsGetSecurityRequirement0, + }; + partial void PrepareAnalyticsContextToolsGatewayAnalyticsV1ContextToolsGetArguments( + global::System.Net.Http.HttpClient httpClient); + partial void PrepareAnalyticsContextToolsGatewayAnalyticsV1ContextToolsGetRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage); + partial void ProcessAnalyticsContextToolsGatewayAnalyticsV1ContextToolsGetResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessAnalyticsContextToolsGatewayAnalyticsV1ContextToolsGetResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Analytics Context Tools + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task AnalyticsContextToolsGatewayAnalyticsV1ContextToolsGetAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await AnalyticsContextToolsGatewayAnalyticsV1ContextToolsGetAsResponseAsync( + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Analytics Context Tools + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> AnalyticsContextToolsGatewayAnalyticsV1ContextToolsGetAsResponseAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareAnalyticsContextToolsGatewayAnalyticsV1ContextToolsGetArguments( + httpClient: HttpClient); + + + var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_AnalyticsContextToolsGatewayAnalyticsV1ContextToolsGetSecurityRequirements, + operationName: "AnalyticsContextToolsGatewayAnalyticsV1ContextToolsGetAsync"); + + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: "/gateway/analytics/v1/context/tools", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.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::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareAnalyticsContextToolsGatewayAnalyticsV1ContextToolsGetRequest( + 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::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "AnalyticsContextToolsGatewayAnalyticsV1ContextToolsGet", + methodName: "AnalyticsContextToolsGatewayAnalyticsV1ContextToolsGetAsync", + pathTemplate: "\"/gateway/analytics/v1/context/tools\"", + 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::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "AnalyticsContextToolsGatewayAnalyticsV1ContextToolsGet", + methodName: "AnalyticsContextToolsGatewayAnalyticsV1ContextToolsGetAsync", + pathTemplate: "\"/gateway/analytics/v1/context/tools\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "AnalyticsContextToolsGatewayAnalyticsV1ContextToolsGet", + methodName: "AnalyticsContextToolsGatewayAnalyticsV1ContextToolsGetAsync", + pathTemplate: "\"/gateway/analytics/v1/context/tools\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessAnalyticsContextToolsGatewayAnalyticsV1ContextToolsGetResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "AnalyticsContextToolsGatewayAnalyticsV1ContextToolsGet", + methodName: "AnalyticsContextToolsGatewayAnalyticsV1ContextToolsGetAsync", + pathTemplate: "\"/gateway/analytics/v1/context/tools\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "AnalyticsContextToolsGatewayAnalyticsV1ContextToolsGet", + methodName: "AnalyticsContextToolsGatewayAnalyticsV1ContextToolsGetAsync", + pathTemplate: "\"/gateway/analytics/v1/context/tools\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: __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); + ProcessAnalyticsContextToolsGatewayAnalyticsV1ContextToolsGetResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? 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::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.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::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.AnalyticsContextToolsTokenwiseAnalyticsV1ContextToolsGet.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.AnalyticsContextToolsTokenwiseAnalyticsV1ContextToolsGet.g.cs new file mode 100644 index 00000000..c8ed3ba0 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Ai21Client.AnalyticsContextToolsTokenwiseAnalyticsV1ContextToolsGet.g.cs @@ -0,0 +1,411 @@ + +#nullable enable + +namespace AI21 +{ + public partial class Ai21Client + { + + + private static readonly global::AI21.EndPointSecurityRequirement s_AnalyticsContextToolsTokenwiseAnalyticsV1ContextToolsGetSecurityRequirement0 = + new global::AI21.EndPointSecurityRequirement + { + Authorizations = new global::AI21.EndPointAuthorizationRequirement[] + { new global::AI21.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::AI21.EndPointSecurityRequirement[] s_AnalyticsContextToolsTokenwiseAnalyticsV1ContextToolsGetSecurityRequirements = + new global::AI21.EndPointSecurityRequirement[] + { s_AnalyticsContextToolsTokenwiseAnalyticsV1ContextToolsGetSecurityRequirement0, + }; + partial void PrepareAnalyticsContextToolsTokenwiseAnalyticsV1ContextToolsGetArguments( + global::System.Net.Http.HttpClient httpClient); + partial void PrepareAnalyticsContextToolsTokenwiseAnalyticsV1ContextToolsGetRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage); + partial void ProcessAnalyticsContextToolsTokenwiseAnalyticsV1ContextToolsGetResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessAnalyticsContextToolsTokenwiseAnalyticsV1ContextToolsGetResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Analytics Context Tools + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task AnalyticsContextToolsTokenwiseAnalyticsV1ContextToolsGetAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await AnalyticsContextToolsTokenwiseAnalyticsV1ContextToolsGetAsResponseAsync( + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Analytics Context Tools + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> AnalyticsContextToolsTokenwiseAnalyticsV1ContextToolsGetAsResponseAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareAnalyticsContextToolsTokenwiseAnalyticsV1ContextToolsGetArguments( + httpClient: HttpClient); + + + var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_AnalyticsContextToolsTokenwiseAnalyticsV1ContextToolsGetSecurityRequirements, + operationName: "AnalyticsContextToolsTokenwiseAnalyticsV1ContextToolsGetAsync"); + + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: "/tokenwise/analytics/v1/context/tools", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.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::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareAnalyticsContextToolsTokenwiseAnalyticsV1ContextToolsGetRequest( + 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::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "AnalyticsContextToolsTokenwiseAnalyticsV1ContextToolsGet", + methodName: "AnalyticsContextToolsTokenwiseAnalyticsV1ContextToolsGetAsync", + pathTemplate: "\"/tokenwise/analytics/v1/context/tools\"", + 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::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "AnalyticsContextToolsTokenwiseAnalyticsV1ContextToolsGet", + methodName: "AnalyticsContextToolsTokenwiseAnalyticsV1ContextToolsGetAsync", + pathTemplate: "\"/tokenwise/analytics/v1/context/tools\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "AnalyticsContextToolsTokenwiseAnalyticsV1ContextToolsGet", + methodName: "AnalyticsContextToolsTokenwiseAnalyticsV1ContextToolsGetAsync", + pathTemplate: "\"/tokenwise/analytics/v1/context/tools\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessAnalyticsContextToolsTokenwiseAnalyticsV1ContextToolsGetResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "AnalyticsContextToolsTokenwiseAnalyticsV1ContextToolsGet", + methodName: "AnalyticsContextToolsTokenwiseAnalyticsV1ContextToolsGetAsync", + pathTemplate: "\"/tokenwise/analytics/v1/context/tools\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "AnalyticsContextToolsTokenwiseAnalyticsV1ContextToolsGet", + methodName: "AnalyticsContextToolsTokenwiseAnalyticsV1ContextToolsGetAsync", + pathTemplate: "\"/tokenwise/analytics/v1/context/tools\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: __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); + ProcessAnalyticsContextToolsTokenwiseAnalyticsV1ContextToolsGetResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? 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::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.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::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.AnalyticsErrorsGatewayAnalyticsV1ErrorsGet.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.AnalyticsErrorsGatewayAnalyticsV1ErrorsGet.g.cs new file mode 100644 index 00000000..6d790093 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Ai21Client.AnalyticsErrorsGatewayAnalyticsV1ErrorsGet.g.cs @@ -0,0 +1,411 @@ + +#nullable enable + +namespace AI21 +{ + public partial class Ai21Client + { + + + private static readonly global::AI21.EndPointSecurityRequirement s_AnalyticsErrorsGatewayAnalyticsV1ErrorsGetSecurityRequirement0 = + new global::AI21.EndPointSecurityRequirement + { + Authorizations = new global::AI21.EndPointAuthorizationRequirement[] + { new global::AI21.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::AI21.EndPointSecurityRequirement[] s_AnalyticsErrorsGatewayAnalyticsV1ErrorsGetSecurityRequirements = + new global::AI21.EndPointSecurityRequirement[] + { s_AnalyticsErrorsGatewayAnalyticsV1ErrorsGetSecurityRequirement0, + }; + partial void PrepareAnalyticsErrorsGatewayAnalyticsV1ErrorsGetArguments( + global::System.Net.Http.HttpClient httpClient); + partial void PrepareAnalyticsErrorsGatewayAnalyticsV1ErrorsGetRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage); + partial void ProcessAnalyticsErrorsGatewayAnalyticsV1ErrorsGetResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessAnalyticsErrorsGatewayAnalyticsV1ErrorsGetResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Analytics Errors + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task AnalyticsErrorsGatewayAnalyticsV1ErrorsGetAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await AnalyticsErrorsGatewayAnalyticsV1ErrorsGetAsResponseAsync( + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Analytics Errors + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> AnalyticsErrorsGatewayAnalyticsV1ErrorsGetAsResponseAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareAnalyticsErrorsGatewayAnalyticsV1ErrorsGetArguments( + httpClient: HttpClient); + + + var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_AnalyticsErrorsGatewayAnalyticsV1ErrorsGetSecurityRequirements, + operationName: "AnalyticsErrorsGatewayAnalyticsV1ErrorsGetAsync"); + + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: "/gateway/analytics/v1/errors", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.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::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareAnalyticsErrorsGatewayAnalyticsV1ErrorsGetRequest( + 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::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "AnalyticsErrorsGatewayAnalyticsV1ErrorsGet", + methodName: "AnalyticsErrorsGatewayAnalyticsV1ErrorsGetAsync", + pathTemplate: "\"/gateway/analytics/v1/errors\"", + 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::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "AnalyticsErrorsGatewayAnalyticsV1ErrorsGet", + methodName: "AnalyticsErrorsGatewayAnalyticsV1ErrorsGetAsync", + pathTemplate: "\"/gateway/analytics/v1/errors\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "AnalyticsErrorsGatewayAnalyticsV1ErrorsGet", + methodName: "AnalyticsErrorsGatewayAnalyticsV1ErrorsGetAsync", + pathTemplate: "\"/gateway/analytics/v1/errors\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessAnalyticsErrorsGatewayAnalyticsV1ErrorsGetResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "AnalyticsErrorsGatewayAnalyticsV1ErrorsGet", + methodName: "AnalyticsErrorsGatewayAnalyticsV1ErrorsGetAsync", + pathTemplate: "\"/gateway/analytics/v1/errors\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "AnalyticsErrorsGatewayAnalyticsV1ErrorsGet", + methodName: "AnalyticsErrorsGatewayAnalyticsV1ErrorsGetAsync", + pathTemplate: "\"/gateway/analytics/v1/errors\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: __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); + ProcessAnalyticsErrorsGatewayAnalyticsV1ErrorsGetResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? 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::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.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::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.AnalyticsErrorsTokenwiseAnalyticsV1ErrorsGet.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.AnalyticsErrorsTokenwiseAnalyticsV1ErrorsGet.g.cs new file mode 100644 index 00000000..4008904f --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Ai21Client.AnalyticsErrorsTokenwiseAnalyticsV1ErrorsGet.g.cs @@ -0,0 +1,411 @@ + +#nullable enable + +namespace AI21 +{ + public partial class Ai21Client + { + + + private static readonly global::AI21.EndPointSecurityRequirement s_AnalyticsErrorsTokenwiseAnalyticsV1ErrorsGetSecurityRequirement0 = + new global::AI21.EndPointSecurityRequirement + { + Authorizations = new global::AI21.EndPointAuthorizationRequirement[] + { new global::AI21.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::AI21.EndPointSecurityRequirement[] s_AnalyticsErrorsTokenwiseAnalyticsV1ErrorsGetSecurityRequirements = + new global::AI21.EndPointSecurityRequirement[] + { s_AnalyticsErrorsTokenwiseAnalyticsV1ErrorsGetSecurityRequirement0, + }; + partial void PrepareAnalyticsErrorsTokenwiseAnalyticsV1ErrorsGetArguments( + global::System.Net.Http.HttpClient httpClient); + partial void PrepareAnalyticsErrorsTokenwiseAnalyticsV1ErrorsGetRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage); + partial void ProcessAnalyticsErrorsTokenwiseAnalyticsV1ErrorsGetResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessAnalyticsErrorsTokenwiseAnalyticsV1ErrorsGetResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Analytics Errors + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task AnalyticsErrorsTokenwiseAnalyticsV1ErrorsGetAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await AnalyticsErrorsTokenwiseAnalyticsV1ErrorsGetAsResponseAsync( + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Analytics Errors + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> AnalyticsErrorsTokenwiseAnalyticsV1ErrorsGetAsResponseAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareAnalyticsErrorsTokenwiseAnalyticsV1ErrorsGetArguments( + httpClient: HttpClient); + + + var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_AnalyticsErrorsTokenwiseAnalyticsV1ErrorsGetSecurityRequirements, + operationName: "AnalyticsErrorsTokenwiseAnalyticsV1ErrorsGetAsync"); + + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: "/tokenwise/analytics/v1/errors", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.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::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareAnalyticsErrorsTokenwiseAnalyticsV1ErrorsGetRequest( + 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::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "AnalyticsErrorsTokenwiseAnalyticsV1ErrorsGet", + methodName: "AnalyticsErrorsTokenwiseAnalyticsV1ErrorsGetAsync", + pathTemplate: "\"/tokenwise/analytics/v1/errors\"", + 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::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "AnalyticsErrorsTokenwiseAnalyticsV1ErrorsGet", + methodName: "AnalyticsErrorsTokenwiseAnalyticsV1ErrorsGetAsync", + pathTemplate: "\"/tokenwise/analytics/v1/errors\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "AnalyticsErrorsTokenwiseAnalyticsV1ErrorsGet", + methodName: "AnalyticsErrorsTokenwiseAnalyticsV1ErrorsGetAsync", + pathTemplate: "\"/tokenwise/analytics/v1/errors\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessAnalyticsErrorsTokenwiseAnalyticsV1ErrorsGetResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "AnalyticsErrorsTokenwiseAnalyticsV1ErrorsGet", + methodName: "AnalyticsErrorsTokenwiseAnalyticsV1ErrorsGetAsync", + pathTemplate: "\"/tokenwise/analytics/v1/errors\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "AnalyticsErrorsTokenwiseAnalyticsV1ErrorsGet", + methodName: "AnalyticsErrorsTokenwiseAnalyticsV1ErrorsGetAsync", + pathTemplate: "\"/tokenwise/analytics/v1/errors\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: __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); + ProcessAnalyticsErrorsTokenwiseAnalyticsV1ErrorsGetResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? 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::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.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::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.AnalyticsFiltersGatewayAnalyticsV1FiltersGet.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.AnalyticsFiltersGatewayAnalyticsV1FiltersGet.g.cs new file mode 100644 index 00000000..3fdfe36f --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Ai21Client.AnalyticsFiltersGatewayAnalyticsV1FiltersGet.g.cs @@ -0,0 +1,411 @@ + +#nullable enable + +namespace AI21 +{ + public partial class Ai21Client + { + + + private static readonly global::AI21.EndPointSecurityRequirement s_AnalyticsFiltersGatewayAnalyticsV1FiltersGetSecurityRequirement0 = + new global::AI21.EndPointSecurityRequirement + { + Authorizations = new global::AI21.EndPointAuthorizationRequirement[] + { new global::AI21.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::AI21.EndPointSecurityRequirement[] s_AnalyticsFiltersGatewayAnalyticsV1FiltersGetSecurityRequirements = + new global::AI21.EndPointSecurityRequirement[] + { s_AnalyticsFiltersGatewayAnalyticsV1FiltersGetSecurityRequirement0, + }; + partial void PrepareAnalyticsFiltersGatewayAnalyticsV1FiltersGetArguments( + global::System.Net.Http.HttpClient httpClient); + partial void PrepareAnalyticsFiltersGatewayAnalyticsV1FiltersGetRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage); + partial void ProcessAnalyticsFiltersGatewayAnalyticsV1FiltersGetResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessAnalyticsFiltersGatewayAnalyticsV1FiltersGetResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Analytics Filters + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task AnalyticsFiltersGatewayAnalyticsV1FiltersGetAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await AnalyticsFiltersGatewayAnalyticsV1FiltersGetAsResponseAsync( + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Analytics Filters + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> AnalyticsFiltersGatewayAnalyticsV1FiltersGetAsResponseAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareAnalyticsFiltersGatewayAnalyticsV1FiltersGetArguments( + httpClient: HttpClient); + + + var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_AnalyticsFiltersGatewayAnalyticsV1FiltersGetSecurityRequirements, + operationName: "AnalyticsFiltersGatewayAnalyticsV1FiltersGetAsync"); + + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: "/gateway/analytics/v1/filters", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.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::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareAnalyticsFiltersGatewayAnalyticsV1FiltersGetRequest( + 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::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "AnalyticsFiltersGatewayAnalyticsV1FiltersGet", + methodName: "AnalyticsFiltersGatewayAnalyticsV1FiltersGetAsync", + pathTemplate: "\"/gateway/analytics/v1/filters\"", + 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::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "AnalyticsFiltersGatewayAnalyticsV1FiltersGet", + methodName: "AnalyticsFiltersGatewayAnalyticsV1FiltersGetAsync", + pathTemplate: "\"/gateway/analytics/v1/filters\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "AnalyticsFiltersGatewayAnalyticsV1FiltersGet", + methodName: "AnalyticsFiltersGatewayAnalyticsV1FiltersGetAsync", + pathTemplate: "\"/gateway/analytics/v1/filters\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessAnalyticsFiltersGatewayAnalyticsV1FiltersGetResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "AnalyticsFiltersGatewayAnalyticsV1FiltersGet", + methodName: "AnalyticsFiltersGatewayAnalyticsV1FiltersGetAsync", + pathTemplate: "\"/gateway/analytics/v1/filters\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "AnalyticsFiltersGatewayAnalyticsV1FiltersGet", + methodName: "AnalyticsFiltersGatewayAnalyticsV1FiltersGetAsync", + pathTemplate: "\"/gateway/analytics/v1/filters\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: __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); + ProcessAnalyticsFiltersGatewayAnalyticsV1FiltersGetResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? 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::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.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::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.AnalyticsFiltersTokenwiseAnalyticsV1FiltersGet.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.AnalyticsFiltersTokenwiseAnalyticsV1FiltersGet.g.cs new file mode 100644 index 00000000..0afc6221 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Ai21Client.AnalyticsFiltersTokenwiseAnalyticsV1FiltersGet.g.cs @@ -0,0 +1,411 @@ + +#nullable enable + +namespace AI21 +{ + public partial class Ai21Client + { + + + private static readonly global::AI21.EndPointSecurityRequirement s_AnalyticsFiltersTokenwiseAnalyticsV1FiltersGetSecurityRequirement0 = + new global::AI21.EndPointSecurityRequirement + { + Authorizations = new global::AI21.EndPointAuthorizationRequirement[] + { new global::AI21.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::AI21.EndPointSecurityRequirement[] s_AnalyticsFiltersTokenwiseAnalyticsV1FiltersGetSecurityRequirements = + new global::AI21.EndPointSecurityRequirement[] + { s_AnalyticsFiltersTokenwiseAnalyticsV1FiltersGetSecurityRequirement0, + }; + partial void PrepareAnalyticsFiltersTokenwiseAnalyticsV1FiltersGetArguments( + global::System.Net.Http.HttpClient httpClient); + partial void PrepareAnalyticsFiltersTokenwiseAnalyticsV1FiltersGetRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage); + partial void ProcessAnalyticsFiltersTokenwiseAnalyticsV1FiltersGetResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessAnalyticsFiltersTokenwiseAnalyticsV1FiltersGetResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Analytics Filters + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task AnalyticsFiltersTokenwiseAnalyticsV1FiltersGetAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await AnalyticsFiltersTokenwiseAnalyticsV1FiltersGetAsResponseAsync( + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Analytics Filters + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> AnalyticsFiltersTokenwiseAnalyticsV1FiltersGetAsResponseAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareAnalyticsFiltersTokenwiseAnalyticsV1FiltersGetArguments( + httpClient: HttpClient); + + + var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_AnalyticsFiltersTokenwiseAnalyticsV1FiltersGetSecurityRequirements, + operationName: "AnalyticsFiltersTokenwiseAnalyticsV1FiltersGetAsync"); + + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: "/tokenwise/analytics/v1/filters", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.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::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareAnalyticsFiltersTokenwiseAnalyticsV1FiltersGetRequest( + 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::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "AnalyticsFiltersTokenwiseAnalyticsV1FiltersGet", + methodName: "AnalyticsFiltersTokenwiseAnalyticsV1FiltersGetAsync", + pathTemplate: "\"/tokenwise/analytics/v1/filters\"", + 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::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "AnalyticsFiltersTokenwiseAnalyticsV1FiltersGet", + methodName: "AnalyticsFiltersTokenwiseAnalyticsV1FiltersGetAsync", + pathTemplate: "\"/tokenwise/analytics/v1/filters\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "AnalyticsFiltersTokenwiseAnalyticsV1FiltersGet", + methodName: "AnalyticsFiltersTokenwiseAnalyticsV1FiltersGetAsync", + pathTemplate: "\"/tokenwise/analytics/v1/filters\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessAnalyticsFiltersTokenwiseAnalyticsV1FiltersGetResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "AnalyticsFiltersTokenwiseAnalyticsV1FiltersGet", + methodName: "AnalyticsFiltersTokenwiseAnalyticsV1FiltersGetAsync", + pathTemplate: "\"/tokenwise/analytics/v1/filters\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "AnalyticsFiltersTokenwiseAnalyticsV1FiltersGet", + methodName: "AnalyticsFiltersTokenwiseAnalyticsV1FiltersGetAsync", + pathTemplate: "\"/tokenwise/analytics/v1/filters\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: __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); + ProcessAnalyticsFiltersTokenwiseAnalyticsV1FiltersGetResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? 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::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.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::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.AnalyticsSessionDetailGatewayAnalyticsV1SessionsSessionIdGet.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.AnalyticsSessionDetailGatewayAnalyticsV1SessionsSessionIdGet.g.cs new file mode 100644 index 00000000..e46cb5d3 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Ai21Client.AnalyticsSessionDetailGatewayAnalyticsV1SessionsSessionIdGet.g.cs @@ -0,0 +1,457 @@ + +#nullable enable + +namespace AI21 +{ + public partial class Ai21Client + { + + + private static readonly global::AI21.EndPointSecurityRequirement s_AnalyticsSessionDetailGatewayAnalyticsV1SessionsSessionIdGetSecurityRequirement0 = + new global::AI21.EndPointSecurityRequirement + { + Authorizations = new global::AI21.EndPointAuthorizationRequirement[] + { new global::AI21.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::AI21.EndPointSecurityRequirement[] s_AnalyticsSessionDetailGatewayAnalyticsV1SessionsSessionIdGetSecurityRequirements = + new global::AI21.EndPointSecurityRequirement[] + { s_AnalyticsSessionDetailGatewayAnalyticsV1SessionsSessionIdGetSecurityRequirement0, + }; + partial void PrepareAnalyticsSessionDetailGatewayAnalyticsV1SessionsSessionIdGetArguments( + global::System.Net.Http.HttpClient httpClient, + ref string sessionId); + partial void PrepareAnalyticsSessionDetailGatewayAnalyticsV1SessionsSessionIdGetRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string sessionId); + partial void ProcessAnalyticsSessionDetailGatewayAnalyticsV1SessionsSessionIdGetResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessAnalyticsSessionDetailGatewayAnalyticsV1SessionsSessionIdGetResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Analytics Session Detail + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task AnalyticsSessionDetailGatewayAnalyticsV1SessionsSessionIdGetAsync( + string sessionId, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await AnalyticsSessionDetailGatewayAnalyticsV1SessionsSessionIdGetAsResponseAsync( + sessionId: sessionId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Analytics Session Detail + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> AnalyticsSessionDetailGatewayAnalyticsV1SessionsSessionIdGetAsResponseAsync( + string sessionId, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareAnalyticsSessionDetailGatewayAnalyticsV1SessionsSessionIdGetArguments( + httpClient: HttpClient, + sessionId: ref sessionId); + + + var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_AnalyticsSessionDetailGatewayAnalyticsV1SessionsSessionIdGetSecurityRequirements, + operationName: "AnalyticsSessionDetailGatewayAnalyticsV1SessionsSessionIdGetAsync"); + + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: $"/gateway/analytics/v1/sessions/{sessionId}", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.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::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareAnalyticsSessionDetailGatewayAnalyticsV1SessionsSessionIdGetRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + sessionId: sessionId!); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "AnalyticsSessionDetailGatewayAnalyticsV1SessionsSessionIdGet", + methodName: "AnalyticsSessionDetailGatewayAnalyticsV1SessionsSessionIdGetAsync", + pathTemplate: "$\"/gateway/analytics/v1/sessions/{sessionId}\"", + 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::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "AnalyticsSessionDetailGatewayAnalyticsV1SessionsSessionIdGet", + methodName: "AnalyticsSessionDetailGatewayAnalyticsV1SessionsSessionIdGetAsync", + pathTemplate: "$\"/gateway/analytics/v1/sessions/{sessionId}\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "AnalyticsSessionDetailGatewayAnalyticsV1SessionsSessionIdGet", + methodName: "AnalyticsSessionDetailGatewayAnalyticsV1SessionsSessionIdGetAsync", + pathTemplate: "$\"/gateway/analytics/v1/sessions/{sessionId}\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessAnalyticsSessionDetailGatewayAnalyticsV1SessionsSessionIdGetResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "AnalyticsSessionDetailGatewayAnalyticsV1SessionsSessionIdGet", + methodName: "AnalyticsSessionDetailGatewayAnalyticsV1SessionsSessionIdGetAsync", + pathTemplate: "$\"/gateway/analytics/v1/sessions/{sessionId}\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "AnalyticsSessionDetailGatewayAnalyticsV1SessionsSessionIdGet", + methodName: "AnalyticsSessionDetailGatewayAnalyticsV1SessionsSessionIdGetAsync", + pathTemplate: "$\"/gateway/analytics/v1/sessions/{sessionId}\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: __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::AI21.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessAnalyticsSessionDetailGatewayAnalyticsV1SessionsSessionIdGetResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? 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::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.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::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.AnalyticsSessionDetailTokenwiseAnalyticsV1SessionsSessionIdGet.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.AnalyticsSessionDetailTokenwiseAnalyticsV1SessionsSessionIdGet.g.cs new file mode 100644 index 00000000..8349d3d2 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Ai21Client.AnalyticsSessionDetailTokenwiseAnalyticsV1SessionsSessionIdGet.g.cs @@ -0,0 +1,457 @@ + +#nullable enable + +namespace AI21 +{ + public partial class Ai21Client + { + + + private static readonly global::AI21.EndPointSecurityRequirement s_AnalyticsSessionDetailTokenwiseAnalyticsV1SessionsSessionIdGetSecurityRequirement0 = + new global::AI21.EndPointSecurityRequirement + { + Authorizations = new global::AI21.EndPointAuthorizationRequirement[] + { new global::AI21.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::AI21.EndPointSecurityRequirement[] s_AnalyticsSessionDetailTokenwiseAnalyticsV1SessionsSessionIdGetSecurityRequirements = + new global::AI21.EndPointSecurityRequirement[] + { s_AnalyticsSessionDetailTokenwiseAnalyticsV1SessionsSessionIdGetSecurityRequirement0, + }; + partial void PrepareAnalyticsSessionDetailTokenwiseAnalyticsV1SessionsSessionIdGetArguments( + global::System.Net.Http.HttpClient httpClient, + ref string sessionId); + partial void PrepareAnalyticsSessionDetailTokenwiseAnalyticsV1SessionsSessionIdGetRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string sessionId); + partial void ProcessAnalyticsSessionDetailTokenwiseAnalyticsV1SessionsSessionIdGetResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessAnalyticsSessionDetailTokenwiseAnalyticsV1SessionsSessionIdGetResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Analytics Session Detail + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task AnalyticsSessionDetailTokenwiseAnalyticsV1SessionsSessionIdGetAsync( + string sessionId, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await AnalyticsSessionDetailTokenwiseAnalyticsV1SessionsSessionIdGetAsResponseAsync( + sessionId: sessionId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Analytics Session Detail + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> AnalyticsSessionDetailTokenwiseAnalyticsV1SessionsSessionIdGetAsResponseAsync( + string sessionId, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareAnalyticsSessionDetailTokenwiseAnalyticsV1SessionsSessionIdGetArguments( + httpClient: HttpClient, + sessionId: ref sessionId); + + + var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_AnalyticsSessionDetailTokenwiseAnalyticsV1SessionsSessionIdGetSecurityRequirements, + operationName: "AnalyticsSessionDetailTokenwiseAnalyticsV1SessionsSessionIdGetAsync"); + + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: $"/tokenwise/analytics/v1/sessions/{sessionId}", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.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::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareAnalyticsSessionDetailTokenwiseAnalyticsV1SessionsSessionIdGetRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + sessionId: sessionId!); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "AnalyticsSessionDetailTokenwiseAnalyticsV1SessionsSessionIdGet", + methodName: "AnalyticsSessionDetailTokenwiseAnalyticsV1SessionsSessionIdGetAsync", + pathTemplate: "$\"/tokenwise/analytics/v1/sessions/{sessionId}\"", + 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::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "AnalyticsSessionDetailTokenwiseAnalyticsV1SessionsSessionIdGet", + methodName: "AnalyticsSessionDetailTokenwiseAnalyticsV1SessionsSessionIdGetAsync", + pathTemplate: "$\"/tokenwise/analytics/v1/sessions/{sessionId}\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "AnalyticsSessionDetailTokenwiseAnalyticsV1SessionsSessionIdGet", + methodName: "AnalyticsSessionDetailTokenwiseAnalyticsV1SessionsSessionIdGetAsync", + pathTemplate: "$\"/tokenwise/analytics/v1/sessions/{sessionId}\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessAnalyticsSessionDetailTokenwiseAnalyticsV1SessionsSessionIdGetResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "AnalyticsSessionDetailTokenwiseAnalyticsV1SessionsSessionIdGet", + methodName: "AnalyticsSessionDetailTokenwiseAnalyticsV1SessionsSessionIdGetAsync", + pathTemplate: "$\"/tokenwise/analytics/v1/sessions/{sessionId}\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "AnalyticsSessionDetailTokenwiseAnalyticsV1SessionsSessionIdGet", + methodName: "AnalyticsSessionDetailTokenwiseAnalyticsV1SessionsSessionIdGetAsync", + pathTemplate: "$\"/tokenwise/analytics/v1/sessions/{sessionId}\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: __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::AI21.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessAnalyticsSessionDetailTokenwiseAnalyticsV1SessionsSessionIdGetResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? 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::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.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::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.AnalyticsSessionsGatewayAnalyticsV1SessionsGet.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.AnalyticsSessionsGatewayAnalyticsV1SessionsGet.g.cs new file mode 100644 index 00000000..3469aa86 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Ai21Client.AnalyticsSessionsGatewayAnalyticsV1SessionsGet.g.cs @@ -0,0 +1,411 @@ + +#nullable enable + +namespace AI21 +{ + public partial class Ai21Client + { + + + private static readonly global::AI21.EndPointSecurityRequirement s_AnalyticsSessionsGatewayAnalyticsV1SessionsGetSecurityRequirement0 = + new global::AI21.EndPointSecurityRequirement + { + Authorizations = new global::AI21.EndPointAuthorizationRequirement[] + { new global::AI21.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::AI21.EndPointSecurityRequirement[] s_AnalyticsSessionsGatewayAnalyticsV1SessionsGetSecurityRequirements = + new global::AI21.EndPointSecurityRequirement[] + { s_AnalyticsSessionsGatewayAnalyticsV1SessionsGetSecurityRequirement0, + }; + partial void PrepareAnalyticsSessionsGatewayAnalyticsV1SessionsGetArguments( + global::System.Net.Http.HttpClient httpClient); + partial void PrepareAnalyticsSessionsGatewayAnalyticsV1SessionsGetRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage); + partial void ProcessAnalyticsSessionsGatewayAnalyticsV1SessionsGetResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessAnalyticsSessionsGatewayAnalyticsV1SessionsGetResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Analytics Sessions + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task AnalyticsSessionsGatewayAnalyticsV1SessionsGetAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await AnalyticsSessionsGatewayAnalyticsV1SessionsGetAsResponseAsync( + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Analytics Sessions + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> AnalyticsSessionsGatewayAnalyticsV1SessionsGetAsResponseAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareAnalyticsSessionsGatewayAnalyticsV1SessionsGetArguments( + httpClient: HttpClient); + + + var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_AnalyticsSessionsGatewayAnalyticsV1SessionsGetSecurityRequirements, + operationName: "AnalyticsSessionsGatewayAnalyticsV1SessionsGetAsync"); + + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: "/gateway/analytics/v1/sessions", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.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::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareAnalyticsSessionsGatewayAnalyticsV1SessionsGetRequest( + 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::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "AnalyticsSessionsGatewayAnalyticsV1SessionsGet", + methodName: "AnalyticsSessionsGatewayAnalyticsV1SessionsGetAsync", + pathTemplate: "\"/gateway/analytics/v1/sessions\"", + 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::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "AnalyticsSessionsGatewayAnalyticsV1SessionsGet", + methodName: "AnalyticsSessionsGatewayAnalyticsV1SessionsGetAsync", + pathTemplate: "\"/gateway/analytics/v1/sessions\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "AnalyticsSessionsGatewayAnalyticsV1SessionsGet", + methodName: "AnalyticsSessionsGatewayAnalyticsV1SessionsGetAsync", + pathTemplate: "\"/gateway/analytics/v1/sessions\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessAnalyticsSessionsGatewayAnalyticsV1SessionsGetResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "AnalyticsSessionsGatewayAnalyticsV1SessionsGet", + methodName: "AnalyticsSessionsGatewayAnalyticsV1SessionsGetAsync", + pathTemplate: "\"/gateway/analytics/v1/sessions\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "AnalyticsSessionsGatewayAnalyticsV1SessionsGet", + methodName: "AnalyticsSessionsGatewayAnalyticsV1SessionsGetAsync", + pathTemplate: "\"/gateway/analytics/v1/sessions\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: __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); + ProcessAnalyticsSessionsGatewayAnalyticsV1SessionsGetResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? 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::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.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::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.AnalyticsSessionsTokenwiseAnalyticsV1SessionsGet.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.AnalyticsSessionsTokenwiseAnalyticsV1SessionsGet.g.cs new file mode 100644 index 00000000..1e8d3c2a --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Ai21Client.AnalyticsSessionsTokenwiseAnalyticsV1SessionsGet.g.cs @@ -0,0 +1,411 @@ + +#nullable enable + +namespace AI21 +{ + public partial class Ai21Client + { + + + private static readonly global::AI21.EndPointSecurityRequirement s_AnalyticsSessionsTokenwiseAnalyticsV1SessionsGetSecurityRequirement0 = + new global::AI21.EndPointSecurityRequirement + { + Authorizations = new global::AI21.EndPointAuthorizationRequirement[] + { new global::AI21.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::AI21.EndPointSecurityRequirement[] s_AnalyticsSessionsTokenwiseAnalyticsV1SessionsGetSecurityRequirements = + new global::AI21.EndPointSecurityRequirement[] + { s_AnalyticsSessionsTokenwiseAnalyticsV1SessionsGetSecurityRequirement0, + }; + partial void PrepareAnalyticsSessionsTokenwiseAnalyticsV1SessionsGetArguments( + global::System.Net.Http.HttpClient httpClient); + partial void PrepareAnalyticsSessionsTokenwiseAnalyticsV1SessionsGetRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage); + partial void ProcessAnalyticsSessionsTokenwiseAnalyticsV1SessionsGetResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessAnalyticsSessionsTokenwiseAnalyticsV1SessionsGetResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Analytics Sessions + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task AnalyticsSessionsTokenwiseAnalyticsV1SessionsGetAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await AnalyticsSessionsTokenwiseAnalyticsV1SessionsGetAsResponseAsync( + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Analytics Sessions + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> AnalyticsSessionsTokenwiseAnalyticsV1SessionsGetAsResponseAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareAnalyticsSessionsTokenwiseAnalyticsV1SessionsGetArguments( + httpClient: HttpClient); + + + var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_AnalyticsSessionsTokenwiseAnalyticsV1SessionsGetSecurityRequirements, + operationName: "AnalyticsSessionsTokenwiseAnalyticsV1SessionsGetAsync"); + + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: "/tokenwise/analytics/v1/sessions", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.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::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareAnalyticsSessionsTokenwiseAnalyticsV1SessionsGetRequest( + 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::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "AnalyticsSessionsTokenwiseAnalyticsV1SessionsGet", + methodName: "AnalyticsSessionsTokenwiseAnalyticsV1SessionsGetAsync", + pathTemplate: "\"/tokenwise/analytics/v1/sessions\"", + 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::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "AnalyticsSessionsTokenwiseAnalyticsV1SessionsGet", + methodName: "AnalyticsSessionsTokenwiseAnalyticsV1SessionsGetAsync", + pathTemplate: "\"/tokenwise/analytics/v1/sessions\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "AnalyticsSessionsTokenwiseAnalyticsV1SessionsGet", + methodName: "AnalyticsSessionsTokenwiseAnalyticsV1SessionsGetAsync", + pathTemplate: "\"/tokenwise/analytics/v1/sessions\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessAnalyticsSessionsTokenwiseAnalyticsV1SessionsGetResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "AnalyticsSessionsTokenwiseAnalyticsV1SessionsGet", + methodName: "AnalyticsSessionsTokenwiseAnalyticsV1SessionsGetAsync", + pathTemplate: "\"/tokenwise/analytics/v1/sessions\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "AnalyticsSessionsTokenwiseAnalyticsV1SessionsGet", + methodName: "AnalyticsSessionsTokenwiseAnalyticsV1SessionsGetAsync", + pathTemplate: "\"/tokenwise/analytics/v1/sessions\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: __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); + ProcessAnalyticsSessionsTokenwiseAnalyticsV1SessionsGetResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? 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::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.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::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.AnalyticsSummaryGatewayAnalyticsV1SummaryGet.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.AnalyticsSummaryGatewayAnalyticsV1SummaryGet.g.cs new file mode 100644 index 00000000..7f436f1e --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Ai21Client.AnalyticsSummaryGatewayAnalyticsV1SummaryGet.g.cs @@ -0,0 +1,411 @@ + +#nullable enable + +namespace AI21 +{ + public partial class Ai21Client + { + + + private static readonly global::AI21.EndPointSecurityRequirement s_AnalyticsSummaryGatewayAnalyticsV1SummaryGetSecurityRequirement0 = + new global::AI21.EndPointSecurityRequirement + { + Authorizations = new global::AI21.EndPointAuthorizationRequirement[] + { new global::AI21.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::AI21.EndPointSecurityRequirement[] s_AnalyticsSummaryGatewayAnalyticsV1SummaryGetSecurityRequirements = + new global::AI21.EndPointSecurityRequirement[] + { s_AnalyticsSummaryGatewayAnalyticsV1SummaryGetSecurityRequirement0, + }; + partial void PrepareAnalyticsSummaryGatewayAnalyticsV1SummaryGetArguments( + global::System.Net.Http.HttpClient httpClient); + partial void PrepareAnalyticsSummaryGatewayAnalyticsV1SummaryGetRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage); + partial void ProcessAnalyticsSummaryGatewayAnalyticsV1SummaryGetResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessAnalyticsSummaryGatewayAnalyticsV1SummaryGetResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Analytics Summary + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task AnalyticsSummaryGatewayAnalyticsV1SummaryGetAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await AnalyticsSummaryGatewayAnalyticsV1SummaryGetAsResponseAsync( + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Analytics Summary + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> AnalyticsSummaryGatewayAnalyticsV1SummaryGetAsResponseAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareAnalyticsSummaryGatewayAnalyticsV1SummaryGetArguments( + httpClient: HttpClient); + + + var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_AnalyticsSummaryGatewayAnalyticsV1SummaryGetSecurityRequirements, + operationName: "AnalyticsSummaryGatewayAnalyticsV1SummaryGetAsync"); + + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: "/gateway/analytics/v1/summary", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.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::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareAnalyticsSummaryGatewayAnalyticsV1SummaryGetRequest( + 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::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "AnalyticsSummaryGatewayAnalyticsV1SummaryGet", + methodName: "AnalyticsSummaryGatewayAnalyticsV1SummaryGetAsync", + pathTemplate: "\"/gateway/analytics/v1/summary\"", + 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::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "AnalyticsSummaryGatewayAnalyticsV1SummaryGet", + methodName: "AnalyticsSummaryGatewayAnalyticsV1SummaryGetAsync", + pathTemplate: "\"/gateway/analytics/v1/summary\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "AnalyticsSummaryGatewayAnalyticsV1SummaryGet", + methodName: "AnalyticsSummaryGatewayAnalyticsV1SummaryGetAsync", + pathTemplate: "\"/gateway/analytics/v1/summary\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessAnalyticsSummaryGatewayAnalyticsV1SummaryGetResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "AnalyticsSummaryGatewayAnalyticsV1SummaryGet", + methodName: "AnalyticsSummaryGatewayAnalyticsV1SummaryGetAsync", + pathTemplate: "\"/gateway/analytics/v1/summary\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "AnalyticsSummaryGatewayAnalyticsV1SummaryGet", + methodName: "AnalyticsSummaryGatewayAnalyticsV1SummaryGetAsync", + pathTemplate: "\"/gateway/analytics/v1/summary\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: __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); + ProcessAnalyticsSummaryGatewayAnalyticsV1SummaryGetResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? 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::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.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::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.AnalyticsSummaryTokenwiseAnalyticsV1SummaryGet.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.AnalyticsSummaryTokenwiseAnalyticsV1SummaryGet.g.cs new file mode 100644 index 00000000..399e8d09 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Ai21Client.AnalyticsSummaryTokenwiseAnalyticsV1SummaryGet.g.cs @@ -0,0 +1,411 @@ + +#nullable enable + +namespace AI21 +{ + public partial class Ai21Client + { + + + private static readonly global::AI21.EndPointSecurityRequirement s_AnalyticsSummaryTokenwiseAnalyticsV1SummaryGetSecurityRequirement0 = + new global::AI21.EndPointSecurityRequirement + { + Authorizations = new global::AI21.EndPointAuthorizationRequirement[] + { new global::AI21.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::AI21.EndPointSecurityRequirement[] s_AnalyticsSummaryTokenwiseAnalyticsV1SummaryGetSecurityRequirements = + new global::AI21.EndPointSecurityRequirement[] + { s_AnalyticsSummaryTokenwiseAnalyticsV1SummaryGetSecurityRequirement0, + }; + partial void PrepareAnalyticsSummaryTokenwiseAnalyticsV1SummaryGetArguments( + global::System.Net.Http.HttpClient httpClient); + partial void PrepareAnalyticsSummaryTokenwiseAnalyticsV1SummaryGetRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage); + partial void ProcessAnalyticsSummaryTokenwiseAnalyticsV1SummaryGetResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessAnalyticsSummaryTokenwiseAnalyticsV1SummaryGetResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Analytics Summary + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task AnalyticsSummaryTokenwiseAnalyticsV1SummaryGetAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await AnalyticsSummaryTokenwiseAnalyticsV1SummaryGetAsResponseAsync( + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Analytics Summary + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> AnalyticsSummaryTokenwiseAnalyticsV1SummaryGetAsResponseAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareAnalyticsSummaryTokenwiseAnalyticsV1SummaryGetArguments( + httpClient: HttpClient); + + + var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_AnalyticsSummaryTokenwiseAnalyticsV1SummaryGetSecurityRequirements, + operationName: "AnalyticsSummaryTokenwiseAnalyticsV1SummaryGetAsync"); + + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: "/tokenwise/analytics/v1/summary", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.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::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareAnalyticsSummaryTokenwiseAnalyticsV1SummaryGetRequest( + 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::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "AnalyticsSummaryTokenwiseAnalyticsV1SummaryGet", + methodName: "AnalyticsSummaryTokenwiseAnalyticsV1SummaryGetAsync", + pathTemplate: "\"/tokenwise/analytics/v1/summary\"", + 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::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "AnalyticsSummaryTokenwiseAnalyticsV1SummaryGet", + methodName: "AnalyticsSummaryTokenwiseAnalyticsV1SummaryGetAsync", + pathTemplate: "\"/tokenwise/analytics/v1/summary\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "AnalyticsSummaryTokenwiseAnalyticsV1SummaryGet", + methodName: "AnalyticsSummaryTokenwiseAnalyticsV1SummaryGetAsync", + pathTemplate: "\"/tokenwise/analytics/v1/summary\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessAnalyticsSummaryTokenwiseAnalyticsV1SummaryGetResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "AnalyticsSummaryTokenwiseAnalyticsV1SummaryGet", + methodName: "AnalyticsSummaryTokenwiseAnalyticsV1SummaryGetAsync", + pathTemplate: "\"/tokenwise/analytics/v1/summary\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "AnalyticsSummaryTokenwiseAnalyticsV1SummaryGet", + methodName: "AnalyticsSummaryTokenwiseAnalyticsV1SummaryGetAsync", + pathTemplate: "\"/tokenwise/analytics/v1/summary\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: __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); + ProcessAnalyticsSummaryTokenwiseAnalyticsV1SummaryGetResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? 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::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.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::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.AnalyticsTransformersGatewayAnalyticsV1TransformersGet.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.AnalyticsTransformersGatewayAnalyticsV1TransformersGet.g.cs new file mode 100644 index 00000000..887bf15f --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Ai21Client.AnalyticsTransformersGatewayAnalyticsV1TransformersGet.g.cs @@ -0,0 +1,411 @@ + +#nullable enable + +namespace AI21 +{ + public partial class Ai21Client + { + + + private static readonly global::AI21.EndPointSecurityRequirement s_AnalyticsTransformersGatewayAnalyticsV1TransformersGetSecurityRequirement0 = + new global::AI21.EndPointSecurityRequirement + { + Authorizations = new global::AI21.EndPointAuthorizationRequirement[] + { new global::AI21.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::AI21.EndPointSecurityRequirement[] s_AnalyticsTransformersGatewayAnalyticsV1TransformersGetSecurityRequirements = + new global::AI21.EndPointSecurityRequirement[] + { s_AnalyticsTransformersGatewayAnalyticsV1TransformersGetSecurityRequirement0, + }; + partial void PrepareAnalyticsTransformersGatewayAnalyticsV1TransformersGetArguments( + global::System.Net.Http.HttpClient httpClient); + partial void PrepareAnalyticsTransformersGatewayAnalyticsV1TransformersGetRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage); + partial void ProcessAnalyticsTransformersGatewayAnalyticsV1TransformersGetResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessAnalyticsTransformersGatewayAnalyticsV1TransformersGetResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Analytics Transformers + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task AnalyticsTransformersGatewayAnalyticsV1TransformersGetAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await AnalyticsTransformersGatewayAnalyticsV1TransformersGetAsResponseAsync( + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Analytics Transformers + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> AnalyticsTransformersGatewayAnalyticsV1TransformersGetAsResponseAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareAnalyticsTransformersGatewayAnalyticsV1TransformersGetArguments( + httpClient: HttpClient); + + + var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_AnalyticsTransformersGatewayAnalyticsV1TransformersGetSecurityRequirements, + operationName: "AnalyticsTransformersGatewayAnalyticsV1TransformersGetAsync"); + + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: "/gateway/analytics/v1/transformers", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.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::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareAnalyticsTransformersGatewayAnalyticsV1TransformersGetRequest( + 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::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "AnalyticsTransformersGatewayAnalyticsV1TransformersGet", + methodName: "AnalyticsTransformersGatewayAnalyticsV1TransformersGetAsync", + pathTemplate: "\"/gateway/analytics/v1/transformers\"", + 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::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "AnalyticsTransformersGatewayAnalyticsV1TransformersGet", + methodName: "AnalyticsTransformersGatewayAnalyticsV1TransformersGetAsync", + pathTemplate: "\"/gateway/analytics/v1/transformers\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "AnalyticsTransformersGatewayAnalyticsV1TransformersGet", + methodName: "AnalyticsTransformersGatewayAnalyticsV1TransformersGetAsync", + pathTemplate: "\"/gateway/analytics/v1/transformers\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessAnalyticsTransformersGatewayAnalyticsV1TransformersGetResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "AnalyticsTransformersGatewayAnalyticsV1TransformersGet", + methodName: "AnalyticsTransformersGatewayAnalyticsV1TransformersGetAsync", + pathTemplate: "\"/gateway/analytics/v1/transformers\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "AnalyticsTransformersGatewayAnalyticsV1TransformersGet", + methodName: "AnalyticsTransformersGatewayAnalyticsV1TransformersGetAsync", + pathTemplate: "\"/gateway/analytics/v1/transformers\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: __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); + ProcessAnalyticsTransformersGatewayAnalyticsV1TransformersGetResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? 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::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.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::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.AnalyticsTransformersTokenwiseAnalyticsV1TransformersGet.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.AnalyticsTransformersTokenwiseAnalyticsV1TransformersGet.g.cs new file mode 100644 index 00000000..e9b9c04f --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Ai21Client.AnalyticsTransformersTokenwiseAnalyticsV1TransformersGet.g.cs @@ -0,0 +1,411 @@ + +#nullable enable + +namespace AI21 +{ + public partial class Ai21Client + { + + + private static readonly global::AI21.EndPointSecurityRequirement s_AnalyticsTransformersTokenwiseAnalyticsV1TransformersGetSecurityRequirement0 = + new global::AI21.EndPointSecurityRequirement + { + Authorizations = new global::AI21.EndPointAuthorizationRequirement[] + { new global::AI21.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::AI21.EndPointSecurityRequirement[] s_AnalyticsTransformersTokenwiseAnalyticsV1TransformersGetSecurityRequirements = + new global::AI21.EndPointSecurityRequirement[] + { s_AnalyticsTransformersTokenwiseAnalyticsV1TransformersGetSecurityRequirement0, + }; + partial void PrepareAnalyticsTransformersTokenwiseAnalyticsV1TransformersGetArguments( + global::System.Net.Http.HttpClient httpClient); + partial void PrepareAnalyticsTransformersTokenwiseAnalyticsV1TransformersGetRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage); + partial void ProcessAnalyticsTransformersTokenwiseAnalyticsV1TransformersGetResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessAnalyticsTransformersTokenwiseAnalyticsV1TransformersGetResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Analytics Transformers + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task AnalyticsTransformersTokenwiseAnalyticsV1TransformersGetAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await AnalyticsTransformersTokenwiseAnalyticsV1TransformersGetAsResponseAsync( + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Analytics Transformers + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> AnalyticsTransformersTokenwiseAnalyticsV1TransformersGetAsResponseAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareAnalyticsTransformersTokenwiseAnalyticsV1TransformersGetArguments( + httpClient: HttpClient); + + + var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_AnalyticsTransformersTokenwiseAnalyticsV1TransformersGetSecurityRequirements, + operationName: "AnalyticsTransformersTokenwiseAnalyticsV1TransformersGetAsync"); + + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: "/tokenwise/analytics/v1/transformers", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.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::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareAnalyticsTransformersTokenwiseAnalyticsV1TransformersGetRequest( + 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::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "AnalyticsTransformersTokenwiseAnalyticsV1TransformersGet", + methodName: "AnalyticsTransformersTokenwiseAnalyticsV1TransformersGetAsync", + pathTemplate: "\"/tokenwise/analytics/v1/transformers\"", + 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::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "AnalyticsTransformersTokenwiseAnalyticsV1TransformersGet", + methodName: "AnalyticsTransformersTokenwiseAnalyticsV1TransformersGetAsync", + pathTemplate: "\"/tokenwise/analytics/v1/transformers\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "AnalyticsTransformersTokenwiseAnalyticsV1TransformersGet", + methodName: "AnalyticsTransformersTokenwiseAnalyticsV1TransformersGetAsync", + pathTemplate: "\"/tokenwise/analytics/v1/transformers\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessAnalyticsTransformersTokenwiseAnalyticsV1TransformersGetResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "AnalyticsTransformersTokenwiseAnalyticsV1TransformersGet", + methodName: "AnalyticsTransformersTokenwiseAnalyticsV1TransformersGetAsync", + pathTemplate: "\"/tokenwise/analytics/v1/transformers\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "AnalyticsTransformersTokenwiseAnalyticsV1TransformersGet", + methodName: "AnalyticsTransformersTokenwiseAnalyticsV1TransformersGetAsync", + pathTemplate: "\"/tokenwise/analytics/v1/transformers\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: __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); + ProcessAnalyticsTransformersTokenwiseAnalyticsV1TransformersGetResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? 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::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.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::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.AnalyticsTrendsGatewayAnalyticsV1TrendsGet.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.AnalyticsTrendsGatewayAnalyticsV1TrendsGet.g.cs new file mode 100644 index 00000000..980856fb --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Ai21Client.AnalyticsTrendsGatewayAnalyticsV1TrendsGet.g.cs @@ -0,0 +1,411 @@ + +#nullable enable + +namespace AI21 +{ + public partial class Ai21Client + { + + + private static readonly global::AI21.EndPointSecurityRequirement s_AnalyticsTrendsGatewayAnalyticsV1TrendsGetSecurityRequirement0 = + new global::AI21.EndPointSecurityRequirement + { + Authorizations = new global::AI21.EndPointAuthorizationRequirement[] + { new global::AI21.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::AI21.EndPointSecurityRequirement[] s_AnalyticsTrendsGatewayAnalyticsV1TrendsGetSecurityRequirements = + new global::AI21.EndPointSecurityRequirement[] + { s_AnalyticsTrendsGatewayAnalyticsV1TrendsGetSecurityRequirement0, + }; + partial void PrepareAnalyticsTrendsGatewayAnalyticsV1TrendsGetArguments( + global::System.Net.Http.HttpClient httpClient); + partial void PrepareAnalyticsTrendsGatewayAnalyticsV1TrendsGetRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage); + partial void ProcessAnalyticsTrendsGatewayAnalyticsV1TrendsGetResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessAnalyticsTrendsGatewayAnalyticsV1TrendsGetResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Analytics Trends + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task AnalyticsTrendsGatewayAnalyticsV1TrendsGetAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await AnalyticsTrendsGatewayAnalyticsV1TrendsGetAsResponseAsync( + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Analytics Trends + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> AnalyticsTrendsGatewayAnalyticsV1TrendsGetAsResponseAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareAnalyticsTrendsGatewayAnalyticsV1TrendsGetArguments( + httpClient: HttpClient); + + + var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_AnalyticsTrendsGatewayAnalyticsV1TrendsGetSecurityRequirements, + operationName: "AnalyticsTrendsGatewayAnalyticsV1TrendsGetAsync"); + + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: "/gateway/analytics/v1/trends", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.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::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareAnalyticsTrendsGatewayAnalyticsV1TrendsGetRequest( + 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::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "AnalyticsTrendsGatewayAnalyticsV1TrendsGet", + methodName: "AnalyticsTrendsGatewayAnalyticsV1TrendsGetAsync", + pathTemplate: "\"/gateway/analytics/v1/trends\"", + 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::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "AnalyticsTrendsGatewayAnalyticsV1TrendsGet", + methodName: "AnalyticsTrendsGatewayAnalyticsV1TrendsGetAsync", + pathTemplate: "\"/gateway/analytics/v1/trends\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "AnalyticsTrendsGatewayAnalyticsV1TrendsGet", + methodName: "AnalyticsTrendsGatewayAnalyticsV1TrendsGetAsync", + pathTemplate: "\"/gateway/analytics/v1/trends\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessAnalyticsTrendsGatewayAnalyticsV1TrendsGetResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "AnalyticsTrendsGatewayAnalyticsV1TrendsGet", + methodName: "AnalyticsTrendsGatewayAnalyticsV1TrendsGetAsync", + pathTemplate: "\"/gateway/analytics/v1/trends\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "AnalyticsTrendsGatewayAnalyticsV1TrendsGet", + methodName: "AnalyticsTrendsGatewayAnalyticsV1TrendsGetAsync", + pathTemplate: "\"/gateway/analytics/v1/trends\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: __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); + ProcessAnalyticsTrendsGatewayAnalyticsV1TrendsGetResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? 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::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.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::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.AnalyticsTrendsTokenwiseAnalyticsV1TrendsGet.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.AnalyticsTrendsTokenwiseAnalyticsV1TrendsGet.g.cs new file mode 100644 index 00000000..f73f0d6a --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Ai21Client.AnalyticsTrendsTokenwiseAnalyticsV1TrendsGet.g.cs @@ -0,0 +1,411 @@ + +#nullable enable + +namespace AI21 +{ + public partial class Ai21Client + { + + + private static readonly global::AI21.EndPointSecurityRequirement s_AnalyticsTrendsTokenwiseAnalyticsV1TrendsGetSecurityRequirement0 = + new global::AI21.EndPointSecurityRequirement + { + Authorizations = new global::AI21.EndPointAuthorizationRequirement[] + { new global::AI21.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::AI21.EndPointSecurityRequirement[] s_AnalyticsTrendsTokenwiseAnalyticsV1TrendsGetSecurityRequirements = + new global::AI21.EndPointSecurityRequirement[] + { s_AnalyticsTrendsTokenwiseAnalyticsV1TrendsGetSecurityRequirement0, + }; + partial void PrepareAnalyticsTrendsTokenwiseAnalyticsV1TrendsGetArguments( + global::System.Net.Http.HttpClient httpClient); + partial void PrepareAnalyticsTrendsTokenwiseAnalyticsV1TrendsGetRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage); + partial void ProcessAnalyticsTrendsTokenwiseAnalyticsV1TrendsGetResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessAnalyticsTrendsTokenwiseAnalyticsV1TrendsGetResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Analytics Trends + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task AnalyticsTrendsTokenwiseAnalyticsV1TrendsGetAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await AnalyticsTrendsTokenwiseAnalyticsV1TrendsGetAsResponseAsync( + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Analytics Trends + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> AnalyticsTrendsTokenwiseAnalyticsV1TrendsGetAsResponseAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareAnalyticsTrendsTokenwiseAnalyticsV1TrendsGetArguments( + httpClient: HttpClient); + + + var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_AnalyticsTrendsTokenwiseAnalyticsV1TrendsGetSecurityRequirements, + operationName: "AnalyticsTrendsTokenwiseAnalyticsV1TrendsGetAsync"); + + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: "/tokenwise/analytics/v1/trends", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.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::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareAnalyticsTrendsTokenwiseAnalyticsV1TrendsGetRequest( + 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::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "AnalyticsTrendsTokenwiseAnalyticsV1TrendsGet", + methodName: "AnalyticsTrendsTokenwiseAnalyticsV1TrendsGetAsync", + pathTemplate: "\"/tokenwise/analytics/v1/trends\"", + 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::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "AnalyticsTrendsTokenwiseAnalyticsV1TrendsGet", + methodName: "AnalyticsTrendsTokenwiseAnalyticsV1TrendsGetAsync", + pathTemplate: "\"/tokenwise/analytics/v1/trends\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "AnalyticsTrendsTokenwiseAnalyticsV1TrendsGet", + methodName: "AnalyticsTrendsTokenwiseAnalyticsV1TrendsGetAsync", + pathTemplate: "\"/tokenwise/analytics/v1/trends\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessAnalyticsTrendsTokenwiseAnalyticsV1TrendsGetResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "AnalyticsTrendsTokenwiseAnalyticsV1TrendsGet", + methodName: "AnalyticsTrendsTokenwiseAnalyticsV1TrendsGetAsync", + pathTemplate: "\"/tokenwise/analytics/v1/trends\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "AnalyticsTrendsTokenwiseAnalyticsV1TrendsGet", + methodName: "AnalyticsTrendsTokenwiseAnalyticsV1TrendsGetAsync", + pathTemplate: "\"/tokenwise/analytics/v1/trends\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: __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); + ProcessAnalyticsTrendsTokenwiseAnalyticsV1TrendsGetResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? 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::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.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::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.Authorizations.Bearer.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.Authorizations.Bearer.g.cs index 3516b31f..c7ffea90 100644 --- a/src/libs/AI21/Generated/AI21.Ai21Client.Authorizations.Bearer.g.cs +++ b/src/libs/AI21/Generated/AI21.Ai21Client.Authorizations.Bearer.g.cs @@ -25,6 +25,7 @@ public void AuthorizeUsingBearer( Authorizations.Add(new global::AI21.EndPointAuthorization { Type = "Http", + SchemeId = "HttpBearer", Location = "Header", Name = "Bearer", Value = apiKey, diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.CanIframeStudioV1DemosScraperCanIframeGet.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.CanIframeStudioV1DemosScraperCanIframeGet.g.cs index ab08e11b..f18f2aa1 100644 --- a/src/libs/AI21/Generated/AI21.Ai21Client.CanIframeStudioV1DemosScraperCanIframeGet.g.cs +++ b/src/libs/AI21/Generated/AI21.Ai21Client.CanIframeStudioV1DemosScraperCanIframeGet.g.cs @@ -14,6 +14,7 @@ public partial class Ai21Client { new global::AI21.EndPointAuthorizationRequirement { Type = "Http", + SchemeId = "HttpBearer", Location = "Header", Name = "Bearer", FriendlyName = "Bearer", @@ -44,10 +45,32 @@ partial void ProcessCanIframeStudioV1DemosScraperCanIframeGetResponseContent( /// Can Iframe /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// public async global::System.Threading.Tasks.Task CanIframeStudioV1DemosScraperCanIframeGetAsync( string url, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await CanIframeStudioV1DemosScraperCanIframeGetAsResponseAsync( + url: url, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Can Iframe + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> CanIframeStudioV1DemosScraperCanIframeGetAsResponseAsync( + string url, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( @@ -62,25 +85,47 @@ partial void ProcessCanIframeStudioV1DemosScraperCanIframeGetResponseContent( securityRequirements: s_CanIframeStudioV1DemosScraperCanIframeGetSecurityRequirements, operationName: "CanIframeStudioV1DemosScraperCanIframeGetAsync"); - var __pathBuilder = new global::AI21.PathBuilder( - path: "/studio/v1/demos/scraper/can-iframe", - baseUri: HttpClient.BaseAddress); - __pathBuilder - .AddRequiredParameter("url", url) - ; - 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)); + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: "/studio/v1/demos/scraper/can-iframe", + baseUri: HttpClient.BaseAddress); + __pathBuilder + .AddRequiredParameter("url", url) + ; + var __path = __pathBuilder.ToString(); + __path = global::AI21.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; + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; #endif foreach (var __authorization in __authorizations) { if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2") + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") { __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( scheme: __authorization.Name, @@ -90,146 +135,326 @@ partial void ProcessCanIframeStudioV1DemosScraperCanIframeGetResponseContent( __authorization.Location == "Header") { __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } + } } + global::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareCanIframeStudioV1DemosScraperCanIframeGetRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - url: url); + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareCanIframeStudioV1DemosScraperCanIframeGetRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + url: url!); - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); + return __httpRequest; + } - ProcessResponse( - client: HttpClient, - response: __response); - ProcessCanIframeStudioV1DemosScraperCanIframeGetResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Validation Error - if ((int)__response.StatusCode == 422) + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::AI21.HTTPValidationError? __value_422 = null; - try + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) { - if (ReadResponseAsString) + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "CanIframeStudioV1DemosScraperCanIframeGet", + methodName: "CanIframeStudioV1DemosScraperCanIframeGetAsync", + pathTemplate: "\"/studio/v1/demos/scraper/can-iframe\"", + 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 { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); } - else + catch (global::System.Net.Http.HttpRequestException __exception) { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "CanIframeStudioV1DemosScraperCanIframeGet", + methodName: "CanIframeStudioV1DemosScraperCanIframeGetAsync", + pathTemplate: "\"/studio/v1/demos/scraper/can-iframe\"", + 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; + } - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "CanIframeStudioV1DemosScraperCanIframeGet", + methodName: "CanIframeStudioV1DemosScraperCanIframeGetAsync", + pathTemplate: "\"/studio/v1/demos/scraper/can-iframe\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; } - catch (global::System.Exception __ex) + + if (__response == null) { - __exception_422 = __ex; + throw new global::System.InvalidOperationException("No response received."); } - throw new global::AI21.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) + using (__response) { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - ProcessResponseContent( + ProcessResponse( client: HttpClient, - response: __response, - content: ref __content); - ProcessCanIframeStudioV1DemosScraperCanIframeGetResponseContent( + response: __response); + ProcessCanIframeStudioV1DemosScraperCanIframeGetResponse( httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) { - __response.EnsureSuccessStatusCode(); - - return __content; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "CanIframeStudioV1DemosScraperCanIframeGet", + methodName: "CanIframeStudioV1DemosScraperCanIframeGetAsync", + pathTemplate: "\"/studio/v1/demos/scraper/can-iframe\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } - catch (global::System.Exception __ex) + else { - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "CanIframeStudioV1DemosScraperCanIframeGet", + methodName: "CanIframeStudioV1DemosScraperCanIframeGetAsync", + pathTemplate: "\"/studio/v1/demos/scraper/can-iframe\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::AI21.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).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) - { - } + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessCanIframeStudioV1DemosScraperCanIframeGetResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? 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::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.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::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; } } + finally + { + __httpRequest?.Dispose(); + } } } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.ClarotyProductLookupSolutionsClarotyProductLookupPost.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.ClarotyProductLookupSolutionsClarotyProductLookupPost.g.cs deleted file mode 100644 index e44727f9..00000000 --- a/src/libs/AI21/Generated/AI21.Ai21Client.ClarotyProductLookupSolutionsClarotyProductLookupPost.g.cs +++ /dev/null @@ -1,188 +0,0 @@ - -#nullable enable - -namespace AI21 -{ - public partial class Ai21Client - { - - - private static readonly global::AI21.EndPointSecurityRequirement s_ClarotyProductLookupSolutionsClarotyProductLookupPostSecurityRequirement0 = - new global::AI21.EndPointSecurityRequirement - { - Authorizations = new global::AI21.EndPointAuthorizationRequirement[] - { new global::AI21.EndPointAuthorizationRequirement - { - Type = "Http", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::AI21.EndPointSecurityRequirement[] s_ClarotyProductLookupSolutionsClarotyProductLookupPostSecurityRequirements = - new global::AI21.EndPointSecurityRequirement[] - { s_ClarotyProductLookupSolutionsClarotyProductLookupPostSecurityRequirement0, - }; - partial void PrepareClarotyProductLookupSolutionsClarotyProductLookupPostArguments( - global::System.Net.Http.HttpClient httpClient); - partial void PrepareClarotyProductLookupSolutionsClarotyProductLookupPostRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage); - partial void ProcessClarotyProductLookupSolutionsClarotyProductLookupPostResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessClarotyProductLookupSolutionsClarotyProductLookupPostResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Claroty Product Lookup - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task ClarotyProductLookupSolutionsClarotyProductLookupPostAsync( - global::System.Threading.CancellationToken cancellationToken = default) - { - PrepareArguments( - client: HttpClient); - PrepareClarotyProductLookupSolutionsClarotyProductLookupPostArguments( - httpClient: HttpClient); - - - var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_ClarotyProductLookupSolutionsClarotyProductLookupPostSecurityRequirements, - operationName: "ClarotyProductLookupSolutionsClarotyProductLookupPostAsync"); - - var __pathBuilder = new global::AI21.PathBuilder( - path: "/solutions/claroty/product-lookup", - 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); - } - } - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareClarotyProductLookupSolutionsClarotyProductLookupPostRequest( - 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); - ProcessClarotyProductLookupSolutionsClarotyProductLookupPostResponse( - 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); - ProcessClarotyProductLookupSolutionsClarotyProductLookupPostResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return __content; - } - catch (global::System.Exception __ex) - { - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __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::AI21.ApiException( - message: __content ?? __response.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/AI21/Generated/AI21.Ai21Client.ClarotyScrapeUrlSolutionsClarotyScrapeUrlPost.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.ClarotyScrapeUrlSolutionsClarotyScrapeUrlPost.g.cs deleted file mode 100644 index 3c130729..00000000 --- a/src/libs/AI21/Generated/AI21.Ai21Client.ClarotyScrapeUrlSolutionsClarotyScrapeUrlPost.g.cs +++ /dev/null @@ -1,188 +0,0 @@ - -#nullable enable - -namespace AI21 -{ - public partial class Ai21Client - { - - - private static readonly global::AI21.EndPointSecurityRequirement s_ClarotyScrapeUrlSolutionsClarotyScrapeUrlPostSecurityRequirement0 = - new global::AI21.EndPointSecurityRequirement - { - Authorizations = new global::AI21.EndPointAuthorizationRequirement[] - { new global::AI21.EndPointAuthorizationRequirement - { - Type = "Http", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::AI21.EndPointSecurityRequirement[] s_ClarotyScrapeUrlSolutionsClarotyScrapeUrlPostSecurityRequirements = - new global::AI21.EndPointSecurityRequirement[] - { s_ClarotyScrapeUrlSolutionsClarotyScrapeUrlPostSecurityRequirement0, - }; - partial void PrepareClarotyScrapeUrlSolutionsClarotyScrapeUrlPostArguments( - global::System.Net.Http.HttpClient httpClient); - partial void PrepareClarotyScrapeUrlSolutionsClarotyScrapeUrlPostRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage); - partial void ProcessClarotyScrapeUrlSolutionsClarotyScrapeUrlPostResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessClarotyScrapeUrlSolutionsClarotyScrapeUrlPostResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Claroty Scrape Url - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task ClarotyScrapeUrlSolutionsClarotyScrapeUrlPostAsync( - global::System.Threading.CancellationToken cancellationToken = default) - { - PrepareArguments( - client: HttpClient); - PrepareClarotyScrapeUrlSolutionsClarotyScrapeUrlPostArguments( - httpClient: HttpClient); - - - var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_ClarotyScrapeUrlSolutionsClarotyScrapeUrlPostSecurityRequirements, - operationName: "ClarotyScrapeUrlSolutionsClarotyScrapeUrlPostAsync"); - - var __pathBuilder = new global::AI21.PathBuilder( - path: "/solutions/claroty/scrape-url", - 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); - } - } - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareClarotyScrapeUrlSolutionsClarotyScrapeUrlPostRequest( - 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); - ProcessClarotyScrapeUrlSolutionsClarotyScrapeUrlPostResponse( - 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); - ProcessClarotyScrapeUrlSolutionsClarotyScrapeUrlPostResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return __content; - } - catch (global::System.Exception __ex) - { - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __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::AI21.ApiException( - message: __content ?? __response.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/AI21/Generated/AI21.Ai21Client.ClarotySuggestVendorModelSolutionsClarotySuggestVendorModelPost.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.ClarotySuggestVendorModelSolutionsClarotySuggestVendorModelPost.g.cs deleted file mode 100644 index 24e94abe..00000000 --- a/src/libs/AI21/Generated/AI21.Ai21Client.ClarotySuggestVendorModelSolutionsClarotySuggestVendorModelPost.g.cs +++ /dev/null @@ -1,188 +0,0 @@ - -#nullable enable - -namespace AI21 -{ - public partial class Ai21Client - { - - - private static readonly global::AI21.EndPointSecurityRequirement s_ClarotySuggestVendorModelSolutionsClarotySuggestVendorModelPostSecurityRequirement0 = - new global::AI21.EndPointSecurityRequirement - { - Authorizations = new global::AI21.EndPointAuthorizationRequirement[] - { new global::AI21.EndPointAuthorizationRequirement - { - Type = "Http", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::AI21.EndPointSecurityRequirement[] s_ClarotySuggestVendorModelSolutionsClarotySuggestVendorModelPostSecurityRequirements = - new global::AI21.EndPointSecurityRequirement[] - { s_ClarotySuggestVendorModelSolutionsClarotySuggestVendorModelPostSecurityRequirement0, - }; - partial void PrepareClarotySuggestVendorModelSolutionsClarotySuggestVendorModelPostArguments( - global::System.Net.Http.HttpClient httpClient); - partial void PrepareClarotySuggestVendorModelSolutionsClarotySuggestVendorModelPostRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage); - partial void ProcessClarotySuggestVendorModelSolutionsClarotySuggestVendorModelPostResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessClarotySuggestVendorModelSolutionsClarotySuggestVendorModelPostResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Claroty Suggest Vendor Model - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task ClarotySuggestVendorModelSolutionsClarotySuggestVendorModelPostAsync( - global::System.Threading.CancellationToken cancellationToken = default) - { - PrepareArguments( - client: HttpClient); - PrepareClarotySuggestVendorModelSolutionsClarotySuggestVendorModelPostArguments( - httpClient: HttpClient); - - - var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_ClarotySuggestVendorModelSolutionsClarotySuggestVendorModelPostSecurityRequirements, - operationName: "ClarotySuggestVendorModelSolutionsClarotySuggestVendorModelPostAsync"); - - var __pathBuilder = new global::AI21.PathBuilder( - path: "/solutions/claroty/suggest-vendor-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); - } - } - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareClarotySuggestVendorModelSolutionsClarotySuggestVendorModelPostRequest( - 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); - ProcessClarotySuggestVendorModelSolutionsClarotySuggestVendorModelPostResponse( - 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); - ProcessClarotySuggestVendorModelSolutionsClarotySuggestVendorModelPostResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return __content; - } - catch (global::System.Exception __ex) - { - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __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::AI21.ApiException( - message: __content ?? __response.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/AI21/Generated/AI21.Ai21Client.CompareTextStudioV1DemosDocumentModifierCompareTextPost.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.CompareTextStudioV1DemosDocumentModifierCompareTextPost.g.cs index b0a8a53e..7575ad31 100644 --- a/src/libs/AI21/Generated/AI21.Ai21Client.CompareTextStudioV1DemosDocumentModifierCompareTextPost.g.cs +++ b/src/libs/AI21/Generated/AI21.Ai21Client.CompareTextStudioV1DemosDocumentModifierCompareTextPost.g.cs @@ -14,6 +14,7 @@ public partial class Ai21Client { new global::AI21.EndPointAuthorizationRequirement { Type = "Http", + SchemeId = "HttpBearer", Location = "Header", Name = "Bearer", FriendlyName = "Bearer", @@ -45,11 +46,36 @@ partial void ProcessCompareTextStudioV1DemosDocumentModifierCompareTextPostRespo /// Compare text in a document file against a reference text. /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// public async global::System.Threading.Tasks.Task CompareTextStudioV1DemosDocumentModifierCompareTextPostAsync( global::AI21.CompareTextRequest request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await CompareTextStudioV1DemosDocumentModifierCompareTextPostAsResponseAsync( + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Compare Text
+ /// Compare text in a document file against a reference text. + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> CompareTextStudioV1DemosDocumentModifierCompareTextPostAsResponseAsync( + + global::AI21.CompareTextRequest request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) { request = request ?? throw new global::System.ArgumentNullException(nameof(request)); @@ -66,22 +92,44 @@ partial void ProcessCompareTextStudioV1DemosDocumentModifierCompareTextPostRespo securityRequirements: s_CompareTextStudioV1DemosDocumentModifierCompareTextPostSecurityRequirements, operationName: "CompareTextStudioV1DemosDocumentModifierCompareTextPostAsync"); - var __pathBuilder = new global::AI21.PathBuilder( - path: "/studio/v1/demos/document-modifier/compare-text", - 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)); + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: "/studio/v1/demos/document-modifier/compare-text", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.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; + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; #endif foreach (var __authorization in __authorizations) { if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2") + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") { __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( scheme: __authorization.Name, @@ -91,152 +139,332 @@ partial void ProcessCompareTextStudioV1DemosDocumentModifierCompareTextPostRespo __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); - PrepareCompareTextStudioV1DemosDocumentModifierCompareTextPostRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - request: request); + 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::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareCompareTextStudioV1DemosDocumentModifierCompareTextPostRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + request: request); - ProcessResponse( - client: HttpClient, - response: __response); - ProcessCompareTextStudioV1DemosDocumentModifierCompareTextPostResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Validation Error - if ((int)__response.StatusCode == 422) + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::AI21.HTTPValidationError? __value_422 = null; - try + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) { - if (ReadResponseAsString) + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "CompareTextStudioV1DemosDocumentModifierCompareTextPost", + methodName: "CompareTextStudioV1DemosDocumentModifierCompareTextPostAsync", + pathTemplate: "\"/studio/v1/demos/document-modifier/compare-text\"", + 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 { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); } - else + catch (global::System.Net.Http.HttpRequestException __exception) { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "CompareTextStudioV1DemosDocumentModifierCompareTextPost", + methodName: "CompareTextStudioV1DemosDocumentModifierCompareTextPostAsync", + pathTemplate: "\"/studio/v1/demos/document-modifier/compare-text\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "CompareTextStudioV1DemosDocumentModifierCompareTextPost", + methodName: "CompareTextStudioV1DemosDocumentModifierCompareTextPostAsync", + pathTemplate: "\"/studio/v1/demos/document-modifier/compare-text\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; } + + break; } - catch (global::System.Exception __ex) + + if (__response == null) { - __exception_422 = __ex; + throw new global::System.InvalidOperationException("No response received."); } - throw new global::AI21.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) + using (__response) { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( + ProcessResponse( client: HttpClient, - response: __response, - content: ref __content); - ProcessCompareTextStudioV1DemosDocumentModifierCompareTextPostResponseContent( + response: __response); + ProcessCompareTextStudioV1DemosDocumentModifierCompareTextPostResponse( httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) { - __response.EnsureSuccessStatusCode(); - - return __content; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "CompareTextStudioV1DemosDocumentModifierCompareTextPost", + methodName: "CompareTextStudioV1DemosDocumentModifierCompareTextPostAsync", + pathTemplate: "\"/studio/v1/demos/document-modifier/compare-text\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } - catch (global::System.Exception __ex) + else { - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "CompareTextStudioV1DemosDocumentModifierCompareTextPost", + methodName: "CompareTextStudioV1DemosDocumentModifierCompareTextPostAsync", + pathTemplate: "\"/studio/v1/demos/document-modifier/compare-text\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::AI21.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).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) - { - } + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessCompareTextStudioV1DemosDocumentModifierCompareTextPostResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? 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::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.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::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; } } + finally + { + __httpRequest?.Dispose(); + } } /// /// Compare Text
@@ -244,11 +472,13 @@ partial void ProcessCompareTextStudioV1DemosDocumentModifierCompareTextPostRespo ///
/// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// public async global::System.Threading.Tasks.Task CompareTextStudioV1DemosDocumentModifierCompareTextPostAsync( string originalText, string modifiedText, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) { var __request = new global::AI21.CompareTextRequest @@ -259,6 +489,7 @@ partial void ProcessCompareTextStudioV1DemosDocumentModifierCompareTextPostRespo return await CompareTextStudioV1DemosDocumentModifierCompareTextPostAsync( request: __request, + requestOptions: requestOptions, cancellationToken: cancellationToken).ConfigureAwait(false); } } diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.Constructors.Bearer.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.Constructors.Bearer.g.cs index bdb1f7c5..5fdbcbdd 100644 --- a/src/libs/AI21/Generated/AI21.Ai21Client.Constructors.Bearer.g.cs +++ b/src/libs/AI21/Generated/AI21.Ai21Client.Constructors.Bearer.g.cs @@ -26,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/AI21/Generated/AI21.Ai21Client.ConvertDocumentFileStudioV1ChatFilesConvertPost.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.ConvertDocumentFileStudioV1ChatFilesConvertPost.g.cs index 25e41545..fb421d0b 100644 --- a/src/libs/AI21/Generated/AI21.Ai21Client.ConvertDocumentFileStudioV1ChatFilesConvertPost.g.cs +++ b/src/libs/AI21/Generated/AI21.Ai21Client.ConvertDocumentFileStudioV1ChatFilesConvertPost.g.cs @@ -14,6 +14,7 @@ public partial class Ai21Client { new global::AI21.EndPointAuthorizationRequirement { Type = "Http", + SchemeId = "HttpBearer", Location = "Header", Name = "Bearer", FriendlyName = "Bearer", @@ -44,11 +45,35 @@ partial void ProcessConvertDocumentFileStudioV1ChatFilesConvertPostResponseConte /// Convert Document 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 ConvertDocumentFileStudioV1ChatFilesConvertPostAsync( global::AI21.BodyConvertDocumentFileStudioV1ChatFilesConvertPost request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ConvertDocumentFileStudioV1ChatFilesConvertPostAsResponseAsync( + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Convert Document 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> ConvertDocumentFileStudioV1ChatFilesConvertPostAsResponseAsync( + + global::AI21.BodyConvertDocumentFileStudioV1ChatFilesConvertPost request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) { request = request ?? throw new global::System.ArgumentNullException(nameof(request)); @@ -65,22 +90,44 @@ partial void ProcessConvertDocumentFileStudioV1ChatFilesConvertPostResponseConte securityRequirements: s_ConvertDocumentFileStudioV1ChatFilesConvertPostSecurityRequirements, operationName: "ConvertDocumentFileStudioV1ChatFilesConvertPostAsync"); - var __pathBuilder = new global::AI21.PathBuilder( - path: "/studio/v1/chat/files/convert", - 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)); + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: false); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: "/studio/v1/chat/files/convert", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.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; + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; #endif foreach (var __authorization in __authorizations) { if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2") + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") { __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( scheme: __authorization.Name, @@ -90,179 +137,1267 @@ partial void ProcessConvertDocumentFileStudioV1ChatFilesConvertPostResponseConte __authorization.Location == "Header") { __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - using var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); - 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); - PrepareConvertDocumentFileStudioV1ChatFilesConvertPostRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - request: request); + var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); + 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; + } + } - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); + __httpRequest.Content = __httpRequestContent; - ProcessResponse( - client: HttpClient, - response: __response); - ProcessConvertDocumentFileStudioV1ChatFilesConvertPostResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Validation Error - if ((int)__response.StatusCode == 422) + global::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareConvertDocumentFileStudioV1ChatFilesConvertPostRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + request: request); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::AI21.HTTPValidationError? __value_422 = null; - try + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) { - if (ReadResponseAsString) + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ConvertDocumentFileStudioV1ChatFilesConvertPost", + methodName: "ConvertDocumentFileStudioV1ChatFilesConvertPostAsync", + pathTemplate: "\"/studio/v1/chat/files/convert\"", + 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 { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); } - else + catch (global::System.Net.Http.HttpRequestException __exception) { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ConvertDocumentFileStudioV1ChatFilesConvertPost", + methodName: "ConvertDocumentFileStudioV1ChatFilesConvertPostAsync", + pathTemplate: "\"/studio/v1/chat/files/convert\"", + 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; + } - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ConvertDocumentFileStudioV1ChatFilesConvertPost", + methodName: "ConvertDocumentFileStudioV1ChatFilesConvertPostAsync", + pathTemplate: "\"/studio/v1/chat/files/convert\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; } - catch (global::System.Exception __ex) + + if (__response == null) { - __exception_422 = __ex; + throw new global::System.InvalidOperationException("No response received."); } - throw new global::AI21.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) + using (__response) { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - ProcessResponseContent( + ProcessResponse( client: HttpClient, - response: __response, - content: ref __content); - ProcessConvertDocumentFileStudioV1ChatFilesConvertPostResponseContent( + response: __response); + ProcessConvertDocumentFileStudioV1ChatFilesConvertPostResponse( httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) { - __response.EnsureSuccessStatusCode(); - - return __content; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ConvertDocumentFileStudioV1ChatFilesConvertPost", + methodName: "ConvertDocumentFileStudioV1ChatFilesConvertPostAsync", + pathTemplate: "\"/studio/v1/chat/files/convert\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } - catch (global::System.Exception __ex) + else { - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ConvertDocumentFileStudioV1ChatFilesConvertPost", + methodName: "ConvertDocumentFileStudioV1ChatFilesConvertPostAsync", + pathTemplate: "\"/studio/v1/chat/files/convert\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __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::AI21.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessConvertDocumentFileStudioV1ChatFilesConvertPostResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? 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::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.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::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + } } - else + finally { - try - { - __response.EnsureSuccessStatusCode(); - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken + __httpRequest?.Dispose(); + } + } + /// + /// Convert Document 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 ConvertDocumentFileStudioV1ChatFilesConvertPostAsync( + global::System.Collections.Generic.IList files, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __request = new global::AI21.BodyConvertDocumentFileStudioV1ChatFilesConvertPost + { + Files = files, + }; + + return await ConvertDocumentFileStudioV1ChatFilesConvertPostAsync( + request: __request, + requestOptions: requestOptions, + cancellationToken: cancellationToken).ConfigureAwait(false); + } + + /// + /// Convert Document File + /// + /// + /// 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 ConvertDocumentFileStudioV1ChatFilesConvertPostAsync( + global::System.Collections.Generic.IReadOnlyList files, + global::System.Collections.Generic.IReadOnlyList? filesFileNames = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + + files = files ?? throw new global::System.ArgumentNullException(nameof(files)); + var request = new global::AI21.BodyConvertDocumentFileStudioV1ChatFilesConvertPost + { + Files = new global::System.Collections.Generic.List(), + }; + PrepareArguments( + client: HttpClient); + PrepareConvertDocumentFileStudioV1ChatFilesConvertPostArguments( + httpClient: HttpClient, + request: request); + + + var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_ConvertDocumentFileStudioV1ChatFilesConvertPostSecurityRequirements, + operationName: "ConvertDocumentFileStudioV1ChatFilesConvertPostAsync"); + + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: false); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: "/studio/v1/chat/files/convert", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.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 - ).ConfigureAwait(false); - return __content; + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); } - catch (global::System.Exception __ex) + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") { - string? __content = null; + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + + var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); + 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::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareConvertDocumentFileStudioV1ChatFilesConvertPostRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + request: request); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ConvertDocumentFileStudioV1ChatFilesConvertPost", + methodName: "ConvertDocumentFileStudioV1ChatFilesConvertPostAsync", + pathTemplate: "\"/studio/v1/chat/files/convert\"", + 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 { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); } - catch (global::System.Exception) + catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ConvertDocumentFileStudioV1ChatFilesConvertPost", + methodName: "ConvertDocumentFileStudioV1ChatFilesConvertPostAsync", + pathTemplate: "\"/studio/v1/chat/files/convert\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; } - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ConvertDocumentFileStudioV1ChatFilesConvertPost", + methodName: "ConvertDocumentFileStudioV1ChatFilesConvertPostAsync", + pathTemplate: "\"/studio/v1/chat/files/convert\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessConvertDocumentFileStudioV1ChatFilesConvertPostResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ConvertDocumentFileStudioV1ChatFilesConvertPost", + methodName: "ConvertDocumentFileStudioV1ChatFilesConvertPostAsync", + pathTemplate: "\"/studio/v1/chat/files/convert\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } + else + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ConvertDocumentFileStudioV1ChatFilesConvertPost", + methodName: "ConvertDocumentFileStudioV1ChatFilesConvertPostAsync", + pathTemplate: "\"/studio/v1/chat/files/convert\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __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::AI21.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessConvertDocumentFileStudioV1ChatFilesConvertPostResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return __content; + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? 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::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); } } /// /// Convert Document File /// - /// + /// + /// 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 ConvertDocumentFileStudioV1ChatFilesConvertPostAsync( - global::System.Collections.Generic.IList files, + /// + public async global::System.Threading.Tasks.Task> ConvertDocumentFileStudioV1ChatFilesConvertPostAsResponseAsync( + global::System.Collections.Generic.IReadOnlyList files, + global::System.Collections.Generic.IReadOnlyList? filesFileNames = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) { - var __request = new global::AI21.BodyConvertDocumentFileStudioV1ChatFilesConvertPost + + files = files ?? throw new global::System.ArgumentNullException(nameof(files)); + var request = new global::AI21.BodyConvertDocumentFileStudioV1ChatFilesConvertPost { - Files = files, + Files = new global::System.Collections.Generic.List(), }; + PrepareArguments( + client: HttpClient); + PrepareConvertDocumentFileStudioV1ChatFilesConvertPostArguments( + httpClient: HttpClient, + request: request); - return await ConvertDocumentFileStudioV1ChatFilesConvertPostAsync( - request: __request, - cancellationToken: cancellationToken).ConfigureAwait(false); + + var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_ConvertDocumentFileStudioV1ChatFilesConvertPostSecurityRequirements, + operationName: "ConvertDocumentFileStudioV1ChatFilesConvertPostAsync"); + + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: false); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: "/studio/v1/chat/files/convert", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Post, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + + var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); + 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::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareConvertDocumentFileStudioV1ChatFilesConvertPostRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + request: request); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ConvertDocumentFileStudioV1ChatFilesConvertPost", + methodName: "ConvertDocumentFileStudioV1ChatFilesConvertPostAsync", + pathTemplate: "\"/studio/v1/chat/files/convert\"", + 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::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ConvertDocumentFileStudioV1ChatFilesConvertPost", + methodName: "ConvertDocumentFileStudioV1ChatFilesConvertPostAsync", + pathTemplate: "\"/studio/v1/chat/files/convert\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ConvertDocumentFileStudioV1ChatFilesConvertPost", + methodName: "ConvertDocumentFileStudioV1ChatFilesConvertPostAsync", + pathTemplate: "\"/studio/v1/chat/files/convert\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessConvertDocumentFileStudioV1ChatFilesConvertPostResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ConvertDocumentFileStudioV1ChatFilesConvertPost", + methodName: "ConvertDocumentFileStudioV1ChatFilesConvertPostAsync", + pathTemplate: "\"/studio/v1/chat/files/convert\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ConvertDocumentFileStudioV1ChatFilesConvertPost", + methodName: "ConvertDocumentFileStudioV1ChatFilesConvertPostAsync", + pathTemplate: "\"/studio/v1/chat/files/convert\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __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::AI21.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessConvertDocumentFileStudioV1ChatFilesConvertPostResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? 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::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.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::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } } } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.CreateAgentGatewaySettingsAgentsPost.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.CreateAgentGatewaySettingsAgentsPost.g.cs new file mode 100644 index 00000000..30434c48 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Ai21Client.CreateAgentGatewaySettingsAgentsPost.g.cs @@ -0,0 +1,513 @@ + +#nullable enable + +namespace AI21 +{ + public partial class Ai21Client + { + + + private static readonly global::AI21.EndPointSecurityRequirement s_CreateAgentGatewaySettingsAgentsPostSecurityRequirement0 = + new global::AI21.EndPointSecurityRequirement + { + Authorizations = new global::AI21.EndPointAuthorizationRequirement[] + { new global::AI21.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::AI21.EndPointSecurityRequirement[] s_CreateAgentGatewaySettingsAgentsPostSecurityRequirements = + new global::AI21.EndPointSecurityRequirement[] + { s_CreateAgentGatewaySettingsAgentsPostSecurityRequirement0, + }; + partial void PrepareCreateAgentGatewaySettingsAgentsPostArguments( + global::System.Net.Http.HttpClient httpClient, + global::AI21.AgentCreate request); + partial void PrepareCreateAgentGatewaySettingsAgentsPostRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + global::AI21.AgentCreate request); + partial void ProcessCreateAgentGatewaySettingsAgentsPostResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessCreateAgentGatewaySettingsAgentsPostResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Create Agent + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task CreateAgentGatewaySettingsAgentsPostAsync( + + global::AI21.AgentCreate request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await CreateAgentGatewaySettingsAgentsPostAsResponseAsync( + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Create Agent + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> CreateAgentGatewaySettingsAgentsPostAsResponseAsync( + + global::AI21.AgentCreate request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + request = request ?? throw new global::System.ArgumentNullException(nameof(request)); + + PrepareArguments( + client: HttpClient); + PrepareCreateAgentGatewaySettingsAgentsPostArguments( + httpClient: HttpClient, + request: request); + + + var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_CreateAgentGatewaySettingsAgentsPostSecurityRequirements, + operationName: "CreateAgentGatewaySettingsAgentsPostAsync"); + + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: "/gateway/settings/agents", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Post, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + var __httpRequestContentBody = request.ToJson(JsonSerializerContext); + var __httpRequestContent = new global::System.Net.Http.StringContent( + content: __httpRequestContentBody, + encoding: global::System.Text.Encoding.UTF8, + mediaType: "application/json"); + __httpRequest.Content = __httpRequestContent; + global::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareCreateAgentGatewaySettingsAgentsPostRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + request: request); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "CreateAgentGatewaySettingsAgentsPost", + methodName: "CreateAgentGatewaySettingsAgentsPostAsync", + pathTemplate: "\"/gateway/settings/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::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "CreateAgentGatewaySettingsAgentsPost", + methodName: "CreateAgentGatewaySettingsAgentsPostAsync", + pathTemplate: "\"/gateway/settings/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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "CreateAgentGatewaySettingsAgentsPost", + methodName: "CreateAgentGatewaySettingsAgentsPostAsync", + pathTemplate: "\"/gateway/settings/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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessCreateAgentGatewaySettingsAgentsPostResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "CreateAgentGatewaySettingsAgentsPost", + methodName: "CreateAgentGatewaySettingsAgentsPostAsync", + pathTemplate: "\"/gateway/settings/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::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "CreateAgentGatewaySettingsAgentsPost", + methodName: "CreateAgentGatewaySettingsAgentsPostAsync", + pathTemplate: "\"/gateway/settings/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); + } + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::AI21.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessCreateAgentGatewaySettingsAgentsPostResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::AI21.AgentOut.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => 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::AI21.AgentOut.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.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 Agent + /// + /// + /// + /// Default Value: other + /// + /// + /// + /// + /// + /// 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 CreateAgentGatewaySettingsAgentsPostAsync( + string agentId, + string? kind = default, + string? name = default, + string? description = default, + string? configId = default, + bool? enabled = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __request = new global::AI21.AgentCreate + { + AgentId = agentId, + Kind = kind, + Name = name, + Description = description, + ConfigId = configId, + Enabled = enabled, + }; + + return await CreateAgentGatewaySettingsAgentsPostAsync( + request: __request, + requestOptions: requestOptions, + cancellationToken: cancellationToken).ConfigureAwait(false); + } + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.CreateAgentTokenwiseSettingsAgentsPost.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.CreateAgentTokenwiseSettingsAgentsPost.g.cs new file mode 100644 index 00000000..2b1bdd35 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Ai21Client.CreateAgentTokenwiseSettingsAgentsPost.g.cs @@ -0,0 +1,513 @@ + +#nullable enable + +namespace AI21 +{ + public partial class Ai21Client + { + + + private static readonly global::AI21.EndPointSecurityRequirement s_CreateAgentTokenwiseSettingsAgentsPostSecurityRequirement0 = + new global::AI21.EndPointSecurityRequirement + { + Authorizations = new global::AI21.EndPointAuthorizationRequirement[] + { new global::AI21.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::AI21.EndPointSecurityRequirement[] s_CreateAgentTokenwiseSettingsAgentsPostSecurityRequirements = + new global::AI21.EndPointSecurityRequirement[] + { s_CreateAgentTokenwiseSettingsAgentsPostSecurityRequirement0, + }; + partial void PrepareCreateAgentTokenwiseSettingsAgentsPostArguments( + global::System.Net.Http.HttpClient httpClient, + global::AI21.AgentCreate request); + partial void PrepareCreateAgentTokenwiseSettingsAgentsPostRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + global::AI21.AgentCreate request); + partial void ProcessCreateAgentTokenwiseSettingsAgentsPostResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessCreateAgentTokenwiseSettingsAgentsPostResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Create Agent + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task CreateAgentTokenwiseSettingsAgentsPostAsync( + + global::AI21.AgentCreate request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await CreateAgentTokenwiseSettingsAgentsPostAsResponseAsync( + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Create Agent + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> CreateAgentTokenwiseSettingsAgentsPostAsResponseAsync( + + global::AI21.AgentCreate request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + request = request ?? throw new global::System.ArgumentNullException(nameof(request)); + + PrepareArguments( + client: HttpClient); + PrepareCreateAgentTokenwiseSettingsAgentsPostArguments( + httpClient: HttpClient, + request: request); + + + var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_CreateAgentTokenwiseSettingsAgentsPostSecurityRequirements, + operationName: "CreateAgentTokenwiseSettingsAgentsPostAsync"); + + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: "/tokenwise/settings/agents", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Post, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + var __httpRequestContentBody = request.ToJson(JsonSerializerContext); + var __httpRequestContent = new global::System.Net.Http.StringContent( + content: __httpRequestContentBody, + encoding: global::System.Text.Encoding.UTF8, + mediaType: "application/json"); + __httpRequest.Content = __httpRequestContent; + global::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareCreateAgentTokenwiseSettingsAgentsPostRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + request: request); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "CreateAgentTokenwiseSettingsAgentsPost", + methodName: "CreateAgentTokenwiseSettingsAgentsPostAsync", + pathTemplate: "\"/tokenwise/settings/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::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "CreateAgentTokenwiseSettingsAgentsPost", + methodName: "CreateAgentTokenwiseSettingsAgentsPostAsync", + pathTemplate: "\"/tokenwise/settings/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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "CreateAgentTokenwiseSettingsAgentsPost", + methodName: "CreateAgentTokenwiseSettingsAgentsPostAsync", + pathTemplate: "\"/tokenwise/settings/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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessCreateAgentTokenwiseSettingsAgentsPostResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "CreateAgentTokenwiseSettingsAgentsPost", + methodName: "CreateAgentTokenwiseSettingsAgentsPostAsync", + pathTemplate: "\"/tokenwise/settings/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::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "CreateAgentTokenwiseSettingsAgentsPost", + methodName: "CreateAgentTokenwiseSettingsAgentsPostAsync", + pathTemplate: "\"/tokenwise/settings/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); + } + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::AI21.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessCreateAgentTokenwiseSettingsAgentsPostResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::AI21.AgentOut.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => 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::AI21.AgentOut.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.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 Agent + /// + /// + /// + /// Default Value: other + /// + /// + /// + /// + /// + /// 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 CreateAgentTokenwiseSettingsAgentsPostAsync( + string agentId, + string? kind = default, + string? name = default, + string? description = default, + string? configId = default, + bool? enabled = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __request = new global::AI21.AgentCreate + { + AgentId = agentId, + Kind = kind, + Name = name, + Description = description, + ConfigId = configId, + Enabled = enabled, + }; + + return await CreateAgentTokenwiseSettingsAgentsPostAsync( + request: __request, + requestOptions: requestOptions, + cancellationToken: cancellationToken).ConfigureAwait(false); + } + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.CreateConfigGatewaySettingsConfigsPost.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.CreateConfigGatewaySettingsConfigsPost.g.cs new file mode 100644 index 00000000..206ee629 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Ai21Client.CreateConfigGatewaySettingsConfigsPost.g.cs @@ -0,0 +1,508 @@ + +#nullable enable + +namespace AI21 +{ + public partial class Ai21Client + { + + + private static readonly global::AI21.EndPointSecurityRequirement s_CreateConfigGatewaySettingsConfigsPostSecurityRequirement0 = + new global::AI21.EndPointSecurityRequirement + { + Authorizations = new global::AI21.EndPointAuthorizationRequirement[] + { new global::AI21.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::AI21.EndPointSecurityRequirement[] s_CreateConfigGatewaySettingsConfigsPostSecurityRequirements = + new global::AI21.EndPointSecurityRequirement[] + { s_CreateConfigGatewaySettingsConfigsPostSecurityRequirement0, + }; + partial void PrepareCreateConfigGatewaySettingsConfigsPostArguments( + global::System.Net.Http.HttpClient httpClient, + global::AI21.ConfigProfileCreate request); + partial void PrepareCreateConfigGatewaySettingsConfigsPostRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + global::AI21.ConfigProfileCreate request); + partial void ProcessCreateConfigGatewaySettingsConfigsPostResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessCreateConfigGatewaySettingsConfigsPostResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Create 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 CreateConfigGatewaySettingsConfigsPostAsync( + + global::AI21.ConfigProfileCreate request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await CreateConfigGatewaySettingsConfigsPostAsResponseAsync( + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Create 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> CreateConfigGatewaySettingsConfigsPostAsResponseAsync( + + global::AI21.ConfigProfileCreate request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + request = request ?? throw new global::System.ArgumentNullException(nameof(request)); + + PrepareArguments( + client: HttpClient); + PrepareCreateConfigGatewaySettingsConfigsPostArguments( + httpClient: HttpClient, + request: request); + + + var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_CreateConfigGatewaySettingsConfigsPostSecurityRequirements, + operationName: "CreateConfigGatewaySettingsConfigsPostAsync"); + + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: "/gateway/settings/configs", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Post, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + var __httpRequestContentBody = request.ToJson(JsonSerializerContext); + var __httpRequestContent = new global::System.Net.Http.StringContent( + content: __httpRequestContentBody, + encoding: global::System.Text.Encoding.UTF8, + mediaType: "application/json"); + __httpRequest.Content = __httpRequestContent; + global::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareCreateConfigGatewaySettingsConfigsPostRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + request: request); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "CreateConfigGatewaySettingsConfigsPost", + methodName: "CreateConfigGatewaySettingsConfigsPostAsync", + pathTemplate: "\"/gateway/settings/configs\"", + 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::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "CreateConfigGatewaySettingsConfigsPost", + methodName: "CreateConfigGatewaySettingsConfigsPostAsync", + pathTemplate: "\"/gateway/settings/configs\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "CreateConfigGatewaySettingsConfigsPost", + methodName: "CreateConfigGatewaySettingsConfigsPostAsync", + pathTemplate: "\"/gateway/settings/configs\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessCreateConfigGatewaySettingsConfigsPostResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "CreateConfigGatewaySettingsConfigsPost", + methodName: "CreateConfigGatewaySettingsConfigsPostAsync", + pathTemplate: "\"/gateway/settings/configs\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "CreateConfigGatewaySettingsConfigsPost", + methodName: "CreateConfigGatewaySettingsConfigsPostAsync", + pathTemplate: "\"/gateway/settings/configs\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __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::AI21.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessCreateConfigGatewaySettingsConfigsPostResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::AI21.ConfigProfileOut.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => 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::AI21.ConfigProfileOut.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.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 Config + /// + /// + /// + /// + /// + /// + /// 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 CreateConfigGatewaySettingsConfigsPostAsync( + string configId, + string? name = default, + string? description = default, + object? overrides = default, + bool? enabled = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __request = new global::AI21.ConfigProfileCreate + { + ConfigId = configId, + Name = name, + Description = description, + Overrides = overrides, + Enabled = enabled, + }; + + return await CreateConfigGatewaySettingsConfigsPostAsync( + request: __request, + requestOptions: requestOptions, + cancellationToken: cancellationToken).ConfigureAwait(false); + } + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.CreateConfigTokenwiseSettingsConfigsPost.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.CreateConfigTokenwiseSettingsConfigsPost.g.cs new file mode 100644 index 00000000..b531f117 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Ai21Client.CreateConfigTokenwiseSettingsConfigsPost.g.cs @@ -0,0 +1,508 @@ + +#nullable enable + +namespace AI21 +{ + public partial class Ai21Client + { + + + private static readonly global::AI21.EndPointSecurityRequirement s_CreateConfigTokenwiseSettingsConfigsPostSecurityRequirement0 = + new global::AI21.EndPointSecurityRequirement + { + Authorizations = new global::AI21.EndPointAuthorizationRequirement[] + { new global::AI21.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::AI21.EndPointSecurityRequirement[] s_CreateConfigTokenwiseSettingsConfigsPostSecurityRequirements = + new global::AI21.EndPointSecurityRequirement[] + { s_CreateConfigTokenwiseSettingsConfigsPostSecurityRequirement0, + }; + partial void PrepareCreateConfigTokenwiseSettingsConfigsPostArguments( + global::System.Net.Http.HttpClient httpClient, + global::AI21.ConfigProfileCreate request); + partial void PrepareCreateConfigTokenwiseSettingsConfigsPostRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + global::AI21.ConfigProfileCreate request); + partial void ProcessCreateConfigTokenwiseSettingsConfigsPostResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessCreateConfigTokenwiseSettingsConfigsPostResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Create 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 CreateConfigTokenwiseSettingsConfigsPostAsync( + + global::AI21.ConfigProfileCreate request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await CreateConfigTokenwiseSettingsConfigsPostAsResponseAsync( + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Create 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> CreateConfigTokenwiseSettingsConfigsPostAsResponseAsync( + + global::AI21.ConfigProfileCreate request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + request = request ?? throw new global::System.ArgumentNullException(nameof(request)); + + PrepareArguments( + client: HttpClient); + PrepareCreateConfigTokenwiseSettingsConfigsPostArguments( + httpClient: HttpClient, + request: request); + + + var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_CreateConfigTokenwiseSettingsConfigsPostSecurityRequirements, + operationName: "CreateConfigTokenwiseSettingsConfigsPostAsync"); + + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: "/tokenwise/settings/configs", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Post, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + var __httpRequestContentBody = request.ToJson(JsonSerializerContext); + var __httpRequestContent = new global::System.Net.Http.StringContent( + content: __httpRequestContentBody, + encoding: global::System.Text.Encoding.UTF8, + mediaType: "application/json"); + __httpRequest.Content = __httpRequestContent; + global::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareCreateConfigTokenwiseSettingsConfigsPostRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + request: request); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "CreateConfigTokenwiseSettingsConfigsPost", + methodName: "CreateConfigTokenwiseSettingsConfigsPostAsync", + pathTemplate: "\"/tokenwise/settings/configs\"", + 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::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "CreateConfigTokenwiseSettingsConfigsPost", + methodName: "CreateConfigTokenwiseSettingsConfigsPostAsync", + pathTemplate: "\"/tokenwise/settings/configs\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "CreateConfigTokenwiseSettingsConfigsPost", + methodName: "CreateConfigTokenwiseSettingsConfigsPostAsync", + pathTemplate: "\"/tokenwise/settings/configs\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessCreateConfigTokenwiseSettingsConfigsPostResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "CreateConfigTokenwiseSettingsConfigsPost", + methodName: "CreateConfigTokenwiseSettingsConfigsPostAsync", + pathTemplate: "\"/tokenwise/settings/configs\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "CreateConfigTokenwiseSettingsConfigsPost", + methodName: "CreateConfigTokenwiseSettingsConfigsPostAsync", + pathTemplate: "\"/tokenwise/settings/configs\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __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::AI21.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessCreateConfigTokenwiseSettingsConfigsPostResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::AI21.ConfigProfileOut.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => 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::AI21.ConfigProfileOut.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.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 Config + /// + /// + /// + /// + /// + /// + /// 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 CreateConfigTokenwiseSettingsConfigsPostAsync( + string configId, + string? name = default, + string? description = default, + object? overrides = default, + bool? enabled = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __request = new global::AI21.ConfigProfileCreate + { + ConfigId = configId, + Name = name, + Description = description, + Overrides = overrides, + Enabled = enabled, + }; + + return await CreateConfigTokenwiseSettingsConfigsPostAsync( + request: __request, + requestOptions: requestOptions, + cancellationToken: cancellationToken).ConfigureAwait(false); + } + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.CreateDemoStudioV1DemosPost.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.CreateDemoStudioV1DemosPost.g.cs index 82d02f97..9cd6d98c 100644 --- a/src/libs/AI21/Generated/AI21.Ai21Client.CreateDemoStudioV1DemosPost.g.cs +++ b/src/libs/AI21/Generated/AI21.Ai21Client.CreateDemoStudioV1DemosPost.g.cs @@ -14,6 +14,7 @@ public partial class Ai21Client { new global::AI21.EndPointAuthorizationRequirement { Type = "Http", + SchemeId = "HttpBearer", Location = "Header", Name = "Bearer", FriendlyName = "Bearer", @@ -45,11 +46,36 @@ partial void ProcessCreateDemoStudioV1DemosPostResponseContent( /// Create a new demo. /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// public async global::System.Threading.Tasks.Task CreateDemoStudioV1DemosPostAsync( global::AI21.DemoCreate request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await CreateDemoStudioV1DemosPostAsResponseAsync( + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Create Demo
+ /// Create a new demo. + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> CreateDemoStudioV1DemosPostAsResponseAsync( + + global::AI21.DemoCreate request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) { request = request ?? throw new global::System.ArgumentNullException(nameof(request)); @@ -66,22 +92,44 @@ partial void ProcessCreateDemoStudioV1DemosPostResponseContent( securityRequirements: s_CreateDemoStudioV1DemosPostSecurityRequirements, operationName: "CreateDemoStudioV1DemosPostAsync"); - var __pathBuilder = new global::AI21.PathBuilder( - path: "/studio/v1/demos", - 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)); + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: "/studio/v1/demos", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.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; + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; #endif foreach (var __authorization in __authorizations) { if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2") + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") { __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( scheme: __authorization.Name, @@ -91,156 +139,336 @@ partial void ProcessCreateDemoStudioV1DemosPostResponseContent( __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); - PrepareCreateDemoStudioV1DemosPostRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - request: request); + 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::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareCreateDemoStudioV1DemosPostRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + request: request); - ProcessResponse( - client: HttpClient, - response: __response); - ProcessCreateDemoStudioV1DemosPostResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Validation Error - if ((int)__response.StatusCode == 422) + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::AI21.HTTPValidationError? __value_422 = null; - try + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) { - if (ReadResponseAsString) + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "CreateDemoStudioV1DemosPost", + methodName: "CreateDemoStudioV1DemosPostAsync", + pathTemplate: "\"/studio/v1/demos\"", + 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 { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); } - else + catch (global::System.Net.Http.HttpRequestException __exception) { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "CreateDemoStudioV1DemosPost", + methodName: "CreateDemoStudioV1DemosPostAsync", + pathTemplate: "\"/studio/v1/demos\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "CreateDemoStudioV1DemosPost", + methodName: "CreateDemoStudioV1DemosPostAsync", + pathTemplate: "\"/studio/v1/demos\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; } + + break; } - catch (global::System.Exception __ex) + + if (__response == null) { - __exception_422 = __ex; + throw new global::System.InvalidOperationException("No response received."); } - throw new global::AI21.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) + using (__response) { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( + ProcessResponse( client: HttpClient, - response: __response, - content: ref __content); - ProcessCreateDemoStudioV1DemosPostResponseContent( + response: __response); + ProcessCreateDemoStudioV1DemosPostResponse( httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) { - __response.EnsureSuccessStatusCode(); - - return - global::AI21.Demo.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "CreateDemoStudioV1DemosPost", + methodName: "CreateDemoStudioV1DemosPostAsync", + pathTemplate: "\"/studio/v1/demos\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } - catch (global::System.Exception __ex) + else { - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "CreateDemoStudioV1DemosPost", + methodName: "CreateDemoStudioV1DemosPostAsync", + pathTemplate: "\"/studio/v1/demos\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - using var __content = await __response.Content.ReadAsStreamAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::AI21.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - return - await global::AI21.Demo.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) - { - } + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessCreateDemoStudioV1DemosPostResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::AI21.Demo.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => 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::AI21.Demo.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; } } + finally + { + __httpRequest?.Dispose(); + } } /// /// Create Demo
@@ -261,6 +489,7 @@ partial void ProcessCreateDemoStudioV1DemosPostResponseContent( /// /// Name of the UI component /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// public async global::System.Threading.Tasks.Task CreateDemoStudioV1DemosPostAsync( @@ -269,6 +498,7 @@ partial void ProcessCreateDemoStudioV1DemosPostResponseContent( global::AI21.DemoStatus status, string uiComponentName, object? config = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) { var __request = new global::AI21.DemoCreate @@ -282,6 +512,7 @@ partial void ProcessCreateDemoStudioV1DemosPostResponseContent( return await CreateDemoStudioV1DemosPostAsync( request: __request, + requestOptions: requestOptions, cancellationToken: cancellationToken).ConfigureAwait(false); } } diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.CreateMcpStorageStudioV1McpStoragePost.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.CreateMcpStorageStudioV1McpStoragePost.g.cs index 82e8f25b..264cf555 100644 --- a/src/libs/AI21/Generated/AI21.Ai21Client.CreateMcpStorageStudioV1McpStoragePost.g.cs +++ b/src/libs/AI21/Generated/AI21.Ai21Client.CreateMcpStorageStudioV1McpStoragePost.g.cs @@ -14,6 +14,7 @@ public partial class Ai21Client { new global::AI21.EndPointAuthorizationRequirement { Type = "Http", + SchemeId = "HttpBearer", Location = "Header", Name = "Bearer", FriendlyName = "Bearer", @@ -44,11 +45,35 @@ partial void ProcessCreateMcpStorageStudioV1McpStoragePostResponseContent( /// Create Mcp Storage ///
/// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// public async global::System.Threading.Tasks.Task CreateMcpStorageStudioV1McpStoragePostAsync( global::AI21.CreateMCPStorageRequest request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await CreateMcpStorageStudioV1McpStoragePostAsResponseAsync( + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Create Mcp Storage + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> CreateMcpStorageStudioV1McpStoragePostAsResponseAsync( + + global::AI21.CreateMCPStorageRequest request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) { request = request ?? throw new global::System.ArgumentNullException(nameof(request)); @@ -65,22 +90,44 @@ partial void ProcessCreateMcpStorageStudioV1McpStoragePostResponseContent( securityRequirements: s_CreateMcpStorageStudioV1McpStoragePostSecurityRequirements, operationName: "CreateMcpStorageStudioV1McpStoragePostAsync"); - var __pathBuilder = new global::AI21.PathBuilder( - path: "/studio/v1/mcp/storage", - 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)); + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: "/studio/v1/mcp/storage", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.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; + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; #endif foreach (var __authorization in __authorizations) { if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2") + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") { __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( scheme: __authorization.Name, @@ -90,156 +137,336 @@ partial void ProcessCreateMcpStorageStudioV1McpStoragePostResponseContent( __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); - PrepareCreateMcpStorageStudioV1McpStoragePostRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - request: request); + 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::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareCreateMcpStorageStudioV1McpStoragePostRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + request: request); - ProcessResponse( - client: HttpClient, - response: __response); - ProcessCreateMcpStorageStudioV1McpStoragePostResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Validation Error - if ((int)__response.StatusCode == 422) + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::AI21.HTTPValidationError? __value_422 = null; - try + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) { - if (ReadResponseAsString) + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "CreateMcpStorageStudioV1McpStoragePost", + methodName: "CreateMcpStorageStudioV1McpStoragePostAsync", + pathTemplate: "\"/studio/v1/mcp/storage\"", + 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 { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); } - else + catch (global::System.Net.Http.HttpRequestException __exception) { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "CreateMcpStorageStudioV1McpStoragePost", + methodName: "CreateMcpStorageStudioV1McpStoragePostAsync", + pathTemplate: "\"/studio/v1/mcp/storage\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "CreateMcpStorageStudioV1McpStoragePost", + methodName: "CreateMcpStorageStudioV1McpStoragePostAsync", + pathTemplate: "\"/studio/v1/mcp/storage\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; } + + break; } - catch (global::System.Exception __ex) + + if (__response == null) { - __exception_422 = __ex; + throw new global::System.InvalidOperationException("No response received."); } - throw new global::AI21.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) + using (__response) { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - ProcessResponseContent( + ProcessResponse( client: HttpClient, - response: __response, - content: ref __content); - ProcessCreateMcpStorageStudioV1McpStoragePostResponseContent( + response: __response); + ProcessCreateMcpStorageStudioV1McpStoragePostResponse( httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) { - __response.EnsureSuccessStatusCode(); - - return - global::AI21.MCPStorageResponse.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "CreateMcpStorageStudioV1McpStoragePost", + methodName: "CreateMcpStorageStudioV1McpStoragePostAsync", + pathTemplate: "\"/studio/v1/mcp/storage\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } - catch (global::System.Exception __ex) + else { - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "CreateMcpStorageStudioV1McpStoragePost", + methodName: "CreateMcpStorageStudioV1McpStoragePostAsync", + pathTemplate: "\"/studio/v1/mcp/storage\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - using var __content = await __response.Content.ReadAsStreamAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::AI21.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - return - await global::AI21.MCPStorageResponse.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) - { - } + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessCreateMcpStorageStudioV1McpStoragePostResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::AI21.MCPStorageResponse.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => 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::AI21.MCPStorageResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; } } + finally + { + __httpRequest?.Dispose(); + } } /// /// Create Mcp Storage @@ -253,6 +480,7 @@ partial void ProcessCreateMcpStorageStudioV1McpStoragePostResponseContent( /// /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// public async global::System.Threading.Tasks.Task CreateMcpStorageStudioV1McpStoragePostAsync( @@ -263,6 +491,7 @@ partial void ProcessCreateMcpStorageStudioV1McpStoragePostResponseContent( string? authHeaderName = default, string? authValue = default, global::System.Collections.Generic.IList? allowedTools = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) { var __request = new global::AI21.CreateMCPStorageRequest @@ -278,6 +507,7 @@ partial void ProcessCreateMcpStorageStudioV1McpStoragePostResponseContent( return await CreateMcpStorageStudioV1McpStoragePostAsync( request: __request, + requestOptions: requestOptions, cancellationToken: cancellationToken).ConfigureAwait(false); } } diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.CreateOrganizationSchemaStudioV1StructuredRagOrganizationsOrganizationIdSchemasPost.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.CreateOrganizationSchemaStudioV1StructuredRagOrganizationsOrganizationIdSchemasPost.g.cs index 8e7b1304..fa2efeac 100644 --- a/src/libs/AI21/Generated/AI21.Ai21Client.CreateOrganizationSchemaStudioV1StructuredRagOrganizationsOrganizationIdSchemasPost.g.cs +++ b/src/libs/AI21/Generated/AI21.Ai21Client.CreateOrganizationSchemaStudioV1StructuredRagOrganizationsOrganizationIdSchemasPost.g.cs @@ -14,6 +14,7 @@ public partial class Ai21Client { new global::AI21.EndPointAuthorizationRequirement { Type = "Http", + SchemeId = "HttpBearer", Location = "Header", Name = "Bearer", FriendlyName = "Bearer", @@ -47,12 +48,39 @@ partial void ProcessCreateOrganizationSchemaStudioV1StructuredRagOrganizationsOr /// /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// public async global::System.Threading.Tasks.Task CreateOrganizationSchemaStudioV1StructuredRagOrganizationsOrganizationIdSchemasPostAsync( string organizationId, global::AI21.CreateOrganizationSchemaRequest request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await CreateOrganizationSchemaStudioV1StructuredRagOrganizationsOrganizationIdSchemasPostAsResponseAsync( + organizationId: organizationId, + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Create Organization 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> CreateOrganizationSchemaStudioV1StructuredRagOrganizationsOrganizationIdSchemasPostAsResponseAsync( + string organizationId, + + global::AI21.CreateOrganizationSchemaRequest request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) { request = request ?? throw new global::System.ArgumentNullException(nameof(request)); @@ -70,22 +98,44 @@ partial void ProcessCreateOrganizationSchemaStudioV1StructuredRagOrganizationsOr securityRequirements: s_CreateOrganizationSchemaStudioV1StructuredRagOrganizationsOrganizationIdSchemasPostSecurityRequirements, operationName: "CreateOrganizationSchemaStudioV1StructuredRagOrganizationsOrganizationIdSchemasPostAsync"); - var __pathBuilder = new global::AI21.PathBuilder( - path: $"/studio/v1/structured-rag/organizations/{organizationId}/schemas", - 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)); + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: $"/studio/v1/structured-rag/organizations/{organizationId}/schemas", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.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; + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; #endif foreach (var __authorization in __authorizations) { if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2") + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") { __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( scheme: __authorization.Name, @@ -95,153 +145,333 @@ partial void ProcessCreateOrganizationSchemaStudioV1StructuredRagOrganizationsOr __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); - PrepareCreateOrganizationSchemaStudioV1StructuredRagOrganizationsOrganizationIdSchemasPostRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - organizationId: organizationId, - request: request); + 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::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareCreateOrganizationSchemaStudioV1StructuredRagOrganizationsOrganizationIdSchemasPostRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + organizationId: organizationId!, + request: request); - ProcessResponse( - client: HttpClient, - response: __response); - ProcessCreateOrganizationSchemaStudioV1StructuredRagOrganizationsOrganizationIdSchemasPostResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Validation Error - if ((int)__response.StatusCode == 422) + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::AI21.HTTPValidationError? __value_422 = null; - try + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) { - if (ReadResponseAsString) + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "CreateOrganizationSchemaStudioV1StructuredRagOrganizationsOrganizationIdSchemasPost", + methodName: "CreateOrganizationSchemaStudioV1StructuredRagOrganizationsOrganizationIdSchemasPostAsync", + pathTemplate: "$\"/studio/v1/structured-rag/organizations/{organizationId}/schemas\"", + 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 { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); } - else + catch (global::System.Net.Http.HttpRequestException __exception) { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "CreateOrganizationSchemaStudioV1StructuredRagOrganizationsOrganizationIdSchemasPost", + methodName: "CreateOrganizationSchemaStudioV1StructuredRagOrganizationsOrganizationIdSchemasPostAsync", + pathTemplate: "$\"/studio/v1/structured-rag/organizations/{organizationId}/schemas\"", + 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; + } - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "CreateOrganizationSchemaStudioV1StructuredRagOrganizationsOrganizationIdSchemasPost", + methodName: "CreateOrganizationSchemaStudioV1StructuredRagOrganizationsOrganizationIdSchemasPostAsync", + pathTemplate: "$\"/studio/v1/structured-rag/organizations/{organizationId}/schemas\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; } - catch (global::System.Exception __ex) + + if (__response == null) { - __exception_422 = __ex; + throw new global::System.InvalidOperationException("No response received."); } - throw new global::AI21.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) + using (__response) { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( + ProcessResponse( client: HttpClient, - response: __response, - content: ref __content); - ProcessCreateOrganizationSchemaStudioV1StructuredRagOrganizationsOrganizationIdSchemasPostResponseContent( + response: __response); + ProcessCreateOrganizationSchemaStudioV1StructuredRagOrganizationsOrganizationIdSchemasPostResponse( httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) { - __response.EnsureSuccessStatusCode(); - - return __content; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "CreateOrganizationSchemaStudioV1StructuredRagOrganizationsOrganizationIdSchemasPost", + methodName: "CreateOrganizationSchemaStudioV1StructuredRagOrganizationsOrganizationIdSchemasPostAsync", + pathTemplate: "$\"/studio/v1/structured-rag/organizations/{organizationId}/schemas\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } - catch (global::System.Exception __ex) + else { - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "CreateOrganizationSchemaStudioV1StructuredRagOrganizationsOrganizationIdSchemasPost", + methodName: "CreateOrganizationSchemaStudioV1StructuredRagOrganizationsOrganizationIdSchemasPostAsync", + pathTemplate: "$\"/studio/v1/structured-rag/organizations/{organizationId}/schemas\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::AI21.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).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) - { - } + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessCreateOrganizationSchemaStudioV1StructuredRagOrganizationsOrganizationIdSchemasPostResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? 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::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.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::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; } } + finally + { + __httpRequest?.Dispose(); + } } /// /// Create Organization Schema @@ -252,6 +482,7 @@ partial void ProcessCreateOrganizationSchemaStudioV1StructuredRagOrganizationsOr /// /// 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 CreateOrganizationSchemaStudioV1StructuredRagOrganizationsOrganizationIdSchemasPostAsync( @@ -259,6 +490,7 @@ partial void ProcessCreateOrganizationSchemaStudioV1StructuredRagOrganizationsOr string schemaName, object schemaObject, bool? runClassification = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) { var __request = new global::AI21.CreateOrganizationSchemaRequest @@ -271,6 +503,7 @@ partial void ProcessCreateOrganizationSchemaStudioV1StructuredRagOrganizationsOr return await CreateOrganizationSchemaStudioV1StructuredRagOrganizationsOrganizationIdSchemasPostAsync( organizationId: organizationId, request: __request, + requestOptions: requestOptions, cancellationToken: cancellationToken).ConfigureAwait(false); } } diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.DeleteAgentGatewaySettingsAgentsAgentIdDelete.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.DeleteAgentGatewaySettingsAgentsAgentIdDelete.g.cs new file mode 100644 index 00000000..d0c9bb2e --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Ai21Client.DeleteAgentGatewaySettingsAgentsAgentIdDelete.g.cs @@ -0,0 +1,438 @@ + +#nullable enable + +namespace AI21 +{ + public partial class Ai21Client + { + + + private static readonly global::AI21.EndPointSecurityRequirement s_DeleteAgentGatewaySettingsAgentsAgentIdDeleteSecurityRequirement0 = + new global::AI21.EndPointSecurityRequirement + { + Authorizations = new global::AI21.EndPointAuthorizationRequirement[] + { new global::AI21.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::AI21.EndPointSecurityRequirement[] s_DeleteAgentGatewaySettingsAgentsAgentIdDeleteSecurityRequirements = + new global::AI21.EndPointSecurityRequirement[] + { s_DeleteAgentGatewaySettingsAgentsAgentIdDeleteSecurityRequirement0, + }; + partial void PrepareDeleteAgentGatewaySettingsAgentsAgentIdDeleteArguments( + global::System.Net.Http.HttpClient httpClient, + ref string agentId); + partial void PrepareDeleteAgentGatewaySettingsAgentsAgentIdDeleteRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string agentId); + partial void ProcessDeleteAgentGatewaySettingsAgentsAgentIdDeleteResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + /// + /// Delete Agent + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task DeleteAgentGatewaySettingsAgentsAgentIdDeleteAsync( + string agentId, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + await DeleteAgentGatewaySettingsAgentsAgentIdDeleteAsResponseAsync( + agentId: agentId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + } + /// + /// Delete Agent + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task DeleteAgentGatewaySettingsAgentsAgentIdDeleteAsResponseAsync( + string agentId, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareDeleteAgentGatewaySettingsAgentsAgentIdDeleteArguments( + httpClient: HttpClient, + agentId: ref agentId); + + + var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_DeleteAgentGatewaySettingsAgentsAgentIdDeleteSecurityRequirements, + operationName: "DeleteAgentGatewaySettingsAgentsAgentIdDeleteAsync"); + + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: $"/gateway/settings/agents/{agentId}", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.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); + } + } + global::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareDeleteAgentGatewaySettingsAgentsAgentIdDeleteRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + agentId: agentId!); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "DeleteAgentGatewaySettingsAgentsAgentIdDelete", + methodName: "DeleteAgentGatewaySettingsAgentsAgentIdDeleteAsync", + pathTemplate: "$\"/gateway/settings/agents/{agentId}\"", + 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::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "DeleteAgentGatewaySettingsAgentsAgentIdDelete", + methodName: "DeleteAgentGatewaySettingsAgentsAgentIdDeleteAsync", + pathTemplate: "$\"/gateway/settings/agents/{agentId}\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "DeleteAgentGatewaySettingsAgentsAgentIdDelete", + methodName: "DeleteAgentGatewaySettingsAgentsAgentIdDeleteAsync", + pathTemplate: "$\"/gateway/settings/agents/{agentId}\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessDeleteAgentGatewaySettingsAgentsAgentIdDeleteResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "DeleteAgentGatewaySettingsAgentsAgentIdDelete", + methodName: "DeleteAgentGatewaySettingsAgentsAgentIdDeleteAsync", + pathTemplate: "$\"/gateway/settings/agents/{agentId}\"", + 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::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "DeleteAgentGatewaySettingsAgentsAgentIdDelete", + methodName: "DeleteAgentGatewaySettingsAgentsAgentIdDeleteAsync", + pathTemplate: "$\"/gateway/settings/agents/{agentId}\"", + 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::AI21.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.DeleteAgentTokenwiseSettingsAgentsAgentIdDelete.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.DeleteAgentTokenwiseSettingsAgentsAgentIdDelete.g.cs new file mode 100644 index 00000000..adabf8ae --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Ai21Client.DeleteAgentTokenwiseSettingsAgentsAgentIdDelete.g.cs @@ -0,0 +1,438 @@ + +#nullable enable + +namespace AI21 +{ + public partial class Ai21Client + { + + + private static readonly global::AI21.EndPointSecurityRequirement s_DeleteAgentTokenwiseSettingsAgentsAgentIdDeleteSecurityRequirement0 = + new global::AI21.EndPointSecurityRequirement + { + Authorizations = new global::AI21.EndPointAuthorizationRequirement[] + { new global::AI21.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::AI21.EndPointSecurityRequirement[] s_DeleteAgentTokenwiseSettingsAgentsAgentIdDeleteSecurityRequirements = + new global::AI21.EndPointSecurityRequirement[] + { s_DeleteAgentTokenwiseSettingsAgentsAgentIdDeleteSecurityRequirement0, + }; + partial void PrepareDeleteAgentTokenwiseSettingsAgentsAgentIdDeleteArguments( + global::System.Net.Http.HttpClient httpClient, + ref string agentId); + partial void PrepareDeleteAgentTokenwiseSettingsAgentsAgentIdDeleteRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string agentId); + partial void ProcessDeleteAgentTokenwiseSettingsAgentsAgentIdDeleteResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + /// + /// Delete Agent + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task DeleteAgentTokenwiseSettingsAgentsAgentIdDeleteAsync( + string agentId, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + await DeleteAgentTokenwiseSettingsAgentsAgentIdDeleteAsResponseAsync( + agentId: agentId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + } + /// + /// Delete Agent + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task DeleteAgentTokenwiseSettingsAgentsAgentIdDeleteAsResponseAsync( + string agentId, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareDeleteAgentTokenwiseSettingsAgentsAgentIdDeleteArguments( + httpClient: HttpClient, + agentId: ref agentId); + + + var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_DeleteAgentTokenwiseSettingsAgentsAgentIdDeleteSecurityRequirements, + operationName: "DeleteAgentTokenwiseSettingsAgentsAgentIdDeleteAsync"); + + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: $"/tokenwise/settings/agents/{agentId}", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.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); + } + } + global::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareDeleteAgentTokenwiseSettingsAgentsAgentIdDeleteRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + agentId: agentId!); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "DeleteAgentTokenwiseSettingsAgentsAgentIdDelete", + methodName: "DeleteAgentTokenwiseSettingsAgentsAgentIdDeleteAsync", + pathTemplate: "$\"/tokenwise/settings/agents/{agentId}\"", + 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::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "DeleteAgentTokenwiseSettingsAgentsAgentIdDelete", + methodName: "DeleteAgentTokenwiseSettingsAgentsAgentIdDeleteAsync", + pathTemplate: "$\"/tokenwise/settings/agents/{agentId}\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "DeleteAgentTokenwiseSettingsAgentsAgentIdDelete", + methodName: "DeleteAgentTokenwiseSettingsAgentsAgentIdDeleteAsync", + pathTemplate: "$\"/tokenwise/settings/agents/{agentId}\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessDeleteAgentTokenwiseSettingsAgentsAgentIdDeleteResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "DeleteAgentTokenwiseSettingsAgentsAgentIdDelete", + methodName: "DeleteAgentTokenwiseSettingsAgentsAgentIdDeleteAsync", + pathTemplate: "$\"/tokenwise/settings/agents/{agentId}\"", + 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::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "DeleteAgentTokenwiseSettingsAgentsAgentIdDelete", + methodName: "DeleteAgentTokenwiseSettingsAgentsAgentIdDeleteAsync", + pathTemplate: "$\"/tokenwise/settings/agents/{agentId}\"", + 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::AI21.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.DeleteConfigGatewaySettingsConfigsConfigIdDelete.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.DeleteConfigGatewaySettingsConfigsConfigIdDelete.g.cs new file mode 100644 index 00000000..4fc016d2 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Ai21Client.DeleteConfigGatewaySettingsConfigsConfigIdDelete.g.cs @@ -0,0 +1,438 @@ + +#nullable enable + +namespace AI21 +{ + public partial class Ai21Client + { + + + private static readonly global::AI21.EndPointSecurityRequirement s_DeleteConfigGatewaySettingsConfigsConfigIdDeleteSecurityRequirement0 = + new global::AI21.EndPointSecurityRequirement + { + Authorizations = new global::AI21.EndPointAuthorizationRequirement[] + { new global::AI21.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::AI21.EndPointSecurityRequirement[] s_DeleteConfigGatewaySettingsConfigsConfigIdDeleteSecurityRequirements = + new global::AI21.EndPointSecurityRequirement[] + { s_DeleteConfigGatewaySettingsConfigsConfigIdDeleteSecurityRequirement0, + }; + partial void PrepareDeleteConfigGatewaySettingsConfigsConfigIdDeleteArguments( + global::System.Net.Http.HttpClient httpClient, + ref string configId); + partial void PrepareDeleteConfigGatewaySettingsConfigsConfigIdDeleteRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string configId); + partial void ProcessDeleteConfigGatewaySettingsConfigsConfigIdDeleteResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + /// + /// Delete 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 DeleteConfigGatewaySettingsConfigsConfigIdDeleteAsync( + string configId, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + await DeleteConfigGatewaySettingsConfigsConfigIdDeleteAsResponseAsync( + configId: configId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + } + /// + /// Delete 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 DeleteConfigGatewaySettingsConfigsConfigIdDeleteAsResponseAsync( + string configId, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareDeleteConfigGatewaySettingsConfigsConfigIdDeleteArguments( + httpClient: HttpClient, + configId: ref configId); + + + var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_DeleteConfigGatewaySettingsConfigsConfigIdDeleteSecurityRequirements, + operationName: "DeleteConfigGatewaySettingsConfigsConfigIdDeleteAsync"); + + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: $"/gateway/settings/configs/{configId}", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.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); + } + } + global::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareDeleteConfigGatewaySettingsConfigsConfigIdDeleteRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + configId: configId!); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "DeleteConfigGatewaySettingsConfigsConfigIdDelete", + methodName: "DeleteConfigGatewaySettingsConfigsConfigIdDeleteAsync", + pathTemplate: "$\"/gateway/settings/configs/{configId}\"", + 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::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "DeleteConfigGatewaySettingsConfigsConfigIdDelete", + methodName: "DeleteConfigGatewaySettingsConfigsConfigIdDeleteAsync", + pathTemplate: "$\"/gateway/settings/configs/{configId}\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "DeleteConfigGatewaySettingsConfigsConfigIdDelete", + methodName: "DeleteConfigGatewaySettingsConfigsConfigIdDeleteAsync", + pathTemplate: "$\"/gateway/settings/configs/{configId}\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessDeleteConfigGatewaySettingsConfigsConfigIdDeleteResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "DeleteConfigGatewaySettingsConfigsConfigIdDelete", + methodName: "DeleteConfigGatewaySettingsConfigsConfigIdDeleteAsync", + pathTemplate: "$\"/gateway/settings/configs/{configId}\"", + 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::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "DeleteConfigGatewaySettingsConfigsConfigIdDelete", + methodName: "DeleteConfigGatewaySettingsConfigsConfigIdDeleteAsync", + pathTemplate: "$\"/gateway/settings/configs/{configId}\"", + 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::AI21.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.DeleteConfigTokenwiseSettingsConfigsConfigIdDelete.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.DeleteConfigTokenwiseSettingsConfigsConfigIdDelete.g.cs new file mode 100644 index 00000000..7511b18b --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Ai21Client.DeleteConfigTokenwiseSettingsConfigsConfigIdDelete.g.cs @@ -0,0 +1,438 @@ + +#nullable enable + +namespace AI21 +{ + public partial class Ai21Client + { + + + private static readonly global::AI21.EndPointSecurityRequirement s_DeleteConfigTokenwiseSettingsConfigsConfigIdDeleteSecurityRequirement0 = + new global::AI21.EndPointSecurityRequirement + { + Authorizations = new global::AI21.EndPointAuthorizationRequirement[] + { new global::AI21.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::AI21.EndPointSecurityRequirement[] s_DeleteConfigTokenwiseSettingsConfigsConfigIdDeleteSecurityRequirements = + new global::AI21.EndPointSecurityRequirement[] + { s_DeleteConfigTokenwiseSettingsConfigsConfigIdDeleteSecurityRequirement0, + }; + partial void PrepareDeleteConfigTokenwiseSettingsConfigsConfigIdDeleteArguments( + global::System.Net.Http.HttpClient httpClient, + ref string configId); + partial void PrepareDeleteConfigTokenwiseSettingsConfigsConfigIdDeleteRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string configId); + partial void ProcessDeleteConfigTokenwiseSettingsConfigsConfigIdDeleteResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + /// + /// Delete 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 DeleteConfigTokenwiseSettingsConfigsConfigIdDeleteAsync( + string configId, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + await DeleteConfigTokenwiseSettingsConfigsConfigIdDeleteAsResponseAsync( + configId: configId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + } + /// + /// Delete 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 DeleteConfigTokenwiseSettingsConfigsConfigIdDeleteAsResponseAsync( + string configId, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareDeleteConfigTokenwiseSettingsConfigsConfigIdDeleteArguments( + httpClient: HttpClient, + configId: ref configId); + + + var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_DeleteConfigTokenwiseSettingsConfigsConfigIdDeleteSecurityRequirements, + operationName: "DeleteConfigTokenwiseSettingsConfigsConfigIdDeleteAsync"); + + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: $"/tokenwise/settings/configs/{configId}", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.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); + } + } + global::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareDeleteConfigTokenwiseSettingsConfigsConfigIdDeleteRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + configId: configId!); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "DeleteConfigTokenwiseSettingsConfigsConfigIdDelete", + methodName: "DeleteConfigTokenwiseSettingsConfigsConfigIdDeleteAsync", + pathTemplate: "$\"/tokenwise/settings/configs/{configId}\"", + 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::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "DeleteConfigTokenwiseSettingsConfigsConfigIdDelete", + methodName: "DeleteConfigTokenwiseSettingsConfigsConfigIdDeleteAsync", + pathTemplate: "$\"/tokenwise/settings/configs/{configId}\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "DeleteConfigTokenwiseSettingsConfigsConfigIdDelete", + methodName: "DeleteConfigTokenwiseSettingsConfigsConfigIdDeleteAsync", + pathTemplate: "$\"/tokenwise/settings/configs/{configId}\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessDeleteConfigTokenwiseSettingsConfigsConfigIdDeleteResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "DeleteConfigTokenwiseSettingsConfigsConfigIdDelete", + methodName: "DeleteConfigTokenwiseSettingsConfigsConfigIdDeleteAsync", + pathTemplate: "$\"/tokenwise/settings/configs/{configId}\"", + 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::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "DeleteConfigTokenwiseSettingsConfigsConfigIdDelete", + methodName: "DeleteConfigTokenwiseSettingsConfigsConfigIdDeleteAsync", + pathTemplate: "$\"/tokenwise/settings/configs/{configId}\"", + 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::AI21.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.DeleteDemoStudioV1DemosDemoIdDelete.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.DeleteDemoStudioV1DemosDemoIdDelete.g.cs index c66cb5ab..f6bf9abd 100644 --- a/src/libs/AI21/Generated/AI21.Ai21Client.DeleteDemoStudioV1DemosDemoIdDelete.g.cs +++ b/src/libs/AI21/Generated/AI21.Ai21Client.DeleteDemoStudioV1DemosDemoIdDelete.g.cs @@ -14,6 +14,7 @@ public partial class Ai21Client { new global::AI21.EndPointAuthorizationRequirement { Type = "Http", + SchemeId = "HttpBearer", Location = "Header", Name = "Bearer", FriendlyName = "Bearer", @@ -45,10 +46,33 @@ partial void ProcessDeleteDemoStudioV1DemosDemoIdDeleteResponseContent( /// Delete a demo. /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// public async global::System.Threading.Tasks.Task DeleteDemoStudioV1DemosDemoIdDeleteAsync( string demoId, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await DeleteDemoStudioV1DemosDemoIdDeleteAsResponseAsync( + demoId: demoId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Delete Demo
+ /// Delete a demo. + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> DeleteDemoStudioV1DemosDemoIdDeleteAsResponseAsync( + string demoId, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( @@ -63,22 +87,44 @@ partial void ProcessDeleteDemoStudioV1DemosDemoIdDeleteResponseContent( securityRequirements: s_DeleteDemoStudioV1DemosDemoIdDeleteSecurityRequirements, operationName: "DeleteDemoStudioV1DemosDemoIdDeleteAsync"); - var __pathBuilder = new global::AI21.PathBuilder( - path: $"/studio/v1/demos/{demoId}", - 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)); + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: $"/studio/v1/demos/{demoId}", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.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; + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; #endif foreach (var __authorization in __authorizations) { if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2") + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") { __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( scheme: __authorization.Name, @@ -88,146 +134,326 @@ partial void ProcessDeleteDemoStudioV1DemosDemoIdDeleteResponseContent( __authorization.Location == "Header") { __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } + } } + global::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareDeleteDemoStudioV1DemosDemoIdDeleteRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - demoId: demoId); + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareDeleteDemoStudioV1DemosDemoIdDeleteRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + demoId: demoId!); - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); + return __httpRequest; + } - ProcessResponse( - client: HttpClient, - response: __response); - ProcessDeleteDemoStudioV1DemosDemoIdDeleteResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Validation Error - if ((int)__response.StatusCode == 422) + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::AI21.HTTPValidationError? __value_422 = null; - try + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) { - if (ReadResponseAsString) + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "DeleteDemoStudioV1DemosDemoIdDelete", + methodName: "DeleteDemoStudioV1DemosDemoIdDeleteAsync", + pathTemplate: "$\"/studio/v1/demos/{demoId}\"", + 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 { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); } - else + catch (global::System.Net.Http.HttpRequestException __exception) { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "DeleteDemoStudioV1DemosDemoIdDelete", + methodName: "DeleteDemoStudioV1DemosDemoIdDeleteAsync", + pathTemplate: "$\"/studio/v1/demos/{demoId}\"", + 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; + } - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "DeleteDemoStudioV1DemosDemoIdDelete", + methodName: "DeleteDemoStudioV1DemosDemoIdDeleteAsync", + pathTemplate: "$\"/studio/v1/demos/{demoId}\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; } - catch (global::System.Exception __ex) + + if (__response == null) { - __exception_422 = __ex; + throw new global::System.InvalidOperationException("No response received."); } - throw new global::AI21.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) + using (__response) { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - ProcessResponseContent( + ProcessResponse( client: HttpClient, - response: __response, - content: ref __content); - ProcessDeleteDemoStudioV1DemosDemoIdDeleteResponseContent( + response: __response); + ProcessDeleteDemoStudioV1DemosDemoIdDeleteResponse( httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) { - __response.EnsureSuccessStatusCode(); - - return __content; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "DeleteDemoStudioV1DemosDemoIdDelete", + methodName: "DeleteDemoStudioV1DemosDemoIdDeleteAsync", + pathTemplate: "$\"/studio/v1/demos/{demoId}\"", + 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); } - catch (global::System.Exception __ex) + else { - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "DeleteDemoStudioV1DemosDemoIdDelete", + methodName: "DeleteDemoStudioV1DemosDemoIdDeleteAsync", + pathTemplate: "$\"/studio/v1/demos/{demoId}\"", + 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 - { - try - { - __response.EnsureSuccessStatusCode(); - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::AI21.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).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) - { - } + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessDeleteDemoStudioV1DemosDemoIdDeleteResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? 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::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.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::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; } } + finally + { + __httpRequest?.Dispose(); + } } } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.DeleteMcpStorageStudioV1McpStorageMcpIdDelete.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.DeleteMcpStorageStudioV1McpStorageMcpIdDelete.g.cs index 1c3f4391..66e3bf28 100644 --- a/src/libs/AI21/Generated/AI21.Ai21Client.DeleteMcpStorageStudioV1McpStorageMcpIdDelete.g.cs +++ b/src/libs/AI21/Generated/AI21.Ai21Client.DeleteMcpStorageStudioV1McpStorageMcpIdDelete.g.cs @@ -14,6 +14,7 @@ public partial class Ai21Client { new global::AI21.EndPointAuthorizationRequirement { Type = "Http", + SchemeId = "HttpBearer", Location = "Header", Name = "Bearer", FriendlyName = "Bearer", @@ -44,10 +45,32 @@ partial void ProcessDeleteMcpStorageStudioV1McpStorageMcpIdDeleteResponseContent /// Delete Mcp Storage /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// public async global::System.Threading.Tasks.Task DeleteMcpStorageStudioV1McpStorageMcpIdDeleteAsync( string mcpId, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await DeleteMcpStorageStudioV1McpStorageMcpIdDeleteAsResponseAsync( + mcpId: mcpId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Delete Mcp Storage + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> DeleteMcpStorageStudioV1McpStorageMcpIdDeleteAsResponseAsync( + string mcpId, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( @@ -62,22 +85,44 @@ partial void ProcessDeleteMcpStorageStudioV1McpStorageMcpIdDeleteResponseContent securityRequirements: s_DeleteMcpStorageStudioV1McpStorageMcpIdDeleteSecurityRequirements, operationName: "DeleteMcpStorageStudioV1McpStorageMcpIdDeleteAsync"); - var __pathBuilder = new global::AI21.PathBuilder( - path: $"/studio/v1/mcp/storage/{mcpId}", - 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)); + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: $"/studio/v1/mcp/storage/{mcpId}", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.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; + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; #endif foreach (var __authorization in __authorizations) { if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2") + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") { __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( scheme: __authorization.Name, @@ -87,150 +132,330 @@ partial void ProcessDeleteMcpStorageStudioV1McpStorageMcpIdDeleteResponseContent __authorization.Location == "Header") { __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } + } } + global::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareDeleteMcpStorageStudioV1McpStorageMcpIdDeleteRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - mcpId: mcpId); + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareDeleteMcpStorageStudioV1McpStorageMcpIdDeleteRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + mcpId: mcpId!); - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); + return __httpRequest; + } - ProcessResponse( - client: HttpClient, - response: __response); - ProcessDeleteMcpStorageStudioV1McpStorageMcpIdDeleteResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Validation Error - if ((int)__response.StatusCode == 422) + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::AI21.HTTPValidationError? __value_422 = null; - try + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) { - if (ReadResponseAsString) + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "DeleteMcpStorageStudioV1McpStorageMcpIdDelete", + methodName: "DeleteMcpStorageStudioV1McpStorageMcpIdDeleteAsync", + pathTemplate: "$\"/studio/v1/mcp/storage/{mcpId}\"", + 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 { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); } - else + catch (global::System.Net.Http.HttpRequestException __exception) { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "DeleteMcpStorageStudioV1McpStorageMcpIdDelete", + methodName: "DeleteMcpStorageStudioV1McpStorageMcpIdDeleteAsync", + pathTemplate: "$\"/studio/v1/mcp/storage/{mcpId}\"", + 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; + } - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "DeleteMcpStorageStudioV1McpStorageMcpIdDelete", + methodName: "DeleteMcpStorageStudioV1McpStorageMcpIdDeleteAsync", + pathTemplate: "$\"/studio/v1/mcp/storage/{mcpId}\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; } - catch (global::System.Exception __ex) + + if (__response == null) { - __exception_422 = __ex; + throw new global::System.InvalidOperationException("No response received."); } - throw new global::AI21.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) + using (__response) { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - ProcessResponseContent( + ProcessResponse( client: HttpClient, - response: __response, - content: ref __content); - ProcessDeleteMcpStorageStudioV1McpStorageMcpIdDeleteResponseContent( + response: __response); + ProcessDeleteMcpStorageStudioV1McpStorageMcpIdDeleteResponse( httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) { - __response.EnsureSuccessStatusCode(); - - return - global::AI21.DeleteMCPStorageResponse.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "DeleteMcpStorageStudioV1McpStorageMcpIdDelete", + methodName: "DeleteMcpStorageStudioV1McpStorageMcpIdDeleteAsync", + pathTemplate: "$\"/studio/v1/mcp/storage/{mcpId}\"", + 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); } - catch (global::System.Exception __ex) + else { - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "DeleteMcpStorageStudioV1McpStorageMcpIdDelete", + methodName: "DeleteMcpStorageStudioV1McpStorageMcpIdDeleteAsync", + pathTemplate: "$\"/studio/v1/mcp/storage/{mcpId}\"", + 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 - { - try - { - __response.EnsureSuccessStatusCode(); - using var __content = await __response.Content.ReadAsStreamAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::AI21.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - return - await global::AI21.DeleteMCPStorageResponse.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) - { - } + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessDeleteMcpStorageStudioV1McpStorageMcpIdDeleteResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::AI21.DeleteMCPStorageResponse.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => 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::AI21.DeleteMCPStorageResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; } } + finally + { + __httpRequest?.Dispose(); + } } } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.DeleteOrganizationSchemaStudioV1StructuredRagOrganizationsOrganizationIdSchemasSchemaNameDelete.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.DeleteOrganizationSchemaStudioV1StructuredRagOrganizationsOrganizationIdSchemasSchemaNameDelete.g.cs index 642c70a4..2c5addc4 100644 --- a/src/libs/AI21/Generated/AI21.Ai21Client.DeleteOrganizationSchemaStudioV1StructuredRagOrganizationsOrganizationIdSchemasSchemaNameDelete.g.cs +++ b/src/libs/AI21/Generated/AI21.Ai21Client.DeleteOrganizationSchemaStudioV1StructuredRagOrganizationsOrganizationIdSchemasSchemaNameDelete.g.cs @@ -14,6 +14,7 @@ public partial class Ai21Client { new global::AI21.EndPointAuthorizationRequirement { Type = "Http", + SchemeId = "HttpBearer", Location = "Header", Name = "Bearer", FriendlyName = "Bearer", @@ -47,11 +48,36 @@ partial void ProcessDeleteOrganizationSchemaStudioV1StructuredRagOrganizationsOr /// /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// public async global::System.Threading.Tasks.Task DeleteOrganizationSchemaStudioV1StructuredRagOrganizationsOrganizationIdSchemasSchemaNameDeleteAsync( string organizationId, string schemaName, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await DeleteOrganizationSchemaStudioV1StructuredRagOrganizationsOrganizationIdSchemasSchemaNameDeleteAsResponseAsync( + organizationId: organizationId, + schemaName: schemaName, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Delete Organization 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> DeleteOrganizationSchemaStudioV1StructuredRagOrganizationsOrganizationIdSchemasSchemaNameDeleteAsResponseAsync( + string organizationId, + string schemaName, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( @@ -67,22 +93,44 @@ partial void ProcessDeleteOrganizationSchemaStudioV1StructuredRagOrganizationsOr securityRequirements: s_DeleteOrganizationSchemaStudioV1StructuredRagOrganizationsOrganizationIdSchemasSchemaNameDeleteSecurityRequirements, operationName: "DeleteOrganizationSchemaStudioV1StructuredRagOrganizationsOrganizationIdSchemasSchemaNameDeleteAsync"); - var __pathBuilder = new global::AI21.PathBuilder( - path: $"/studio/v1/structured-rag/organizations/{organizationId}/schemas/{schemaName}", - 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)); + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: $"/studio/v1/structured-rag/organizations/{organizationId}/schemas/{schemaName}", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.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; + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; #endif foreach (var __authorization in __authorizations) { if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2") + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") { __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( scheme: __authorization.Name, @@ -92,147 +140,327 @@ partial void ProcessDeleteOrganizationSchemaStudioV1StructuredRagOrganizationsOr __authorization.Location == "Header") { __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } + } } + global::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareDeleteOrganizationSchemaStudioV1StructuredRagOrganizationsOrganizationIdSchemasSchemaNameDeleteRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - organizationId: organizationId, - schemaName: schemaName); + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareDeleteOrganizationSchemaStudioV1StructuredRagOrganizationsOrganizationIdSchemasSchemaNameDeleteRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + organizationId: organizationId!, + schemaName: schemaName!); - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); + return __httpRequest; + } - ProcessResponse( - client: HttpClient, - response: __response); - ProcessDeleteOrganizationSchemaStudioV1StructuredRagOrganizationsOrganizationIdSchemasSchemaNameDeleteResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Validation Error - if ((int)__response.StatusCode == 422) + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::AI21.HTTPValidationError? __value_422 = null; - try + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) { - if (ReadResponseAsString) + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "DeleteOrganizationSchemaStudioV1StructuredRagOrganizationsOrganizationIdSchemasSchemaNameDelete", + methodName: "DeleteOrganizationSchemaStudioV1StructuredRagOrganizationsOrganizationIdSchemasSchemaNameDeleteAsync", + pathTemplate: "$\"/studio/v1/structured-rag/organizations/{organizationId}/schemas/{schemaName}\"", + 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 { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); } - else + catch (global::System.Net.Http.HttpRequestException __exception) { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "DeleteOrganizationSchemaStudioV1StructuredRagOrganizationsOrganizationIdSchemasSchemaNameDelete", + methodName: "DeleteOrganizationSchemaStudioV1StructuredRagOrganizationsOrganizationIdSchemasSchemaNameDeleteAsync", + pathTemplate: "$\"/studio/v1/structured-rag/organizations/{organizationId}/schemas/{schemaName}\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "DeleteOrganizationSchemaStudioV1StructuredRagOrganizationsOrganizationIdSchemasSchemaNameDelete", + methodName: "DeleteOrganizationSchemaStudioV1StructuredRagOrganizationsOrganizationIdSchemasSchemaNameDeleteAsync", + pathTemplate: "$\"/studio/v1/structured-rag/organizations/{organizationId}/schemas/{schemaName}\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; } + + break; } - catch (global::System.Exception __ex) + + if (__response == null) { - __exception_422 = __ex; + throw new global::System.InvalidOperationException("No response received."); } - throw new global::AI21.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) + using (__response) { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - ProcessResponseContent( + ProcessResponse( client: HttpClient, - response: __response, - content: ref __content); - ProcessDeleteOrganizationSchemaStudioV1StructuredRagOrganizationsOrganizationIdSchemasSchemaNameDeleteResponseContent( + response: __response); + ProcessDeleteOrganizationSchemaStudioV1StructuredRagOrganizationsOrganizationIdSchemasSchemaNameDeleteResponse( httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) { - __response.EnsureSuccessStatusCode(); - - return __content; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "DeleteOrganizationSchemaStudioV1StructuredRagOrganizationsOrganizationIdSchemasSchemaNameDelete", + methodName: "DeleteOrganizationSchemaStudioV1StructuredRagOrganizationsOrganizationIdSchemasSchemaNameDeleteAsync", + pathTemplate: "$\"/studio/v1/structured-rag/organizations/{organizationId}/schemas/{schemaName}\"", + 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); } - catch (global::System.Exception __ex) + else { - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "DeleteOrganizationSchemaStudioV1StructuredRagOrganizationsOrganizationIdSchemasSchemaNameDelete", + methodName: "DeleteOrganizationSchemaStudioV1StructuredRagOrganizationsOrganizationIdSchemasSchemaNameDeleteAsync", + pathTemplate: "$\"/studio/v1/structured-rag/organizations/{organizationId}/schemas/{schemaName}\"", + 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 - { - try - { - __response.EnsureSuccessStatusCode(); - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::AI21.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).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) - { - } + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessDeleteOrganizationSchemaStudioV1StructuredRagOrganizationsOrganizationIdSchemasSchemaNameDeleteResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? 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::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.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::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; } } + finally + { + __httpRequest?.Dispose(); + } } } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.DeleteWebsiteConnectorStudioV1ConnectorsWebsiteConnectorIdDelete.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.DeleteWebsiteConnectorStudioV1ConnectorsWebsiteConnectorIdDelete.g.cs deleted file mode 100644 index 2576f925..00000000 --- a/src/libs/AI21/Generated/AI21.Ai21Client.DeleteWebsiteConnectorStudioV1ConnectorsWebsiteConnectorIdDelete.g.cs +++ /dev/null @@ -1,232 +0,0 @@ - -#nullable enable - -namespace AI21 -{ - public partial class Ai21Client - { - - - private static readonly global::AI21.EndPointSecurityRequirement s_DeleteWebsiteConnectorStudioV1ConnectorsWebsiteConnectorIdDeleteSecurityRequirement0 = - new global::AI21.EndPointSecurityRequirement - { - Authorizations = new global::AI21.EndPointAuthorizationRequirement[] - { new global::AI21.EndPointAuthorizationRequirement - { - Type = "Http", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::AI21.EndPointSecurityRequirement[] s_DeleteWebsiteConnectorStudioV1ConnectorsWebsiteConnectorIdDeleteSecurityRequirements = - new global::AI21.EndPointSecurityRequirement[] - { s_DeleteWebsiteConnectorStudioV1ConnectorsWebsiteConnectorIdDeleteSecurityRequirement0, - }; - partial void PrepareDeleteWebsiteConnectorStudioV1ConnectorsWebsiteConnectorIdDeleteArguments( - global::System.Net.Http.HttpClient httpClient, - ref string connectorId); - partial void PrepareDeleteWebsiteConnectorStudioV1ConnectorsWebsiteConnectorIdDeleteRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - string connectorId); - partial void ProcessDeleteWebsiteConnectorStudioV1ConnectorsWebsiteConnectorIdDeleteResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessDeleteWebsiteConnectorStudioV1ConnectorsWebsiteConnectorIdDeleteResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Delete Website Connector - /// - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task DeleteWebsiteConnectorStudioV1ConnectorsWebsiteConnectorIdDeleteAsync( - string connectorId, - global::System.Threading.CancellationToken cancellationToken = default) - { - PrepareArguments( - client: HttpClient); - PrepareDeleteWebsiteConnectorStudioV1ConnectorsWebsiteConnectorIdDeleteArguments( - httpClient: HttpClient, - connectorId: ref connectorId); - - - var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_DeleteWebsiteConnectorStudioV1ConnectorsWebsiteConnectorIdDeleteSecurityRequirements, - operationName: "DeleteWebsiteConnectorStudioV1ConnectorsWebsiteConnectorIdDeleteAsync"); - - var __pathBuilder = new global::AI21.PathBuilder( - path: $"/studio/v1/connectors/website/{connectorId}", - 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); - } - } - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareDeleteWebsiteConnectorStudioV1ConnectorsWebsiteConnectorIdDeleteRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - connectorId: connectorId); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessDeleteWebsiteConnectorStudioV1ConnectorsWebsiteConnectorIdDeleteResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Validation Error - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::AI21.HTTPValidationError? __value_422 = null; - try - { - if (ReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - throw new global::AI21.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) - { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessDeleteWebsiteConnectorStudioV1ConnectorsWebsiteConnectorIdDeleteResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return __content; - } - catch (global::System.Exception __ex) - { - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __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::AI21.ApiException( - message: __content ?? __response.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/AI21/Generated/AI21.Ai21Client.DeleteWorkspaceModelEndpointStudioV1SettingsModelsNameDelete.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.DeleteWorkspaceModelEndpointStudioV1SettingsModelsNameDelete.g.cs deleted file mode 100644 index e0de2153..00000000 --- a/src/libs/AI21/Generated/AI21.Ai21Client.DeleteWorkspaceModelEndpointStudioV1SettingsModelsNameDelete.g.cs +++ /dev/null @@ -1,232 +0,0 @@ - -#nullable enable - -namespace AI21 -{ - public partial class Ai21Client - { - - - private static readonly global::AI21.EndPointSecurityRequirement s_DeleteWorkspaceModelEndpointStudioV1SettingsModelsNameDeleteSecurityRequirement0 = - new global::AI21.EndPointSecurityRequirement - { - Authorizations = new global::AI21.EndPointAuthorizationRequirement[] - { new global::AI21.EndPointAuthorizationRequirement - { - Type = "Http", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::AI21.EndPointSecurityRequirement[] s_DeleteWorkspaceModelEndpointStudioV1SettingsModelsNameDeleteSecurityRequirements = - new global::AI21.EndPointSecurityRequirement[] - { s_DeleteWorkspaceModelEndpointStudioV1SettingsModelsNameDeleteSecurityRequirement0, - }; - partial void PrepareDeleteWorkspaceModelEndpointStudioV1SettingsModelsNameDeleteArguments( - global::System.Net.Http.HttpClient httpClient, - ref string name); - partial void PrepareDeleteWorkspaceModelEndpointStudioV1SettingsModelsNameDeleteRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - string name); - partial void ProcessDeleteWorkspaceModelEndpointStudioV1SettingsModelsNameDeleteResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessDeleteWorkspaceModelEndpointStudioV1SettingsModelsNameDeleteResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Delete Workspace Model Endpoint - /// - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task DeleteWorkspaceModelEndpointStudioV1SettingsModelsNameDeleteAsync( - string name, - global::System.Threading.CancellationToken cancellationToken = default) - { - PrepareArguments( - client: HttpClient); - PrepareDeleteWorkspaceModelEndpointStudioV1SettingsModelsNameDeleteArguments( - httpClient: HttpClient, - name: ref name); - - - var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_DeleteWorkspaceModelEndpointStudioV1SettingsModelsNameDeleteSecurityRequirements, - operationName: "DeleteWorkspaceModelEndpointStudioV1SettingsModelsNameDeleteAsync"); - - var __pathBuilder = new global::AI21.PathBuilder( - path: $"/studio/v1/settings/models/{name}", - 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); - } - } - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareDeleteWorkspaceModelEndpointStudioV1SettingsModelsNameDeleteRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - name: name); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessDeleteWorkspaceModelEndpointStudioV1SettingsModelsNameDeleteResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Validation Error - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::AI21.HTTPValidationError? __value_422 = null; - try - { - if (ReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - throw new global::AI21.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) - { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessDeleteWorkspaceModelEndpointStudioV1SettingsModelsNameDeleteResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return __content; - } - catch (global::System.Exception __ex) - { - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __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::AI21.ApiException( - message: __content ?? __response.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/AI21/Generated/AI21.Ai21Client.DetectSchemaStudioV1StructuredRagOrganizationsOrganizationIdSchemaDetectionPost.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.DetectSchemaStudioV1StructuredRagOrganizationsOrganizationIdSchemaDetectionPost.g.cs index 3d21597f..2263f799 100644 --- a/src/libs/AI21/Generated/AI21.Ai21Client.DetectSchemaStudioV1StructuredRagOrganizationsOrganizationIdSchemaDetectionPost.g.cs +++ b/src/libs/AI21/Generated/AI21.Ai21Client.DetectSchemaStudioV1StructuredRagOrganizationsOrganizationIdSchemaDetectionPost.g.cs @@ -14,6 +14,7 @@ public partial class Ai21Client { new global::AI21.EndPointAuthorizationRequirement { Type = "Http", + SchemeId = "HttpBearer", Location = "Header", Name = "Bearer", FriendlyName = "Bearer", @@ -47,12 +48,39 @@ partial void ProcessDetectSchemaStudioV1StructuredRagOrganizationsOrganizationId /// /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// public async global::System.Threading.Tasks.Task DetectSchemaStudioV1StructuredRagOrganizationsOrganizationIdSchemaDetectionPostAsync( string organizationId, global::AI21.DetectSchemaRequest request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await DetectSchemaStudioV1StructuredRagOrganizationsOrganizationIdSchemaDetectionPostAsResponseAsync( + organizationId: organizationId, + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Detect 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> DetectSchemaStudioV1StructuredRagOrganizationsOrganizationIdSchemaDetectionPostAsResponseAsync( + string organizationId, + + global::AI21.DetectSchemaRequest request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) { request = request ?? throw new global::System.ArgumentNullException(nameof(request)); @@ -70,22 +98,44 @@ partial void ProcessDetectSchemaStudioV1StructuredRagOrganizationsOrganizationId securityRequirements: s_DetectSchemaStudioV1StructuredRagOrganizationsOrganizationIdSchemaDetectionPostSecurityRequirements, operationName: "DetectSchemaStudioV1StructuredRagOrganizationsOrganizationIdSchemaDetectionPostAsync"); - var __pathBuilder = new global::AI21.PathBuilder( - path: $"/studio/v1/structured-rag/organizations/{organizationId}/schema-detection", - 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)); + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: $"/studio/v1/structured-rag/organizations/{organizationId}/schema-detection", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.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; + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; #endif foreach (var __authorization in __authorizations) { if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2") + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") { __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( scheme: __authorization.Name, @@ -95,157 +145,337 @@ partial void ProcessDetectSchemaStudioV1StructuredRagOrganizationsOrganizationId __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); - PrepareDetectSchemaStudioV1StructuredRagOrganizationsOrganizationIdSchemaDetectionPostRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - organizationId: organizationId, - request: request); + 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::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareDetectSchemaStudioV1StructuredRagOrganizationsOrganizationIdSchemaDetectionPostRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + organizationId: organizationId!, + request: request); - ProcessResponse( - client: HttpClient, - response: __response); - ProcessDetectSchemaStudioV1StructuredRagOrganizationsOrganizationIdSchemaDetectionPostResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Validation Error - if ((int)__response.StatusCode == 422) + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::AI21.HTTPValidationError? __value_422 = null; - try + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) { - if (ReadResponseAsString) + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "DetectSchemaStudioV1StructuredRagOrganizationsOrganizationIdSchemaDetectionPost", + methodName: "DetectSchemaStudioV1StructuredRagOrganizationsOrganizationIdSchemaDetectionPostAsync", + pathTemplate: "$\"/studio/v1/structured-rag/organizations/{organizationId}/schema-detection\"", + 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 { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); } - else + catch (global::System.Net.Http.HttpRequestException __exception) { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "DetectSchemaStudioV1StructuredRagOrganizationsOrganizationIdSchemaDetectionPost", + methodName: "DetectSchemaStudioV1StructuredRagOrganizationsOrganizationIdSchemaDetectionPostAsync", + pathTemplate: "$\"/studio/v1/structured-rag/organizations/{organizationId}/schema-detection\"", + 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; + } - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "DetectSchemaStudioV1StructuredRagOrganizationsOrganizationIdSchemaDetectionPost", + methodName: "DetectSchemaStudioV1StructuredRagOrganizationsOrganizationIdSchemaDetectionPostAsync", + pathTemplate: "$\"/studio/v1/structured-rag/organizations/{organizationId}/schema-detection\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; } - catch (global::System.Exception __ex) + + if (__response == null) { - __exception_422 = __ex; + throw new global::System.InvalidOperationException("No response received."); } - throw new global::AI21.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) + using (__response) { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( + ProcessResponse( client: HttpClient, - response: __response, - content: ref __content); - ProcessDetectSchemaStudioV1StructuredRagOrganizationsOrganizationIdSchemaDetectionPostResponseContent( + response: __response); + ProcessDetectSchemaStudioV1StructuredRagOrganizationsOrganizationIdSchemaDetectionPostResponse( httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) { - __response.EnsureSuccessStatusCode(); - - return - global::AI21.DetectSchemaResponse.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "DetectSchemaStudioV1StructuredRagOrganizationsOrganizationIdSchemaDetectionPost", + methodName: "DetectSchemaStudioV1StructuredRagOrganizationsOrganizationIdSchemaDetectionPostAsync", + pathTemplate: "$\"/studio/v1/structured-rag/organizations/{organizationId}/schema-detection\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } - catch (global::System.Exception __ex) + else { - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "DetectSchemaStudioV1StructuredRagOrganizationsOrganizationIdSchemaDetectionPost", + methodName: "DetectSchemaStudioV1StructuredRagOrganizationsOrganizationIdSchemaDetectionPostAsync", + pathTemplate: "$\"/studio/v1/structured-rag/organizations/{organizationId}/schema-detection\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - using var __content = await __response.Content.ReadAsStreamAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::AI21.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - return - await global::AI21.DetectSchemaResponse.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) - { - } + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessDetectSchemaStudioV1StructuredRagOrganizationsOrganizationIdSchemaDetectionPostResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::AI21.DetectSchemaResponse.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => 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::AI21.DetectSchemaResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; } } + finally + { + __httpRequest?.Dispose(); + } } /// /// Detect Schema @@ -253,12 +483,14 @@ partial void ProcessDetectSchemaStudioV1StructuredRagOrganizationsOrganizationId /// /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// public async global::System.Threading.Tasks.Task DetectSchemaStudioV1StructuredRagOrganizationsOrganizationIdSchemaDetectionPostAsync( string organizationId, global::System.Collections.Generic.IList documents, global::System.Collections.Generic.IList? queries = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) { var __request = new global::AI21.DetectSchemaRequest @@ -270,6 +502,7 @@ partial void ProcessDetectSchemaStudioV1StructuredRagOrganizationsOrganizationId return await DetectSchemaStudioV1StructuredRagOrganizationsOrganizationIdSchemaDetectionPostAsync( organizationId: organizationId, request: __request, + requestOptions: requestOptions, cancellationToken: cancellationToken).ConfigureAwait(false); } } diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.DownloadModifiedDocumentStudioV1DemosDocumentModifierDownloadPost.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.DownloadModifiedDocumentStudioV1DemosDocumentModifierDownloadPost.g.cs index 80eb9870..ec967fa7 100644 --- a/src/libs/AI21/Generated/AI21.Ai21Client.DownloadModifiedDocumentStudioV1DemosDocumentModifierDownloadPost.g.cs +++ b/src/libs/AI21/Generated/AI21.Ai21Client.DownloadModifiedDocumentStudioV1DemosDocumentModifierDownloadPost.g.cs @@ -14,6 +14,7 @@ public partial class Ai21Client { new global::AI21.EndPointAuthorizationRequirement { Type = "Http", + SchemeId = "HttpBearer", Location = "Header", Name = "Bearer", FriendlyName = "Bearer", @@ -45,11 +46,36 @@ partial void ProcessDownloadModifiedDocumentStudioV1DemosDocumentModifierDownloa /// Download a modified document. /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// public async global::System.Threading.Tasks.Task DownloadModifiedDocumentStudioV1DemosDocumentModifierDownloadPostAsync( global::AI21.DownloadModifiedDocumentRequest request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await DownloadModifiedDocumentStudioV1DemosDocumentModifierDownloadPostAsResponseAsync( + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Download Modified Document
+ /// Download a modified document. + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> DownloadModifiedDocumentStudioV1DemosDocumentModifierDownloadPostAsResponseAsync( + + global::AI21.DownloadModifiedDocumentRequest request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) { request = request ?? throw new global::System.ArgumentNullException(nameof(request)); @@ -66,22 +92,44 @@ partial void ProcessDownloadModifiedDocumentStudioV1DemosDocumentModifierDownloa securityRequirements: s_DownloadModifiedDocumentStudioV1DemosDocumentModifierDownloadPostSecurityRequirements, operationName: "DownloadModifiedDocumentStudioV1DemosDocumentModifierDownloadPostAsync"); - var __pathBuilder = new global::AI21.PathBuilder( - path: "/studio/v1/demos/document-modifier/download", - 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)); + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: "/studio/v1/demos/document-modifier/download", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.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; + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; #endif foreach (var __authorization in __authorizations) { if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2") + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") { __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( scheme: __authorization.Name, @@ -91,152 +139,332 @@ partial void ProcessDownloadModifiedDocumentStudioV1DemosDocumentModifierDownloa __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); - PrepareDownloadModifiedDocumentStudioV1DemosDocumentModifierDownloadPostRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - request: request); + 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::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareDownloadModifiedDocumentStudioV1DemosDocumentModifierDownloadPostRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + request: request); - ProcessResponse( - client: HttpClient, - response: __response); - ProcessDownloadModifiedDocumentStudioV1DemosDocumentModifierDownloadPostResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Validation Error - if ((int)__response.StatusCode == 422) + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::AI21.HTTPValidationError? __value_422 = null; - try + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) { - if (ReadResponseAsString) + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "DownloadModifiedDocumentStudioV1DemosDocumentModifierDownloadPost", + methodName: "DownloadModifiedDocumentStudioV1DemosDocumentModifierDownloadPostAsync", + pathTemplate: "\"/studio/v1/demos/document-modifier/download\"", + 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 { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); } - else + catch (global::System.Net.Http.HttpRequestException __exception) { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "DownloadModifiedDocumentStudioV1DemosDocumentModifierDownloadPost", + methodName: "DownloadModifiedDocumentStudioV1DemosDocumentModifierDownloadPostAsync", + pathTemplate: "\"/studio/v1/demos/document-modifier/download\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "DownloadModifiedDocumentStudioV1DemosDocumentModifierDownloadPost", + methodName: "DownloadModifiedDocumentStudioV1DemosDocumentModifierDownloadPostAsync", + pathTemplate: "\"/studio/v1/demos/document-modifier/download\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; } + + break; } - catch (global::System.Exception __ex) + + if (__response == null) { - __exception_422 = __ex; + throw new global::System.InvalidOperationException("No response received."); } - throw new global::AI21.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) + using (__response) { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( + ProcessResponse( client: HttpClient, - response: __response, - content: ref __content); - ProcessDownloadModifiedDocumentStudioV1DemosDocumentModifierDownloadPostResponseContent( + response: __response); + ProcessDownloadModifiedDocumentStudioV1DemosDocumentModifierDownloadPostResponse( httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) { - __response.EnsureSuccessStatusCode(); - - return __content; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "DownloadModifiedDocumentStudioV1DemosDocumentModifierDownloadPost", + methodName: "DownloadModifiedDocumentStudioV1DemosDocumentModifierDownloadPostAsync", + pathTemplate: "\"/studio/v1/demos/document-modifier/download\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } - catch (global::System.Exception __ex) + else { - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "DownloadModifiedDocumentStudioV1DemosDocumentModifierDownloadPost", + methodName: "DownloadModifiedDocumentStudioV1DemosDocumentModifierDownloadPostAsync", + pathTemplate: "\"/studio/v1/demos/document-modifier/download\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::AI21.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).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) - { - } + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessDownloadModifiedDocumentStudioV1DemosDocumentModifierDownloadPostResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? 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::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.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::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; } } + finally + { + __httpRequest?.Dispose(); + } } /// /// Download Modified Document
@@ -244,11 +472,13 @@ partial void ProcessDownloadModifiedDocumentStudioV1DemosDocumentModifierDownloa ///
/// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// public async global::System.Threading.Tasks.Task DownloadModifiedDocumentStudioV1DemosDocumentModifierDownloadPostAsync( string content, string filename, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) { var __request = new global::AI21.DownloadModifiedDocumentRequest @@ -259,6 +489,7 @@ partial void ProcessDownloadModifiedDocumentStudioV1DemosDocumentModifierDownloa return await DownloadModifiedDocumentStudioV1DemosDocumentModifierDownloadPostAsync( request: __request, + requestOptions: requestOptions, cancellationToken: cancellationToken).ConfigureAwait(false); } } diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.FnacAftersalesBatchPredictPrefixPreviewSolutionsPreviewFdAftersalesPartsClassificationBatchPost.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.FnacAftersalesBatchPredictPrefixPreviewSolutionsPreviewFdAftersalesPartsClassificationBatchPost.g.cs deleted file mode 100644 index 6668d609..00000000 --- a/src/libs/AI21/Generated/AI21.Ai21Client.FnacAftersalesBatchPredictPrefixPreviewSolutionsPreviewFdAftersalesPartsClassificationBatchPost.g.cs +++ /dev/null @@ -1,188 +0,0 @@ - -#nullable enable - -namespace AI21 -{ - public partial class Ai21Client - { - - - private static readonly global::AI21.EndPointSecurityRequirement s_FnacAftersalesBatchPredictPrefixPreviewSolutionsPreviewFdAftersalesPartsClassificationBatchPostSecurityRequirement0 = - new global::AI21.EndPointSecurityRequirement - { - Authorizations = new global::AI21.EndPointAuthorizationRequirement[] - { new global::AI21.EndPointAuthorizationRequirement - { - Type = "Http", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::AI21.EndPointSecurityRequirement[] s_FnacAftersalesBatchPredictPrefixPreviewSolutionsPreviewFdAftersalesPartsClassificationBatchPostSecurityRequirements = - new global::AI21.EndPointSecurityRequirement[] - { s_FnacAftersalesBatchPredictPrefixPreviewSolutionsPreviewFdAftersalesPartsClassificationBatchPostSecurityRequirement0, - }; - partial void PrepareFnacAftersalesBatchPredictPrefixPreviewSolutionsPreviewFdAftersalesPartsClassificationBatchPostArguments( - global::System.Net.Http.HttpClient httpClient); - partial void PrepareFnacAftersalesBatchPredictPrefixPreviewSolutionsPreviewFdAftersalesPartsClassificationBatchPostRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage); - partial void ProcessFnacAftersalesBatchPredictPrefixPreviewSolutionsPreviewFdAftersalesPartsClassificationBatchPostResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessFnacAftersalesBatchPredictPrefixPreviewSolutionsPreviewFdAftersalesPartsClassificationBatchPostResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Fnac Aftersales Batch Predict Prefix Preview - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task FnacAftersalesBatchPredictPrefixPreviewSolutionsPreviewFdAftersalesPartsClassificationBatchPostAsync( - global::System.Threading.CancellationToken cancellationToken = default) - { - PrepareArguments( - client: HttpClient); - PrepareFnacAftersalesBatchPredictPrefixPreviewSolutionsPreviewFdAftersalesPartsClassificationBatchPostArguments( - httpClient: HttpClient); - - - var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_FnacAftersalesBatchPredictPrefixPreviewSolutionsPreviewFdAftersalesPartsClassificationBatchPostSecurityRequirements, - operationName: "FnacAftersalesBatchPredictPrefixPreviewSolutionsPreviewFdAftersalesPartsClassificationBatchPostAsync"); - - var __pathBuilder = new global::AI21.PathBuilder( - path: "/solutions-preview/fd_aftersales/parts-classification/batch", - 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); - } - } - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareFnacAftersalesBatchPredictPrefixPreviewSolutionsPreviewFdAftersalesPartsClassificationBatchPostRequest( - 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); - ProcessFnacAftersalesBatchPredictPrefixPreviewSolutionsPreviewFdAftersalesPartsClassificationBatchPostResponse( - 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); - ProcessFnacAftersalesBatchPredictPrefixPreviewSolutionsPreviewFdAftersalesPartsClassificationBatchPostResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return __content; - } - catch (global::System.Exception __ex) - { - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __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::AI21.ApiException( - message: __content ?? __response.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/AI21/Generated/AI21.Ai21Client.FnacAftersalesBatchPredictSolutionsFdAftersalesPartsClassificationBatchPost.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.FnacAftersalesBatchPredictSolutionsFdAftersalesPartsClassificationBatchPost.g.cs deleted file mode 100644 index a1acc9b3..00000000 --- a/src/libs/AI21/Generated/AI21.Ai21Client.FnacAftersalesBatchPredictSolutionsFdAftersalesPartsClassificationBatchPost.g.cs +++ /dev/null @@ -1,188 +0,0 @@ - -#nullable enable - -namespace AI21 -{ - public partial class Ai21Client - { - - - private static readonly global::AI21.EndPointSecurityRequirement s_FnacAftersalesBatchPredictSolutionsFdAftersalesPartsClassificationBatchPostSecurityRequirement0 = - new global::AI21.EndPointSecurityRequirement - { - Authorizations = new global::AI21.EndPointAuthorizationRequirement[] - { new global::AI21.EndPointAuthorizationRequirement - { - Type = "Http", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::AI21.EndPointSecurityRequirement[] s_FnacAftersalesBatchPredictSolutionsFdAftersalesPartsClassificationBatchPostSecurityRequirements = - new global::AI21.EndPointSecurityRequirement[] - { s_FnacAftersalesBatchPredictSolutionsFdAftersalesPartsClassificationBatchPostSecurityRequirement0, - }; - partial void PrepareFnacAftersalesBatchPredictSolutionsFdAftersalesPartsClassificationBatchPostArguments( - global::System.Net.Http.HttpClient httpClient); - partial void PrepareFnacAftersalesBatchPredictSolutionsFdAftersalesPartsClassificationBatchPostRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage); - partial void ProcessFnacAftersalesBatchPredictSolutionsFdAftersalesPartsClassificationBatchPostResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessFnacAftersalesBatchPredictSolutionsFdAftersalesPartsClassificationBatchPostResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Fnac Aftersales Batch Predict - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task FnacAftersalesBatchPredictSolutionsFdAftersalesPartsClassificationBatchPostAsync( - global::System.Threading.CancellationToken cancellationToken = default) - { - PrepareArguments( - client: HttpClient); - PrepareFnacAftersalesBatchPredictSolutionsFdAftersalesPartsClassificationBatchPostArguments( - httpClient: HttpClient); - - - var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_FnacAftersalesBatchPredictSolutionsFdAftersalesPartsClassificationBatchPostSecurityRequirements, - operationName: "FnacAftersalesBatchPredictSolutionsFdAftersalesPartsClassificationBatchPostAsync"); - - var __pathBuilder = new global::AI21.PathBuilder( - path: "/solutions/fd_aftersales/parts-classification/batch", - 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); - } - } - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareFnacAftersalesBatchPredictSolutionsFdAftersalesPartsClassificationBatchPostRequest( - 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); - ProcessFnacAftersalesBatchPredictSolutionsFdAftersalesPartsClassificationBatchPostResponse( - 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); - ProcessFnacAftersalesBatchPredictSolutionsFdAftersalesPartsClassificationBatchPostResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return __content; - } - catch (global::System.Exception __ex) - { - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __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::AI21.ApiException( - message: __content ?? __response.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/AI21/Generated/AI21.Ai21Client.FnacAftersalesBatchPredictStatusPrefixPreviewSolutionsPreviewFdAftersalesPartsClassificationBatchBatchIdStatusGet.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.FnacAftersalesBatchPredictStatusPrefixPreviewSolutionsPreviewFdAftersalesPartsClassificationBatchBatchIdStatusGet.g.cs deleted file mode 100644 index ebc139d9..00000000 --- a/src/libs/AI21/Generated/AI21.Ai21Client.FnacAftersalesBatchPredictStatusPrefixPreviewSolutionsPreviewFdAftersalesPartsClassificationBatchBatchIdStatusGet.g.cs +++ /dev/null @@ -1,232 +0,0 @@ - -#nullable enable - -namespace AI21 -{ - public partial class Ai21Client - { - - - private static readonly global::AI21.EndPointSecurityRequirement s_FnacAftersalesBatchPredictStatusPrefixPreviewSolutionsPreviewFdAftersalesPartsClassificationBatchBatchIdStatusGetSecurityRequirement0 = - new global::AI21.EndPointSecurityRequirement - { - Authorizations = new global::AI21.EndPointAuthorizationRequirement[] - { new global::AI21.EndPointAuthorizationRequirement - { - Type = "Http", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::AI21.EndPointSecurityRequirement[] s_FnacAftersalesBatchPredictStatusPrefixPreviewSolutionsPreviewFdAftersalesPartsClassificationBatchBatchIdStatusGetSecurityRequirements = - new global::AI21.EndPointSecurityRequirement[] - { s_FnacAftersalesBatchPredictStatusPrefixPreviewSolutionsPreviewFdAftersalesPartsClassificationBatchBatchIdStatusGetSecurityRequirement0, - }; - partial void PrepareFnacAftersalesBatchPredictStatusPrefixPreviewSolutionsPreviewFdAftersalesPartsClassificationBatchBatchIdStatusGetArguments( - global::System.Net.Http.HttpClient httpClient, - ref string batchId); - partial void PrepareFnacAftersalesBatchPredictStatusPrefixPreviewSolutionsPreviewFdAftersalesPartsClassificationBatchBatchIdStatusGetRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - string batchId); - partial void ProcessFnacAftersalesBatchPredictStatusPrefixPreviewSolutionsPreviewFdAftersalesPartsClassificationBatchBatchIdStatusGetResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessFnacAftersalesBatchPredictStatusPrefixPreviewSolutionsPreviewFdAftersalesPartsClassificationBatchBatchIdStatusGetResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Fnac Aftersales Batch Predict Status Prefix Preview - /// - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task FnacAftersalesBatchPredictStatusPrefixPreviewSolutionsPreviewFdAftersalesPartsClassificationBatchBatchIdStatusGetAsync( - string batchId, - global::System.Threading.CancellationToken cancellationToken = default) - { - PrepareArguments( - client: HttpClient); - PrepareFnacAftersalesBatchPredictStatusPrefixPreviewSolutionsPreviewFdAftersalesPartsClassificationBatchBatchIdStatusGetArguments( - httpClient: HttpClient, - batchId: ref batchId); - - - var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_FnacAftersalesBatchPredictStatusPrefixPreviewSolutionsPreviewFdAftersalesPartsClassificationBatchBatchIdStatusGetSecurityRequirements, - operationName: "FnacAftersalesBatchPredictStatusPrefixPreviewSolutionsPreviewFdAftersalesPartsClassificationBatchBatchIdStatusGetAsync"); - - var __pathBuilder = new global::AI21.PathBuilder( - path: $"/solutions-preview/fd_aftersales/parts-classification/batch/{batchId}/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); - } - } - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareFnacAftersalesBatchPredictStatusPrefixPreviewSolutionsPreviewFdAftersalesPartsClassificationBatchBatchIdStatusGetRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - batchId: batchId); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessFnacAftersalesBatchPredictStatusPrefixPreviewSolutionsPreviewFdAftersalesPartsClassificationBatchBatchIdStatusGetResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Validation Error - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::AI21.HTTPValidationError? __value_422 = null; - try - { - if (ReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - throw new global::AI21.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) - { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessFnacAftersalesBatchPredictStatusPrefixPreviewSolutionsPreviewFdAftersalesPartsClassificationBatchBatchIdStatusGetResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return __content; - } - catch (global::System.Exception __ex) - { - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __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::AI21.ApiException( - message: __content ?? __response.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/AI21/Generated/AI21.Ai21Client.FnacAftersalesBatchPredictStatusSolutionsFdAftersalesPartsClassificationBatchBatchIdStatusGet.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.FnacAftersalesBatchPredictStatusSolutionsFdAftersalesPartsClassificationBatchBatchIdStatusGet.g.cs deleted file mode 100644 index f250d687..00000000 --- a/src/libs/AI21/Generated/AI21.Ai21Client.FnacAftersalesBatchPredictStatusSolutionsFdAftersalesPartsClassificationBatchBatchIdStatusGet.g.cs +++ /dev/null @@ -1,232 +0,0 @@ - -#nullable enable - -namespace AI21 -{ - public partial class Ai21Client - { - - - private static readonly global::AI21.EndPointSecurityRequirement s_FnacAftersalesBatchPredictStatusSolutionsFdAftersalesPartsClassificationBatchBatchIdStatusGetSecurityRequirement0 = - new global::AI21.EndPointSecurityRequirement - { - Authorizations = new global::AI21.EndPointAuthorizationRequirement[] - { new global::AI21.EndPointAuthorizationRequirement - { - Type = "Http", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::AI21.EndPointSecurityRequirement[] s_FnacAftersalesBatchPredictStatusSolutionsFdAftersalesPartsClassificationBatchBatchIdStatusGetSecurityRequirements = - new global::AI21.EndPointSecurityRequirement[] - { s_FnacAftersalesBatchPredictStatusSolutionsFdAftersalesPartsClassificationBatchBatchIdStatusGetSecurityRequirement0, - }; - partial void PrepareFnacAftersalesBatchPredictStatusSolutionsFdAftersalesPartsClassificationBatchBatchIdStatusGetArguments( - global::System.Net.Http.HttpClient httpClient, - ref string batchId); - partial void PrepareFnacAftersalesBatchPredictStatusSolutionsFdAftersalesPartsClassificationBatchBatchIdStatusGetRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - string batchId); - partial void ProcessFnacAftersalesBatchPredictStatusSolutionsFdAftersalesPartsClassificationBatchBatchIdStatusGetResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessFnacAftersalesBatchPredictStatusSolutionsFdAftersalesPartsClassificationBatchBatchIdStatusGetResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Fnac Aftersales Batch Predict Status - /// - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task FnacAftersalesBatchPredictStatusSolutionsFdAftersalesPartsClassificationBatchBatchIdStatusGetAsync( - string batchId, - global::System.Threading.CancellationToken cancellationToken = default) - { - PrepareArguments( - client: HttpClient); - PrepareFnacAftersalesBatchPredictStatusSolutionsFdAftersalesPartsClassificationBatchBatchIdStatusGetArguments( - httpClient: HttpClient, - batchId: ref batchId); - - - var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_FnacAftersalesBatchPredictStatusSolutionsFdAftersalesPartsClassificationBatchBatchIdStatusGetSecurityRequirements, - operationName: "FnacAftersalesBatchPredictStatusSolutionsFdAftersalesPartsClassificationBatchBatchIdStatusGetAsync"); - - var __pathBuilder = new global::AI21.PathBuilder( - path: $"/solutions/fd_aftersales/parts-classification/batch/{batchId}/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); - } - } - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareFnacAftersalesBatchPredictStatusSolutionsFdAftersalesPartsClassificationBatchBatchIdStatusGetRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - batchId: batchId); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessFnacAftersalesBatchPredictStatusSolutionsFdAftersalesPartsClassificationBatchBatchIdStatusGetResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Validation Error - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::AI21.HTTPValidationError? __value_422 = null; - try - { - if (ReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - throw new global::AI21.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) - { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessFnacAftersalesBatchPredictStatusSolutionsFdAftersalesPartsClassificationBatchBatchIdStatusGetResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return __content; - } - catch (global::System.Exception __ex) - { - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __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::AI21.ApiException( - message: __content ?? __response.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/AI21/Generated/AI21.Ai21Client.FnacBatchClassificationsPrefixPreviewSolutionsPreviewFdBatchesV1ClassificationsPost.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.FnacBatchClassificationsPrefixPreviewSolutionsPreviewFdBatchesV1ClassificationsPost.g.cs deleted file mode 100644 index 12e14f5e..00000000 --- a/src/libs/AI21/Generated/AI21.Ai21Client.FnacBatchClassificationsPrefixPreviewSolutionsPreviewFdBatchesV1ClassificationsPost.g.cs +++ /dev/null @@ -1,188 +0,0 @@ - -#nullable enable - -namespace AI21 -{ - public partial class Ai21Client - { - - - private static readonly global::AI21.EndPointSecurityRequirement s_FnacBatchClassificationsPrefixPreviewSolutionsPreviewFdBatchesV1ClassificationsPostSecurityRequirement0 = - new global::AI21.EndPointSecurityRequirement - { - Authorizations = new global::AI21.EndPointAuthorizationRequirement[] - { new global::AI21.EndPointAuthorizationRequirement - { - Type = "Http", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::AI21.EndPointSecurityRequirement[] s_FnacBatchClassificationsPrefixPreviewSolutionsPreviewFdBatchesV1ClassificationsPostSecurityRequirements = - new global::AI21.EndPointSecurityRequirement[] - { s_FnacBatchClassificationsPrefixPreviewSolutionsPreviewFdBatchesV1ClassificationsPostSecurityRequirement0, - }; - partial void PrepareFnacBatchClassificationsPrefixPreviewSolutionsPreviewFdBatchesV1ClassificationsPostArguments( - global::System.Net.Http.HttpClient httpClient); - partial void PrepareFnacBatchClassificationsPrefixPreviewSolutionsPreviewFdBatchesV1ClassificationsPostRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage); - partial void ProcessFnacBatchClassificationsPrefixPreviewSolutionsPreviewFdBatchesV1ClassificationsPostResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessFnacBatchClassificationsPrefixPreviewSolutionsPreviewFdBatchesV1ClassificationsPostResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Fnac Batch Classifications Prefix Preview - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task FnacBatchClassificationsPrefixPreviewSolutionsPreviewFdBatchesV1ClassificationsPostAsync( - global::System.Threading.CancellationToken cancellationToken = default) - { - PrepareArguments( - client: HttpClient); - PrepareFnacBatchClassificationsPrefixPreviewSolutionsPreviewFdBatchesV1ClassificationsPostArguments( - httpClient: HttpClient); - - - var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_FnacBatchClassificationsPrefixPreviewSolutionsPreviewFdBatchesV1ClassificationsPostSecurityRequirements, - operationName: "FnacBatchClassificationsPrefixPreviewSolutionsPreviewFdBatchesV1ClassificationsPostAsync"); - - var __pathBuilder = new global::AI21.PathBuilder( - path: "/solutions-preview/fd/batches/v1/classifications", - 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); - } - } - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareFnacBatchClassificationsPrefixPreviewSolutionsPreviewFdBatchesV1ClassificationsPostRequest( - 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); - ProcessFnacBatchClassificationsPrefixPreviewSolutionsPreviewFdBatchesV1ClassificationsPostResponse( - 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); - ProcessFnacBatchClassificationsPrefixPreviewSolutionsPreviewFdBatchesV1ClassificationsPostResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return __content; - } - catch (global::System.Exception __ex) - { - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __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::AI21.ApiException( - message: __content ?? __response.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/AI21/Generated/AI21.Ai21Client.FnacBatchClassificationsResultsPrefixPreviewSolutionsPreviewFdBatchesV1ClassificationsBatchIdResultsPost.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.FnacBatchClassificationsResultsPrefixPreviewSolutionsPreviewFdBatchesV1ClassificationsBatchIdResultsPost.g.cs deleted file mode 100644 index e97db143..00000000 --- a/src/libs/AI21/Generated/AI21.Ai21Client.FnacBatchClassificationsResultsPrefixPreviewSolutionsPreviewFdBatchesV1ClassificationsBatchIdResultsPost.g.cs +++ /dev/null @@ -1,232 +0,0 @@ - -#nullable enable - -namespace AI21 -{ - public partial class Ai21Client - { - - - private static readonly global::AI21.EndPointSecurityRequirement s_FnacBatchClassificationsResultsPrefixPreviewSolutionsPreviewFdBatchesV1ClassificationsBatchIdResultsPostSecurityRequirement0 = - new global::AI21.EndPointSecurityRequirement - { - Authorizations = new global::AI21.EndPointAuthorizationRequirement[] - { new global::AI21.EndPointAuthorizationRequirement - { - Type = "Http", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::AI21.EndPointSecurityRequirement[] s_FnacBatchClassificationsResultsPrefixPreviewSolutionsPreviewFdBatchesV1ClassificationsBatchIdResultsPostSecurityRequirements = - new global::AI21.EndPointSecurityRequirement[] - { s_FnacBatchClassificationsResultsPrefixPreviewSolutionsPreviewFdBatchesV1ClassificationsBatchIdResultsPostSecurityRequirement0, - }; - partial void PrepareFnacBatchClassificationsResultsPrefixPreviewSolutionsPreviewFdBatchesV1ClassificationsBatchIdResultsPostArguments( - global::System.Net.Http.HttpClient httpClient, - ref string batchId); - partial void PrepareFnacBatchClassificationsResultsPrefixPreviewSolutionsPreviewFdBatchesV1ClassificationsBatchIdResultsPostRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - string batchId); - partial void ProcessFnacBatchClassificationsResultsPrefixPreviewSolutionsPreviewFdBatchesV1ClassificationsBatchIdResultsPostResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessFnacBatchClassificationsResultsPrefixPreviewSolutionsPreviewFdBatchesV1ClassificationsBatchIdResultsPostResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Fnac Batch Classifications Results Prefix Preview - /// - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task FnacBatchClassificationsResultsPrefixPreviewSolutionsPreviewFdBatchesV1ClassificationsBatchIdResultsPostAsync( - string batchId, - global::System.Threading.CancellationToken cancellationToken = default) - { - PrepareArguments( - client: HttpClient); - PrepareFnacBatchClassificationsResultsPrefixPreviewSolutionsPreviewFdBatchesV1ClassificationsBatchIdResultsPostArguments( - httpClient: HttpClient, - batchId: ref batchId); - - - var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_FnacBatchClassificationsResultsPrefixPreviewSolutionsPreviewFdBatchesV1ClassificationsBatchIdResultsPostSecurityRequirements, - operationName: "FnacBatchClassificationsResultsPrefixPreviewSolutionsPreviewFdBatchesV1ClassificationsBatchIdResultsPostAsync"); - - var __pathBuilder = new global::AI21.PathBuilder( - path: $"/solutions-preview/fd/batches/v1/classifications/{batchId}/results", - 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); - } - } - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareFnacBatchClassificationsResultsPrefixPreviewSolutionsPreviewFdBatchesV1ClassificationsBatchIdResultsPostRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - batchId: batchId); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessFnacBatchClassificationsResultsPrefixPreviewSolutionsPreviewFdBatchesV1ClassificationsBatchIdResultsPostResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Validation Error - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::AI21.HTTPValidationError? __value_422 = null; - try - { - if (ReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - throw new global::AI21.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) - { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessFnacBatchClassificationsResultsPrefixPreviewSolutionsPreviewFdBatchesV1ClassificationsBatchIdResultsPostResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return __content; - } - catch (global::System.Exception __ex) - { - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __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::AI21.ApiException( - message: __content ?? __response.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/AI21/Generated/AI21.Ai21Client.FnacBatchClassificationsResultsSolutionsFdBatchesV1ClassificationsBatchIdResultsPost.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.FnacBatchClassificationsResultsSolutionsFdBatchesV1ClassificationsBatchIdResultsPost.g.cs deleted file mode 100644 index 5b6a29c9..00000000 --- a/src/libs/AI21/Generated/AI21.Ai21Client.FnacBatchClassificationsResultsSolutionsFdBatchesV1ClassificationsBatchIdResultsPost.g.cs +++ /dev/null @@ -1,232 +0,0 @@ - -#nullable enable - -namespace AI21 -{ - public partial class Ai21Client - { - - - private static readonly global::AI21.EndPointSecurityRequirement s_FnacBatchClassificationsResultsSolutionsFdBatchesV1ClassificationsBatchIdResultsPostSecurityRequirement0 = - new global::AI21.EndPointSecurityRequirement - { - Authorizations = new global::AI21.EndPointAuthorizationRequirement[] - { new global::AI21.EndPointAuthorizationRequirement - { - Type = "Http", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::AI21.EndPointSecurityRequirement[] s_FnacBatchClassificationsResultsSolutionsFdBatchesV1ClassificationsBatchIdResultsPostSecurityRequirements = - new global::AI21.EndPointSecurityRequirement[] - { s_FnacBatchClassificationsResultsSolutionsFdBatchesV1ClassificationsBatchIdResultsPostSecurityRequirement0, - }; - partial void PrepareFnacBatchClassificationsResultsSolutionsFdBatchesV1ClassificationsBatchIdResultsPostArguments( - global::System.Net.Http.HttpClient httpClient, - ref string batchId); - partial void PrepareFnacBatchClassificationsResultsSolutionsFdBatchesV1ClassificationsBatchIdResultsPostRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - string batchId); - partial void ProcessFnacBatchClassificationsResultsSolutionsFdBatchesV1ClassificationsBatchIdResultsPostResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessFnacBatchClassificationsResultsSolutionsFdBatchesV1ClassificationsBatchIdResultsPostResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Fnac Batch Classifications Results - /// - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task FnacBatchClassificationsResultsSolutionsFdBatchesV1ClassificationsBatchIdResultsPostAsync( - string batchId, - global::System.Threading.CancellationToken cancellationToken = default) - { - PrepareArguments( - client: HttpClient); - PrepareFnacBatchClassificationsResultsSolutionsFdBatchesV1ClassificationsBatchIdResultsPostArguments( - httpClient: HttpClient, - batchId: ref batchId); - - - var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_FnacBatchClassificationsResultsSolutionsFdBatchesV1ClassificationsBatchIdResultsPostSecurityRequirements, - operationName: "FnacBatchClassificationsResultsSolutionsFdBatchesV1ClassificationsBatchIdResultsPostAsync"); - - var __pathBuilder = new global::AI21.PathBuilder( - path: $"/solutions/fd/batches/v1/classifications/{batchId}/results", - 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); - } - } - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareFnacBatchClassificationsResultsSolutionsFdBatchesV1ClassificationsBatchIdResultsPostRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - batchId: batchId); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessFnacBatchClassificationsResultsSolutionsFdBatchesV1ClassificationsBatchIdResultsPostResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Validation Error - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::AI21.HTTPValidationError? __value_422 = null; - try - { - if (ReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - throw new global::AI21.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) - { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessFnacBatchClassificationsResultsSolutionsFdBatchesV1ClassificationsBatchIdResultsPostResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return __content; - } - catch (global::System.Exception __ex) - { - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __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::AI21.ApiException( - message: __content ?? __response.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/AI21/Generated/AI21.Ai21Client.FnacBatchClassificationsSolutionsFdBatchesV1ClassificationsPost.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.FnacBatchClassificationsSolutionsFdBatchesV1ClassificationsPost.g.cs deleted file mode 100644 index 0ca47c65..00000000 --- a/src/libs/AI21/Generated/AI21.Ai21Client.FnacBatchClassificationsSolutionsFdBatchesV1ClassificationsPost.g.cs +++ /dev/null @@ -1,188 +0,0 @@ - -#nullable enable - -namespace AI21 -{ - public partial class Ai21Client - { - - - private static readonly global::AI21.EndPointSecurityRequirement s_FnacBatchClassificationsSolutionsFdBatchesV1ClassificationsPostSecurityRequirement0 = - new global::AI21.EndPointSecurityRequirement - { - Authorizations = new global::AI21.EndPointAuthorizationRequirement[] - { new global::AI21.EndPointAuthorizationRequirement - { - Type = "Http", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::AI21.EndPointSecurityRequirement[] s_FnacBatchClassificationsSolutionsFdBatchesV1ClassificationsPostSecurityRequirements = - new global::AI21.EndPointSecurityRequirement[] - { s_FnacBatchClassificationsSolutionsFdBatchesV1ClassificationsPostSecurityRequirement0, - }; - partial void PrepareFnacBatchClassificationsSolutionsFdBatchesV1ClassificationsPostArguments( - global::System.Net.Http.HttpClient httpClient); - partial void PrepareFnacBatchClassificationsSolutionsFdBatchesV1ClassificationsPostRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage); - partial void ProcessFnacBatchClassificationsSolutionsFdBatchesV1ClassificationsPostResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessFnacBatchClassificationsSolutionsFdBatchesV1ClassificationsPostResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Fnac Batch Classifications - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task FnacBatchClassificationsSolutionsFdBatchesV1ClassificationsPostAsync( - global::System.Threading.CancellationToken cancellationToken = default) - { - PrepareArguments( - client: HttpClient); - PrepareFnacBatchClassificationsSolutionsFdBatchesV1ClassificationsPostArguments( - httpClient: HttpClient); - - - var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_FnacBatchClassificationsSolutionsFdBatchesV1ClassificationsPostSecurityRequirements, - operationName: "FnacBatchClassificationsSolutionsFdBatchesV1ClassificationsPostAsync"); - - var __pathBuilder = new global::AI21.PathBuilder( - path: "/solutions/fd/batches/v1/classifications", - 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); - } - } - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareFnacBatchClassificationsSolutionsFdBatchesV1ClassificationsPostRequest( - 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); - ProcessFnacBatchClassificationsSolutionsFdBatchesV1ClassificationsPostResponse( - 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); - ProcessFnacBatchClassificationsSolutionsFdBatchesV1ClassificationsPostResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return __content; - } - catch (global::System.Exception __ex) - { - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __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::AI21.ApiException( - message: __content ?? __response.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/AI21/Generated/AI21.Ai21Client.FnacBatchClassificationsStatusPrefixPreviewSolutionsPreviewFdBatchesV1ClassificationsBatchIdStatusPost.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.FnacBatchClassificationsStatusPrefixPreviewSolutionsPreviewFdBatchesV1ClassificationsBatchIdStatusPost.g.cs deleted file mode 100644 index 5c451fd6..00000000 --- a/src/libs/AI21/Generated/AI21.Ai21Client.FnacBatchClassificationsStatusPrefixPreviewSolutionsPreviewFdBatchesV1ClassificationsBatchIdStatusPost.g.cs +++ /dev/null @@ -1,232 +0,0 @@ - -#nullable enable - -namespace AI21 -{ - public partial class Ai21Client - { - - - private static readonly global::AI21.EndPointSecurityRequirement s_FnacBatchClassificationsStatusPrefixPreviewSolutionsPreviewFdBatchesV1ClassificationsBatchIdStatusPostSecurityRequirement0 = - new global::AI21.EndPointSecurityRequirement - { - Authorizations = new global::AI21.EndPointAuthorizationRequirement[] - { new global::AI21.EndPointAuthorizationRequirement - { - Type = "Http", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::AI21.EndPointSecurityRequirement[] s_FnacBatchClassificationsStatusPrefixPreviewSolutionsPreviewFdBatchesV1ClassificationsBatchIdStatusPostSecurityRequirements = - new global::AI21.EndPointSecurityRequirement[] - { s_FnacBatchClassificationsStatusPrefixPreviewSolutionsPreviewFdBatchesV1ClassificationsBatchIdStatusPostSecurityRequirement0, - }; - partial void PrepareFnacBatchClassificationsStatusPrefixPreviewSolutionsPreviewFdBatchesV1ClassificationsBatchIdStatusPostArguments( - global::System.Net.Http.HttpClient httpClient, - ref string batchId); - partial void PrepareFnacBatchClassificationsStatusPrefixPreviewSolutionsPreviewFdBatchesV1ClassificationsBatchIdStatusPostRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - string batchId); - partial void ProcessFnacBatchClassificationsStatusPrefixPreviewSolutionsPreviewFdBatchesV1ClassificationsBatchIdStatusPostResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessFnacBatchClassificationsStatusPrefixPreviewSolutionsPreviewFdBatchesV1ClassificationsBatchIdStatusPostResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Fnac Batch Classifications Status Prefix Preview - /// - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task FnacBatchClassificationsStatusPrefixPreviewSolutionsPreviewFdBatchesV1ClassificationsBatchIdStatusPostAsync( - string batchId, - global::System.Threading.CancellationToken cancellationToken = default) - { - PrepareArguments( - client: HttpClient); - PrepareFnacBatchClassificationsStatusPrefixPreviewSolutionsPreviewFdBatchesV1ClassificationsBatchIdStatusPostArguments( - httpClient: HttpClient, - batchId: ref batchId); - - - var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_FnacBatchClassificationsStatusPrefixPreviewSolutionsPreviewFdBatchesV1ClassificationsBatchIdStatusPostSecurityRequirements, - operationName: "FnacBatchClassificationsStatusPrefixPreviewSolutionsPreviewFdBatchesV1ClassificationsBatchIdStatusPostAsync"); - - var __pathBuilder = new global::AI21.PathBuilder( - path: $"/solutions-preview/fd/batches/v1/classifications/{batchId}/status", - 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); - } - } - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareFnacBatchClassificationsStatusPrefixPreviewSolutionsPreviewFdBatchesV1ClassificationsBatchIdStatusPostRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - batchId: batchId); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessFnacBatchClassificationsStatusPrefixPreviewSolutionsPreviewFdBatchesV1ClassificationsBatchIdStatusPostResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Validation Error - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::AI21.HTTPValidationError? __value_422 = null; - try - { - if (ReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - throw new global::AI21.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) - { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessFnacBatchClassificationsStatusPrefixPreviewSolutionsPreviewFdBatchesV1ClassificationsBatchIdStatusPostResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return __content; - } - catch (global::System.Exception __ex) - { - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __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::AI21.ApiException( - message: __content ?? __response.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/AI21/Generated/AI21.Ai21Client.FnacBatchClassificationsStatusSolutionsFdBatchesV1ClassificationsBatchIdStatusPost.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.FnacBatchClassificationsStatusSolutionsFdBatchesV1ClassificationsBatchIdStatusPost.g.cs deleted file mode 100644 index 35659cde..00000000 --- a/src/libs/AI21/Generated/AI21.Ai21Client.FnacBatchClassificationsStatusSolutionsFdBatchesV1ClassificationsBatchIdStatusPost.g.cs +++ /dev/null @@ -1,232 +0,0 @@ - -#nullable enable - -namespace AI21 -{ - public partial class Ai21Client - { - - - private static readonly global::AI21.EndPointSecurityRequirement s_FnacBatchClassificationsStatusSolutionsFdBatchesV1ClassificationsBatchIdStatusPostSecurityRequirement0 = - new global::AI21.EndPointSecurityRequirement - { - Authorizations = new global::AI21.EndPointAuthorizationRequirement[] - { new global::AI21.EndPointAuthorizationRequirement - { - Type = "Http", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::AI21.EndPointSecurityRequirement[] s_FnacBatchClassificationsStatusSolutionsFdBatchesV1ClassificationsBatchIdStatusPostSecurityRequirements = - new global::AI21.EndPointSecurityRequirement[] - { s_FnacBatchClassificationsStatusSolutionsFdBatchesV1ClassificationsBatchIdStatusPostSecurityRequirement0, - }; - partial void PrepareFnacBatchClassificationsStatusSolutionsFdBatchesV1ClassificationsBatchIdStatusPostArguments( - global::System.Net.Http.HttpClient httpClient, - ref string batchId); - partial void PrepareFnacBatchClassificationsStatusSolutionsFdBatchesV1ClassificationsBatchIdStatusPostRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - string batchId); - partial void ProcessFnacBatchClassificationsStatusSolutionsFdBatchesV1ClassificationsBatchIdStatusPostResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessFnacBatchClassificationsStatusSolutionsFdBatchesV1ClassificationsBatchIdStatusPostResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Fnac Batch Classifications Status - /// - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task FnacBatchClassificationsStatusSolutionsFdBatchesV1ClassificationsBatchIdStatusPostAsync( - string batchId, - global::System.Threading.CancellationToken cancellationToken = default) - { - PrepareArguments( - client: HttpClient); - PrepareFnacBatchClassificationsStatusSolutionsFdBatchesV1ClassificationsBatchIdStatusPostArguments( - httpClient: HttpClient, - batchId: ref batchId); - - - var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_FnacBatchClassificationsStatusSolutionsFdBatchesV1ClassificationsBatchIdStatusPostSecurityRequirements, - operationName: "FnacBatchClassificationsStatusSolutionsFdBatchesV1ClassificationsBatchIdStatusPostAsync"); - - var __pathBuilder = new global::AI21.PathBuilder( - path: $"/solutions/fd/batches/v1/classifications/{batchId}/status", - 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); - } - } - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareFnacBatchClassificationsStatusSolutionsFdBatchesV1ClassificationsBatchIdStatusPostRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - batchId: batchId); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessFnacBatchClassificationsStatusSolutionsFdBatchesV1ClassificationsBatchIdStatusPostResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Validation Error - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::AI21.HTTPValidationError? __value_422 = null; - try - { - if (ReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - throw new global::AI21.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) - { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessFnacBatchClassificationsStatusSolutionsFdBatchesV1ClassificationsBatchIdStatusPostResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return __content; - } - catch (global::System.Exception __ex) - { - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __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::AI21.ApiException( - message: __content ?? __response.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/AI21/Generated/AI21.Ai21Client.FnacBatchDescriptionsPrefixPreviewSolutionsPreviewFdBatchesV1DescriptionsPost.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.FnacBatchDescriptionsPrefixPreviewSolutionsPreviewFdBatchesV1DescriptionsPost.g.cs deleted file mode 100644 index 9e577387..00000000 --- a/src/libs/AI21/Generated/AI21.Ai21Client.FnacBatchDescriptionsPrefixPreviewSolutionsPreviewFdBatchesV1DescriptionsPost.g.cs +++ /dev/null @@ -1,188 +0,0 @@ - -#nullable enable - -namespace AI21 -{ - public partial class Ai21Client - { - - - private static readonly global::AI21.EndPointSecurityRequirement s_FnacBatchDescriptionsPrefixPreviewSolutionsPreviewFdBatchesV1DescriptionsPostSecurityRequirement0 = - new global::AI21.EndPointSecurityRequirement - { - Authorizations = new global::AI21.EndPointAuthorizationRequirement[] - { new global::AI21.EndPointAuthorizationRequirement - { - Type = "Http", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::AI21.EndPointSecurityRequirement[] s_FnacBatchDescriptionsPrefixPreviewSolutionsPreviewFdBatchesV1DescriptionsPostSecurityRequirements = - new global::AI21.EndPointSecurityRequirement[] - { s_FnacBatchDescriptionsPrefixPreviewSolutionsPreviewFdBatchesV1DescriptionsPostSecurityRequirement0, - }; - partial void PrepareFnacBatchDescriptionsPrefixPreviewSolutionsPreviewFdBatchesV1DescriptionsPostArguments( - global::System.Net.Http.HttpClient httpClient); - partial void PrepareFnacBatchDescriptionsPrefixPreviewSolutionsPreviewFdBatchesV1DescriptionsPostRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage); - partial void ProcessFnacBatchDescriptionsPrefixPreviewSolutionsPreviewFdBatchesV1DescriptionsPostResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessFnacBatchDescriptionsPrefixPreviewSolutionsPreviewFdBatchesV1DescriptionsPostResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Fnac Batch Descriptions Prefix Preview - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task FnacBatchDescriptionsPrefixPreviewSolutionsPreviewFdBatchesV1DescriptionsPostAsync( - global::System.Threading.CancellationToken cancellationToken = default) - { - PrepareArguments( - client: HttpClient); - PrepareFnacBatchDescriptionsPrefixPreviewSolutionsPreviewFdBatchesV1DescriptionsPostArguments( - httpClient: HttpClient); - - - var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_FnacBatchDescriptionsPrefixPreviewSolutionsPreviewFdBatchesV1DescriptionsPostSecurityRequirements, - operationName: "FnacBatchDescriptionsPrefixPreviewSolutionsPreviewFdBatchesV1DescriptionsPostAsync"); - - var __pathBuilder = new global::AI21.PathBuilder( - path: "/solutions-preview/fd/batches/v1/descriptions", - 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); - } - } - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareFnacBatchDescriptionsPrefixPreviewSolutionsPreviewFdBatchesV1DescriptionsPostRequest( - 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); - ProcessFnacBatchDescriptionsPrefixPreviewSolutionsPreviewFdBatchesV1DescriptionsPostResponse( - 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); - ProcessFnacBatchDescriptionsPrefixPreviewSolutionsPreviewFdBatchesV1DescriptionsPostResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return __content; - } - catch (global::System.Exception __ex) - { - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __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::AI21.ApiException( - message: __content ?? __response.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/AI21/Generated/AI21.Ai21Client.FnacBatchDescriptionsResultsPrefixPreviewSolutionsPreviewFdBatchesV1DescriptionsBatchIdResultsPost.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.FnacBatchDescriptionsResultsPrefixPreviewSolutionsPreviewFdBatchesV1DescriptionsBatchIdResultsPost.g.cs deleted file mode 100644 index 6d8bcb7f..00000000 --- a/src/libs/AI21/Generated/AI21.Ai21Client.FnacBatchDescriptionsResultsPrefixPreviewSolutionsPreviewFdBatchesV1DescriptionsBatchIdResultsPost.g.cs +++ /dev/null @@ -1,232 +0,0 @@ - -#nullable enable - -namespace AI21 -{ - public partial class Ai21Client - { - - - private static readonly global::AI21.EndPointSecurityRequirement s_FnacBatchDescriptionsResultsPrefixPreviewSolutionsPreviewFdBatchesV1DescriptionsBatchIdResultsPostSecurityRequirement0 = - new global::AI21.EndPointSecurityRequirement - { - Authorizations = new global::AI21.EndPointAuthorizationRequirement[] - { new global::AI21.EndPointAuthorizationRequirement - { - Type = "Http", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::AI21.EndPointSecurityRequirement[] s_FnacBatchDescriptionsResultsPrefixPreviewSolutionsPreviewFdBatchesV1DescriptionsBatchIdResultsPostSecurityRequirements = - new global::AI21.EndPointSecurityRequirement[] - { s_FnacBatchDescriptionsResultsPrefixPreviewSolutionsPreviewFdBatchesV1DescriptionsBatchIdResultsPostSecurityRequirement0, - }; - partial void PrepareFnacBatchDescriptionsResultsPrefixPreviewSolutionsPreviewFdBatchesV1DescriptionsBatchIdResultsPostArguments( - global::System.Net.Http.HttpClient httpClient, - ref string batchId); - partial void PrepareFnacBatchDescriptionsResultsPrefixPreviewSolutionsPreviewFdBatchesV1DescriptionsBatchIdResultsPostRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - string batchId); - partial void ProcessFnacBatchDescriptionsResultsPrefixPreviewSolutionsPreviewFdBatchesV1DescriptionsBatchIdResultsPostResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessFnacBatchDescriptionsResultsPrefixPreviewSolutionsPreviewFdBatchesV1DescriptionsBatchIdResultsPostResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Fnac Batch Descriptions Results Prefix Preview - /// - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task FnacBatchDescriptionsResultsPrefixPreviewSolutionsPreviewFdBatchesV1DescriptionsBatchIdResultsPostAsync( - string batchId, - global::System.Threading.CancellationToken cancellationToken = default) - { - PrepareArguments( - client: HttpClient); - PrepareFnacBatchDescriptionsResultsPrefixPreviewSolutionsPreviewFdBatchesV1DescriptionsBatchIdResultsPostArguments( - httpClient: HttpClient, - batchId: ref batchId); - - - var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_FnacBatchDescriptionsResultsPrefixPreviewSolutionsPreviewFdBatchesV1DescriptionsBatchIdResultsPostSecurityRequirements, - operationName: "FnacBatchDescriptionsResultsPrefixPreviewSolutionsPreviewFdBatchesV1DescriptionsBatchIdResultsPostAsync"); - - var __pathBuilder = new global::AI21.PathBuilder( - path: $"/solutions-preview/fd/batches/v1/descriptions/{batchId}/results", - 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); - } - } - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareFnacBatchDescriptionsResultsPrefixPreviewSolutionsPreviewFdBatchesV1DescriptionsBatchIdResultsPostRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - batchId: batchId); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessFnacBatchDescriptionsResultsPrefixPreviewSolutionsPreviewFdBatchesV1DescriptionsBatchIdResultsPostResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Validation Error - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::AI21.HTTPValidationError? __value_422 = null; - try - { - if (ReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - throw new global::AI21.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) - { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessFnacBatchDescriptionsResultsPrefixPreviewSolutionsPreviewFdBatchesV1DescriptionsBatchIdResultsPostResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return __content; - } - catch (global::System.Exception __ex) - { - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __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::AI21.ApiException( - message: __content ?? __response.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/AI21/Generated/AI21.Ai21Client.FnacBatchDescriptionsResultsSolutionsFdBatchesV1DescriptionsBatchIdResultsPost.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.FnacBatchDescriptionsResultsSolutionsFdBatchesV1DescriptionsBatchIdResultsPost.g.cs deleted file mode 100644 index 19aad154..00000000 --- a/src/libs/AI21/Generated/AI21.Ai21Client.FnacBatchDescriptionsResultsSolutionsFdBatchesV1DescriptionsBatchIdResultsPost.g.cs +++ /dev/null @@ -1,232 +0,0 @@ - -#nullable enable - -namespace AI21 -{ - public partial class Ai21Client - { - - - private static readonly global::AI21.EndPointSecurityRequirement s_FnacBatchDescriptionsResultsSolutionsFdBatchesV1DescriptionsBatchIdResultsPostSecurityRequirement0 = - new global::AI21.EndPointSecurityRequirement - { - Authorizations = new global::AI21.EndPointAuthorizationRequirement[] - { new global::AI21.EndPointAuthorizationRequirement - { - Type = "Http", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::AI21.EndPointSecurityRequirement[] s_FnacBatchDescriptionsResultsSolutionsFdBatchesV1DescriptionsBatchIdResultsPostSecurityRequirements = - new global::AI21.EndPointSecurityRequirement[] - { s_FnacBatchDescriptionsResultsSolutionsFdBatchesV1DescriptionsBatchIdResultsPostSecurityRequirement0, - }; - partial void PrepareFnacBatchDescriptionsResultsSolutionsFdBatchesV1DescriptionsBatchIdResultsPostArguments( - global::System.Net.Http.HttpClient httpClient, - ref string batchId); - partial void PrepareFnacBatchDescriptionsResultsSolutionsFdBatchesV1DescriptionsBatchIdResultsPostRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - string batchId); - partial void ProcessFnacBatchDescriptionsResultsSolutionsFdBatchesV1DescriptionsBatchIdResultsPostResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessFnacBatchDescriptionsResultsSolutionsFdBatchesV1DescriptionsBatchIdResultsPostResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Fnac Batch Descriptions Results - /// - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task FnacBatchDescriptionsResultsSolutionsFdBatchesV1DescriptionsBatchIdResultsPostAsync( - string batchId, - global::System.Threading.CancellationToken cancellationToken = default) - { - PrepareArguments( - client: HttpClient); - PrepareFnacBatchDescriptionsResultsSolutionsFdBatchesV1DescriptionsBatchIdResultsPostArguments( - httpClient: HttpClient, - batchId: ref batchId); - - - var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_FnacBatchDescriptionsResultsSolutionsFdBatchesV1DescriptionsBatchIdResultsPostSecurityRequirements, - operationName: "FnacBatchDescriptionsResultsSolutionsFdBatchesV1DescriptionsBatchIdResultsPostAsync"); - - var __pathBuilder = new global::AI21.PathBuilder( - path: $"/solutions/fd/batches/v1/descriptions/{batchId}/results", - 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); - } - } - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareFnacBatchDescriptionsResultsSolutionsFdBatchesV1DescriptionsBatchIdResultsPostRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - batchId: batchId); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessFnacBatchDescriptionsResultsSolutionsFdBatchesV1DescriptionsBatchIdResultsPostResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Validation Error - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::AI21.HTTPValidationError? __value_422 = null; - try - { - if (ReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - throw new global::AI21.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) - { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessFnacBatchDescriptionsResultsSolutionsFdBatchesV1DescriptionsBatchIdResultsPostResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return __content; - } - catch (global::System.Exception __ex) - { - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __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::AI21.ApiException( - message: __content ?? __response.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/AI21/Generated/AI21.Ai21Client.FnacBatchDescriptionsSolutionsFdBatchesV1DescriptionsPost.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.FnacBatchDescriptionsSolutionsFdBatchesV1DescriptionsPost.g.cs deleted file mode 100644 index d1f94499..00000000 --- a/src/libs/AI21/Generated/AI21.Ai21Client.FnacBatchDescriptionsSolutionsFdBatchesV1DescriptionsPost.g.cs +++ /dev/null @@ -1,188 +0,0 @@ - -#nullable enable - -namespace AI21 -{ - public partial class Ai21Client - { - - - private static readonly global::AI21.EndPointSecurityRequirement s_FnacBatchDescriptionsSolutionsFdBatchesV1DescriptionsPostSecurityRequirement0 = - new global::AI21.EndPointSecurityRequirement - { - Authorizations = new global::AI21.EndPointAuthorizationRequirement[] - { new global::AI21.EndPointAuthorizationRequirement - { - Type = "Http", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::AI21.EndPointSecurityRequirement[] s_FnacBatchDescriptionsSolutionsFdBatchesV1DescriptionsPostSecurityRequirements = - new global::AI21.EndPointSecurityRequirement[] - { s_FnacBatchDescriptionsSolutionsFdBatchesV1DescriptionsPostSecurityRequirement0, - }; - partial void PrepareFnacBatchDescriptionsSolutionsFdBatchesV1DescriptionsPostArguments( - global::System.Net.Http.HttpClient httpClient); - partial void PrepareFnacBatchDescriptionsSolutionsFdBatchesV1DescriptionsPostRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage); - partial void ProcessFnacBatchDescriptionsSolutionsFdBatchesV1DescriptionsPostResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessFnacBatchDescriptionsSolutionsFdBatchesV1DescriptionsPostResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Fnac Batch Descriptions - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task FnacBatchDescriptionsSolutionsFdBatchesV1DescriptionsPostAsync( - global::System.Threading.CancellationToken cancellationToken = default) - { - PrepareArguments( - client: HttpClient); - PrepareFnacBatchDescriptionsSolutionsFdBatchesV1DescriptionsPostArguments( - httpClient: HttpClient); - - - var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_FnacBatchDescriptionsSolutionsFdBatchesV1DescriptionsPostSecurityRequirements, - operationName: "FnacBatchDescriptionsSolutionsFdBatchesV1DescriptionsPostAsync"); - - var __pathBuilder = new global::AI21.PathBuilder( - path: "/solutions/fd/batches/v1/descriptions", - 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); - } - } - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareFnacBatchDescriptionsSolutionsFdBatchesV1DescriptionsPostRequest( - 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); - ProcessFnacBatchDescriptionsSolutionsFdBatchesV1DescriptionsPostResponse( - 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); - ProcessFnacBatchDescriptionsSolutionsFdBatchesV1DescriptionsPostResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return __content; - } - catch (global::System.Exception __ex) - { - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __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::AI21.ApiException( - message: __content ?? __response.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/AI21/Generated/AI21.Ai21Client.FnacBatchDescriptionsStatusPrefixPreviewSolutionsPreviewFdBatchesV1DescriptionsBatchIdStatusPost.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.FnacBatchDescriptionsStatusPrefixPreviewSolutionsPreviewFdBatchesV1DescriptionsBatchIdStatusPost.g.cs deleted file mode 100644 index 8d38e6c8..00000000 --- a/src/libs/AI21/Generated/AI21.Ai21Client.FnacBatchDescriptionsStatusPrefixPreviewSolutionsPreviewFdBatchesV1DescriptionsBatchIdStatusPost.g.cs +++ /dev/null @@ -1,232 +0,0 @@ - -#nullable enable - -namespace AI21 -{ - public partial class Ai21Client - { - - - private static readonly global::AI21.EndPointSecurityRequirement s_FnacBatchDescriptionsStatusPrefixPreviewSolutionsPreviewFdBatchesV1DescriptionsBatchIdStatusPostSecurityRequirement0 = - new global::AI21.EndPointSecurityRequirement - { - Authorizations = new global::AI21.EndPointAuthorizationRequirement[] - { new global::AI21.EndPointAuthorizationRequirement - { - Type = "Http", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::AI21.EndPointSecurityRequirement[] s_FnacBatchDescriptionsStatusPrefixPreviewSolutionsPreviewFdBatchesV1DescriptionsBatchIdStatusPostSecurityRequirements = - new global::AI21.EndPointSecurityRequirement[] - { s_FnacBatchDescriptionsStatusPrefixPreviewSolutionsPreviewFdBatchesV1DescriptionsBatchIdStatusPostSecurityRequirement0, - }; - partial void PrepareFnacBatchDescriptionsStatusPrefixPreviewSolutionsPreviewFdBatchesV1DescriptionsBatchIdStatusPostArguments( - global::System.Net.Http.HttpClient httpClient, - ref string batchId); - partial void PrepareFnacBatchDescriptionsStatusPrefixPreviewSolutionsPreviewFdBatchesV1DescriptionsBatchIdStatusPostRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - string batchId); - partial void ProcessFnacBatchDescriptionsStatusPrefixPreviewSolutionsPreviewFdBatchesV1DescriptionsBatchIdStatusPostResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessFnacBatchDescriptionsStatusPrefixPreviewSolutionsPreviewFdBatchesV1DescriptionsBatchIdStatusPostResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Fnac Batch Descriptions Status Prefix Preview - /// - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task FnacBatchDescriptionsStatusPrefixPreviewSolutionsPreviewFdBatchesV1DescriptionsBatchIdStatusPostAsync( - string batchId, - global::System.Threading.CancellationToken cancellationToken = default) - { - PrepareArguments( - client: HttpClient); - PrepareFnacBatchDescriptionsStatusPrefixPreviewSolutionsPreviewFdBatchesV1DescriptionsBatchIdStatusPostArguments( - httpClient: HttpClient, - batchId: ref batchId); - - - var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_FnacBatchDescriptionsStatusPrefixPreviewSolutionsPreviewFdBatchesV1DescriptionsBatchIdStatusPostSecurityRequirements, - operationName: "FnacBatchDescriptionsStatusPrefixPreviewSolutionsPreviewFdBatchesV1DescriptionsBatchIdStatusPostAsync"); - - var __pathBuilder = new global::AI21.PathBuilder( - path: $"/solutions-preview/fd/batches/v1/descriptions/{batchId}/status", - 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); - } - } - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareFnacBatchDescriptionsStatusPrefixPreviewSolutionsPreviewFdBatchesV1DescriptionsBatchIdStatusPostRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - batchId: batchId); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessFnacBatchDescriptionsStatusPrefixPreviewSolutionsPreviewFdBatchesV1DescriptionsBatchIdStatusPostResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Validation Error - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::AI21.HTTPValidationError? __value_422 = null; - try - { - if (ReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - throw new global::AI21.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) - { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessFnacBatchDescriptionsStatusPrefixPreviewSolutionsPreviewFdBatchesV1DescriptionsBatchIdStatusPostResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return __content; - } - catch (global::System.Exception __ex) - { - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __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::AI21.ApiException( - message: __content ?? __response.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/AI21/Generated/AI21.Ai21Client.FnacBatchDescriptionsStatusSolutionsFdBatchesV1DescriptionsBatchIdStatusPost.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.FnacBatchDescriptionsStatusSolutionsFdBatchesV1DescriptionsBatchIdStatusPost.g.cs deleted file mode 100644 index 46eefd5f..00000000 --- a/src/libs/AI21/Generated/AI21.Ai21Client.FnacBatchDescriptionsStatusSolutionsFdBatchesV1DescriptionsBatchIdStatusPost.g.cs +++ /dev/null @@ -1,232 +0,0 @@ - -#nullable enable - -namespace AI21 -{ - public partial class Ai21Client - { - - - private static readonly global::AI21.EndPointSecurityRequirement s_FnacBatchDescriptionsStatusSolutionsFdBatchesV1DescriptionsBatchIdStatusPostSecurityRequirement0 = - new global::AI21.EndPointSecurityRequirement - { - Authorizations = new global::AI21.EndPointAuthorizationRequirement[] - { new global::AI21.EndPointAuthorizationRequirement - { - Type = "Http", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::AI21.EndPointSecurityRequirement[] s_FnacBatchDescriptionsStatusSolutionsFdBatchesV1DescriptionsBatchIdStatusPostSecurityRequirements = - new global::AI21.EndPointSecurityRequirement[] - { s_FnacBatchDescriptionsStatusSolutionsFdBatchesV1DescriptionsBatchIdStatusPostSecurityRequirement0, - }; - partial void PrepareFnacBatchDescriptionsStatusSolutionsFdBatchesV1DescriptionsBatchIdStatusPostArguments( - global::System.Net.Http.HttpClient httpClient, - ref string batchId); - partial void PrepareFnacBatchDescriptionsStatusSolutionsFdBatchesV1DescriptionsBatchIdStatusPostRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - string batchId); - partial void ProcessFnacBatchDescriptionsStatusSolutionsFdBatchesV1DescriptionsBatchIdStatusPostResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessFnacBatchDescriptionsStatusSolutionsFdBatchesV1DescriptionsBatchIdStatusPostResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Fnac Batch Descriptions Status - /// - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task FnacBatchDescriptionsStatusSolutionsFdBatchesV1DescriptionsBatchIdStatusPostAsync( - string batchId, - global::System.Threading.CancellationToken cancellationToken = default) - { - PrepareArguments( - client: HttpClient); - PrepareFnacBatchDescriptionsStatusSolutionsFdBatchesV1DescriptionsBatchIdStatusPostArguments( - httpClient: HttpClient, - batchId: ref batchId); - - - var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_FnacBatchDescriptionsStatusSolutionsFdBatchesV1DescriptionsBatchIdStatusPostSecurityRequirements, - operationName: "FnacBatchDescriptionsStatusSolutionsFdBatchesV1DescriptionsBatchIdStatusPostAsync"); - - var __pathBuilder = new global::AI21.PathBuilder( - path: $"/solutions/fd/batches/v1/descriptions/{batchId}/status", - 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); - } - } - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareFnacBatchDescriptionsStatusSolutionsFdBatchesV1DescriptionsBatchIdStatusPostRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - batchId: batchId); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessFnacBatchDescriptionsStatusSolutionsFdBatchesV1DescriptionsBatchIdStatusPostResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Validation Error - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::AI21.HTTPValidationError? __value_422 = null; - try - { - if (ReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - throw new global::AI21.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) - { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessFnacBatchDescriptionsStatusSolutionsFdBatchesV1DescriptionsBatchIdStatusPostResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return __content; - } - catch (global::System.Exception __ex) - { - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __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::AI21.ApiException( - message: __content ?? __response.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/AI21/Generated/AI21.Ai21Client.FnacV1ClassificationsPrefixPreviewSolutionsPreviewFnacV1ClassificationsPost.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.FnacV1ClassificationsPrefixPreviewSolutionsPreviewFnacV1ClassificationsPost.g.cs deleted file mode 100644 index a7de48cb..00000000 --- a/src/libs/AI21/Generated/AI21.Ai21Client.FnacV1ClassificationsPrefixPreviewSolutionsPreviewFnacV1ClassificationsPost.g.cs +++ /dev/null @@ -1,188 +0,0 @@ - -#nullable enable - -namespace AI21 -{ - public partial class Ai21Client - { - - - private static readonly global::AI21.EndPointSecurityRequirement s_FnacV1ClassificationsPrefixPreviewSolutionsPreviewFnacV1ClassificationsPostSecurityRequirement0 = - new global::AI21.EndPointSecurityRequirement - { - Authorizations = new global::AI21.EndPointAuthorizationRequirement[] - { new global::AI21.EndPointAuthorizationRequirement - { - Type = "Http", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::AI21.EndPointSecurityRequirement[] s_FnacV1ClassificationsPrefixPreviewSolutionsPreviewFnacV1ClassificationsPostSecurityRequirements = - new global::AI21.EndPointSecurityRequirement[] - { s_FnacV1ClassificationsPrefixPreviewSolutionsPreviewFnacV1ClassificationsPostSecurityRequirement0, - }; - partial void PrepareFnacV1ClassificationsPrefixPreviewSolutionsPreviewFnacV1ClassificationsPostArguments( - global::System.Net.Http.HttpClient httpClient); - partial void PrepareFnacV1ClassificationsPrefixPreviewSolutionsPreviewFnacV1ClassificationsPostRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage); - partial void ProcessFnacV1ClassificationsPrefixPreviewSolutionsPreviewFnacV1ClassificationsPostResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessFnacV1ClassificationsPrefixPreviewSolutionsPreviewFnacV1ClassificationsPostResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Fnac V1 Classifications Prefix Preview - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task FnacV1ClassificationsPrefixPreviewSolutionsPreviewFnacV1ClassificationsPostAsync( - global::System.Threading.CancellationToken cancellationToken = default) - { - PrepareArguments( - client: HttpClient); - PrepareFnacV1ClassificationsPrefixPreviewSolutionsPreviewFnacV1ClassificationsPostArguments( - httpClient: HttpClient); - - - var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_FnacV1ClassificationsPrefixPreviewSolutionsPreviewFnacV1ClassificationsPostSecurityRequirements, - operationName: "FnacV1ClassificationsPrefixPreviewSolutionsPreviewFnacV1ClassificationsPostAsync"); - - var __pathBuilder = new global::AI21.PathBuilder( - path: "/solutions-preview/fnac/v1/classifications", - 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); - } - } - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareFnacV1ClassificationsPrefixPreviewSolutionsPreviewFnacV1ClassificationsPostRequest( - 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); - ProcessFnacV1ClassificationsPrefixPreviewSolutionsPreviewFnacV1ClassificationsPostResponse( - 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); - ProcessFnacV1ClassificationsPrefixPreviewSolutionsPreviewFnacV1ClassificationsPostResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return __content; - } - catch (global::System.Exception __ex) - { - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __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::AI21.ApiException( - message: __content ?? __response.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/AI21/Generated/AI21.Ai21Client.FnacV1ClassificationsSolutionsFnacV1ClassificationsPost.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.FnacV1ClassificationsSolutionsFnacV1ClassificationsPost.g.cs deleted file mode 100644 index 8e937113..00000000 --- a/src/libs/AI21/Generated/AI21.Ai21Client.FnacV1ClassificationsSolutionsFnacV1ClassificationsPost.g.cs +++ /dev/null @@ -1,188 +0,0 @@ - -#nullable enable - -namespace AI21 -{ - public partial class Ai21Client - { - - - private static readonly global::AI21.EndPointSecurityRequirement s_FnacV1ClassificationsSolutionsFnacV1ClassificationsPostSecurityRequirement0 = - new global::AI21.EndPointSecurityRequirement - { - Authorizations = new global::AI21.EndPointAuthorizationRequirement[] - { new global::AI21.EndPointAuthorizationRequirement - { - Type = "Http", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::AI21.EndPointSecurityRequirement[] s_FnacV1ClassificationsSolutionsFnacV1ClassificationsPostSecurityRequirements = - new global::AI21.EndPointSecurityRequirement[] - { s_FnacV1ClassificationsSolutionsFnacV1ClassificationsPostSecurityRequirement0, - }; - partial void PrepareFnacV1ClassificationsSolutionsFnacV1ClassificationsPostArguments( - global::System.Net.Http.HttpClient httpClient); - partial void PrepareFnacV1ClassificationsSolutionsFnacV1ClassificationsPostRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage); - partial void ProcessFnacV1ClassificationsSolutionsFnacV1ClassificationsPostResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessFnacV1ClassificationsSolutionsFnacV1ClassificationsPostResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Fnac V1 Classifications - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task FnacV1ClassificationsSolutionsFnacV1ClassificationsPostAsync( - global::System.Threading.CancellationToken cancellationToken = default) - { - PrepareArguments( - client: HttpClient); - PrepareFnacV1ClassificationsSolutionsFnacV1ClassificationsPostArguments( - httpClient: HttpClient); - - - var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_FnacV1ClassificationsSolutionsFnacV1ClassificationsPostSecurityRequirements, - operationName: "FnacV1ClassificationsSolutionsFnacV1ClassificationsPostAsync"); - - var __pathBuilder = new global::AI21.PathBuilder( - path: "/solutions/fnac/v1/classifications", - 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); - } - } - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareFnacV1ClassificationsSolutionsFnacV1ClassificationsPostRequest( - 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); - ProcessFnacV1ClassificationsSolutionsFnacV1ClassificationsPostResponse( - 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); - ProcessFnacV1ClassificationsSolutionsFnacV1ClassificationsPostResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return __content; - } - catch (global::System.Exception __ex) - { - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __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::AI21.ApiException( - message: __content ?? __response.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/AI21/Generated/AI21.Ai21Client.FnacV1DeprecatedClassificationsPrefixPreviewSolutionsPreviewFnacV1DeprecatedClassificationsPost.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.FnacV1DeprecatedClassificationsPrefixPreviewSolutionsPreviewFnacV1DeprecatedClassificationsPost.g.cs deleted file mode 100644 index bd7aa3cd..00000000 --- a/src/libs/AI21/Generated/AI21.Ai21Client.FnacV1DeprecatedClassificationsPrefixPreviewSolutionsPreviewFnacV1DeprecatedClassificationsPost.g.cs +++ /dev/null @@ -1,188 +0,0 @@ - -#nullable enable - -namespace AI21 -{ - public partial class Ai21Client - { - - - private static readonly global::AI21.EndPointSecurityRequirement s_FnacV1DeprecatedClassificationsPrefixPreviewSolutionsPreviewFnacV1DeprecatedClassificationsPostSecurityRequirement0 = - new global::AI21.EndPointSecurityRequirement - { - Authorizations = new global::AI21.EndPointAuthorizationRequirement[] - { new global::AI21.EndPointAuthorizationRequirement - { - Type = "Http", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::AI21.EndPointSecurityRequirement[] s_FnacV1DeprecatedClassificationsPrefixPreviewSolutionsPreviewFnacV1DeprecatedClassificationsPostSecurityRequirements = - new global::AI21.EndPointSecurityRequirement[] - { s_FnacV1DeprecatedClassificationsPrefixPreviewSolutionsPreviewFnacV1DeprecatedClassificationsPostSecurityRequirement0, - }; - partial void PrepareFnacV1DeprecatedClassificationsPrefixPreviewSolutionsPreviewFnacV1DeprecatedClassificationsPostArguments( - global::System.Net.Http.HttpClient httpClient); - partial void PrepareFnacV1DeprecatedClassificationsPrefixPreviewSolutionsPreviewFnacV1DeprecatedClassificationsPostRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage); - partial void ProcessFnacV1DeprecatedClassificationsPrefixPreviewSolutionsPreviewFnacV1DeprecatedClassificationsPostResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessFnacV1DeprecatedClassificationsPrefixPreviewSolutionsPreviewFnacV1DeprecatedClassificationsPostResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Fnac V1 Deprecated Classifications Prefix Preview - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task FnacV1DeprecatedClassificationsPrefixPreviewSolutionsPreviewFnacV1DeprecatedClassificationsPostAsync( - global::System.Threading.CancellationToken cancellationToken = default) - { - PrepareArguments( - client: HttpClient); - PrepareFnacV1DeprecatedClassificationsPrefixPreviewSolutionsPreviewFnacV1DeprecatedClassificationsPostArguments( - httpClient: HttpClient); - - - var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_FnacV1DeprecatedClassificationsPrefixPreviewSolutionsPreviewFnacV1DeprecatedClassificationsPostSecurityRequirements, - operationName: "FnacV1DeprecatedClassificationsPrefixPreviewSolutionsPreviewFnacV1DeprecatedClassificationsPostAsync"); - - var __pathBuilder = new global::AI21.PathBuilder( - path: "/solutions-preview/fnac/v1-deprecated/classifications", - 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); - } - } - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareFnacV1DeprecatedClassificationsPrefixPreviewSolutionsPreviewFnacV1DeprecatedClassificationsPostRequest( - 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); - ProcessFnacV1DeprecatedClassificationsPrefixPreviewSolutionsPreviewFnacV1DeprecatedClassificationsPostResponse( - 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); - ProcessFnacV1DeprecatedClassificationsPrefixPreviewSolutionsPreviewFnacV1DeprecatedClassificationsPostResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return __content; - } - catch (global::System.Exception __ex) - { - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __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::AI21.ApiException( - message: __content ?? __response.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/AI21/Generated/AI21.Ai21Client.FnacV1DeprecatedClassificationsSolutionsFnacV1DeprecatedClassificationsPost.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.FnacV1DeprecatedClassificationsSolutionsFnacV1DeprecatedClassificationsPost.g.cs deleted file mode 100644 index 958e51ac..00000000 --- a/src/libs/AI21/Generated/AI21.Ai21Client.FnacV1DeprecatedClassificationsSolutionsFnacV1DeprecatedClassificationsPost.g.cs +++ /dev/null @@ -1,188 +0,0 @@ - -#nullable enable - -namespace AI21 -{ - public partial class Ai21Client - { - - - private static readonly global::AI21.EndPointSecurityRequirement s_FnacV1DeprecatedClassificationsSolutionsFnacV1DeprecatedClassificationsPostSecurityRequirement0 = - new global::AI21.EndPointSecurityRequirement - { - Authorizations = new global::AI21.EndPointAuthorizationRequirement[] - { new global::AI21.EndPointAuthorizationRequirement - { - Type = "Http", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::AI21.EndPointSecurityRequirement[] s_FnacV1DeprecatedClassificationsSolutionsFnacV1DeprecatedClassificationsPostSecurityRequirements = - new global::AI21.EndPointSecurityRequirement[] - { s_FnacV1DeprecatedClassificationsSolutionsFnacV1DeprecatedClassificationsPostSecurityRequirement0, - }; - partial void PrepareFnacV1DeprecatedClassificationsSolutionsFnacV1DeprecatedClassificationsPostArguments( - global::System.Net.Http.HttpClient httpClient); - partial void PrepareFnacV1DeprecatedClassificationsSolutionsFnacV1DeprecatedClassificationsPostRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage); - partial void ProcessFnacV1DeprecatedClassificationsSolutionsFnacV1DeprecatedClassificationsPostResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessFnacV1DeprecatedClassificationsSolutionsFnacV1DeprecatedClassificationsPostResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Fnac V1 Deprecated Classifications - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task FnacV1DeprecatedClassificationsSolutionsFnacV1DeprecatedClassificationsPostAsync( - global::System.Threading.CancellationToken cancellationToken = default) - { - PrepareArguments( - client: HttpClient); - PrepareFnacV1DeprecatedClassificationsSolutionsFnacV1DeprecatedClassificationsPostArguments( - httpClient: HttpClient); - - - var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_FnacV1DeprecatedClassificationsSolutionsFnacV1DeprecatedClassificationsPostSecurityRequirements, - operationName: "FnacV1DeprecatedClassificationsSolutionsFnacV1DeprecatedClassificationsPostAsync"); - - var __pathBuilder = new global::AI21.PathBuilder( - path: "/solutions/fnac/v1-deprecated/classifications", - 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); - } - } - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareFnacV1DeprecatedClassificationsSolutionsFnacV1DeprecatedClassificationsPostRequest( - 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); - ProcessFnacV1DeprecatedClassificationsSolutionsFnacV1DeprecatedClassificationsPostResponse( - 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); - ProcessFnacV1DeprecatedClassificationsSolutionsFnacV1DeprecatedClassificationsPostResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return __content; - } - catch (global::System.Exception __ex) - { - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __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::AI21.ApiException( - message: __content ?? __response.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/AI21/Generated/AI21.Ai21Client.FnacV1DeprecatedDescriptionsPrefixPreviewSolutionsPreviewFnacV1DeprecatedDescriptionsPost.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.FnacV1DeprecatedDescriptionsPrefixPreviewSolutionsPreviewFnacV1DeprecatedDescriptionsPost.g.cs deleted file mode 100644 index 0a7b86d8..00000000 --- a/src/libs/AI21/Generated/AI21.Ai21Client.FnacV1DeprecatedDescriptionsPrefixPreviewSolutionsPreviewFnacV1DeprecatedDescriptionsPost.g.cs +++ /dev/null @@ -1,188 +0,0 @@ - -#nullable enable - -namespace AI21 -{ - public partial class Ai21Client - { - - - private static readonly global::AI21.EndPointSecurityRequirement s_FnacV1DeprecatedDescriptionsPrefixPreviewSolutionsPreviewFnacV1DeprecatedDescriptionsPostSecurityRequirement0 = - new global::AI21.EndPointSecurityRequirement - { - Authorizations = new global::AI21.EndPointAuthorizationRequirement[] - { new global::AI21.EndPointAuthorizationRequirement - { - Type = "Http", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::AI21.EndPointSecurityRequirement[] s_FnacV1DeprecatedDescriptionsPrefixPreviewSolutionsPreviewFnacV1DeprecatedDescriptionsPostSecurityRequirements = - new global::AI21.EndPointSecurityRequirement[] - { s_FnacV1DeprecatedDescriptionsPrefixPreviewSolutionsPreviewFnacV1DeprecatedDescriptionsPostSecurityRequirement0, - }; - partial void PrepareFnacV1DeprecatedDescriptionsPrefixPreviewSolutionsPreviewFnacV1DeprecatedDescriptionsPostArguments( - global::System.Net.Http.HttpClient httpClient); - partial void PrepareFnacV1DeprecatedDescriptionsPrefixPreviewSolutionsPreviewFnacV1DeprecatedDescriptionsPostRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage); - partial void ProcessFnacV1DeprecatedDescriptionsPrefixPreviewSolutionsPreviewFnacV1DeprecatedDescriptionsPostResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessFnacV1DeprecatedDescriptionsPrefixPreviewSolutionsPreviewFnacV1DeprecatedDescriptionsPostResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Fnac V1 Deprecated Descriptions Prefix Preview - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task FnacV1DeprecatedDescriptionsPrefixPreviewSolutionsPreviewFnacV1DeprecatedDescriptionsPostAsync( - global::System.Threading.CancellationToken cancellationToken = default) - { - PrepareArguments( - client: HttpClient); - PrepareFnacV1DeprecatedDescriptionsPrefixPreviewSolutionsPreviewFnacV1DeprecatedDescriptionsPostArguments( - httpClient: HttpClient); - - - var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_FnacV1DeprecatedDescriptionsPrefixPreviewSolutionsPreviewFnacV1DeprecatedDescriptionsPostSecurityRequirements, - operationName: "FnacV1DeprecatedDescriptionsPrefixPreviewSolutionsPreviewFnacV1DeprecatedDescriptionsPostAsync"); - - var __pathBuilder = new global::AI21.PathBuilder( - path: "/solutions-preview/fnac/v1-deprecated/descriptions", - 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); - } - } - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareFnacV1DeprecatedDescriptionsPrefixPreviewSolutionsPreviewFnacV1DeprecatedDescriptionsPostRequest( - 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); - ProcessFnacV1DeprecatedDescriptionsPrefixPreviewSolutionsPreviewFnacV1DeprecatedDescriptionsPostResponse( - 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); - ProcessFnacV1DeprecatedDescriptionsPrefixPreviewSolutionsPreviewFnacV1DeprecatedDescriptionsPostResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return __content; - } - catch (global::System.Exception __ex) - { - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __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::AI21.ApiException( - message: __content ?? __response.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/AI21/Generated/AI21.Ai21Client.FnacV1DeprecatedDescriptionsSolutionsFnacV1DeprecatedDescriptionsPost.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.FnacV1DeprecatedDescriptionsSolutionsFnacV1DeprecatedDescriptionsPost.g.cs deleted file mode 100644 index 7e1c4772..00000000 --- a/src/libs/AI21/Generated/AI21.Ai21Client.FnacV1DeprecatedDescriptionsSolutionsFnacV1DeprecatedDescriptionsPost.g.cs +++ /dev/null @@ -1,188 +0,0 @@ - -#nullable enable - -namespace AI21 -{ - public partial class Ai21Client - { - - - private static readonly global::AI21.EndPointSecurityRequirement s_FnacV1DeprecatedDescriptionsSolutionsFnacV1DeprecatedDescriptionsPostSecurityRequirement0 = - new global::AI21.EndPointSecurityRequirement - { - Authorizations = new global::AI21.EndPointAuthorizationRequirement[] - { new global::AI21.EndPointAuthorizationRequirement - { - Type = "Http", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::AI21.EndPointSecurityRequirement[] s_FnacV1DeprecatedDescriptionsSolutionsFnacV1DeprecatedDescriptionsPostSecurityRequirements = - new global::AI21.EndPointSecurityRequirement[] - { s_FnacV1DeprecatedDescriptionsSolutionsFnacV1DeprecatedDescriptionsPostSecurityRequirement0, - }; - partial void PrepareFnacV1DeprecatedDescriptionsSolutionsFnacV1DeprecatedDescriptionsPostArguments( - global::System.Net.Http.HttpClient httpClient); - partial void PrepareFnacV1DeprecatedDescriptionsSolutionsFnacV1DeprecatedDescriptionsPostRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage); - partial void ProcessFnacV1DeprecatedDescriptionsSolutionsFnacV1DeprecatedDescriptionsPostResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessFnacV1DeprecatedDescriptionsSolutionsFnacV1DeprecatedDescriptionsPostResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Fnac V1 Deprecated Descriptions - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task FnacV1DeprecatedDescriptionsSolutionsFnacV1DeprecatedDescriptionsPostAsync( - global::System.Threading.CancellationToken cancellationToken = default) - { - PrepareArguments( - client: HttpClient); - PrepareFnacV1DeprecatedDescriptionsSolutionsFnacV1DeprecatedDescriptionsPostArguments( - httpClient: HttpClient); - - - var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_FnacV1DeprecatedDescriptionsSolutionsFnacV1DeprecatedDescriptionsPostSecurityRequirements, - operationName: "FnacV1DeprecatedDescriptionsSolutionsFnacV1DeprecatedDescriptionsPostAsync"); - - var __pathBuilder = new global::AI21.PathBuilder( - path: "/solutions/fnac/v1-deprecated/descriptions", - 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); - } - } - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareFnacV1DeprecatedDescriptionsSolutionsFnacV1DeprecatedDescriptionsPostRequest( - 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); - ProcessFnacV1DeprecatedDescriptionsSolutionsFnacV1DeprecatedDescriptionsPostResponse( - 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); - ProcessFnacV1DeprecatedDescriptionsSolutionsFnacV1DeprecatedDescriptionsPostResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return __content; - } - catch (global::System.Exception __ex) - { - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __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::AI21.ApiException( - message: __content ?? __response.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/AI21/Generated/AI21.Ai21Client.FnacV1DescriptionsPrefixPreviewSolutionsPreviewFnacV1DescriptionsPost.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.FnacV1DescriptionsPrefixPreviewSolutionsPreviewFnacV1DescriptionsPost.g.cs deleted file mode 100644 index 96c01ce2..00000000 --- a/src/libs/AI21/Generated/AI21.Ai21Client.FnacV1DescriptionsPrefixPreviewSolutionsPreviewFnacV1DescriptionsPost.g.cs +++ /dev/null @@ -1,188 +0,0 @@ - -#nullable enable - -namespace AI21 -{ - public partial class Ai21Client - { - - - private static readonly global::AI21.EndPointSecurityRequirement s_FnacV1DescriptionsPrefixPreviewSolutionsPreviewFnacV1DescriptionsPostSecurityRequirement0 = - new global::AI21.EndPointSecurityRequirement - { - Authorizations = new global::AI21.EndPointAuthorizationRequirement[] - { new global::AI21.EndPointAuthorizationRequirement - { - Type = "Http", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::AI21.EndPointSecurityRequirement[] s_FnacV1DescriptionsPrefixPreviewSolutionsPreviewFnacV1DescriptionsPostSecurityRequirements = - new global::AI21.EndPointSecurityRequirement[] - { s_FnacV1DescriptionsPrefixPreviewSolutionsPreviewFnacV1DescriptionsPostSecurityRequirement0, - }; - partial void PrepareFnacV1DescriptionsPrefixPreviewSolutionsPreviewFnacV1DescriptionsPostArguments( - global::System.Net.Http.HttpClient httpClient); - partial void PrepareFnacV1DescriptionsPrefixPreviewSolutionsPreviewFnacV1DescriptionsPostRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage); - partial void ProcessFnacV1DescriptionsPrefixPreviewSolutionsPreviewFnacV1DescriptionsPostResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessFnacV1DescriptionsPrefixPreviewSolutionsPreviewFnacV1DescriptionsPostResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Fnac V1 Descriptions Prefix Preview - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task FnacV1DescriptionsPrefixPreviewSolutionsPreviewFnacV1DescriptionsPostAsync( - global::System.Threading.CancellationToken cancellationToken = default) - { - PrepareArguments( - client: HttpClient); - PrepareFnacV1DescriptionsPrefixPreviewSolutionsPreviewFnacV1DescriptionsPostArguments( - httpClient: HttpClient); - - - var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_FnacV1DescriptionsPrefixPreviewSolutionsPreviewFnacV1DescriptionsPostSecurityRequirements, - operationName: "FnacV1DescriptionsPrefixPreviewSolutionsPreviewFnacV1DescriptionsPostAsync"); - - var __pathBuilder = new global::AI21.PathBuilder( - path: "/solutions-preview/fnac/v1/descriptions", - 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); - } - } - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareFnacV1DescriptionsPrefixPreviewSolutionsPreviewFnacV1DescriptionsPostRequest( - 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); - ProcessFnacV1DescriptionsPrefixPreviewSolutionsPreviewFnacV1DescriptionsPostResponse( - 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); - ProcessFnacV1DescriptionsPrefixPreviewSolutionsPreviewFnacV1DescriptionsPostResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return __content; - } - catch (global::System.Exception __ex) - { - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __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::AI21.ApiException( - message: __content ?? __response.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/AI21/Generated/AI21.Ai21Client.FnacV1DescriptionsSolutionsFnacV1DescriptionsPost.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.FnacV1DescriptionsSolutionsFnacV1DescriptionsPost.g.cs deleted file mode 100644 index 85598b4b..00000000 --- a/src/libs/AI21/Generated/AI21.Ai21Client.FnacV1DescriptionsSolutionsFnacV1DescriptionsPost.g.cs +++ /dev/null @@ -1,188 +0,0 @@ - -#nullable enable - -namespace AI21 -{ - public partial class Ai21Client - { - - - private static readonly global::AI21.EndPointSecurityRequirement s_FnacV1DescriptionsSolutionsFnacV1DescriptionsPostSecurityRequirement0 = - new global::AI21.EndPointSecurityRequirement - { - Authorizations = new global::AI21.EndPointAuthorizationRequirement[] - { new global::AI21.EndPointAuthorizationRequirement - { - Type = "Http", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::AI21.EndPointSecurityRequirement[] s_FnacV1DescriptionsSolutionsFnacV1DescriptionsPostSecurityRequirements = - new global::AI21.EndPointSecurityRequirement[] - { s_FnacV1DescriptionsSolutionsFnacV1DescriptionsPostSecurityRequirement0, - }; - partial void PrepareFnacV1DescriptionsSolutionsFnacV1DescriptionsPostArguments( - global::System.Net.Http.HttpClient httpClient); - partial void PrepareFnacV1DescriptionsSolutionsFnacV1DescriptionsPostRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage); - partial void ProcessFnacV1DescriptionsSolutionsFnacV1DescriptionsPostResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessFnacV1DescriptionsSolutionsFnacV1DescriptionsPostResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Fnac V1 Descriptions - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task FnacV1DescriptionsSolutionsFnacV1DescriptionsPostAsync( - global::System.Threading.CancellationToken cancellationToken = default) - { - PrepareArguments( - client: HttpClient); - PrepareFnacV1DescriptionsSolutionsFnacV1DescriptionsPostArguments( - httpClient: HttpClient); - - - var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_FnacV1DescriptionsSolutionsFnacV1DescriptionsPostSecurityRequirements, - operationName: "FnacV1DescriptionsSolutionsFnacV1DescriptionsPostAsync"); - - var __pathBuilder = new global::AI21.PathBuilder( - path: "/solutions/fnac/v1/descriptions", - 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); - } - } - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareFnacV1DescriptionsSolutionsFnacV1DescriptionsPostRequest( - 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); - ProcessFnacV1DescriptionsSolutionsFnacV1DescriptionsPostResponse( - 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); - ProcessFnacV1DescriptionsSolutionsFnacV1DescriptionsPostResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return __content; - } - catch (global::System.Exception __ex) - { - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __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::AI21.ApiException( - message: __content ?? __response.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/AI21/Generated/AI21.Ai21Client.ForwardParagonWebhookStudioV1ConnectorsParagonWebhookPost.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.ForwardParagonWebhookStudioV1ConnectorsParagonWebhookPost.g.cs deleted file mode 100644 index 615a0b88..00000000 --- a/src/libs/AI21/Generated/AI21.Ai21Client.ForwardParagonWebhookStudioV1ConnectorsParagonWebhookPost.g.cs +++ /dev/null @@ -1,188 +0,0 @@ - -#nullable enable - -namespace AI21 -{ - public partial class Ai21Client - { - - - private static readonly global::AI21.EndPointSecurityRequirement s_ForwardParagonWebhookStudioV1ConnectorsParagonWebhookPostSecurityRequirement0 = - new global::AI21.EndPointSecurityRequirement - { - Authorizations = new global::AI21.EndPointAuthorizationRequirement[] - { new global::AI21.EndPointAuthorizationRequirement - { - Type = "Http", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::AI21.EndPointSecurityRequirement[] s_ForwardParagonWebhookStudioV1ConnectorsParagonWebhookPostSecurityRequirements = - new global::AI21.EndPointSecurityRequirement[] - { s_ForwardParagonWebhookStudioV1ConnectorsParagonWebhookPostSecurityRequirement0, - }; - partial void PrepareForwardParagonWebhookStudioV1ConnectorsParagonWebhookPostArguments( - global::System.Net.Http.HttpClient httpClient); - partial void PrepareForwardParagonWebhookStudioV1ConnectorsParagonWebhookPostRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage); - partial void ProcessForwardParagonWebhookStudioV1ConnectorsParagonWebhookPostResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessForwardParagonWebhookStudioV1ConnectorsParagonWebhookPostResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Forward Paragon Webhook - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task ForwardParagonWebhookStudioV1ConnectorsParagonWebhookPostAsync( - global::System.Threading.CancellationToken cancellationToken = default) - { - PrepareArguments( - client: HttpClient); - PrepareForwardParagonWebhookStudioV1ConnectorsParagonWebhookPostArguments( - httpClient: HttpClient); - - - var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_ForwardParagonWebhookStudioV1ConnectorsParagonWebhookPostSecurityRequirements, - operationName: "ForwardParagonWebhookStudioV1ConnectorsParagonWebhookPostAsync"); - - var __pathBuilder = new global::AI21.PathBuilder( - path: "/studio/v1/connectors/paragon/webhook", - 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); - } - } - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareForwardParagonWebhookStudioV1ConnectorsParagonWebhookPostRequest( - 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); - ProcessForwardParagonWebhookStudioV1ConnectorsParagonWebhookPostResponse( - 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); - ProcessForwardParagonWebhookStudioV1ConnectorsParagonWebhookPostResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return __content; - } - catch (global::System.Exception __ex) - { - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __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::AI21.ApiException( - message: __content ?? __response.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/AI21/Generated/AI21.Ai21Client.GenerateOrgTokenStudioV1ConnectorsConnectedUsersEntityIdTokensPost.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.GenerateOrgTokenStudioV1ConnectorsConnectedUsersEntityIdTokensPost.g.cs deleted file mode 100644 index fff72f6b..00000000 --- a/src/libs/AI21/Generated/AI21.Ai21Client.GenerateOrgTokenStudioV1ConnectorsConnectedUsersEntityIdTokensPost.g.cs +++ /dev/null @@ -1,236 +0,0 @@ - -#nullable enable - -namespace AI21 -{ - public partial class Ai21Client - { - - - private static readonly global::AI21.EndPointSecurityRequirement s_GenerateOrgTokenStudioV1ConnectorsConnectedUsersEntityIdTokensPostSecurityRequirement0 = - new global::AI21.EndPointSecurityRequirement - { - Authorizations = new global::AI21.EndPointAuthorizationRequirement[] - { new global::AI21.EndPointAuthorizationRequirement - { - Type = "Http", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::AI21.EndPointSecurityRequirement[] s_GenerateOrgTokenStudioV1ConnectorsConnectedUsersEntityIdTokensPostSecurityRequirements = - new global::AI21.EndPointSecurityRequirement[] - { s_GenerateOrgTokenStudioV1ConnectorsConnectedUsersEntityIdTokensPostSecurityRequirement0, - }; - partial void PrepareGenerateOrgTokenStudioV1ConnectorsConnectedUsersEntityIdTokensPostArguments( - global::System.Net.Http.HttpClient httpClient, - ref string entityId); - partial void PrepareGenerateOrgTokenStudioV1ConnectorsConnectedUsersEntityIdTokensPostRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - string entityId); - partial void ProcessGenerateOrgTokenStudioV1ConnectorsConnectedUsersEntityIdTokensPostResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessGenerateOrgTokenStudioV1ConnectorsConnectedUsersEntityIdTokensPostResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Generate Org Token - /// - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task GenerateOrgTokenStudioV1ConnectorsConnectedUsersEntityIdTokensPostAsync( - string entityId, - global::System.Threading.CancellationToken cancellationToken = default) - { - PrepareArguments( - client: HttpClient); - PrepareGenerateOrgTokenStudioV1ConnectorsConnectedUsersEntityIdTokensPostArguments( - httpClient: HttpClient, - entityId: ref entityId); - - - var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_GenerateOrgTokenStudioV1ConnectorsConnectedUsersEntityIdTokensPostSecurityRequirements, - operationName: "GenerateOrgTokenStudioV1ConnectorsConnectedUsersEntityIdTokensPostAsync"); - - var __pathBuilder = new global::AI21.PathBuilder( - path: $"/studio/v1/connectors/connected-users/{entityId}/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); - } - } - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareGenerateOrgTokenStudioV1ConnectorsConnectedUsersEntityIdTokensPostRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - entityId: entityId); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessGenerateOrgTokenStudioV1ConnectorsConnectedUsersEntityIdTokensPostResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Validation Error - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::AI21.HTTPValidationError? __value_422 = null; - try - { - if (ReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - throw new global::AI21.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) - { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessGenerateOrgTokenStudioV1ConnectorsConnectedUsersEntityIdTokensPostResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return - global::AI21.ConnectorsToken.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - } - catch (global::System.Exception __ex) - { - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __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::AI21.ConnectorsToken.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::AI21.ApiException( - message: __content ?? __response.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/AI21/Generated/AI21.Ai21Client.GenerateResponsePdfStudioV1DemosRfiGenerateResponsePdfPost.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.GenerateResponsePdfStudioV1DemosRfiGenerateResponsePdfPost.g.cs index 90bcd74b..51de3d27 100644 --- a/src/libs/AI21/Generated/AI21.Ai21Client.GenerateResponsePdfStudioV1DemosRfiGenerateResponsePdfPost.g.cs +++ b/src/libs/AI21/Generated/AI21.Ai21Client.GenerateResponsePdfStudioV1DemosRfiGenerateResponsePdfPost.g.cs @@ -14,6 +14,7 @@ public partial class Ai21Client { new global::AI21.EndPointAuthorizationRequirement { Type = "Http", + SchemeId = "HttpBearer", Location = "Header", Name = "Bearer", FriendlyName = "Bearer", @@ -44,11 +45,35 @@ partial void ProcessGenerateResponsePdfStudioV1DemosRfiGenerateResponsePdfPostRe /// Combine section answers ➜ styled PDF for download /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// public async global::System.Threading.Tasks.Task GenerateResponsePdfStudioV1DemosRfiGenerateResponsePdfPostAsync( global::AI21.MarkdownRequest request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await GenerateResponsePdfStudioV1DemosRfiGenerateResponsePdfPostAsResponseAsync( + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Combine section answers ➜ styled PDF for download + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> GenerateResponsePdfStudioV1DemosRfiGenerateResponsePdfPostAsResponseAsync( + + global::AI21.MarkdownRequest request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) { request = request ?? throw new global::System.ArgumentNullException(nameof(request)); @@ -65,22 +90,44 @@ partial void ProcessGenerateResponsePdfStudioV1DemosRfiGenerateResponsePdfPostRe securityRequirements: s_GenerateResponsePdfStudioV1DemosRfiGenerateResponsePdfPostSecurityRequirements, operationName: "GenerateResponsePdfStudioV1DemosRfiGenerateResponsePdfPostAsync"); - var __pathBuilder = new global::AI21.PathBuilder( - path: "/studio/v1/demos/rfi/generate-response-pdf", - 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)); + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: "/studio/v1/demos/rfi/generate-response-pdf", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.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; + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; #endif foreach (var __authorization in __authorizations) { if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2") + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") { __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( scheme: __authorization.Name, @@ -90,152 +137,332 @@ partial void ProcessGenerateResponsePdfStudioV1DemosRfiGenerateResponsePdfPostRe __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); - PrepareGenerateResponsePdfStudioV1DemosRfiGenerateResponsePdfPostRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - request: request); + 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::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareGenerateResponsePdfStudioV1DemosRfiGenerateResponsePdfPostRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + request: request); - ProcessResponse( - client: HttpClient, - response: __response); - ProcessGenerateResponsePdfStudioV1DemosRfiGenerateResponsePdfPostResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Validation Error - if ((int)__response.StatusCode == 422) + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::AI21.HTTPValidationError? __value_422 = null; - try + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) { - if (ReadResponseAsString) + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GenerateResponsePdfStudioV1DemosRfiGenerateResponsePdfPost", + methodName: "GenerateResponsePdfStudioV1DemosRfiGenerateResponsePdfPostAsync", + pathTemplate: "\"/studio/v1/demos/rfi/generate-response-pdf\"", + 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 { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); } - else + catch (global::System.Net.Http.HttpRequestException __exception) { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GenerateResponsePdfStudioV1DemosRfiGenerateResponsePdfPost", + methodName: "GenerateResponsePdfStudioV1DemosRfiGenerateResponsePdfPostAsync", + pathTemplate: "\"/studio/v1/demos/rfi/generate-response-pdf\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GenerateResponsePdfStudioV1DemosRfiGenerateResponsePdfPost", + methodName: "GenerateResponsePdfStudioV1DemosRfiGenerateResponsePdfPostAsync", + pathTemplate: "\"/studio/v1/demos/rfi/generate-response-pdf\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; } + + break; } - catch (global::System.Exception __ex) + + if (__response == null) { - __exception_422 = __ex; + throw new global::System.InvalidOperationException("No response received."); } - throw new global::AI21.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) + using (__response) { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - ProcessResponseContent( + ProcessResponse( client: HttpClient, - response: __response, - content: ref __content); - ProcessGenerateResponsePdfStudioV1DemosRfiGenerateResponsePdfPostResponseContent( + response: __response); + ProcessGenerateResponsePdfStudioV1DemosRfiGenerateResponsePdfPostResponse( httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) { - __response.EnsureSuccessStatusCode(); - - return __content; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GenerateResponsePdfStudioV1DemosRfiGenerateResponsePdfPost", + methodName: "GenerateResponsePdfStudioV1DemosRfiGenerateResponsePdfPostAsync", + pathTemplate: "\"/studio/v1/demos/rfi/generate-response-pdf\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } - catch (global::System.Exception __ex) + else { - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GenerateResponsePdfStudioV1DemosRfiGenerateResponsePdfPost", + methodName: "GenerateResponsePdfStudioV1DemosRfiGenerateResponsePdfPostAsync", + pathTemplate: "\"/studio/v1/demos/rfi/generate-response-pdf\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::AI21.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).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) - { - } + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessGenerateResponsePdfStudioV1DemosRfiGenerateResponsePdfPostResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? 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::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.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::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; } } + finally + { + __httpRequest?.Dispose(); + } } /// /// Combine section answers ➜ styled PDF for download @@ -243,10 +470,12 @@ partial void ProcessGenerateResponsePdfStudioV1DemosRfiGenerateResponsePdfPostRe /// /// All section answers concatenated /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// public async global::System.Threading.Tasks.Task GenerateResponsePdfStudioV1DemosRfiGenerateResponsePdfPostAsync( string text, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) { var __request = new global::AI21.MarkdownRequest @@ -256,6 +485,7 @@ partial void ProcessGenerateResponsePdfStudioV1DemosRfiGenerateResponsePdfPostRe return await GenerateResponsePdfStudioV1DemosRfiGenerateResponsePdfPostAsync( request: __request, + requestOptions: requestOptions, cancellationToken: cancellationToken).ConfigureAwait(false); } } diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.GetAgentGatewaySettingsAgentsAgentIdGet.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.GetAgentGatewaySettingsAgentsAgentIdGet.g.cs new file mode 100644 index 00000000..8b31d829 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Ai21Client.GetAgentGatewaySettingsAgentsAgentIdGet.g.cs @@ -0,0 +1,461 @@ + +#nullable enable + +namespace AI21 +{ + public partial class Ai21Client + { + + + private static readonly global::AI21.EndPointSecurityRequirement s_GetAgentGatewaySettingsAgentsAgentIdGetSecurityRequirement0 = + new global::AI21.EndPointSecurityRequirement + { + Authorizations = new global::AI21.EndPointAuthorizationRequirement[] + { new global::AI21.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::AI21.EndPointSecurityRequirement[] s_GetAgentGatewaySettingsAgentsAgentIdGetSecurityRequirements = + new global::AI21.EndPointSecurityRequirement[] + { s_GetAgentGatewaySettingsAgentsAgentIdGetSecurityRequirement0, + }; + partial void PrepareGetAgentGatewaySettingsAgentsAgentIdGetArguments( + global::System.Net.Http.HttpClient httpClient, + ref string agentId); + partial void PrepareGetAgentGatewaySettingsAgentsAgentIdGetRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string agentId); + partial void ProcessGetAgentGatewaySettingsAgentsAgentIdGetResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessGetAgentGatewaySettingsAgentsAgentIdGetResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Get Agent + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task GetAgentGatewaySettingsAgentsAgentIdGetAsync( + string agentId, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await GetAgentGatewaySettingsAgentsAgentIdGetAsResponseAsync( + agentId: agentId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Get Agent + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> GetAgentGatewaySettingsAgentsAgentIdGetAsResponseAsync( + string agentId, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareGetAgentGatewaySettingsAgentsAgentIdGetArguments( + httpClient: HttpClient, + agentId: ref agentId); + + + var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_GetAgentGatewaySettingsAgentsAgentIdGetSecurityRequirements, + operationName: "GetAgentGatewaySettingsAgentsAgentIdGetAsync"); + + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: $"/gateway/settings/agents/{agentId}", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.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::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareGetAgentGatewaySettingsAgentsAgentIdGetRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + agentId: agentId!); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GetAgentGatewaySettingsAgentsAgentIdGet", + methodName: "GetAgentGatewaySettingsAgentsAgentIdGetAsync", + pathTemplate: "$\"/gateway/settings/agents/{agentId}\"", + 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::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GetAgentGatewaySettingsAgentsAgentIdGet", + methodName: "GetAgentGatewaySettingsAgentsAgentIdGetAsync", + pathTemplate: "$\"/gateway/settings/agents/{agentId}\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GetAgentGatewaySettingsAgentsAgentIdGet", + methodName: "GetAgentGatewaySettingsAgentsAgentIdGetAsync", + pathTemplate: "$\"/gateway/settings/agents/{agentId}\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessGetAgentGatewaySettingsAgentsAgentIdGetResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GetAgentGatewaySettingsAgentsAgentIdGet", + methodName: "GetAgentGatewaySettingsAgentsAgentIdGetAsync", + pathTemplate: "$\"/gateway/settings/agents/{agentId}\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GetAgentGatewaySettingsAgentsAgentIdGet", + methodName: "GetAgentGatewaySettingsAgentsAgentIdGetAsync", + pathTemplate: "$\"/gateway/settings/agents/{agentId}\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: __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::AI21.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessGetAgentGatewaySettingsAgentsAgentIdGetResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::AI21.AgentOut.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => 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::AI21.AgentOut.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.GetAgentOptimizationsGatewaySettingsAgentsAgentIdOptimizationsGet.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.GetAgentOptimizationsGatewaySettingsAgentsAgentIdOptimizationsGet.g.cs new file mode 100644 index 00000000..d19859f4 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Ai21Client.GetAgentOptimizationsGatewaySettingsAgentsAgentIdOptimizationsGet.g.cs @@ -0,0 +1,461 @@ + +#nullable enable + +namespace AI21 +{ + public partial class Ai21Client + { + + + private static readonly global::AI21.EndPointSecurityRequirement s_GetAgentOptimizationsGatewaySettingsAgentsAgentIdOptimizationsGetSecurityRequirement0 = + new global::AI21.EndPointSecurityRequirement + { + Authorizations = new global::AI21.EndPointAuthorizationRequirement[] + { new global::AI21.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::AI21.EndPointSecurityRequirement[] s_GetAgentOptimizationsGatewaySettingsAgentsAgentIdOptimizationsGetSecurityRequirements = + new global::AI21.EndPointSecurityRequirement[] + { s_GetAgentOptimizationsGatewaySettingsAgentsAgentIdOptimizationsGetSecurityRequirement0, + }; + partial void PrepareGetAgentOptimizationsGatewaySettingsAgentsAgentIdOptimizationsGetArguments( + global::System.Net.Http.HttpClient httpClient, + ref string agentId); + partial void PrepareGetAgentOptimizationsGatewaySettingsAgentsAgentIdOptimizationsGetRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string agentId); + partial void ProcessGetAgentOptimizationsGatewaySettingsAgentsAgentIdOptimizationsGetResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessGetAgentOptimizationsGatewaySettingsAgentsAgentIdOptimizationsGetResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Get Agent Optimizations + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> GetAgentOptimizationsGatewaySettingsAgentsAgentIdOptimizationsGetAsync( + string agentId, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await GetAgentOptimizationsGatewaySettingsAgentsAgentIdOptimizationsGetAsResponseAsync( + agentId: agentId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Get Agent Optimizations + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task>> GetAgentOptimizationsGatewaySettingsAgentsAgentIdOptimizationsGetAsResponseAsync( + string agentId, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareGetAgentOptimizationsGatewaySettingsAgentsAgentIdOptimizationsGetArguments( + httpClient: HttpClient, + agentId: ref agentId); + + + var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_GetAgentOptimizationsGatewaySettingsAgentsAgentIdOptimizationsGetSecurityRequirements, + operationName: "GetAgentOptimizationsGatewaySettingsAgentsAgentIdOptimizationsGetAsync"); + + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: $"/gateway/settings/agents/{agentId}/optimizations", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.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::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareGetAgentOptimizationsGatewaySettingsAgentsAgentIdOptimizationsGetRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + agentId: agentId!); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GetAgentOptimizationsGatewaySettingsAgentsAgentIdOptimizationsGet", + methodName: "GetAgentOptimizationsGatewaySettingsAgentsAgentIdOptimizationsGetAsync", + pathTemplate: "$\"/gateway/settings/agents/{agentId}/optimizations\"", + 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::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GetAgentOptimizationsGatewaySettingsAgentsAgentIdOptimizationsGet", + methodName: "GetAgentOptimizationsGatewaySettingsAgentsAgentIdOptimizationsGetAsync", + pathTemplate: "$\"/gateway/settings/agents/{agentId}/optimizations\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GetAgentOptimizationsGatewaySettingsAgentsAgentIdOptimizationsGet", + methodName: "GetAgentOptimizationsGatewaySettingsAgentsAgentIdOptimizationsGetAsync", + pathTemplate: "$\"/gateway/settings/agents/{agentId}/optimizations\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessGetAgentOptimizationsGatewaySettingsAgentsAgentIdOptimizationsGetResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GetAgentOptimizationsGatewaySettingsAgentsAgentIdOptimizationsGet", + methodName: "GetAgentOptimizationsGatewaySettingsAgentsAgentIdOptimizationsGetAsync", + pathTemplate: "$\"/gateway/settings/agents/{agentId}/optimizations\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GetAgentOptimizationsGatewaySettingsAgentsAgentIdOptimizationsGet", + methodName: "GetAgentOptimizationsGatewaySettingsAgentsAgentIdOptimizationsGetAsync", + pathTemplate: "$\"/gateway/settings/agents/{agentId}/optimizations\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: __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::AI21.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessGetAgentOptimizationsGatewaySettingsAgentsAgentIdOptimizationsGetResponseContent( + 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::AI21.AutoSDKHttpResponse>( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => 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::AI21.AutoSDKHttpResponse>( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.GetAgentOptimizationsTokenwiseSettingsAgentsAgentIdOptimizationsGet.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.GetAgentOptimizationsTokenwiseSettingsAgentsAgentIdOptimizationsGet.g.cs new file mode 100644 index 00000000..b01f2fc0 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Ai21Client.GetAgentOptimizationsTokenwiseSettingsAgentsAgentIdOptimizationsGet.g.cs @@ -0,0 +1,461 @@ + +#nullable enable + +namespace AI21 +{ + public partial class Ai21Client + { + + + private static readonly global::AI21.EndPointSecurityRequirement s_GetAgentOptimizationsTokenwiseSettingsAgentsAgentIdOptimizationsGetSecurityRequirement0 = + new global::AI21.EndPointSecurityRequirement + { + Authorizations = new global::AI21.EndPointAuthorizationRequirement[] + { new global::AI21.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::AI21.EndPointSecurityRequirement[] s_GetAgentOptimizationsTokenwiseSettingsAgentsAgentIdOptimizationsGetSecurityRequirements = + new global::AI21.EndPointSecurityRequirement[] + { s_GetAgentOptimizationsTokenwiseSettingsAgentsAgentIdOptimizationsGetSecurityRequirement0, + }; + partial void PrepareGetAgentOptimizationsTokenwiseSettingsAgentsAgentIdOptimizationsGetArguments( + global::System.Net.Http.HttpClient httpClient, + ref string agentId); + partial void PrepareGetAgentOptimizationsTokenwiseSettingsAgentsAgentIdOptimizationsGetRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string agentId); + partial void ProcessGetAgentOptimizationsTokenwiseSettingsAgentsAgentIdOptimizationsGetResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessGetAgentOptimizationsTokenwiseSettingsAgentsAgentIdOptimizationsGetResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Get Agent Optimizations + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> GetAgentOptimizationsTokenwiseSettingsAgentsAgentIdOptimizationsGetAsync( + string agentId, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await GetAgentOptimizationsTokenwiseSettingsAgentsAgentIdOptimizationsGetAsResponseAsync( + agentId: agentId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Get Agent Optimizations + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task>> GetAgentOptimizationsTokenwiseSettingsAgentsAgentIdOptimizationsGetAsResponseAsync( + string agentId, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareGetAgentOptimizationsTokenwiseSettingsAgentsAgentIdOptimizationsGetArguments( + httpClient: HttpClient, + agentId: ref agentId); + + + var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_GetAgentOptimizationsTokenwiseSettingsAgentsAgentIdOptimizationsGetSecurityRequirements, + operationName: "GetAgentOptimizationsTokenwiseSettingsAgentsAgentIdOptimizationsGetAsync"); + + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: $"/tokenwise/settings/agents/{agentId}/optimizations", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.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::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareGetAgentOptimizationsTokenwiseSettingsAgentsAgentIdOptimizationsGetRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + agentId: agentId!); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GetAgentOptimizationsTokenwiseSettingsAgentsAgentIdOptimizationsGet", + methodName: "GetAgentOptimizationsTokenwiseSettingsAgentsAgentIdOptimizationsGetAsync", + pathTemplate: "$\"/tokenwise/settings/agents/{agentId}/optimizations\"", + 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::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GetAgentOptimizationsTokenwiseSettingsAgentsAgentIdOptimizationsGet", + methodName: "GetAgentOptimizationsTokenwiseSettingsAgentsAgentIdOptimizationsGetAsync", + pathTemplate: "$\"/tokenwise/settings/agents/{agentId}/optimizations\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GetAgentOptimizationsTokenwiseSettingsAgentsAgentIdOptimizationsGet", + methodName: "GetAgentOptimizationsTokenwiseSettingsAgentsAgentIdOptimizationsGetAsync", + pathTemplate: "$\"/tokenwise/settings/agents/{agentId}/optimizations\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessGetAgentOptimizationsTokenwiseSettingsAgentsAgentIdOptimizationsGetResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GetAgentOptimizationsTokenwiseSettingsAgentsAgentIdOptimizationsGet", + methodName: "GetAgentOptimizationsTokenwiseSettingsAgentsAgentIdOptimizationsGetAsync", + pathTemplate: "$\"/tokenwise/settings/agents/{agentId}/optimizations\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GetAgentOptimizationsTokenwiseSettingsAgentsAgentIdOptimizationsGet", + methodName: "GetAgentOptimizationsTokenwiseSettingsAgentsAgentIdOptimizationsGetAsync", + pathTemplate: "$\"/tokenwise/settings/agents/{agentId}/optimizations\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: __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::AI21.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessGetAgentOptimizationsTokenwiseSettingsAgentsAgentIdOptimizationsGetResponseContent( + 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::AI21.AutoSDKHttpResponse>( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => 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::AI21.AutoSDKHttpResponse>( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.GetAgentTokenwiseSettingsAgentsAgentIdGet.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.GetAgentTokenwiseSettingsAgentsAgentIdGet.g.cs new file mode 100644 index 00000000..5534c1b1 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Ai21Client.GetAgentTokenwiseSettingsAgentsAgentIdGet.g.cs @@ -0,0 +1,461 @@ + +#nullable enable + +namespace AI21 +{ + public partial class Ai21Client + { + + + private static readonly global::AI21.EndPointSecurityRequirement s_GetAgentTokenwiseSettingsAgentsAgentIdGetSecurityRequirement0 = + new global::AI21.EndPointSecurityRequirement + { + Authorizations = new global::AI21.EndPointAuthorizationRequirement[] + { new global::AI21.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::AI21.EndPointSecurityRequirement[] s_GetAgentTokenwiseSettingsAgentsAgentIdGetSecurityRequirements = + new global::AI21.EndPointSecurityRequirement[] + { s_GetAgentTokenwiseSettingsAgentsAgentIdGetSecurityRequirement0, + }; + partial void PrepareGetAgentTokenwiseSettingsAgentsAgentIdGetArguments( + global::System.Net.Http.HttpClient httpClient, + ref string agentId); + partial void PrepareGetAgentTokenwiseSettingsAgentsAgentIdGetRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string agentId); + partial void ProcessGetAgentTokenwiseSettingsAgentsAgentIdGetResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessGetAgentTokenwiseSettingsAgentsAgentIdGetResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Get Agent + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task GetAgentTokenwiseSettingsAgentsAgentIdGetAsync( + string agentId, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await GetAgentTokenwiseSettingsAgentsAgentIdGetAsResponseAsync( + agentId: agentId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Get Agent + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> GetAgentTokenwiseSettingsAgentsAgentIdGetAsResponseAsync( + string agentId, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareGetAgentTokenwiseSettingsAgentsAgentIdGetArguments( + httpClient: HttpClient, + agentId: ref agentId); + + + var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_GetAgentTokenwiseSettingsAgentsAgentIdGetSecurityRequirements, + operationName: "GetAgentTokenwiseSettingsAgentsAgentIdGetAsync"); + + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: $"/tokenwise/settings/agents/{agentId}", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.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::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareGetAgentTokenwiseSettingsAgentsAgentIdGetRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + agentId: agentId!); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GetAgentTokenwiseSettingsAgentsAgentIdGet", + methodName: "GetAgentTokenwiseSettingsAgentsAgentIdGetAsync", + pathTemplate: "$\"/tokenwise/settings/agents/{agentId}\"", + 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::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GetAgentTokenwiseSettingsAgentsAgentIdGet", + methodName: "GetAgentTokenwiseSettingsAgentsAgentIdGetAsync", + pathTemplate: "$\"/tokenwise/settings/agents/{agentId}\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GetAgentTokenwiseSettingsAgentsAgentIdGet", + methodName: "GetAgentTokenwiseSettingsAgentsAgentIdGetAsync", + pathTemplate: "$\"/tokenwise/settings/agents/{agentId}\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessGetAgentTokenwiseSettingsAgentsAgentIdGetResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GetAgentTokenwiseSettingsAgentsAgentIdGet", + methodName: "GetAgentTokenwiseSettingsAgentsAgentIdGetAsync", + pathTemplate: "$\"/tokenwise/settings/agents/{agentId}\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GetAgentTokenwiseSettingsAgentsAgentIdGet", + methodName: "GetAgentTokenwiseSettingsAgentsAgentIdGetAsync", + pathTemplate: "$\"/tokenwise/settings/agents/{agentId}\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: __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::AI21.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessGetAgentTokenwiseSettingsAgentsAgentIdGetResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::AI21.AgentOut.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => 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::AI21.AgentOut.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.GetAssistantsByMcpStudioV1McpStorageMcpIdAssistantsGet.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.GetAssistantsByMcpStudioV1McpStorageMcpIdAssistantsGet.g.cs index 48e820d0..254c71f0 100644 --- a/src/libs/AI21/Generated/AI21.Ai21Client.GetAssistantsByMcpStudioV1McpStorageMcpIdAssistantsGet.g.cs +++ b/src/libs/AI21/Generated/AI21.Ai21Client.GetAssistantsByMcpStudioV1McpStorageMcpIdAssistantsGet.g.cs @@ -14,6 +14,7 @@ public partial class Ai21Client { new global::AI21.EndPointAuthorizationRequirement { Type = "Http", + SchemeId = "HttpBearer", Location = "Header", Name = "Bearer", FriendlyName = "Bearer", @@ -44,10 +45,32 @@ partial void ProcessGetAssistantsByMcpStudioV1McpStorageMcpIdAssistantsGetRespon /// Get Assistants By Mcp /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// public async global::System.Threading.Tasks.Task GetAssistantsByMcpStudioV1McpStorageMcpIdAssistantsGetAsync( string mcpId, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await GetAssistantsByMcpStudioV1McpStorageMcpIdAssistantsGetAsResponseAsync( + mcpId: mcpId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Get Assistants By Mcp + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> GetAssistantsByMcpStudioV1McpStorageMcpIdAssistantsGetAsResponseAsync( + string mcpId, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( @@ -62,22 +85,44 @@ partial void ProcessGetAssistantsByMcpStudioV1McpStorageMcpIdAssistantsGetRespon securityRequirements: s_GetAssistantsByMcpStudioV1McpStorageMcpIdAssistantsGetSecurityRequirements, operationName: "GetAssistantsByMcpStudioV1McpStorageMcpIdAssistantsGetAsync"); - var __pathBuilder = new global::AI21.PathBuilder( - path: $"/studio/v1/mcp/storage/{mcpId}/assistants", - 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)); + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: $"/studio/v1/mcp/storage/{mcpId}/assistants", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.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; + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; #endif foreach (var __authorization in __authorizations) { if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2") + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") { __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( scheme: __authorization.Name, @@ -87,150 +132,330 @@ partial void ProcessGetAssistantsByMcpStudioV1McpStorageMcpIdAssistantsGetRespon __authorization.Location == "Header") { __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } + } } + global::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareGetAssistantsByMcpStudioV1McpStorageMcpIdAssistantsGetRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - mcpId: mcpId); + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareGetAssistantsByMcpStudioV1McpStorageMcpIdAssistantsGetRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + mcpId: mcpId!); - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); + return __httpRequest; + } - ProcessResponse( - client: HttpClient, - response: __response); - ProcessGetAssistantsByMcpStudioV1McpStorageMcpIdAssistantsGetResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Validation Error - if ((int)__response.StatusCode == 422) + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::AI21.HTTPValidationError? __value_422 = null; - try + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) { - if (ReadResponseAsString) + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GetAssistantsByMcpStudioV1McpStorageMcpIdAssistantsGet", + methodName: "GetAssistantsByMcpStudioV1McpStorageMcpIdAssistantsGetAsync", + pathTemplate: "$\"/studio/v1/mcp/storage/{mcpId}/assistants\"", + 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 { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); } - else + catch (global::System.Net.Http.HttpRequestException __exception) { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GetAssistantsByMcpStudioV1McpStorageMcpIdAssistantsGet", + methodName: "GetAssistantsByMcpStudioV1McpStorageMcpIdAssistantsGetAsync", + pathTemplate: "$\"/studio/v1/mcp/storage/{mcpId}/assistants\"", + 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; + } - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GetAssistantsByMcpStudioV1McpStorageMcpIdAssistantsGet", + methodName: "GetAssistantsByMcpStudioV1McpStorageMcpIdAssistantsGetAsync", + pathTemplate: "$\"/studio/v1/mcp/storage/{mcpId}/assistants\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; } - catch (global::System.Exception __ex) + + if (__response == null) { - __exception_422 = __ex; + throw new global::System.InvalidOperationException("No response received."); } - throw new global::AI21.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) + using (__response) { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - ProcessResponseContent( + ProcessResponse( client: HttpClient, - response: __response, - content: ref __content); - ProcessGetAssistantsByMcpStudioV1McpStorageMcpIdAssistantsGetResponseContent( + response: __response); + ProcessGetAssistantsByMcpStudioV1McpStorageMcpIdAssistantsGetResponse( httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) { - __response.EnsureSuccessStatusCode(); - - return - global::AI21.AssistantsByMcpResponse.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GetAssistantsByMcpStudioV1McpStorageMcpIdAssistantsGet", + methodName: "GetAssistantsByMcpStudioV1McpStorageMcpIdAssistantsGetAsync", + pathTemplate: "$\"/studio/v1/mcp/storage/{mcpId}/assistants\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } - catch (global::System.Exception __ex) + else { - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GetAssistantsByMcpStudioV1McpStorageMcpIdAssistantsGet", + methodName: "GetAssistantsByMcpStudioV1McpStorageMcpIdAssistantsGetAsync", + pathTemplate: "$\"/studio/v1/mcp/storage/{mcpId}/assistants\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - using var __content = await __response.Content.ReadAsStreamAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::AI21.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - return - await global::AI21.AssistantsByMcpResponse.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) - { - } + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessGetAssistantsByMcpStudioV1McpStorageMcpIdAssistantsGetResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::AI21.AssistantsByMcpResponse.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => 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::AI21.AssistantsByMcpResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; } } + finally + { + __httpRequest?.Dispose(); + } } } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.GetAvailableModelsEndpointStudioV1SettingsModelsAvailableGet.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.GetAvailableModelsEndpointStudioV1SettingsModelsAvailableGet.g.cs index 6f59f946..eb807234 100644 --- a/src/libs/AI21/Generated/AI21.Ai21Client.GetAvailableModelsEndpointStudioV1SettingsModelsAvailableGet.g.cs +++ b/src/libs/AI21/Generated/AI21.Ai21Client.GetAvailableModelsEndpointStudioV1SettingsModelsAvailableGet.g.cs @@ -14,6 +14,7 @@ public partial class Ai21Client { new global::AI21.EndPointAuthorizationRequirement { Type = "Http", + SchemeId = "HttpBearer", Location = "Header", Name = "Bearer", FriendlyName = "Bearer", @@ -41,9 +42,28 @@ partial void ProcessGetAvailableModelsEndpointStudioV1SettingsModelsAvailableGet /// /// Get Available Models Endpoint /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// public async global::System.Threading.Tasks.Task GetAvailableModelsEndpointStudioV1SettingsModelsAvailableGetAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await GetAvailableModelsEndpointStudioV1SettingsModelsAvailableGetAsResponseAsync( + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Get Available Models Endpoint + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> GetAvailableModelsEndpointStudioV1SettingsModelsAvailableGetAsResponseAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( @@ -57,22 +77,44 @@ partial void ProcessGetAvailableModelsEndpointStudioV1SettingsModelsAvailableGet securityRequirements: s_GetAvailableModelsEndpointStudioV1SettingsModelsAvailableGetSecurityRequirements, operationName: "GetAvailableModelsEndpointStudioV1SettingsModelsAvailableGetAsync"); - var __pathBuilder = new global::AI21.PathBuilder( - path: "/studio/v1/settings/models/available", - 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)); + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: "/studio/v1/settings/models/available", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.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; + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; #endif foreach (var __authorization in __authorizations) { if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2") + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") { __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( scheme: __authorization.Name, @@ -82,107 +124,288 @@ partial void ProcessGetAvailableModelsEndpointStudioV1SettingsModelsAvailableGet __authorization.Location == "Header") { __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } + } } + global::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareGetAvailableModelsEndpointStudioV1SettingsModelsAvailableGetRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareGetAvailableModelsEndpointStudioV1SettingsModelsAvailableGetRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest); - ProcessResponse( - client: HttpClient, - response: __response); - ProcessGetAvailableModelsEndpointStudioV1SettingsModelsAvailableGetResponse( - httpClient: HttpClient, - httpResponseMessage: __response); + return __httpRequest; + } - if (ReadResponseAsString) + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GetAvailableModelsEndpointStudioV1SettingsModelsAvailableGet", + methodName: "GetAvailableModelsEndpointStudioV1SettingsModelsAvailableGetAsync", + pathTemplate: "\"/studio/v1/settings/models/available\"", + 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::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GetAvailableModelsEndpointStudioV1SettingsModelsAvailableGet", + methodName: "GetAvailableModelsEndpointStudioV1SettingsModelsAvailableGetAsync", + pathTemplate: "\"/studio/v1/settings/models/available\"", + 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; + } - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessGetAvailableModelsEndpointStudioV1SettingsModelsAvailableGetResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } - try - { - __response.EnsureSuccessStatusCode(); + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GetAvailableModelsEndpointStudioV1SettingsModelsAvailableGet", + methodName: "GetAvailableModelsEndpointStudioV1SettingsModelsAvailableGetAsync", + pathTemplate: "\"/studio/v1/settings/models/available\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } - return __content; + break; } - catch (global::System.Exception __ex) + + if (__response == null) { - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; + throw new global::System.InvalidOperationException("No response received."); } - } - else - { - try + + using (__response) { - __response.EnsureSuccessStatusCode(); - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - return __content; + ProcessResponse( + client: HttpClient, + response: __response); + ProcessGetAvailableModelsEndpointStudioV1SettingsModelsAvailableGetResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GetAvailableModelsEndpointStudioV1SettingsModelsAvailableGet", + methodName: "GetAvailableModelsEndpointStudioV1SettingsModelsAvailableGetAsync", + pathTemplate: "\"/studio/v1/settings/models/available\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } - catch (global::System.Exception __ex) + else { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GetAvailableModelsEndpointStudioV1SettingsModelsAvailableGet", + methodName: "GetAvailableModelsEndpointStudioV1SettingsModelsAvailableGetAsync", + pathTemplate: "\"/studio/v1/settings/models/available\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: __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); + ProcessGetAvailableModelsEndpointStudioV1SettingsModelsAvailableGetResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? 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::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.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::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; } } + finally + { + __httpRequest?.Dispose(); + } } } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.GetConfigGatewaySettingsConfigsConfigIdGet.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.GetConfigGatewaySettingsConfigsConfigIdGet.g.cs new file mode 100644 index 00000000..5901f449 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Ai21Client.GetConfigGatewaySettingsConfigsConfigIdGet.g.cs @@ -0,0 +1,461 @@ + +#nullable enable + +namespace AI21 +{ + public partial class Ai21Client + { + + + private static readonly global::AI21.EndPointSecurityRequirement s_GetConfigGatewaySettingsConfigsConfigIdGetSecurityRequirement0 = + new global::AI21.EndPointSecurityRequirement + { + Authorizations = new global::AI21.EndPointAuthorizationRequirement[] + { new global::AI21.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::AI21.EndPointSecurityRequirement[] s_GetConfigGatewaySettingsConfigsConfigIdGetSecurityRequirements = + new global::AI21.EndPointSecurityRequirement[] + { s_GetConfigGatewaySettingsConfigsConfigIdGetSecurityRequirement0, + }; + partial void PrepareGetConfigGatewaySettingsConfigsConfigIdGetArguments( + global::System.Net.Http.HttpClient httpClient, + ref string configId); + partial void PrepareGetConfigGatewaySettingsConfigsConfigIdGetRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string configId); + partial void ProcessGetConfigGatewaySettingsConfigsConfigIdGetResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessGetConfigGatewaySettingsConfigsConfigIdGetResponseContent( + 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 GetConfigGatewaySettingsConfigsConfigIdGetAsync( + string configId, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await GetConfigGatewaySettingsConfigsConfigIdGetAsResponseAsync( + configId: configId, + 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> GetConfigGatewaySettingsConfigsConfigIdGetAsResponseAsync( + string configId, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareGetConfigGatewaySettingsConfigsConfigIdGetArguments( + httpClient: HttpClient, + configId: ref configId); + + + var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_GetConfigGatewaySettingsConfigsConfigIdGetSecurityRequirements, + operationName: "GetConfigGatewaySettingsConfigsConfigIdGetAsync"); + + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: $"/gateway/settings/configs/{configId}", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.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::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareGetConfigGatewaySettingsConfigsConfigIdGetRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + configId: configId!); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GetConfigGatewaySettingsConfigsConfigIdGet", + methodName: "GetConfigGatewaySettingsConfigsConfigIdGetAsync", + pathTemplate: "$\"/gateway/settings/configs/{configId}\"", + 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::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GetConfigGatewaySettingsConfigsConfigIdGet", + methodName: "GetConfigGatewaySettingsConfigsConfigIdGetAsync", + pathTemplate: "$\"/gateway/settings/configs/{configId}\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GetConfigGatewaySettingsConfigsConfigIdGet", + methodName: "GetConfigGatewaySettingsConfigsConfigIdGetAsync", + pathTemplate: "$\"/gateway/settings/configs/{configId}\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessGetConfigGatewaySettingsConfigsConfigIdGetResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GetConfigGatewaySettingsConfigsConfigIdGet", + methodName: "GetConfigGatewaySettingsConfigsConfigIdGetAsync", + pathTemplate: "$\"/gateway/settings/configs/{configId}\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GetConfigGatewaySettingsConfigsConfigIdGet", + methodName: "GetConfigGatewaySettingsConfigsConfigIdGetAsync", + pathTemplate: "$\"/gateway/settings/configs/{configId}\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: __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::AI21.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessGetConfigGatewaySettingsConfigsConfigIdGetResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::AI21.ConfigProfileOut.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => 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::AI21.ConfigProfileOut.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.GetConfigSchemaGatewaySettingsConfigsSchemaGet.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.GetConfigSchemaGatewaySettingsConfigsSchemaGet.g.cs new file mode 100644 index 00000000..6ec19b4b --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Ai21Client.GetConfigSchemaGatewaySettingsConfigsSchemaGet.g.cs @@ -0,0 +1,415 @@ + +#nullable enable + +namespace AI21 +{ + public partial class Ai21Client + { + + + private static readonly global::AI21.EndPointSecurityRequirement s_GetConfigSchemaGatewaySettingsConfigsSchemaGetSecurityRequirement0 = + new global::AI21.EndPointSecurityRequirement + { + Authorizations = new global::AI21.EndPointAuthorizationRequirement[] + { new global::AI21.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::AI21.EndPointSecurityRequirement[] s_GetConfigSchemaGatewaySettingsConfigsSchemaGetSecurityRequirements = + new global::AI21.EndPointSecurityRequirement[] + { s_GetConfigSchemaGatewaySettingsConfigsSchemaGetSecurityRequirement0, + }; + partial void PrepareGetConfigSchemaGatewaySettingsConfigsSchemaGetArguments( + global::System.Net.Http.HttpClient httpClient); + partial void PrepareGetConfigSchemaGatewaySettingsConfigsSchemaGetRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage); + partial void ProcessGetConfigSchemaGatewaySettingsConfigsSchemaGetResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessGetConfigSchemaGatewaySettingsConfigsSchemaGetResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Get Config 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 GetConfigSchemaGatewaySettingsConfigsSchemaGetAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await GetConfigSchemaGatewaySettingsConfigsSchemaGetAsResponseAsync( + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Get Config 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> GetConfigSchemaGatewaySettingsConfigsSchemaGetAsResponseAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareGetConfigSchemaGatewaySettingsConfigsSchemaGetArguments( + httpClient: HttpClient); + + + var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_GetConfigSchemaGatewaySettingsConfigsSchemaGetSecurityRequirements, + operationName: "GetConfigSchemaGatewaySettingsConfigsSchemaGetAsync"); + + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: "/gateway/settings/configs/schema", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.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::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareGetConfigSchemaGatewaySettingsConfigsSchemaGetRequest( + 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::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GetConfigSchemaGatewaySettingsConfigsSchemaGet", + methodName: "GetConfigSchemaGatewaySettingsConfigsSchemaGetAsync", + pathTemplate: "\"/gateway/settings/configs/schema\"", + 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::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GetConfigSchemaGatewaySettingsConfigsSchemaGet", + methodName: "GetConfigSchemaGatewaySettingsConfigsSchemaGetAsync", + pathTemplate: "\"/gateway/settings/configs/schema\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GetConfigSchemaGatewaySettingsConfigsSchemaGet", + methodName: "GetConfigSchemaGatewaySettingsConfigsSchemaGetAsync", + pathTemplate: "\"/gateway/settings/configs/schema\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessGetConfigSchemaGatewaySettingsConfigsSchemaGetResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GetConfigSchemaGatewaySettingsConfigsSchemaGet", + methodName: "GetConfigSchemaGatewaySettingsConfigsSchemaGetAsync", + pathTemplate: "\"/gateway/settings/configs/schema\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GetConfigSchemaGatewaySettingsConfigsSchemaGet", + methodName: "GetConfigSchemaGatewaySettingsConfigsSchemaGetAsync", + pathTemplate: "\"/gateway/settings/configs/schema\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: __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); + ProcessGetConfigSchemaGatewaySettingsConfigsSchemaGetResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::AI21.ConfigSchemaOut.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => 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::AI21.ConfigSchemaOut.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.GetConfigSchemaTokenwiseSettingsConfigsSchemaGet.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.GetConfigSchemaTokenwiseSettingsConfigsSchemaGet.g.cs new file mode 100644 index 00000000..bd7091d8 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Ai21Client.GetConfigSchemaTokenwiseSettingsConfigsSchemaGet.g.cs @@ -0,0 +1,415 @@ + +#nullable enable + +namespace AI21 +{ + public partial class Ai21Client + { + + + private static readonly global::AI21.EndPointSecurityRequirement s_GetConfigSchemaTokenwiseSettingsConfigsSchemaGetSecurityRequirement0 = + new global::AI21.EndPointSecurityRequirement + { + Authorizations = new global::AI21.EndPointAuthorizationRequirement[] + { new global::AI21.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::AI21.EndPointSecurityRequirement[] s_GetConfigSchemaTokenwiseSettingsConfigsSchemaGetSecurityRequirements = + new global::AI21.EndPointSecurityRequirement[] + { s_GetConfigSchemaTokenwiseSettingsConfigsSchemaGetSecurityRequirement0, + }; + partial void PrepareGetConfigSchemaTokenwiseSettingsConfigsSchemaGetArguments( + global::System.Net.Http.HttpClient httpClient); + partial void PrepareGetConfigSchemaTokenwiseSettingsConfigsSchemaGetRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage); + partial void ProcessGetConfigSchemaTokenwiseSettingsConfigsSchemaGetResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessGetConfigSchemaTokenwiseSettingsConfigsSchemaGetResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Get Config 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 GetConfigSchemaTokenwiseSettingsConfigsSchemaGetAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await GetConfigSchemaTokenwiseSettingsConfigsSchemaGetAsResponseAsync( + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Get Config 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> GetConfigSchemaTokenwiseSettingsConfigsSchemaGetAsResponseAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareGetConfigSchemaTokenwiseSettingsConfigsSchemaGetArguments( + httpClient: HttpClient); + + + var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_GetConfigSchemaTokenwiseSettingsConfigsSchemaGetSecurityRequirements, + operationName: "GetConfigSchemaTokenwiseSettingsConfigsSchemaGetAsync"); + + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: "/tokenwise/settings/configs/schema", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.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::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareGetConfigSchemaTokenwiseSettingsConfigsSchemaGetRequest( + 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::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GetConfigSchemaTokenwiseSettingsConfigsSchemaGet", + methodName: "GetConfigSchemaTokenwiseSettingsConfigsSchemaGetAsync", + pathTemplate: "\"/tokenwise/settings/configs/schema\"", + 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::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GetConfigSchemaTokenwiseSettingsConfigsSchemaGet", + methodName: "GetConfigSchemaTokenwiseSettingsConfigsSchemaGetAsync", + pathTemplate: "\"/tokenwise/settings/configs/schema\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GetConfigSchemaTokenwiseSettingsConfigsSchemaGet", + methodName: "GetConfigSchemaTokenwiseSettingsConfigsSchemaGetAsync", + pathTemplate: "\"/tokenwise/settings/configs/schema\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessGetConfigSchemaTokenwiseSettingsConfigsSchemaGetResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GetConfigSchemaTokenwiseSettingsConfigsSchemaGet", + methodName: "GetConfigSchemaTokenwiseSettingsConfigsSchemaGetAsync", + pathTemplate: "\"/tokenwise/settings/configs/schema\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GetConfigSchemaTokenwiseSettingsConfigsSchemaGet", + methodName: "GetConfigSchemaTokenwiseSettingsConfigsSchemaGetAsync", + pathTemplate: "\"/tokenwise/settings/configs/schema\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: __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); + ProcessGetConfigSchemaTokenwiseSettingsConfigsSchemaGetResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::AI21.ConfigSchemaOut.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => 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::AI21.ConfigSchemaOut.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.GetConfigTokenwiseSettingsConfigsConfigIdGet.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.GetConfigTokenwiseSettingsConfigsConfigIdGet.g.cs new file mode 100644 index 00000000..3715aeba --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Ai21Client.GetConfigTokenwiseSettingsConfigsConfigIdGet.g.cs @@ -0,0 +1,461 @@ + +#nullable enable + +namespace AI21 +{ + public partial class Ai21Client + { + + + private static readonly global::AI21.EndPointSecurityRequirement s_GetConfigTokenwiseSettingsConfigsConfigIdGetSecurityRequirement0 = + new global::AI21.EndPointSecurityRequirement + { + Authorizations = new global::AI21.EndPointAuthorizationRequirement[] + { new global::AI21.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::AI21.EndPointSecurityRequirement[] s_GetConfigTokenwiseSettingsConfigsConfigIdGetSecurityRequirements = + new global::AI21.EndPointSecurityRequirement[] + { s_GetConfigTokenwiseSettingsConfigsConfigIdGetSecurityRequirement0, + }; + partial void PrepareGetConfigTokenwiseSettingsConfigsConfigIdGetArguments( + global::System.Net.Http.HttpClient httpClient, + ref string configId); + partial void PrepareGetConfigTokenwiseSettingsConfigsConfigIdGetRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string configId); + partial void ProcessGetConfigTokenwiseSettingsConfigsConfigIdGetResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessGetConfigTokenwiseSettingsConfigsConfigIdGetResponseContent( + 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 GetConfigTokenwiseSettingsConfigsConfigIdGetAsync( + string configId, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await GetConfigTokenwiseSettingsConfigsConfigIdGetAsResponseAsync( + configId: configId, + 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> GetConfigTokenwiseSettingsConfigsConfigIdGetAsResponseAsync( + string configId, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareGetConfigTokenwiseSettingsConfigsConfigIdGetArguments( + httpClient: HttpClient, + configId: ref configId); + + + var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_GetConfigTokenwiseSettingsConfigsConfigIdGetSecurityRequirements, + operationName: "GetConfigTokenwiseSettingsConfigsConfigIdGetAsync"); + + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: $"/tokenwise/settings/configs/{configId}", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.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::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareGetConfigTokenwiseSettingsConfigsConfigIdGetRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + configId: configId!); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GetConfigTokenwiseSettingsConfigsConfigIdGet", + methodName: "GetConfigTokenwiseSettingsConfigsConfigIdGetAsync", + pathTemplate: "$\"/tokenwise/settings/configs/{configId}\"", + 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::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GetConfigTokenwiseSettingsConfigsConfigIdGet", + methodName: "GetConfigTokenwiseSettingsConfigsConfigIdGetAsync", + pathTemplate: "$\"/tokenwise/settings/configs/{configId}\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GetConfigTokenwiseSettingsConfigsConfigIdGet", + methodName: "GetConfigTokenwiseSettingsConfigsConfigIdGetAsync", + pathTemplate: "$\"/tokenwise/settings/configs/{configId}\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessGetConfigTokenwiseSettingsConfigsConfigIdGetResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GetConfigTokenwiseSettingsConfigsConfigIdGet", + methodName: "GetConfigTokenwiseSettingsConfigsConfigIdGetAsync", + pathTemplate: "$\"/tokenwise/settings/configs/{configId}\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GetConfigTokenwiseSettingsConfigsConfigIdGet", + methodName: "GetConfigTokenwiseSettingsConfigsConfigIdGetAsync", + pathTemplate: "$\"/tokenwise/settings/configs/{configId}\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: __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::AI21.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessGetConfigTokenwiseSettingsConfigsConfigIdGetResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::AI21.ConfigProfileOut.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => 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::AI21.ConfigProfileOut.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.GetConnectorConnectionStatusStudioV1ConnectorsConnectedUsersEntityIdDataSourcesDataSourceConnectionStatusGet.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.GetConnectorConnectionStatusStudioV1ConnectorsConnectedUsersEntityIdDataSourcesDataSourceConnectionStatusGet.g.cs deleted file mode 100644 index 3954d98b..00000000 --- a/src/libs/AI21/Generated/AI21.Ai21Client.GetConnectorConnectionStatusStudioV1ConnectorsConnectedUsersEntityIdDataSourcesDataSourceConnectionStatusGet.g.cs +++ /dev/null @@ -1,251 +0,0 @@ - -#nullable enable - -namespace AI21 -{ - public partial class Ai21Client - { - - - private static readonly global::AI21.EndPointSecurityRequirement s_GetConnectorConnectionStatusStudioV1ConnectorsConnectedUsersEntityIdDataSourcesDataSourceConnectionStatusGetSecurityRequirement0 = - new global::AI21.EndPointSecurityRequirement - { - Authorizations = new global::AI21.EndPointAuthorizationRequirement[] - { new global::AI21.EndPointAuthorizationRequirement - { - Type = "Http", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::AI21.EndPointSecurityRequirement[] s_GetConnectorConnectionStatusStudioV1ConnectorsConnectedUsersEntityIdDataSourcesDataSourceConnectionStatusGetSecurityRequirements = - new global::AI21.EndPointSecurityRequirement[] - { s_GetConnectorConnectionStatusStudioV1ConnectorsConnectedUsersEntityIdDataSourcesDataSourceConnectionStatusGetSecurityRequirement0, - }; - partial void PrepareGetConnectorConnectionStatusStudioV1ConnectorsConnectedUsersEntityIdDataSourcesDataSourceConnectionStatusGetArguments( - global::System.Net.Http.HttpClient httpClient, - ref string entityId, - ref string dataSource, - ref string paragonToken); - partial void PrepareGetConnectorConnectionStatusStudioV1ConnectorsConnectedUsersEntityIdDataSourcesDataSourceConnectionStatusGetRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - string entityId, - string dataSource, - string paragonToken); - partial void ProcessGetConnectorConnectionStatusStudioV1ConnectorsConnectedUsersEntityIdDataSourcesDataSourceConnectionStatusGetResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessGetConnectorConnectionStatusStudioV1ConnectorsConnectedUsersEntityIdDataSourcesDataSourceConnectionStatusGetResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Get Connector Connection Status - /// - /// - /// - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task GetConnectorConnectionStatusStudioV1ConnectorsConnectedUsersEntityIdDataSourcesDataSourceConnectionStatusGetAsync( - string entityId, - string dataSource, - string paragonToken, - global::System.Threading.CancellationToken cancellationToken = default) - { - PrepareArguments( - client: HttpClient); - PrepareGetConnectorConnectionStatusStudioV1ConnectorsConnectedUsersEntityIdDataSourcesDataSourceConnectionStatusGetArguments( - httpClient: HttpClient, - entityId: ref entityId, - dataSource: ref dataSource, - paragonToken: ref paragonToken); - - - var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_GetConnectorConnectionStatusStudioV1ConnectorsConnectedUsersEntityIdDataSourcesDataSourceConnectionStatusGetSecurityRequirements, - operationName: "GetConnectorConnectionStatusStudioV1ConnectorsConnectedUsersEntityIdDataSourcesDataSourceConnectionStatusGetAsync"); - - var __pathBuilder = new global::AI21.PathBuilder( - path: $"/studio/v1/connectors/connected-users/{entityId}/data-sources/{dataSource}/connection-status", - baseUri: HttpClient.BaseAddress); - __pathBuilder - .AddRequiredParameter("paragon_token", paragonToken) - ; - 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); - PrepareGetConnectorConnectionStatusStudioV1ConnectorsConnectedUsersEntityIdDataSourcesDataSourceConnectionStatusGetRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - entityId: entityId, - dataSource: dataSource, - paragonToken: paragonToken); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessGetConnectorConnectionStatusStudioV1ConnectorsConnectedUsersEntityIdDataSourcesDataSourceConnectionStatusGetResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Validation Error - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::AI21.HTTPValidationError? __value_422 = null; - try - { - if (ReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - throw new global::AI21.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) - { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessGetConnectorConnectionStatusStudioV1ConnectorsConnectedUsersEntityIdDataSourcesDataSourceConnectionStatusGetResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return - global::AI21.ConnectorConnectionStatus.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - } - catch (global::System.Exception __ex) - { - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __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::AI21.ConnectorConnectionStatus.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::AI21.ApiException( - message: __content ?? __response.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/AI21/Generated/AI21.Ai21Client.GetDataSourceStatusStudioV1ConnectorsConnectedUsersEntityIdDataSourcesDataSourceStatusGet.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.GetDataSourceStatusStudioV1ConnectorsConnectedUsersEntityIdDataSourcesDataSourceStatusGet.g.cs deleted file mode 100644 index 27b7a7b8..00000000 --- a/src/libs/AI21/Generated/AI21.Ai21Client.GetDataSourceStatusStudioV1ConnectorsConnectedUsersEntityIdDataSourcesDataSourceStatusGet.g.cs +++ /dev/null @@ -1,251 +0,0 @@ - -#nullable enable - -namespace AI21 -{ - public partial class Ai21Client - { - - - private static readonly global::AI21.EndPointSecurityRequirement s_GetDataSourceStatusStudioV1ConnectorsConnectedUsersEntityIdDataSourcesDataSourceStatusGetSecurityRequirement0 = - new global::AI21.EndPointSecurityRequirement - { - Authorizations = new global::AI21.EndPointAuthorizationRequirement[] - { new global::AI21.EndPointAuthorizationRequirement - { - Type = "Http", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::AI21.EndPointSecurityRequirement[] s_GetDataSourceStatusStudioV1ConnectorsConnectedUsersEntityIdDataSourcesDataSourceStatusGetSecurityRequirements = - new global::AI21.EndPointSecurityRequirement[] - { s_GetDataSourceStatusStudioV1ConnectorsConnectedUsersEntityIdDataSourcesDataSourceStatusGetSecurityRequirement0, - }; - partial void PrepareGetDataSourceStatusStudioV1ConnectorsConnectedUsersEntityIdDataSourcesDataSourceStatusGetArguments( - global::System.Net.Http.HttpClient httpClient, - ref string entityId, - ref string dataSource, - ref string paragonToken); - partial void PrepareGetDataSourceStatusStudioV1ConnectorsConnectedUsersEntityIdDataSourcesDataSourceStatusGetRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - string entityId, - string dataSource, - string paragonToken); - partial void ProcessGetDataSourceStatusStudioV1ConnectorsConnectedUsersEntityIdDataSourcesDataSourceStatusGetResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessGetDataSourceStatusStudioV1ConnectorsConnectedUsersEntityIdDataSourcesDataSourceStatusGetResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Get Data Source Status - /// - /// - /// - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task GetDataSourceStatusStudioV1ConnectorsConnectedUsersEntityIdDataSourcesDataSourceStatusGetAsync( - string entityId, - string dataSource, - string paragonToken, - global::System.Threading.CancellationToken cancellationToken = default) - { - PrepareArguments( - client: HttpClient); - PrepareGetDataSourceStatusStudioV1ConnectorsConnectedUsersEntityIdDataSourcesDataSourceStatusGetArguments( - httpClient: HttpClient, - entityId: ref entityId, - dataSource: ref dataSource, - paragonToken: ref paragonToken); - - - var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_GetDataSourceStatusStudioV1ConnectorsConnectedUsersEntityIdDataSourcesDataSourceStatusGetSecurityRequirements, - operationName: "GetDataSourceStatusStudioV1ConnectorsConnectedUsersEntityIdDataSourcesDataSourceStatusGetAsync"); - - var __pathBuilder = new global::AI21.PathBuilder( - path: $"/studio/v1/connectors/connected-users/{entityId}/data-sources/{dataSource}/status", - baseUri: HttpClient.BaseAddress); - __pathBuilder - .AddRequiredParameter("paragon_token", paragonToken) - ; - 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); - PrepareGetDataSourceStatusStudioV1ConnectorsConnectedUsersEntityIdDataSourcesDataSourceStatusGetRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - entityId: entityId, - dataSource: dataSource, - paragonToken: paragonToken); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessGetDataSourceStatusStudioV1ConnectorsConnectedUsersEntityIdDataSourcesDataSourceStatusGetResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Validation Error - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::AI21.HTTPValidationError? __value_422 = null; - try - { - if (ReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - throw new global::AI21.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) - { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessGetDataSourceStatusStudioV1ConnectorsConnectedUsersEntityIdDataSourcesDataSourceStatusGetResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return - global::AI21.ConnectorsStatus.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - } - catch (global::System.Exception __ex) - { - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __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::AI21.ConnectorsStatus.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::AI21.ApiException( - message: __content ?? __response.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/AI21/Generated/AI21.Ai21Client.GetDemoStudioV1DemosDemoIdGet.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.GetDemoStudioV1DemosDemoIdGet.g.cs index bfb8180d..72d7693c 100644 --- a/src/libs/AI21/Generated/AI21.Ai21Client.GetDemoStudioV1DemosDemoIdGet.g.cs +++ b/src/libs/AI21/Generated/AI21.Ai21Client.GetDemoStudioV1DemosDemoIdGet.g.cs @@ -14,6 +14,7 @@ public partial class Ai21Client { new global::AI21.EndPointAuthorizationRequirement { Type = "Http", + SchemeId = "HttpBearer", Location = "Header", Name = "Bearer", FriendlyName = "Bearer", @@ -45,10 +46,33 @@ partial void ProcessGetDemoStudioV1DemosDemoIdGetResponseContent( /// Get a specific demo by 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 GetDemoStudioV1DemosDemoIdGetAsync( string demoId, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await GetDemoStudioV1DemosDemoIdGetAsResponseAsync( + demoId: demoId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Get Demo
+ /// Get a specific demo by 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> GetDemoStudioV1DemosDemoIdGetAsResponseAsync( + string demoId, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( @@ -63,22 +87,44 @@ partial void ProcessGetDemoStudioV1DemosDemoIdGetResponseContent( securityRequirements: s_GetDemoStudioV1DemosDemoIdGetSecurityRequirements, operationName: "GetDemoStudioV1DemosDemoIdGetAsync"); - var __pathBuilder = new global::AI21.PathBuilder( - path: $"/studio/v1/demos/{demoId}", - 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)); + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: $"/studio/v1/demos/{demoId}", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.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; + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; #endif foreach (var __authorization in __authorizations) { if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2") + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") { __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( scheme: __authorization.Name, @@ -88,150 +134,330 @@ partial void ProcessGetDemoStudioV1DemosDemoIdGetResponseContent( __authorization.Location == "Header") { __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } + } } + global::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareGetDemoStudioV1DemosDemoIdGetRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - demoId: demoId); + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareGetDemoStudioV1DemosDemoIdGetRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + demoId: demoId!); - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); + return __httpRequest; + } - ProcessResponse( - client: HttpClient, - response: __response); - ProcessGetDemoStudioV1DemosDemoIdGetResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Validation Error - if ((int)__response.StatusCode == 422) + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::AI21.HTTPValidationError? __value_422 = null; - try + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) { - if (ReadResponseAsString) + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GetDemoStudioV1DemosDemoIdGet", + methodName: "GetDemoStudioV1DemosDemoIdGetAsync", + pathTemplate: "$\"/studio/v1/demos/{demoId}\"", + 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 { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); } - else + catch (global::System.Net.Http.HttpRequestException __exception) { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GetDemoStudioV1DemosDemoIdGet", + methodName: "GetDemoStudioV1DemosDemoIdGetAsync", + pathTemplate: "$\"/studio/v1/demos/{demoId}\"", + 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; + } - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GetDemoStudioV1DemosDemoIdGet", + methodName: "GetDemoStudioV1DemosDemoIdGetAsync", + pathTemplate: "$\"/studio/v1/demos/{demoId}\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; } - catch (global::System.Exception __ex) + + if (__response == null) { - __exception_422 = __ex; + throw new global::System.InvalidOperationException("No response received."); } - throw new global::AI21.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) + using (__response) { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - ProcessResponseContent( + ProcessResponse( client: HttpClient, - response: __response, - content: ref __content); - ProcessGetDemoStudioV1DemosDemoIdGetResponseContent( + response: __response); + ProcessGetDemoStudioV1DemosDemoIdGetResponse( httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) { - __response.EnsureSuccessStatusCode(); - - return - global::AI21.Demo.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GetDemoStudioV1DemosDemoIdGet", + methodName: "GetDemoStudioV1DemosDemoIdGetAsync", + pathTemplate: "$\"/studio/v1/demos/{demoId}\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } - catch (global::System.Exception __ex) + else { - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GetDemoStudioV1DemosDemoIdGet", + methodName: "GetDemoStudioV1DemosDemoIdGetAsync", + pathTemplate: "$\"/studio/v1/demos/{demoId}\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - using var __content = await __response.Content.ReadAsStreamAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::AI21.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - return - await global::AI21.Demo.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) - { - } + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessGetDemoStudioV1DemosDemoIdGetResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::AI21.Demo.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => 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::AI21.Demo.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; } } + finally + { + __httpRequest?.Dispose(); + } } } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.GetFileUrlStudioV1DemosScraperFileUrlFileIdGet.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.GetFileUrlStudioV1DemosScraperFileUrlFileIdGet.g.cs index b33bd6a0..7a6ca36e 100644 --- a/src/libs/AI21/Generated/AI21.Ai21Client.GetFileUrlStudioV1DemosScraperFileUrlFileIdGet.g.cs +++ b/src/libs/AI21/Generated/AI21.Ai21Client.GetFileUrlStudioV1DemosScraperFileUrlFileIdGet.g.cs @@ -14,6 +14,7 @@ public partial class Ai21Client { new global::AI21.EndPointAuthorizationRequirement { Type = "Http", + SchemeId = "HttpBearer", Location = "Header", Name = "Bearer", FriendlyName = "Bearer", @@ -47,11 +48,36 @@ partial void ProcessGetFileUrlStudioV1DemosScraperFileUrlFileIdGetResponseConten /// /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// public async global::System.Threading.Tasks.Task GetFileUrlStudioV1DemosScraperFileUrlFileIdGetAsync( string fileId, string? apiKey = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await GetFileUrlStudioV1DemosScraperFileUrlFileIdGetAsResponseAsync( + fileId: fileId, + apiKey: apiKey, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Get File Url + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> GetFileUrlStudioV1DemosScraperFileUrlFileIdGetAsResponseAsync( + string fileId, + string? apiKey = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( @@ -67,25 +93,47 @@ partial void ProcessGetFileUrlStudioV1DemosScraperFileUrlFileIdGetResponseConten securityRequirements: s_GetFileUrlStudioV1DemosScraperFileUrlFileIdGetSecurityRequirements, operationName: "GetFileUrlStudioV1DemosScraperFileUrlFileIdGetAsync"); - var __pathBuilder = new global::AI21.PathBuilder( - path: $"/studio/v1/demos/scraper/file-url/{fileId}", - baseUri: HttpClient.BaseAddress); - __pathBuilder - .AddOptionalParameter("api_key", apiKey) - ; - 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)); + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: $"/studio/v1/demos/scraper/file-url/{fileId}", + baseUri: HttpClient.BaseAddress); + __pathBuilder + .AddOptionalParameter("api_key", apiKey) + ; + var __path = __pathBuilder.ToString(); + __path = global::AI21.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; + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; #endif foreach (var __authorization in __authorizations) { if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2") + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") { __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( scheme: __authorization.Name, @@ -95,147 +143,327 @@ partial void ProcessGetFileUrlStudioV1DemosScraperFileUrlFileIdGetResponseConten __authorization.Location == "Header") { __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } + } } + global::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareGetFileUrlStudioV1DemosScraperFileUrlFileIdGetRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - fileId: fileId, - apiKey: apiKey); + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareGetFileUrlStudioV1DemosScraperFileUrlFileIdGetRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + fileId: fileId!, + apiKey: apiKey); - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); + return __httpRequest; + } - ProcessResponse( - client: HttpClient, - response: __response); - ProcessGetFileUrlStudioV1DemosScraperFileUrlFileIdGetResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Validation Error - if ((int)__response.StatusCode == 422) + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::AI21.HTTPValidationError? __value_422 = null; - try + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) { - if (ReadResponseAsString) + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GetFileUrlStudioV1DemosScraperFileUrlFileIdGet", + methodName: "GetFileUrlStudioV1DemosScraperFileUrlFileIdGetAsync", + pathTemplate: "$\"/studio/v1/demos/scraper/file-url/{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 { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); } - else + catch (global::System.Net.Http.HttpRequestException __exception) { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GetFileUrlStudioV1DemosScraperFileUrlFileIdGet", + methodName: "GetFileUrlStudioV1DemosScraperFileUrlFileIdGetAsync", + pathTemplate: "$\"/studio/v1/demos/scraper/file-url/{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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GetFileUrlStudioV1DemosScraperFileUrlFileIdGet", + methodName: "GetFileUrlStudioV1DemosScraperFileUrlFileIdGetAsync", + pathTemplate: "$\"/studio/v1/demos/scraper/file-url/{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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; } + + break; } - catch (global::System.Exception __ex) + + if (__response == null) { - __exception_422 = __ex; + throw new global::System.InvalidOperationException("No response received."); } - throw new global::AI21.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) + using (__response) { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - ProcessResponseContent( + ProcessResponse( client: HttpClient, - response: __response, - content: ref __content); - ProcessGetFileUrlStudioV1DemosScraperFileUrlFileIdGetResponseContent( + response: __response); + ProcessGetFileUrlStudioV1DemosScraperFileUrlFileIdGetResponse( httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) { - __response.EnsureSuccessStatusCode(); - - return __content; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GetFileUrlStudioV1DemosScraperFileUrlFileIdGet", + methodName: "GetFileUrlStudioV1DemosScraperFileUrlFileIdGetAsync", + pathTemplate: "$\"/studio/v1/demos/scraper/file-url/{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); } - catch (global::System.Exception __ex) + else { - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GetFileUrlStudioV1DemosScraperFileUrlFileIdGet", + methodName: "GetFileUrlStudioV1DemosScraperFileUrlFileIdGetAsync", + pathTemplate: "$\"/studio/v1/demos/scraper/file-url/{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 - { - try - { - __response.EnsureSuccessStatusCode(); - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::AI21.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).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) - { - } + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessGetFileUrlStudioV1DemosScraperFileUrlFileIdGetResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? 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::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.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::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; } } + finally + { + __httpRequest?.Dispose(); + } } } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.GetMcpStorageStudioV1McpStorageMcpIdGet.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.GetMcpStorageStudioV1McpStorageMcpIdGet.g.cs index b12b2046..2d25a5ed 100644 --- a/src/libs/AI21/Generated/AI21.Ai21Client.GetMcpStorageStudioV1McpStorageMcpIdGet.g.cs +++ b/src/libs/AI21/Generated/AI21.Ai21Client.GetMcpStorageStudioV1McpStorageMcpIdGet.g.cs @@ -14,6 +14,7 @@ public partial class Ai21Client { new global::AI21.EndPointAuthorizationRequirement { Type = "Http", + SchemeId = "HttpBearer", Location = "Header", Name = "Bearer", FriendlyName = "Bearer", @@ -44,10 +45,32 @@ partial void ProcessGetMcpStorageStudioV1McpStorageMcpIdGetResponseContent( /// Get Mcp Storage /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// public async global::System.Threading.Tasks.Task GetMcpStorageStudioV1McpStorageMcpIdGetAsync( string mcpId, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await GetMcpStorageStudioV1McpStorageMcpIdGetAsResponseAsync( + mcpId: mcpId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Get Mcp Storage + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> GetMcpStorageStudioV1McpStorageMcpIdGetAsResponseAsync( + string mcpId, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( @@ -62,22 +85,44 @@ partial void ProcessGetMcpStorageStudioV1McpStorageMcpIdGetResponseContent( securityRequirements: s_GetMcpStorageStudioV1McpStorageMcpIdGetSecurityRequirements, operationName: "GetMcpStorageStudioV1McpStorageMcpIdGetAsync"); - var __pathBuilder = new global::AI21.PathBuilder( - path: $"/studio/v1/mcp/storage/{mcpId}", - 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)); + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: $"/studio/v1/mcp/storage/{mcpId}", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.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; + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; #endif foreach (var __authorization in __authorizations) { if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2") + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") { __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( scheme: __authorization.Name, @@ -87,150 +132,330 @@ partial void ProcessGetMcpStorageStudioV1McpStorageMcpIdGetResponseContent( __authorization.Location == "Header") { __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } + } } + global::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareGetMcpStorageStudioV1McpStorageMcpIdGetRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - mcpId: mcpId); + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareGetMcpStorageStudioV1McpStorageMcpIdGetRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + mcpId: mcpId!); - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); + return __httpRequest; + } - ProcessResponse( - client: HttpClient, - response: __response); - ProcessGetMcpStorageStudioV1McpStorageMcpIdGetResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Validation Error - if ((int)__response.StatusCode == 422) + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::AI21.HTTPValidationError? __value_422 = null; - try + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) { - if (ReadResponseAsString) + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GetMcpStorageStudioV1McpStorageMcpIdGet", + methodName: "GetMcpStorageStudioV1McpStorageMcpIdGetAsync", + pathTemplate: "$\"/studio/v1/mcp/storage/{mcpId}\"", + 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 { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); } - else + catch (global::System.Net.Http.HttpRequestException __exception) { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GetMcpStorageStudioV1McpStorageMcpIdGet", + methodName: "GetMcpStorageStudioV1McpStorageMcpIdGetAsync", + pathTemplate: "$\"/studio/v1/mcp/storage/{mcpId}\"", + 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; + } - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GetMcpStorageStudioV1McpStorageMcpIdGet", + methodName: "GetMcpStorageStudioV1McpStorageMcpIdGetAsync", + pathTemplate: "$\"/studio/v1/mcp/storage/{mcpId}\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; } - catch (global::System.Exception __ex) + + if (__response == null) { - __exception_422 = __ex; + throw new global::System.InvalidOperationException("No response received."); } - throw new global::AI21.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) + using (__response) { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - ProcessResponseContent( + ProcessResponse( client: HttpClient, - response: __response, - content: ref __content); - ProcessGetMcpStorageStudioV1McpStorageMcpIdGetResponseContent( + response: __response); + ProcessGetMcpStorageStudioV1McpStorageMcpIdGetResponse( httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) { - __response.EnsureSuccessStatusCode(); - - return - global::AI21.MCPStorageResponse.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GetMcpStorageStudioV1McpStorageMcpIdGet", + methodName: "GetMcpStorageStudioV1McpStorageMcpIdGetAsync", + pathTemplate: "$\"/studio/v1/mcp/storage/{mcpId}\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } - catch (global::System.Exception __ex) + else { - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GetMcpStorageStudioV1McpStorageMcpIdGet", + methodName: "GetMcpStorageStudioV1McpStorageMcpIdGetAsync", + pathTemplate: "$\"/studio/v1/mcp/storage/{mcpId}\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - using var __content = await __response.Content.ReadAsStreamAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::AI21.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - return - await global::AI21.MCPStorageResponse.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) - { - } + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessGetMcpStorageStudioV1McpStorageMcpIdGetResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::AI21.MCPStorageResponse.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => 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::AI21.MCPStorageResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; } } + finally + { + __httpRequest?.Dispose(); + } } } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.GetOrgDataSourcesInfoStudioV1ConnectorsConnectedUsersEntityIdDataSourcesGet.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.GetOrgDataSourcesInfoStudioV1ConnectorsConnectedUsersEntityIdDataSourcesGet.g.cs deleted file mode 100644 index 46b2c91c..00000000 --- a/src/libs/AI21/Generated/AI21.Ai21Client.GetOrgDataSourcesInfoStudioV1ConnectorsConnectedUsersEntityIdDataSourcesGet.g.cs +++ /dev/null @@ -1,236 +0,0 @@ - -#nullable enable - -namespace AI21 -{ - public partial class Ai21Client - { - - - private static readonly global::AI21.EndPointSecurityRequirement s_GetOrgDataSourcesInfoStudioV1ConnectorsConnectedUsersEntityIdDataSourcesGetSecurityRequirement0 = - new global::AI21.EndPointSecurityRequirement - { - Authorizations = new global::AI21.EndPointAuthorizationRequirement[] - { new global::AI21.EndPointAuthorizationRequirement - { - Type = "Http", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::AI21.EndPointSecurityRequirement[] s_GetOrgDataSourcesInfoStudioV1ConnectorsConnectedUsersEntityIdDataSourcesGetSecurityRequirements = - new global::AI21.EndPointSecurityRequirement[] - { s_GetOrgDataSourcesInfoStudioV1ConnectorsConnectedUsersEntityIdDataSourcesGetSecurityRequirement0, - }; - partial void PrepareGetOrgDataSourcesInfoStudioV1ConnectorsConnectedUsersEntityIdDataSourcesGetArguments( - global::System.Net.Http.HttpClient httpClient, - ref string entityId); - partial void PrepareGetOrgDataSourcesInfoStudioV1ConnectorsConnectedUsersEntityIdDataSourcesGetRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - string entityId); - partial void ProcessGetOrgDataSourcesInfoStudioV1ConnectorsConnectedUsersEntityIdDataSourcesGetResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessGetOrgDataSourcesInfoStudioV1ConnectorsConnectedUsersEntityIdDataSourcesGetResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Get Org Data Sources Info - /// - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task GetOrgDataSourcesInfoStudioV1ConnectorsConnectedUsersEntityIdDataSourcesGetAsync( - string entityId, - global::System.Threading.CancellationToken cancellationToken = default) - { - PrepareArguments( - client: HttpClient); - PrepareGetOrgDataSourcesInfoStudioV1ConnectorsConnectedUsersEntityIdDataSourcesGetArguments( - httpClient: HttpClient, - entityId: ref entityId); - - - var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_GetOrgDataSourcesInfoStudioV1ConnectorsConnectedUsersEntityIdDataSourcesGetSecurityRequirements, - operationName: "GetOrgDataSourcesInfoStudioV1ConnectorsConnectedUsersEntityIdDataSourcesGetAsync"); - - var __pathBuilder = new global::AI21.PathBuilder( - path: $"/studio/v1/connectors/connected-users/{entityId}/data-sources", - 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); - PrepareGetOrgDataSourcesInfoStudioV1ConnectorsConnectedUsersEntityIdDataSourcesGetRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - entityId: entityId); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessGetOrgDataSourcesInfoStudioV1ConnectorsConnectedUsersEntityIdDataSourcesGetResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Validation Error - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::AI21.HTTPValidationError? __value_422 = null; - try - { - if (ReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - throw new global::AI21.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) - { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessGetOrgDataSourcesInfoStudioV1ConnectorsConnectedUsersEntityIdDataSourcesGetResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return - global::AI21.ConnectorsDataSources.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - } - catch (global::System.Exception __ex) - { - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __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::AI21.ConnectorsDataSources.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::AI21.ApiException( - message: __content ?? __response.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/AI21/Generated/AI21.Ai21Client.GetOrganizationSchemasStudioV1StructuredRagOrganizationsOrganizationIdSchemasGet.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.GetOrganizationSchemasStudioV1StructuredRagOrganizationsOrganizationIdSchemasGet.g.cs index db3a80ba..4a6b3ddc 100644 --- a/src/libs/AI21/Generated/AI21.Ai21Client.GetOrganizationSchemasStudioV1StructuredRagOrganizationsOrganizationIdSchemasGet.g.cs +++ b/src/libs/AI21/Generated/AI21.Ai21Client.GetOrganizationSchemasStudioV1StructuredRagOrganizationsOrganizationIdSchemasGet.g.cs @@ -14,6 +14,7 @@ public partial class Ai21Client { new global::AI21.EndPointAuthorizationRequirement { Type = "Http", + SchemeId = "HttpBearer", Location = "Header", Name = "Bearer", FriendlyName = "Bearer", @@ -44,10 +45,32 @@ partial void ProcessGetOrganizationSchemasStudioV1StructuredRagOrganizationsOrga /// Get Organization Schemas /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// public async global::System.Threading.Tasks.Task GetOrganizationSchemasStudioV1StructuredRagOrganizationsOrganizationIdSchemasGetAsync( string organizationId, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await GetOrganizationSchemasStudioV1StructuredRagOrganizationsOrganizationIdSchemasGetAsResponseAsync( + organizationId: organizationId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Get Organization Schemas + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> GetOrganizationSchemasStudioV1StructuredRagOrganizationsOrganizationIdSchemasGetAsResponseAsync( + string organizationId, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( @@ -62,22 +85,44 @@ partial void ProcessGetOrganizationSchemasStudioV1StructuredRagOrganizationsOrga securityRequirements: s_GetOrganizationSchemasStudioV1StructuredRagOrganizationsOrganizationIdSchemasGetSecurityRequirements, operationName: "GetOrganizationSchemasStudioV1StructuredRagOrganizationsOrganizationIdSchemasGetAsync"); - var __pathBuilder = new global::AI21.PathBuilder( - path: $"/studio/v1/structured-rag/organizations/{organizationId}/schemas", - 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)); + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: $"/studio/v1/structured-rag/organizations/{organizationId}/schemas", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.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; + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; #endif foreach (var __authorization in __authorizations) { if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2") + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") { __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( scheme: __authorization.Name, @@ -87,150 +132,330 @@ partial void ProcessGetOrganizationSchemasStudioV1StructuredRagOrganizationsOrga __authorization.Location == "Header") { __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } + } } + global::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareGetOrganizationSchemasStudioV1StructuredRagOrganizationsOrganizationIdSchemasGetRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - organizationId: organizationId); + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareGetOrganizationSchemasStudioV1StructuredRagOrganizationsOrganizationIdSchemasGetRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + organizationId: organizationId!); - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); + return __httpRequest; + } - ProcessResponse( - client: HttpClient, - response: __response); - ProcessGetOrganizationSchemasStudioV1StructuredRagOrganizationsOrganizationIdSchemasGetResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Validation Error - if ((int)__response.StatusCode == 422) + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::AI21.HTTPValidationError? __value_422 = null; - try + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) { - if (ReadResponseAsString) + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GetOrganizationSchemasStudioV1StructuredRagOrganizationsOrganizationIdSchemasGet", + methodName: "GetOrganizationSchemasStudioV1StructuredRagOrganizationsOrganizationIdSchemasGetAsync", + pathTemplate: "$\"/studio/v1/structured-rag/organizations/{organizationId}/schemas\"", + 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 { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); } - else + catch (global::System.Net.Http.HttpRequestException __exception) { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GetOrganizationSchemasStudioV1StructuredRagOrganizationsOrganizationIdSchemasGet", + methodName: "GetOrganizationSchemasStudioV1StructuredRagOrganizationsOrganizationIdSchemasGetAsync", + pathTemplate: "$\"/studio/v1/structured-rag/organizations/{organizationId}/schemas\"", + 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; + } - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GetOrganizationSchemasStudioV1StructuredRagOrganizationsOrganizationIdSchemasGet", + methodName: "GetOrganizationSchemasStudioV1StructuredRagOrganizationsOrganizationIdSchemasGetAsync", + pathTemplate: "$\"/studio/v1/structured-rag/organizations/{organizationId}/schemas\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; } - catch (global::System.Exception __ex) + + if (__response == null) { - __exception_422 = __ex; + throw new global::System.InvalidOperationException("No response received."); } - throw new global::AI21.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) + using (__response) { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - ProcessResponseContent( + ProcessResponse( client: HttpClient, - response: __response, - content: ref __content); - ProcessGetOrganizationSchemasStudioV1StructuredRagOrganizationsOrganizationIdSchemasGetResponseContent( + response: __response); + ProcessGetOrganizationSchemasStudioV1StructuredRagOrganizationsOrganizationIdSchemasGetResponse( httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) { - __response.EnsureSuccessStatusCode(); - - return - global::AI21.OrgSchemas.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GetOrganizationSchemasStudioV1StructuredRagOrganizationsOrganizationIdSchemasGet", + methodName: "GetOrganizationSchemasStudioV1StructuredRagOrganizationsOrganizationIdSchemasGetAsync", + pathTemplate: "$\"/studio/v1/structured-rag/organizations/{organizationId}/schemas\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } - catch (global::System.Exception __ex) + else { - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GetOrganizationSchemasStudioV1StructuredRagOrganizationsOrganizationIdSchemasGet", + methodName: "GetOrganizationSchemasStudioV1StructuredRagOrganizationsOrganizationIdSchemasGetAsync", + pathTemplate: "$\"/studio/v1/structured-rag/organizations/{organizationId}/schemas\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - using var __content = await __response.Content.ReadAsStreamAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::AI21.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - return - await global::AI21.OrgSchemas.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) - { - } + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessGetOrganizationSchemasStudioV1StructuredRagOrganizationsOrganizationIdSchemasGetResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::AI21.OrgSchemas.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => 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::AI21.OrgSchemas.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; } } + finally + { + __httpRequest?.Dispose(); + } } } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.GetOutputExplanationStudioV1ExecutionsExecutionIdExplanationsOutputGet.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.GetOutputExplanationStudioV1ExecutionsExecutionIdExplanationsOutputGet.g.cs deleted file mode 100644 index 9ef705e0..00000000 --- a/src/libs/AI21/Generated/AI21.Ai21Client.GetOutputExplanationStudioV1ExecutionsExecutionIdExplanationsOutputGet.g.cs +++ /dev/null @@ -1,245 +0,0 @@ - -#nullable enable - -namespace AI21 -{ - public partial class Ai21Client - { - - - private static readonly global::AI21.EndPointSecurityRequirement s_GetOutputExplanationStudioV1ExecutionsExecutionIdExplanationsOutputGetSecurityRequirement0 = - new global::AI21.EndPointSecurityRequirement - { - Authorizations = new global::AI21.EndPointAuthorizationRequirement[] - { new global::AI21.EndPointAuthorizationRequirement - { - Type = "Http", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::AI21.EndPointSecurityRequirement[] s_GetOutputExplanationStudioV1ExecutionsExecutionIdExplanationsOutputGetSecurityRequirements = - new global::AI21.EndPointSecurityRequirement[] - { s_GetOutputExplanationStudioV1ExecutionsExecutionIdExplanationsOutputGetSecurityRequirement0, - }; - partial void PrepareGetOutputExplanationStudioV1ExecutionsExecutionIdExplanationsOutputGetArguments( - global::System.Net.Http.HttpClient httpClient, - ref string executionId, - ref bool? forceRegenerate); - partial void PrepareGetOutputExplanationStudioV1ExecutionsExecutionIdExplanationsOutputGetRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - string executionId, - bool? forceRegenerate); - partial void ProcessGetOutputExplanationStudioV1ExecutionsExecutionIdExplanationsOutputGetResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessGetOutputExplanationStudioV1ExecutionsExecutionIdExplanationsOutputGetResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Get Output Explanation
- /// Get output explanation for an execution (cached or generated).
- /// Set force_regenerate=True to regenerate even if cached. - ///
- /// - /// - /// Default Value: false - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task GetOutputExplanationStudioV1ExecutionsExecutionIdExplanationsOutputGetAsync( - string executionId, - bool? forceRegenerate = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - PrepareArguments( - client: HttpClient); - PrepareGetOutputExplanationStudioV1ExecutionsExecutionIdExplanationsOutputGetArguments( - httpClient: HttpClient, - executionId: ref executionId, - forceRegenerate: ref forceRegenerate); - - - var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_GetOutputExplanationStudioV1ExecutionsExecutionIdExplanationsOutputGetSecurityRequirements, - operationName: "GetOutputExplanationStudioV1ExecutionsExecutionIdExplanationsOutputGetAsync"); - - var __pathBuilder = new global::AI21.PathBuilder( - path: $"/studio/v1/executions/{executionId}/explanations/output", - baseUri: HttpClient.BaseAddress); - __pathBuilder - .AddOptionalParameter("force_regenerate", forceRegenerate?.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); - PrepareGetOutputExplanationStudioV1ExecutionsExecutionIdExplanationsOutputGetRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - executionId: executionId, - forceRegenerate: forceRegenerate); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessGetOutputExplanationStudioV1ExecutionsExecutionIdExplanationsOutputGetResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Validation Error - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::AI21.HTTPValidationError? __value_422 = null; - try - { - if (ReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - throw new global::AI21.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) - { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessGetOutputExplanationStudioV1ExecutionsExecutionIdExplanationsOutputGetResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return __content; - } - catch (global::System.Exception __ex) - { - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __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::AI21.ApiException( - message: __content ?? __response.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/AI21/Generated/AI21.Ai21Client.GetParsedFileStudioV1DemosDocumentModifierGetParsedFileGet.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.GetParsedFileStudioV1DemosDocumentModifierGetParsedFileGet.g.cs index b48ae78b..da0fa4df 100644 --- a/src/libs/AI21/Generated/AI21.Ai21Client.GetParsedFileStudioV1DemosDocumentModifierGetParsedFileGet.g.cs +++ b/src/libs/AI21/Generated/AI21.Ai21Client.GetParsedFileStudioV1DemosDocumentModifierGetParsedFileGet.g.cs @@ -14,6 +14,7 @@ public partial class Ai21Client { new global::AI21.EndPointAuthorizationRequirement { Type = "Http", + SchemeId = "HttpBearer", Location = "Header", Name = "Bearer", FriendlyName = "Bearer", @@ -45,10 +46,33 @@ partial void ProcessGetParsedFileStudioV1DemosDocumentModifierGetParsedFileGetRe /// Get the parsed file from the document modifier. /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// public async global::System.Threading.Tasks.Task GetParsedFileStudioV1DemosDocumentModifierGetParsedFileGetAsync( string fileName, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await GetParsedFileStudioV1DemosDocumentModifierGetParsedFileGetAsResponseAsync( + fileName: fileName, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Get Parsed File
+ /// Get the parsed file from the document modifier. + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> GetParsedFileStudioV1DemosDocumentModifierGetParsedFileGetAsResponseAsync( + string fileName, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( @@ -63,25 +87,47 @@ partial void ProcessGetParsedFileStudioV1DemosDocumentModifierGetParsedFileGetRe securityRequirements: s_GetParsedFileStudioV1DemosDocumentModifierGetParsedFileGetSecurityRequirements, operationName: "GetParsedFileStudioV1DemosDocumentModifierGetParsedFileGetAsync"); - var __pathBuilder = new global::AI21.PathBuilder( - path: "/studio/v1/demos/document-modifier/get-parsed-file", - baseUri: HttpClient.BaseAddress); - __pathBuilder - .AddRequiredParameter("file_name", fileName) - ; - 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)); + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: "/studio/v1/demos/document-modifier/get-parsed-file", + baseUri: HttpClient.BaseAddress); + __pathBuilder + .AddRequiredParameter("file_name", fileName) + ; + var __path = __pathBuilder.ToString(); + __path = global::AI21.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; + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; #endif foreach (var __authorization in __authorizations) { if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2") + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") { __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( scheme: __authorization.Name, @@ -91,146 +137,326 @@ partial void ProcessGetParsedFileStudioV1DemosDocumentModifierGetParsedFileGetRe __authorization.Location == "Header") { __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } + } } + global::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareGetParsedFileStudioV1DemosDocumentModifierGetParsedFileGetRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - fileName: fileName); + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareGetParsedFileStudioV1DemosDocumentModifierGetParsedFileGetRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + fileName: fileName!); - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); + return __httpRequest; + } - ProcessResponse( - client: HttpClient, - response: __response); - ProcessGetParsedFileStudioV1DemosDocumentModifierGetParsedFileGetResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Validation Error - if ((int)__response.StatusCode == 422) + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::AI21.HTTPValidationError? __value_422 = null; - try + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) { - if (ReadResponseAsString) + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GetParsedFileStudioV1DemosDocumentModifierGetParsedFileGet", + methodName: "GetParsedFileStudioV1DemosDocumentModifierGetParsedFileGetAsync", + pathTemplate: "\"/studio/v1/demos/document-modifier/get-parsed-file\"", + 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 { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); } - else + catch (global::System.Net.Http.HttpRequestException __exception) { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GetParsedFileStudioV1DemosDocumentModifierGetParsedFileGet", + methodName: "GetParsedFileStudioV1DemosDocumentModifierGetParsedFileGetAsync", + pathTemplate: "\"/studio/v1/demos/document-modifier/get-parsed-file\"", + 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; + } - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GetParsedFileStudioV1DemosDocumentModifierGetParsedFileGet", + methodName: "GetParsedFileStudioV1DemosDocumentModifierGetParsedFileGetAsync", + pathTemplate: "\"/studio/v1/demos/document-modifier/get-parsed-file\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; } - catch (global::System.Exception __ex) + + if (__response == null) { - __exception_422 = __ex; + throw new global::System.InvalidOperationException("No response received."); } - throw new global::AI21.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) + using (__response) { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - ProcessResponseContent( + ProcessResponse( client: HttpClient, - response: __response, - content: ref __content); - ProcessGetParsedFileStudioV1DemosDocumentModifierGetParsedFileGetResponseContent( + response: __response); + ProcessGetParsedFileStudioV1DemosDocumentModifierGetParsedFileGetResponse( httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) { - __response.EnsureSuccessStatusCode(); - - return __content; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GetParsedFileStudioV1DemosDocumentModifierGetParsedFileGet", + methodName: "GetParsedFileStudioV1DemosDocumentModifierGetParsedFileGetAsync", + pathTemplate: "\"/studio/v1/demos/document-modifier/get-parsed-file\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } - catch (global::System.Exception __ex) + else { - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GetParsedFileStudioV1DemosDocumentModifierGetParsedFileGet", + methodName: "GetParsedFileStudioV1DemosDocumentModifierGetParsedFileGetAsync", + pathTemplate: "\"/studio/v1/demos/document-modifier/get-parsed-file\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::AI21.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).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) - { - } + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessGetParsedFileStudioV1DemosDocumentModifierGetParsedFileGetResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? 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::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.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::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; } } + finally + { + __httpRequest?.Dispose(); + } } } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.GetStepExplanationsStudioV1ExecutionsExecutionIdExplanationsStepsGet.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.GetStepExplanationsStudioV1ExecutionsExecutionIdExplanationsStepsGet.g.cs deleted file mode 100644 index e3b68873..00000000 --- a/src/libs/AI21/Generated/AI21.Ai21Client.GetStepExplanationsStudioV1ExecutionsExecutionIdExplanationsStepsGet.g.cs +++ /dev/null @@ -1,245 +0,0 @@ - -#nullable enable - -namespace AI21 -{ - public partial class Ai21Client - { - - - private static readonly global::AI21.EndPointSecurityRequirement s_GetStepExplanationsStudioV1ExecutionsExecutionIdExplanationsStepsGetSecurityRequirement0 = - new global::AI21.EndPointSecurityRequirement - { - Authorizations = new global::AI21.EndPointAuthorizationRequirement[] - { new global::AI21.EndPointAuthorizationRequirement - { - Type = "Http", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::AI21.EndPointSecurityRequirement[] s_GetStepExplanationsStudioV1ExecutionsExecutionIdExplanationsStepsGetSecurityRequirements = - new global::AI21.EndPointSecurityRequirement[] - { s_GetStepExplanationsStudioV1ExecutionsExecutionIdExplanationsStepsGetSecurityRequirement0, - }; - partial void PrepareGetStepExplanationsStudioV1ExecutionsExecutionIdExplanationsStepsGetArguments( - global::System.Net.Http.HttpClient httpClient, - ref string executionId, - ref bool? forceRegenerate); - partial void PrepareGetStepExplanationsStudioV1ExecutionsExecutionIdExplanationsStepsGetRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - string executionId, - bool? forceRegenerate); - partial void ProcessGetStepExplanationsStudioV1ExecutionsExecutionIdExplanationsStepsGetResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessGetStepExplanationsStudioV1ExecutionsExecutionIdExplanationsStepsGetResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Get Step Explanations
- /// Get step explanations for an execution (cached or generated).
- /// Set force_regenerate=True to regenerate even if cached. - ///
- /// - /// - /// Default Value: false - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task GetStepExplanationsStudioV1ExecutionsExecutionIdExplanationsStepsGetAsync( - string executionId, - bool? forceRegenerate = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - PrepareArguments( - client: HttpClient); - PrepareGetStepExplanationsStudioV1ExecutionsExecutionIdExplanationsStepsGetArguments( - httpClient: HttpClient, - executionId: ref executionId, - forceRegenerate: ref forceRegenerate); - - - var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_GetStepExplanationsStudioV1ExecutionsExecutionIdExplanationsStepsGetSecurityRequirements, - operationName: "GetStepExplanationsStudioV1ExecutionsExecutionIdExplanationsStepsGetAsync"); - - var __pathBuilder = new global::AI21.PathBuilder( - path: $"/studio/v1/executions/{executionId}/explanations/steps", - baseUri: HttpClient.BaseAddress); - __pathBuilder - .AddOptionalParameter("force_regenerate", forceRegenerate?.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); - PrepareGetStepExplanationsStudioV1ExecutionsExecutionIdExplanationsStepsGetRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - executionId: executionId, - forceRegenerate: forceRegenerate); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessGetStepExplanationsStudioV1ExecutionsExecutionIdExplanationsStepsGetResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Validation Error - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::AI21.HTTPValidationError? __value_422 = null; - try - { - if (ReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - throw new global::AI21.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) - { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessGetStepExplanationsStudioV1ExecutionsExecutionIdExplanationsStepsGetResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return __content; - } - catch (global::System.Exception __ex) - { - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __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::AI21.ApiException( - message: __content ?? __response.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/AI21/Generated/AI21.Ai21Client.GetVectorStoreStudioV1DemosRegulationsVectorStoreVectorStoreIdGet.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.GetVectorStoreStudioV1DemosRegulationsVectorStoreVectorStoreIdGet.g.cs index c76a4686..a52b4b92 100644 --- a/src/libs/AI21/Generated/AI21.Ai21Client.GetVectorStoreStudioV1DemosRegulationsVectorStoreVectorStoreIdGet.g.cs +++ b/src/libs/AI21/Generated/AI21.Ai21Client.GetVectorStoreStudioV1DemosRegulationsVectorStoreVectorStoreIdGet.g.cs @@ -14,6 +14,7 @@ public partial class Ai21Client { new global::AI21.EndPointAuthorizationRequirement { Type = "Http", + SchemeId = "HttpBearer", Location = "Header", Name = "Bearer", FriendlyName = "Bearer", @@ -45,10 +46,33 @@ partial void ProcessGetVectorStoreStudioV1DemosRegulationsVectorStoreVectorStore /// Get a vector store by 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 GetVectorStoreStudioV1DemosRegulationsVectorStoreVectorStoreIdGetAsync( string vectorStoreId, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await GetVectorStoreStudioV1DemosRegulationsVectorStoreVectorStoreIdGetAsResponseAsync( + vectorStoreId: vectorStoreId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Get Vector Store
+ /// Get a vector store by 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> GetVectorStoreStudioV1DemosRegulationsVectorStoreVectorStoreIdGetAsResponseAsync( + string vectorStoreId, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( @@ -63,22 +87,44 @@ partial void ProcessGetVectorStoreStudioV1DemosRegulationsVectorStoreVectorStore securityRequirements: s_GetVectorStoreStudioV1DemosRegulationsVectorStoreVectorStoreIdGetSecurityRequirements, operationName: "GetVectorStoreStudioV1DemosRegulationsVectorStoreVectorStoreIdGetAsync"); - var __pathBuilder = new global::AI21.PathBuilder( - path: $"/studio/v1/demos/regulations/vector-store/{vectorStoreId}", - 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)); + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: $"/studio/v1/demos/regulations/vector-store/{vectorStoreId}", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.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; + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; #endif foreach (var __authorization in __authorizations) { if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2") + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") { __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( scheme: __authorization.Name, @@ -88,146 +134,326 @@ partial void ProcessGetVectorStoreStudioV1DemosRegulationsVectorStoreVectorStore __authorization.Location == "Header") { __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } + } } + global::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareGetVectorStoreStudioV1DemosRegulationsVectorStoreVectorStoreIdGetRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - vectorStoreId: vectorStoreId); + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareGetVectorStoreStudioV1DemosRegulationsVectorStoreVectorStoreIdGetRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + vectorStoreId: vectorStoreId!); - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); + return __httpRequest; + } - ProcessResponse( - client: HttpClient, - response: __response); - ProcessGetVectorStoreStudioV1DemosRegulationsVectorStoreVectorStoreIdGetResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Validation Error - if ((int)__response.StatusCode == 422) + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::AI21.HTTPValidationError? __value_422 = null; - try + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) { - if (ReadResponseAsString) + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GetVectorStoreStudioV1DemosRegulationsVectorStoreVectorStoreIdGet", + methodName: "GetVectorStoreStudioV1DemosRegulationsVectorStoreVectorStoreIdGetAsync", + pathTemplate: "$\"/studio/v1/demos/regulations/vector-store/{vectorStoreId}\"", + 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 { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); } - else + catch (global::System.Net.Http.HttpRequestException __exception) { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GetVectorStoreStudioV1DemosRegulationsVectorStoreVectorStoreIdGet", + methodName: "GetVectorStoreStudioV1DemosRegulationsVectorStoreVectorStoreIdGetAsync", + pathTemplate: "$\"/studio/v1/demos/regulations/vector-store/{vectorStoreId}\"", + 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; + } - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GetVectorStoreStudioV1DemosRegulationsVectorStoreVectorStoreIdGet", + methodName: "GetVectorStoreStudioV1DemosRegulationsVectorStoreVectorStoreIdGetAsync", + pathTemplate: "$\"/studio/v1/demos/regulations/vector-store/{vectorStoreId}\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; } - catch (global::System.Exception __ex) + + if (__response == null) { - __exception_422 = __ex; + throw new global::System.InvalidOperationException("No response received."); } - throw new global::AI21.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) + using (__response) { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - ProcessResponseContent( + ProcessResponse( client: HttpClient, - response: __response, - content: ref __content); - ProcessGetVectorStoreStudioV1DemosRegulationsVectorStoreVectorStoreIdGetResponseContent( + response: __response); + ProcessGetVectorStoreStudioV1DemosRegulationsVectorStoreVectorStoreIdGetResponse( httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) { - __response.EnsureSuccessStatusCode(); - - return __content; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GetVectorStoreStudioV1DemosRegulationsVectorStoreVectorStoreIdGet", + methodName: "GetVectorStoreStudioV1DemosRegulationsVectorStoreVectorStoreIdGetAsync", + pathTemplate: "$\"/studio/v1/demos/regulations/vector-store/{vectorStoreId}\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } - catch (global::System.Exception __ex) + else { - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GetVectorStoreStudioV1DemosRegulationsVectorStoreVectorStoreIdGet", + methodName: "GetVectorStoreStudioV1DemosRegulationsVectorStoreVectorStoreIdGetAsync", + pathTemplate: "$\"/studio/v1/demos/regulations/vector-store/{vectorStoreId}\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::AI21.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).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) - { - } + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessGetVectorStoreStudioV1DemosRegulationsVectorStoreVectorStoreIdGetResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? 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::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.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::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; } } + finally + { + __httpRequest?.Dispose(); + } } } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.GetWebsiteConnectorByIdStudioV1ConnectorsWebsiteConnectorIdGet.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.GetWebsiteConnectorByIdStudioV1ConnectorsWebsiteConnectorIdGet.g.cs deleted file mode 100644 index 9c550c13..00000000 --- a/src/libs/AI21/Generated/AI21.Ai21Client.GetWebsiteConnectorByIdStudioV1ConnectorsWebsiteConnectorIdGet.g.cs +++ /dev/null @@ -1,232 +0,0 @@ - -#nullable enable - -namespace AI21 -{ - public partial class Ai21Client - { - - - private static readonly global::AI21.EndPointSecurityRequirement s_GetWebsiteConnectorByIdStudioV1ConnectorsWebsiteConnectorIdGetSecurityRequirement0 = - new global::AI21.EndPointSecurityRequirement - { - Authorizations = new global::AI21.EndPointAuthorizationRequirement[] - { new global::AI21.EndPointAuthorizationRequirement - { - Type = "Http", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::AI21.EndPointSecurityRequirement[] s_GetWebsiteConnectorByIdStudioV1ConnectorsWebsiteConnectorIdGetSecurityRequirements = - new global::AI21.EndPointSecurityRequirement[] - { s_GetWebsiteConnectorByIdStudioV1ConnectorsWebsiteConnectorIdGetSecurityRequirement0, - }; - partial void PrepareGetWebsiteConnectorByIdStudioV1ConnectorsWebsiteConnectorIdGetArguments( - global::System.Net.Http.HttpClient httpClient, - ref string connectorId); - partial void PrepareGetWebsiteConnectorByIdStudioV1ConnectorsWebsiteConnectorIdGetRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - string connectorId); - partial void ProcessGetWebsiteConnectorByIdStudioV1ConnectorsWebsiteConnectorIdGetResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessGetWebsiteConnectorByIdStudioV1ConnectorsWebsiteConnectorIdGetResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Get Website Connector By Id - /// - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task GetWebsiteConnectorByIdStudioV1ConnectorsWebsiteConnectorIdGetAsync( - string connectorId, - global::System.Threading.CancellationToken cancellationToken = default) - { - PrepareArguments( - client: HttpClient); - PrepareGetWebsiteConnectorByIdStudioV1ConnectorsWebsiteConnectorIdGetArguments( - httpClient: HttpClient, - connectorId: ref connectorId); - - - var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_GetWebsiteConnectorByIdStudioV1ConnectorsWebsiteConnectorIdGetSecurityRequirements, - operationName: "GetWebsiteConnectorByIdStudioV1ConnectorsWebsiteConnectorIdGetAsync"); - - var __pathBuilder = new global::AI21.PathBuilder( - path: $"/studio/v1/connectors/website/{connectorId}", - 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); - PrepareGetWebsiteConnectorByIdStudioV1ConnectorsWebsiteConnectorIdGetRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - connectorId: connectorId); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessGetWebsiteConnectorByIdStudioV1ConnectorsWebsiteConnectorIdGetResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Validation Error - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::AI21.HTTPValidationError? __value_422 = null; - try - { - if (ReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - throw new global::AI21.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) - { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessGetWebsiteConnectorByIdStudioV1ConnectorsWebsiteConnectorIdGetResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return __content; - } - catch (global::System.Exception __ex) - { - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __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::AI21.ApiException( - message: __content ?? __response.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/AI21/Generated/AI21.Ai21Client.GetWebsiteConnectorStudioV1ConnectorsWebsiteGet.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.GetWebsiteConnectorStudioV1ConnectorsWebsiteGet.g.cs deleted file mode 100644 index ab1e01bf..00000000 --- a/src/libs/AI21/Generated/AI21.Ai21Client.GetWebsiteConnectorStudioV1ConnectorsWebsiteGet.g.cs +++ /dev/null @@ -1,188 +0,0 @@ - -#nullable enable - -namespace AI21 -{ - public partial class Ai21Client - { - - - private static readonly global::AI21.EndPointSecurityRequirement s_GetWebsiteConnectorStudioV1ConnectorsWebsiteGetSecurityRequirement0 = - new global::AI21.EndPointSecurityRequirement - { - Authorizations = new global::AI21.EndPointAuthorizationRequirement[] - { new global::AI21.EndPointAuthorizationRequirement - { - Type = "Http", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::AI21.EndPointSecurityRequirement[] s_GetWebsiteConnectorStudioV1ConnectorsWebsiteGetSecurityRequirements = - new global::AI21.EndPointSecurityRequirement[] - { s_GetWebsiteConnectorStudioV1ConnectorsWebsiteGetSecurityRequirement0, - }; - partial void PrepareGetWebsiteConnectorStudioV1ConnectorsWebsiteGetArguments( - global::System.Net.Http.HttpClient httpClient); - partial void PrepareGetWebsiteConnectorStudioV1ConnectorsWebsiteGetRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage); - partial void ProcessGetWebsiteConnectorStudioV1ConnectorsWebsiteGetResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessGetWebsiteConnectorStudioV1ConnectorsWebsiteGetResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Get Website Connector - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task GetWebsiteConnectorStudioV1ConnectorsWebsiteGetAsync( - global::System.Threading.CancellationToken cancellationToken = default) - { - PrepareArguments( - client: HttpClient); - PrepareGetWebsiteConnectorStudioV1ConnectorsWebsiteGetArguments( - httpClient: HttpClient); - - - var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_GetWebsiteConnectorStudioV1ConnectorsWebsiteGetSecurityRequirements, - operationName: "GetWebsiteConnectorStudioV1ConnectorsWebsiteGetAsync"); - - var __pathBuilder = new global::AI21.PathBuilder( - path: "/studio/v1/connectors/website", - 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); - PrepareGetWebsiteConnectorStudioV1ConnectorsWebsiteGetRequest( - 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); - ProcessGetWebsiteConnectorStudioV1ConnectorsWebsiteGetResponse( - 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); - ProcessGetWebsiteConnectorStudioV1ConnectorsWebsiteGetResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return __content; - } - catch (global::System.Exception __ex) - { - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __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::AI21.ApiException( - message: __content ?? __response.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/AI21/Generated/AI21.Ai21Client.GetWorkspaceModelSecretEndpointStudioV1SettingsModelsNameSecretsGet.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.GetWorkspaceModelSecretEndpointStudioV1SettingsModelsNameSecretsGet.g.cs index baef1842..883e836c 100644 --- a/src/libs/AI21/Generated/AI21.Ai21Client.GetWorkspaceModelSecretEndpointStudioV1SettingsModelsNameSecretsGet.g.cs +++ b/src/libs/AI21/Generated/AI21.Ai21Client.GetWorkspaceModelSecretEndpointStudioV1SettingsModelsNameSecretsGet.g.cs @@ -14,6 +14,7 @@ public partial class Ai21Client { new global::AI21.EndPointAuthorizationRequirement { Type = "Http", + SchemeId = "HttpBearer", Location = "Header", Name = "Bearer", FriendlyName = "Bearer", @@ -44,10 +45,32 @@ partial void ProcessGetWorkspaceModelSecretEndpointStudioV1SettingsModelsNameSec /// Get Workspace Model Secret Endpoint /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// public async global::System.Threading.Tasks.Task GetWorkspaceModelSecretEndpointStudioV1SettingsModelsNameSecretsGetAsync( string name, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await GetWorkspaceModelSecretEndpointStudioV1SettingsModelsNameSecretsGetAsResponseAsync( + name: name, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Get Workspace Model Secret Endpoint + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> GetWorkspaceModelSecretEndpointStudioV1SettingsModelsNameSecretsGetAsResponseAsync( + string name, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( @@ -62,22 +85,44 @@ partial void ProcessGetWorkspaceModelSecretEndpointStudioV1SettingsModelsNameSec securityRequirements: s_GetWorkspaceModelSecretEndpointStudioV1SettingsModelsNameSecretsGetSecurityRequirements, operationName: "GetWorkspaceModelSecretEndpointStudioV1SettingsModelsNameSecretsGetAsync"); - var __pathBuilder = new global::AI21.PathBuilder( - path: $"/studio/v1/settings/models/{name}/secrets", - 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)); + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: $"/studio/v1/settings/models/{name}/secrets", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.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; + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; #endif foreach (var __authorization in __authorizations) { if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2") + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") { __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( scheme: __authorization.Name, @@ -87,150 +132,330 @@ partial void ProcessGetWorkspaceModelSecretEndpointStudioV1SettingsModelsNameSec __authorization.Location == "Header") { __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } + } } + global::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareGetWorkspaceModelSecretEndpointStudioV1SettingsModelsNameSecretsGetRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - name: name); + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareGetWorkspaceModelSecretEndpointStudioV1SettingsModelsNameSecretsGetRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + name: name!); - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); + return __httpRequest; + } - ProcessResponse( - client: HttpClient, - response: __response); - ProcessGetWorkspaceModelSecretEndpointStudioV1SettingsModelsNameSecretsGetResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Validation Error - if ((int)__response.StatusCode == 422) + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::AI21.HTTPValidationError? __value_422 = null; - try + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) { - if (ReadResponseAsString) + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GetWorkspaceModelSecretEndpointStudioV1SettingsModelsNameSecretsGet", + methodName: "GetWorkspaceModelSecretEndpointStudioV1SettingsModelsNameSecretsGetAsync", + pathTemplate: "$\"/studio/v1/settings/models/{name}/secrets\"", + 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 { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); } - else + catch (global::System.Net.Http.HttpRequestException __exception) { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GetWorkspaceModelSecretEndpointStudioV1SettingsModelsNameSecretsGet", + methodName: "GetWorkspaceModelSecretEndpointStudioV1SettingsModelsNameSecretsGetAsync", + pathTemplate: "$\"/studio/v1/settings/models/{name}/secrets\"", + 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; + } - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GetWorkspaceModelSecretEndpointStudioV1SettingsModelsNameSecretsGet", + methodName: "GetWorkspaceModelSecretEndpointStudioV1SettingsModelsNameSecretsGetAsync", + pathTemplate: "$\"/studio/v1/settings/models/{name}/secrets\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; } - catch (global::System.Exception __ex) + + if (__response == null) { - __exception_422 = __ex; + throw new global::System.InvalidOperationException("No response received."); } - throw new global::AI21.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) + using (__response) { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - ProcessResponseContent( + ProcessResponse( client: HttpClient, - response: __response, - content: ref __content); - ProcessGetWorkspaceModelSecretEndpointStudioV1SettingsModelsNameSecretsGetResponseContent( + response: __response); + ProcessGetWorkspaceModelSecretEndpointStudioV1SettingsModelsNameSecretsGetResponse( httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) { - __response.EnsureSuccessStatusCode(); - - return - global::AI21.SecretResponse.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GetWorkspaceModelSecretEndpointStudioV1SettingsModelsNameSecretsGet", + methodName: "GetWorkspaceModelSecretEndpointStudioV1SettingsModelsNameSecretsGetAsync", + pathTemplate: "$\"/studio/v1/settings/models/{name}/secrets\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } - catch (global::System.Exception __ex) + else { - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GetWorkspaceModelSecretEndpointStudioV1SettingsModelsNameSecretsGet", + methodName: "GetWorkspaceModelSecretEndpointStudioV1SettingsModelsNameSecretsGetAsync", + pathTemplate: "$\"/studio/v1/settings/models/{name}/secrets\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - using var __content = await __response.Content.ReadAsStreamAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::AI21.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - return - await global::AI21.SecretResponse.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) - { - } + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessGetWorkspaceModelSecretEndpointStudioV1SettingsModelsNameSecretsGetResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::AI21.SecretResponse.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => 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::AI21.SecretResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; } } + finally + { + __httpRequest?.Dispose(); + } } } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.GetWorkspaceModelsByOrganizationEndpointStudioV1SettingsModelsGet.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.GetWorkspaceModelsByOrganizationEndpointStudioV1SettingsModelsGet.g.cs index bcb25460..bfecd5c6 100644 --- a/src/libs/AI21/Generated/AI21.Ai21Client.GetWorkspaceModelsByOrganizationEndpointStudioV1SettingsModelsGet.g.cs +++ b/src/libs/AI21/Generated/AI21.Ai21Client.GetWorkspaceModelsByOrganizationEndpointStudioV1SettingsModelsGet.g.cs @@ -14,6 +14,7 @@ public partial class Ai21Client { new global::AI21.EndPointAuthorizationRequirement { Type = "Http", + SchemeId = "HttpBearer", Location = "Header", Name = "Bearer", FriendlyName = "Bearer", @@ -41,9 +42,28 @@ partial void ProcessGetWorkspaceModelsByOrganizationEndpointStudioV1SettingsMode /// /// Get Workspace Models By Organization Endpoint /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// public async global::System.Threading.Tasks.Task GetWorkspaceModelsByOrganizationEndpointStudioV1SettingsModelsGetAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await GetWorkspaceModelsByOrganizationEndpointStudioV1SettingsModelsGetAsResponseAsync( + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Get Workspace Models By Organization Endpoint + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> GetWorkspaceModelsByOrganizationEndpointStudioV1SettingsModelsGetAsResponseAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( @@ -57,22 +77,44 @@ partial void ProcessGetWorkspaceModelsByOrganizationEndpointStudioV1SettingsMode securityRequirements: s_GetWorkspaceModelsByOrganizationEndpointStudioV1SettingsModelsGetSecurityRequirements, operationName: "GetWorkspaceModelsByOrganizationEndpointStudioV1SettingsModelsGetAsync"); - var __pathBuilder = new global::AI21.PathBuilder( - path: "/studio/v1/settings/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)); + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: "/studio/v1/settings/models", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.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; + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; #endif foreach (var __authorization in __authorizations) { if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2") + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") { __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( scheme: __authorization.Name, @@ -82,111 +124,292 @@ partial void ProcessGetWorkspaceModelsByOrganizationEndpointStudioV1SettingsMode __authorization.Location == "Header") { __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } + } } + global::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareGetWorkspaceModelsByOrganizationEndpointStudioV1SettingsModelsGetRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareGetWorkspaceModelsByOrganizationEndpointStudioV1SettingsModelsGetRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest); - ProcessResponse( - client: HttpClient, - response: __response); - ProcessGetWorkspaceModelsByOrganizationEndpointStudioV1SettingsModelsGetResponse( - httpClient: HttpClient, - httpResponseMessage: __response); + return __httpRequest; + } - if (ReadResponseAsString) + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GetWorkspaceModelsByOrganizationEndpointStudioV1SettingsModelsGet", + methodName: "GetWorkspaceModelsByOrganizationEndpointStudioV1SettingsModelsGetAsync", + pathTemplate: "\"/studio/v1/settings/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::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GetWorkspaceModelsByOrganizationEndpointStudioV1SettingsModelsGet", + methodName: "GetWorkspaceModelsByOrganizationEndpointStudioV1SettingsModelsGetAsync", + pathTemplate: "\"/studio/v1/settings/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; + } - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessGetWorkspaceModelsByOrganizationEndpointStudioV1SettingsModelsGetResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } - try - { - __response.EnsureSuccessStatusCode(); + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GetWorkspaceModelsByOrganizationEndpointStudioV1SettingsModelsGet", + methodName: "GetWorkspaceModelsByOrganizationEndpointStudioV1SettingsModelsGetAsync", + pathTemplate: "\"/studio/v1/settings/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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } - return - global::AI21.WorkspaceModelsResponse.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + break; } - catch (global::System.Exception __ex) + + if (__response == null) { - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; + throw new global::System.InvalidOperationException("No response received."); } - } - else - { - try + + using (__response) { - __response.EnsureSuccessStatusCode(); - using var __content = await __response.Content.ReadAsStreamAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - return - await global::AI21.WorkspaceModelsResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); + ProcessResponse( + client: HttpClient, + response: __response); + ProcessGetWorkspaceModelsByOrganizationEndpointStudioV1SettingsModelsGetResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GetWorkspaceModelsByOrganizationEndpointStudioV1SettingsModelsGet", + methodName: "GetWorkspaceModelsByOrganizationEndpointStudioV1SettingsModelsGetAsync", + pathTemplate: "\"/studio/v1/settings/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); } - catch (global::System.Exception __ex) + else { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GetWorkspaceModelsByOrganizationEndpointStudioV1SettingsModelsGet", + methodName: "GetWorkspaceModelsByOrganizationEndpointStudioV1SettingsModelsGetAsync", + pathTemplate: "\"/studio/v1/settings/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); + ProcessGetWorkspaceModelsByOrganizationEndpointStudioV1SettingsModelsGetResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::AI21.WorkspaceModelsResponse.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => 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::AI21.WorkspaceModelsResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; } } + finally + { + __httpRequest?.Dispose(); + } } } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.JambaExecuteStudioV1DemosDocumentModifierJambaExecutePost.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.JambaExecuteStudioV1DemosDocumentModifierJambaExecutePost.g.cs index dc0f6aa6..b4a261da 100644 --- a/src/libs/AI21/Generated/AI21.Ai21Client.JambaExecuteStudioV1DemosDocumentModifierJambaExecutePost.g.cs +++ b/src/libs/AI21/Generated/AI21.Ai21Client.JambaExecuteStudioV1DemosDocumentModifierJambaExecutePost.g.cs @@ -14,6 +14,7 @@ public partial class Ai21Client { new global::AI21.EndPointAuthorizationRequirement { Type = "Http", + SchemeId = "HttpBearer", Location = "Header", Name = "Bearer", FriendlyName = "Bearer", @@ -45,11 +46,36 @@ partial void ProcessJambaExecuteStudioV1DemosDocumentModifierJambaExecutePostRes /// Execute a Jamba request. /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// public async global::System.Threading.Tasks.Task JambaExecuteStudioV1DemosDocumentModifierJambaExecutePostAsync( global::AI21.JambaExecuteRequest request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await JambaExecuteStudioV1DemosDocumentModifierJambaExecutePostAsResponseAsync( + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Jamba Execute
+ /// Execute a Jamba request. + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> JambaExecuteStudioV1DemosDocumentModifierJambaExecutePostAsResponseAsync( + + global::AI21.JambaExecuteRequest request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) { request = request ?? throw new global::System.ArgumentNullException(nameof(request)); @@ -66,22 +92,44 @@ partial void ProcessJambaExecuteStudioV1DemosDocumentModifierJambaExecutePostRes securityRequirements: s_JambaExecuteStudioV1DemosDocumentModifierJambaExecutePostSecurityRequirements, operationName: "JambaExecuteStudioV1DemosDocumentModifierJambaExecutePostAsync"); - var __pathBuilder = new global::AI21.PathBuilder( - path: "/studio/v1/demos/document-modifier/jamba-execute", - 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)); + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: "/studio/v1/demos/document-modifier/jamba-execute", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.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; + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; #endif foreach (var __authorization in __authorizations) { if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2") + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") { __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( scheme: __authorization.Name, @@ -91,152 +139,332 @@ partial void ProcessJambaExecuteStudioV1DemosDocumentModifierJambaExecutePostRes __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); - PrepareJambaExecuteStudioV1DemosDocumentModifierJambaExecutePostRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - request: request); + 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::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareJambaExecuteStudioV1DemosDocumentModifierJambaExecutePostRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + request: request); - ProcessResponse( - client: HttpClient, - response: __response); - ProcessJambaExecuteStudioV1DemosDocumentModifierJambaExecutePostResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Validation Error - if ((int)__response.StatusCode == 422) + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::AI21.HTTPValidationError? __value_422 = null; - try + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) { - if (ReadResponseAsString) + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "JambaExecuteStudioV1DemosDocumentModifierJambaExecutePost", + methodName: "JambaExecuteStudioV1DemosDocumentModifierJambaExecutePostAsync", + pathTemplate: "\"/studio/v1/demos/document-modifier/jamba-execute\"", + 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 { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); } - else + catch (global::System.Net.Http.HttpRequestException __exception) { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "JambaExecuteStudioV1DemosDocumentModifierJambaExecutePost", + methodName: "JambaExecuteStudioV1DemosDocumentModifierJambaExecutePostAsync", + pathTemplate: "\"/studio/v1/demos/document-modifier/jamba-execute\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "JambaExecuteStudioV1DemosDocumentModifierJambaExecutePost", + methodName: "JambaExecuteStudioV1DemosDocumentModifierJambaExecutePostAsync", + pathTemplate: "\"/studio/v1/demos/document-modifier/jamba-execute\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; } + + break; } - catch (global::System.Exception __ex) + + if (__response == null) { - __exception_422 = __ex; + throw new global::System.InvalidOperationException("No response received."); } - throw new global::AI21.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) + using (__response) { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( + ProcessResponse( client: HttpClient, - response: __response, - content: ref __content); - ProcessJambaExecuteStudioV1DemosDocumentModifierJambaExecutePostResponseContent( + response: __response); + ProcessJambaExecuteStudioV1DemosDocumentModifierJambaExecutePostResponse( httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) { - __response.EnsureSuccessStatusCode(); - - return __content; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "JambaExecuteStudioV1DemosDocumentModifierJambaExecutePost", + methodName: "JambaExecuteStudioV1DemosDocumentModifierJambaExecutePostAsync", + pathTemplate: "\"/studio/v1/demos/document-modifier/jamba-execute\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } - catch (global::System.Exception __ex) + else { - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "JambaExecuteStudioV1DemosDocumentModifierJambaExecutePost", + methodName: "JambaExecuteStudioV1DemosDocumentModifierJambaExecutePostAsync", + pathTemplate: "\"/studio/v1/demos/document-modifier/jamba-execute\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::AI21.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).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) - { - } + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessJambaExecuteStudioV1DemosDocumentModifierJambaExecutePostResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? 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::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.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::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; } } + finally + { + __httpRequest?.Dispose(); + } } /// /// Jamba Execute
@@ -246,6 +474,7 @@ partial void ProcessJambaExecuteStudioV1DemosDocumentModifierJambaExecutePostRes /// /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// public async global::System.Threading.Tasks.Task JambaExecuteStudioV1DemosDocumentModifierJambaExecutePostAsync( @@ -253,6 +482,7 @@ partial void ProcessJambaExecuteStudioV1DemosDocumentModifierJambaExecutePostRes string task, string prompt, string? apiKey = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) { var __request = new global::AI21.JambaExecuteRequest @@ -265,6 +495,7 @@ partial void ProcessJambaExecuteStudioV1DemosDocumentModifierJambaExecutePostRes return await JambaExecuteStudioV1DemosDocumentModifierJambaExecutePostAsync( request: __request, + requestOptions: requestOptions, cancellationToken: cancellationToken).ConfigureAwait(false); } } diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.KirshDocumentUploadProcessPrefixPreviewSolutionsPreviewKirshDocumentUploadProcessPost.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.KirshDocumentUploadProcessPrefixPreviewSolutionsPreviewKirshDocumentUploadProcessPost.g.cs deleted file mode 100644 index 458183fd..00000000 --- a/src/libs/AI21/Generated/AI21.Ai21Client.KirshDocumentUploadProcessPrefixPreviewSolutionsPreviewKirshDocumentUploadProcessPost.g.cs +++ /dev/null @@ -1,188 +0,0 @@ - -#nullable enable - -namespace AI21 -{ - public partial class Ai21Client - { - - - private static readonly global::AI21.EndPointSecurityRequirement s_KirshDocumentUploadProcessPrefixPreviewSolutionsPreviewKirshDocumentUploadProcessPostSecurityRequirement0 = - new global::AI21.EndPointSecurityRequirement - { - Authorizations = new global::AI21.EndPointAuthorizationRequirement[] - { new global::AI21.EndPointAuthorizationRequirement - { - Type = "Http", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::AI21.EndPointSecurityRequirement[] s_KirshDocumentUploadProcessPrefixPreviewSolutionsPreviewKirshDocumentUploadProcessPostSecurityRequirements = - new global::AI21.EndPointSecurityRequirement[] - { s_KirshDocumentUploadProcessPrefixPreviewSolutionsPreviewKirshDocumentUploadProcessPostSecurityRequirement0, - }; - partial void PrepareKirshDocumentUploadProcessPrefixPreviewSolutionsPreviewKirshDocumentUploadProcessPostArguments( - global::System.Net.Http.HttpClient httpClient); - partial void PrepareKirshDocumentUploadProcessPrefixPreviewSolutionsPreviewKirshDocumentUploadProcessPostRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage); - partial void ProcessKirshDocumentUploadProcessPrefixPreviewSolutionsPreviewKirshDocumentUploadProcessPostResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessKirshDocumentUploadProcessPrefixPreviewSolutionsPreviewKirshDocumentUploadProcessPostResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Kirsh Document Upload Process Prefix Preview - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task KirshDocumentUploadProcessPrefixPreviewSolutionsPreviewKirshDocumentUploadProcessPostAsync( - global::System.Threading.CancellationToken cancellationToken = default) - { - PrepareArguments( - client: HttpClient); - PrepareKirshDocumentUploadProcessPrefixPreviewSolutionsPreviewKirshDocumentUploadProcessPostArguments( - httpClient: HttpClient); - - - var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_KirshDocumentUploadProcessPrefixPreviewSolutionsPreviewKirshDocumentUploadProcessPostSecurityRequirements, - operationName: "KirshDocumentUploadProcessPrefixPreviewSolutionsPreviewKirshDocumentUploadProcessPostAsync"); - - var __pathBuilder = new global::AI21.PathBuilder( - path: "/solutions-preview/kirsh-document-upload/process", - 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); - } - } - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareKirshDocumentUploadProcessPrefixPreviewSolutionsPreviewKirshDocumentUploadProcessPostRequest( - 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); - ProcessKirshDocumentUploadProcessPrefixPreviewSolutionsPreviewKirshDocumentUploadProcessPostResponse( - 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); - ProcessKirshDocumentUploadProcessPrefixPreviewSolutionsPreviewKirshDocumentUploadProcessPostResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return __content; - } - catch (global::System.Exception __ex) - { - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __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::AI21.ApiException( - message: __content ?? __response.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/AI21/Generated/AI21.Ai21Client.KirshDocumentUploadProcessSolutionsKirshDocumentUploadProcessPost.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.KirshDocumentUploadProcessSolutionsKirshDocumentUploadProcessPost.g.cs deleted file mode 100644 index eada2ef4..00000000 --- a/src/libs/AI21/Generated/AI21.Ai21Client.KirshDocumentUploadProcessSolutionsKirshDocumentUploadProcessPost.g.cs +++ /dev/null @@ -1,188 +0,0 @@ - -#nullable enable - -namespace AI21 -{ - public partial class Ai21Client - { - - - private static readonly global::AI21.EndPointSecurityRequirement s_KirshDocumentUploadProcessSolutionsKirshDocumentUploadProcessPostSecurityRequirement0 = - new global::AI21.EndPointSecurityRequirement - { - Authorizations = new global::AI21.EndPointAuthorizationRequirement[] - { new global::AI21.EndPointAuthorizationRequirement - { - Type = "Http", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::AI21.EndPointSecurityRequirement[] s_KirshDocumentUploadProcessSolutionsKirshDocumentUploadProcessPostSecurityRequirements = - new global::AI21.EndPointSecurityRequirement[] - { s_KirshDocumentUploadProcessSolutionsKirshDocumentUploadProcessPostSecurityRequirement0, - }; - partial void PrepareKirshDocumentUploadProcessSolutionsKirshDocumentUploadProcessPostArguments( - global::System.Net.Http.HttpClient httpClient); - partial void PrepareKirshDocumentUploadProcessSolutionsKirshDocumentUploadProcessPostRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage); - partial void ProcessKirshDocumentUploadProcessSolutionsKirshDocumentUploadProcessPostResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessKirshDocumentUploadProcessSolutionsKirshDocumentUploadProcessPostResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Kirsh Document Upload Process - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task KirshDocumentUploadProcessSolutionsKirshDocumentUploadProcessPostAsync( - global::System.Threading.CancellationToken cancellationToken = default) - { - PrepareArguments( - client: HttpClient); - PrepareKirshDocumentUploadProcessSolutionsKirshDocumentUploadProcessPostArguments( - httpClient: HttpClient); - - - var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_KirshDocumentUploadProcessSolutionsKirshDocumentUploadProcessPostSecurityRequirements, - operationName: "KirshDocumentUploadProcessSolutionsKirshDocumentUploadProcessPostAsync"); - - var __pathBuilder = new global::AI21.PathBuilder( - path: "/solutions/kirsh-document-upload/process", - 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); - } - } - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareKirshDocumentUploadProcessSolutionsKirshDocumentUploadProcessPostRequest( - 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); - ProcessKirshDocumentUploadProcessSolutionsKirshDocumentUploadProcessPostResponse( - 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); - ProcessKirshDocumentUploadProcessSolutionsKirshDocumentUploadProcessPostResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return __content; - } - catch (global::System.Exception __ex) - { - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __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::AI21.ApiException( - message: __content ?? __response.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/AI21/Generated/AI21.Ai21Client.KirshEmailAssistantPrefixPreviewSolutionsPreviewKirshEmailAssistantPost.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.KirshEmailAssistantPrefixPreviewSolutionsPreviewKirshEmailAssistantPost.g.cs deleted file mode 100644 index 30cb9da8..00000000 --- a/src/libs/AI21/Generated/AI21.Ai21Client.KirshEmailAssistantPrefixPreviewSolutionsPreviewKirshEmailAssistantPost.g.cs +++ /dev/null @@ -1,188 +0,0 @@ - -#nullable enable - -namespace AI21 -{ - public partial class Ai21Client - { - - - private static readonly global::AI21.EndPointSecurityRequirement s_KirshEmailAssistantPrefixPreviewSolutionsPreviewKirshEmailAssistantPostSecurityRequirement0 = - new global::AI21.EndPointSecurityRequirement - { - Authorizations = new global::AI21.EndPointAuthorizationRequirement[] - { new global::AI21.EndPointAuthorizationRequirement - { - Type = "Http", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::AI21.EndPointSecurityRequirement[] s_KirshEmailAssistantPrefixPreviewSolutionsPreviewKirshEmailAssistantPostSecurityRequirements = - new global::AI21.EndPointSecurityRequirement[] - { s_KirshEmailAssistantPrefixPreviewSolutionsPreviewKirshEmailAssistantPostSecurityRequirement0, - }; - partial void PrepareKirshEmailAssistantPrefixPreviewSolutionsPreviewKirshEmailAssistantPostArguments( - global::System.Net.Http.HttpClient httpClient); - partial void PrepareKirshEmailAssistantPrefixPreviewSolutionsPreviewKirshEmailAssistantPostRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage); - partial void ProcessKirshEmailAssistantPrefixPreviewSolutionsPreviewKirshEmailAssistantPostResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessKirshEmailAssistantPrefixPreviewSolutionsPreviewKirshEmailAssistantPostResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Kirsh Email Assistant Prefix Preview - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task KirshEmailAssistantPrefixPreviewSolutionsPreviewKirshEmailAssistantPostAsync( - global::System.Threading.CancellationToken cancellationToken = default) - { - PrepareArguments( - client: HttpClient); - PrepareKirshEmailAssistantPrefixPreviewSolutionsPreviewKirshEmailAssistantPostArguments( - httpClient: HttpClient); - - - var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_KirshEmailAssistantPrefixPreviewSolutionsPreviewKirshEmailAssistantPostSecurityRequirements, - operationName: "KirshEmailAssistantPrefixPreviewSolutionsPreviewKirshEmailAssistantPostAsync"); - - var __pathBuilder = new global::AI21.PathBuilder( - path: "/solutions-preview/kirsh/email-assistant", - 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); - } - } - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareKirshEmailAssistantPrefixPreviewSolutionsPreviewKirshEmailAssistantPostRequest( - 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); - ProcessKirshEmailAssistantPrefixPreviewSolutionsPreviewKirshEmailAssistantPostResponse( - 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); - ProcessKirshEmailAssistantPrefixPreviewSolutionsPreviewKirshEmailAssistantPostResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return __content; - } - catch (global::System.Exception __ex) - { - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __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::AI21.ApiException( - message: __content ?? __response.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/AI21/Generated/AI21.Ai21Client.KirshEmailAssistantSolutionsKirshEmailAssistantPost.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.KirshEmailAssistantSolutionsKirshEmailAssistantPost.g.cs deleted file mode 100644 index 78033089..00000000 --- a/src/libs/AI21/Generated/AI21.Ai21Client.KirshEmailAssistantSolutionsKirshEmailAssistantPost.g.cs +++ /dev/null @@ -1,188 +0,0 @@ - -#nullable enable - -namespace AI21 -{ - public partial class Ai21Client - { - - - private static readonly global::AI21.EndPointSecurityRequirement s_KirshEmailAssistantSolutionsKirshEmailAssistantPostSecurityRequirement0 = - new global::AI21.EndPointSecurityRequirement - { - Authorizations = new global::AI21.EndPointAuthorizationRequirement[] - { new global::AI21.EndPointAuthorizationRequirement - { - Type = "Http", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::AI21.EndPointSecurityRequirement[] s_KirshEmailAssistantSolutionsKirshEmailAssistantPostSecurityRequirements = - new global::AI21.EndPointSecurityRequirement[] - { s_KirshEmailAssistantSolutionsKirshEmailAssistantPostSecurityRequirement0, - }; - partial void PrepareKirshEmailAssistantSolutionsKirshEmailAssistantPostArguments( - global::System.Net.Http.HttpClient httpClient); - partial void PrepareKirshEmailAssistantSolutionsKirshEmailAssistantPostRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage); - partial void ProcessKirshEmailAssistantSolutionsKirshEmailAssistantPostResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessKirshEmailAssistantSolutionsKirshEmailAssistantPostResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Kirsh Email Assistant - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task KirshEmailAssistantSolutionsKirshEmailAssistantPostAsync( - global::System.Threading.CancellationToken cancellationToken = default) - { - PrepareArguments( - client: HttpClient); - PrepareKirshEmailAssistantSolutionsKirshEmailAssistantPostArguments( - httpClient: HttpClient); - - - var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_KirshEmailAssistantSolutionsKirshEmailAssistantPostSecurityRequirements, - operationName: "KirshEmailAssistantSolutionsKirshEmailAssistantPostAsync"); - - var __pathBuilder = new global::AI21.PathBuilder( - path: "/solutions/kirsh/email-assistant", - 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); - } - } - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareKirshEmailAssistantSolutionsKirshEmailAssistantPostRequest( - 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); - ProcessKirshEmailAssistantSolutionsKirshEmailAssistantPostResponse( - 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); - ProcessKirshEmailAssistantSolutionsKirshEmailAssistantPostResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return __content; - } - catch (global::System.Exception __ex) - { - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __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::AI21.ApiException( - message: __content ?? __response.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/AI21/Generated/AI21.Ai21Client.KirshFundingAndCategorizationCheckPrefixPreviewSolutionsPreviewKirshFundingAndCategorizationCheckPost.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.KirshFundingAndCategorizationCheckPrefixPreviewSolutionsPreviewKirshFundingAndCategorizationCheckPost.g.cs deleted file mode 100644 index 7b750fa3..00000000 --- a/src/libs/AI21/Generated/AI21.Ai21Client.KirshFundingAndCategorizationCheckPrefixPreviewSolutionsPreviewKirshFundingAndCategorizationCheckPost.g.cs +++ /dev/null @@ -1,188 +0,0 @@ - -#nullable enable - -namespace AI21 -{ - public partial class Ai21Client - { - - - private static readonly global::AI21.EndPointSecurityRequirement s_KirshFundingAndCategorizationCheckPrefixPreviewSolutionsPreviewKirshFundingAndCategorizationCheckPostSecurityRequirement0 = - new global::AI21.EndPointSecurityRequirement - { - Authorizations = new global::AI21.EndPointAuthorizationRequirement[] - { new global::AI21.EndPointAuthorizationRequirement - { - Type = "Http", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::AI21.EndPointSecurityRequirement[] s_KirshFundingAndCategorizationCheckPrefixPreviewSolutionsPreviewKirshFundingAndCategorizationCheckPostSecurityRequirements = - new global::AI21.EndPointSecurityRequirement[] - { s_KirshFundingAndCategorizationCheckPrefixPreviewSolutionsPreviewKirshFundingAndCategorizationCheckPostSecurityRequirement0, - }; - partial void PrepareKirshFundingAndCategorizationCheckPrefixPreviewSolutionsPreviewKirshFundingAndCategorizationCheckPostArguments( - global::System.Net.Http.HttpClient httpClient); - partial void PrepareKirshFundingAndCategorizationCheckPrefixPreviewSolutionsPreviewKirshFundingAndCategorizationCheckPostRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage); - partial void ProcessKirshFundingAndCategorizationCheckPrefixPreviewSolutionsPreviewKirshFundingAndCategorizationCheckPostResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessKirshFundingAndCategorizationCheckPrefixPreviewSolutionsPreviewKirshFundingAndCategorizationCheckPostResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Kirsh Funding And Categorization Check Prefix Preview - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task KirshFundingAndCategorizationCheckPrefixPreviewSolutionsPreviewKirshFundingAndCategorizationCheckPostAsync( - global::System.Threading.CancellationToken cancellationToken = default) - { - PrepareArguments( - client: HttpClient); - PrepareKirshFundingAndCategorizationCheckPrefixPreviewSolutionsPreviewKirshFundingAndCategorizationCheckPostArguments( - httpClient: HttpClient); - - - var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_KirshFundingAndCategorizationCheckPrefixPreviewSolutionsPreviewKirshFundingAndCategorizationCheckPostSecurityRequirements, - operationName: "KirshFundingAndCategorizationCheckPrefixPreviewSolutionsPreviewKirshFundingAndCategorizationCheckPostAsync"); - - var __pathBuilder = new global::AI21.PathBuilder( - path: "/solutions-preview/kirsh/funding-and-categorization-check", - 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); - } - } - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareKirshFundingAndCategorizationCheckPrefixPreviewSolutionsPreviewKirshFundingAndCategorizationCheckPostRequest( - 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); - ProcessKirshFundingAndCategorizationCheckPrefixPreviewSolutionsPreviewKirshFundingAndCategorizationCheckPostResponse( - 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); - ProcessKirshFundingAndCategorizationCheckPrefixPreviewSolutionsPreviewKirshFundingAndCategorizationCheckPostResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return __content; - } - catch (global::System.Exception __ex) - { - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __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::AI21.ApiException( - message: __content ?? __response.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/AI21/Generated/AI21.Ai21Client.KirshFundingAndCategorizationCheckSolutionsKirshFundingAndCategorizationCheckPost.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.KirshFundingAndCategorizationCheckSolutionsKirshFundingAndCategorizationCheckPost.g.cs deleted file mode 100644 index 5b9e0060..00000000 --- a/src/libs/AI21/Generated/AI21.Ai21Client.KirshFundingAndCategorizationCheckSolutionsKirshFundingAndCategorizationCheckPost.g.cs +++ /dev/null @@ -1,188 +0,0 @@ - -#nullable enable - -namespace AI21 -{ - public partial class Ai21Client - { - - - private static readonly global::AI21.EndPointSecurityRequirement s_KirshFundingAndCategorizationCheckSolutionsKirshFundingAndCategorizationCheckPostSecurityRequirement0 = - new global::AI21.EndPointSecurityRequirement - { - Authorizations = new global::AI21.EndPointAuthorizationRequirement[] - { new global::AI21.EndPointAuthorizationRequirement - { - Type = "Http", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::AI21.EndPointSecurityRequirement[] s_KirshFundingAndCategorizationCheckSolutionsKirshFundingAndCategorizationCheckPostSecurityRequirements = - new global::AI21.EndPointSecurityRequirement[] - { s_KirshFundingAndCategorizationCheckSolutionsKirshFundingAndCategorizationCheckPostSecurityRequirement0, - }; - partial void PrepareKirshFundingAndCategorizationCheckSolutionsKirshFundingAndCategorizationCheckPostArguments( - global::System.Net.Http.HttpClient httpClient); - partial void PrepareKirshFundingAndCategorizationCheckSolutionsKirshFundingAndCategorizationCheckPostRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage); - partial void ProcessKirshFundingAndCategorizationCheckSolutionsKirshFundingAndCategorizationCheckPostResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessKirshFundingAndCategorizationCheckSolutionsKirshFundingAndCategorizationCheckPostResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Kirsh Funding And Categorization Check - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task KirshFundingAndCategorizationCheckSolutionsKirshFundingAndCategorizationCheckPostAsync( - global::System.Threading.CancellationToken cancellationToken = default) - { - PrepareArguments( - client: HttpClient); - PrepareKirshFundingAndCategorizationCheckSolutionsKirshFundingAndCategorizationCheckPostArguments( - httpClient: HttpClient); - - - var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_KirshFundingAndCategorizationCheckSolutionsKirshFundingAndCategorizationCheckPostSecurityRequirements, - operationName: "KirshFundingAndCategorizationCheckSolutionsKirshFundingAndCategorizationCheckPostAsync"); - - var __pathBuilder = new global::AI21.PathBuilder( - path: "/solutions/kirsh/funding-and-categorization-check", - 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); - } - } - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareKirshFundingAndCategorizationCheckSolutionsKirshFundingAndCategorizationCheckPostRequest( - 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); - ProcessKirshFundingAndCategorizationCheckSolutionsKirshFundingAndCategorizationCheckPostResponse( - 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); - ProcessKirshFundingAndCategorizationCheckSolutionsKirshFundingAndCategorizationCheckPostResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return __content; - } - catch (global::System.Exception __ex) - { - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __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::AI21.ApiException( - message: __content ?? __response.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/AI21/Generated/AI21.Ai21Client.KirshGrantCompliancePrefixPreviewSolutionsPreviewKirshGrantCompliancePost.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.KirshGrantCompliancePrefixPreviewSolutionsPreviewKirshGrantCompliancePost.g.cs deleted file mode 100644 index f2df7857..00000000 --- a/src/libs/AI21/Generated/AI21.Ai21Client.KirshGrantCompliancePrefixPreviewSolutionsPreviewKirshGrantCompliancePost.g.cs +++ /dev/null @@ -1,188 +0,0 @@ - -#nullable enable - -namespace AI21 -{ - public partial class Ai21Client - { - - - private static readonly global::AI21.EndPointSecurityRequirement s_KirshGrantCompliancePrefixPreviewSolutionsPreviewKirshGrantCompliancePostSecurityRequirement0 = - new global::AI21.EndPointSecurityRequirement - { - Authorizations = new global::AI21.EndPointAuthorizationRequirement[] - { new global::AI21.EndPointAuthorizationRequirement - { - Type = "Http", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::AI21.EndPointSecurityRequirement[] s_KirshGrantCompliancePrefixPreviewSolutionsPreviewKirshGrantCompliancePostSecurityRequirements = - new global::AI21.EndPointSecurityRequirement[] - { s_KirshGrantCompliancePrefixPreviewSolutionsPreviewKirshGrantCompliancePostSecurityRequirement0, - }; - partial void PrepareKirshGrantCompliancePrefixPreviewSolutionsPreviewKirshGrantCompliancePostArguments( - global::System.Net.Http.HttpClient httpClient); - partial void PrepareKirshGrantCompliancePrefixPreviewSolutionsPreviewKirshGrantCompliancePostRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage); - partial void ProcessKirshGrantCompliancePrefixPreviewSolutionsPreviewKirshGrantCompliancePostResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessKirshGrantCompliancePrefixPreviewSolutionsPreviewKirshGrantCompliancePostResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Kirsh Grant Compliance Prefix Preview - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task KirshGrantCompliancePrefixPreviewSolutionsPreviewKirshGrantCompliancePostAsync( - global::System.Threading.CancellationToken cancellationToken = default) - { - PrepareArguments( - client: HttpClient); - PrepareKirshGrantCompliancePrefixPreviewSolutionsPreviewKirshGrantCompliancePostArguments( - httpClient: HttpClient); - - - var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_KirshGrantCompliancePrefixPreviewSolutionsPreviewKirshGrantCompliancePostSecurityRequirements, - operationName: "KirshGrantCompliancePrefixPreviewSolutionsPreviewKirshGrantCompliancePostAsync"); - - var __pathBuilder = new global::AI21.PathBuilder( - path: "/solutions-preview/kirsh/grant-compliance", - 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); - } - } - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareKirshGrantCompliancePrefixPreviewSolutionsPreviewKirshGrantCompliancePostRequest( - 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); - ProcessKirshGrantCompliancePrefixPreviewSolutionsPreviewKirshGrantCompliancePostResponse( - 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); - ProcessKirshGrantCompliancePrefixPreviewSolutionsPreviewKirshGrantCompliancePostResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return __content; - } - catch (global::System.Exception __ex) - { - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __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::AI21.ApiException( - message: __content ?? __response.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/AI21/Generated/AI21.Ai21Client.KirshGrantComplianceSolutionsKirshGrantCompliancePost.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.KirshGrantComplianceSolutionsKirshGrantCompliancePost.g.cs deleted file mode 100644 index 3935fd8f..00000000 --- a/src/libs/AI21/Generated/AI21.Ai21Client.KirshGrantComplianceSolutionsKirshGrantCompliancePost.g.cs +++ /dev/null @@ -1,188 +0,0 @@ - -#nullable enable - -namespace AI21 -{ - public partial class Ai21Client - { - - - private static readonly global::AI21.EndPointSecurityRequirement s_KirshGrantComplianceSolutionsKirshGrantCompliancePostSecurityRequirement0 = - new global::AI21.EndPointSecurityRequirement - { - Authorizations = new global::AI21.EndPointAuthorizationRequirement[] - { new global::AI21.EndPointAuthorizationRequirement - { - Type = "Http", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::AI21.EndPointSecurityRequirement[] s_KirshGrantComplianceSolutionsKirshGrantCompliancePostSecurityRequirements = - new global::AI21.EndPointSecurityRequirement[] - { s_KirshGrantComplianceSolutionsKirshGrantCompliancePostSecurityRequirement0, - }; - partial void PrepareKirshGrantComplianceSolutionsKirshGrantCompliancePostArguments( - global::System.Net.Http.HttpClient httpClient); - partial void PrepareKirshGrantComplianceSolutionsKirshGrantCompliancePostRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage); - partial void ProcessKirshGrantComplianceSolutionsKirshGrantCompliancePostResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessKirshGrantComplianceSolutionsKirshGrantCompliancePostResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Kirsh Grant Compliance - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task KirshGrantComplianceSolutionsKirshGrantCompliancePostAsync( - global::System.Threading.CancellationToken cancellationToken = default) - { - PrepareArguments( - client: HttpClient); - PrepareKirshGrantComplianceSolutionsKirshGrantCompliancePostArguments( - httpClient: HttpClient); - - - var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_KirshGrantComplianceSolutionsKirshGrantCompliancePostSecurityRequirements, - operationName: "KirshGrantComplianceSolutionsKirshGrantCompliancePostAsync"); - - var __pathBuilder = new global::AI21.PathBuilder( - path: "/solutions/kirsh/grant-compliance", - 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); - } - } - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareKirshGrantComplianceSolutionsKirshGrantCompliancePostRequest( - 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); - ProcessKirshGrantComplianceSolutionsKirshGrantCompliancePostResponse( - 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); - ProcessKirshGrantComplianceSolutionsKirshGrantCompliancePostResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return __content; - } - catch (global::System.Exception __ex) - { - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __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::AI21.ApiException( - message: __content ?? __response.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/AI21/Generated/AI21.Ai21Client.KirshGrantMetadataPrefixPreviewSolutionsPreviewKirshGrantMetadataPost.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.KirshGrantMetadataPrefixPreviewSolutionsPreviewKirshGrantMetadataPost.g.cs deleted file mode 100644 index 4b9df551..00000000 --- a/src/libs/AI21/Generated/AI21.Ai21Client.KirshGrantMetadataPrefixPreviewSolutionsPreviewKirshGrantMetadataPost.g.cs +++ /dev/null @@ -1,188 +0,0 @@ - -#nullable enable - -namespace AI21 -{ - public partial class Ai21Client - { - - - private static readonly global::AI21.EndPointSecurityRequirement s_KirshGrantMetadataPrefixPreviewSolutionsPreviewKirshGrantMetadataPostSecurityRequirement0 = - new global::AI21.EndPointSecurityRequirement - { - Authorizations = new global::AI21.EndPointAuthorizationRequirement[] - { new global::AI21.EndPointAuthorizationRequirement - { - Type = "Http", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::AI21.EndPointSecurityRequirement[] s_KirshGrantMetadataPrefixPreviewSolutionsPreviewKirshGrantMetadataPostSecurityRequirements = - new global::AI21.EndPointSecurityRequirement[] - { s_KirshGrantMetadataPrefixPreviewSolutionsPreviewKirshGrantMetadataPostSecurityRequirement0, - }; - partial void PrepareKirshGrantMetadataPrefixPreviewSolutionsPreviewKirshGrantMetadataPostArguments( - global::System.Net.Http.HttpClient httpClient); - partial void PrepareKirshGrantMetadataPrefixPreviewSolutionsPreviewKirshGrantMetadataPostRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage); - partial void ProcessKirshGrantMetadataPrefixPreviewSolutionsPreviewKirshGrantMetadataPostResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessKirshGrantMetadataPrefixPreviewSolutionsPreviewKirshGrantMetadataPostResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Kirsh Grant Metadata Prefix Preview - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task KirshGrantMetadataPrefixPreviewSolutionsPreviewKirshGrantMetadataPostAsync( - global::System.Threading.CancellationToken cancellationToken = default) - { - PrepareArguments( - client: HttpClient); - PrepareKirshGrantMetadataPrefixPreviewSolutionsPreviewKirshGrantMetadataPostArguments( - httpClient: HttpClient); - - - var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_KirshGrantMetadataPrefixPreviewSolutionsPreviewKirshGrantMetadataPostSecurityRequirements, - operationName: "KirshGrantMetadataPrefixPreviewSolutionsPreviewKirshGrantMetadataPostAsync"); - - var __pathBuilder = new global::AI21.PathBuilder( - path: "/solutions-preview/kirsh/grant-metadata", - 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); - } - } - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareKirshGrantMetadataPrefixPreviewSolutionsPreviewKirshGrantMetadataPostRequest( - 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); - ProcessKirshGrantMetadataPrefixPreviewSolutionsPreviewKirshGrantMetadataPostResponse( - 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); - ProcessKirshGrantMetadataPrefixPreviewSolutionsPreviewKirshGrantMetadataPostResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return __content; - } - catch (global::System.Exception __ex) - { - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __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::AI21.ApiException( - message: __content ?? __response.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/AI21/Generated/AI21.Ai21Client.KirshGrantMetadataSolutionsKirshGrantMetadataPost.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.KirshGrantMetadataSolutionsKirshGrantMetadataPost.g.cs deleted file mode 100644 index cbd08e5c..00000000 --- a/src/libs/AI21/Generated/AI21.Ai21Client.KirshGrantMetadataSolutionsKirshGrantMetadataPost.g.cs +++ /dev/null @@ -1,188 +0,0 @@ - -#nullable enable - -namespace AI21 -{ - public partial class Ai21Client - { - - - private static readonly global::AI21.EndPointSecurityRequirement s_KirshGrantMetadataSolutionsKirshGrantMetadataPostSecurityRequirement0 = - new global::AI21.EndPointSecurityRequirement - { - Authorizations = new global::AI21.EndPointAuthorizationRequirement[] - { new global::AI21.EndPointAuthorizationRequirement - { - Type = "Http", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::AI21.EndPointSecurityRequirement[] s_KirshGrantMetadataSolutionsKirshGrantMetadataPostSecurityRequirements = - new global::AI21.EndPointSecurityRequirement[] - { s_KirshGrantMetadataSolutionsKirshGrantMetadataPostSecurityRequirement0, - }; - partial void PrepareKirshGrantMetadataSolutionsKirshGrantMetadataPostArguments( - global::System.Net.Http.HttpClient httpClient); - partial void PrepareKirshGrantMetadataSolutionsKirshGrantMetadataPostRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage); - partial void ProcessKirshGrantMetadataSolutionsKirshGrantMetadataPostResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessKirshGrantMetadataSolutionsKirshGrantMetadataPostResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Kirsh Grant Metadata - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task KirshGrantMetadataSolutionsKirshGrantMetadataPostAsync( - global::System.Threading.CancellationToken cancellationToken = default) - { - PrepareArguments( - client: HttpClient); - PrepareKirshGrantMetadataSolutionsKirshGrantMetadataPostArguments( - httpClient: HttpClient); - - - var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_KirshGrantMetadataSolutionsKirshGrantMetadataPostSecurityRequirements, - operationName: "KirshGrantMetadataSolutionsKirshGrantMetadataPostAsync"); - - var __pathBuilder = new global::AI21.PathBuilder( - path: "/solutions/kirsh/grant-metadata", - 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); - } - } - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareKirshGrantMetadataSolutionsKirshGrantMetadataPostRequest( - 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); - ProcessKirshGrantMetadataSolutionsKirshGrantMetadataPostResponse( - 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); - ProcessKirshGrantMetadataSolutionsKirshGrantMetadataPostResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return __content; - } - catch (global::System.Exception __ex) - { - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __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::AI21.ApiException( - message: __content ?? __response.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/AI21/Generated/AI21.Ai21Client.KirshPublicInformationCheckPrefixPreviewSolutionsPreviewKirshPublicInformationCheckPost.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.KirshPublicInformationCheckPrefixPreviewSolutionsPreviewKirshPublicInformationCheckPost.g.cs deleted file mode 100644 index 05968fc3..00000000 --- a/src/libs/AI21/Generated/AI21.Ai21Client.KirshPublicInformationCheckPrefixPreviewSolutionsPreviewKirshPublicInformationCheckPost.g.cs +++ /dev/null @@ -1,188 +0,0 @@ - -#nullable enable - -namespace AI21 -{ - public partial class Ai21Client - { - - - private static readonly global::AI21.EndPointSecurityRequirement s_KirshPublicInformationCheckPrefixPreviewSolutionsPreviewKirshPublicInformationCheckPostSecurityRequirement0 = - new global::AI21.EndPointSecurityRequirement - { - Authorizations = new global::AI21.EndPointAuthorizationRequirement[] - { new global::AI21.EndPointAuthorizationRequirement - { - Type = "Http", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::AI21.EndPointSecurityRequirement[] s_KirshPublicInformationCheckPrefixPreviewSolutionsPreviewKirshPublicInformationCheckPostSecurityRequirements = - new global::AI21.EndPointSecurityRequirement[] - { s_KirshPublicInformationCheckPrefixPreviewSolutionsPreviewKirshPublicInformationCheckPostSecurityRequirement0, - }; - partial void PrepareKirshPublicInformationCheckPrefixPreviewSolutionsPreviewKirshPublicInformationCheckPostArguments( - global::System.Net.Http.HttpClient httpClient); - partial void PrepareKirshPublicInformationCheckPrefixPreviewSolutionsPreviewKirshPublicInformationCheckPostRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage); - partial void ProcessKirshPublicInformationCheckPrefixPreviewSolutionsPreviewKirshPublicInformationCheckPostResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessKirshPublicInformationCheckPrefixPreviewSolutionsPreviewKirshPublicInformationCheckPostResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Kirsh Public Information Check Prefix Preview - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task KirshPublicInformationCheckPrefixPreviewSolutionsPreviewKirshPublicInformationCheckPostAsync( - global::System.Threading.CancellationToken cancellationToken = default) - { - PrepareArguments( - client: HttpClient); - PrepareKirshPublicInformationCheckPrefixPreviewSolutionsPreviewKirshPublicInformationCheckPostArguments( - httpClient: HttpClient); - - - var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_KirshPublicInformationCheckPrefixPreviewSolutionsPreviewKirshPublicInformationCheckPostSecurityRequirements, - operationName: "KirshPublicInformationCheckPrefixPreviewSolutionsPreviewKirshPublicInformationCheckPostAsync"); - - var __pathBuilder = new global::AI21.PathBuilder( - path: "/solutions-preview/kirsh/public-information-check", - 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); - } - } - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareKirshPublicInformationCheckPrefixPreviewSolutionsPreviewKirshPublicInformationCheckPostRequest( - 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); - ProcessKirshPublicInformationCheckPrefixPreviewSolutionsPreviewKirshPublicInformationCheckPostResponse( - 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); - ProcessKirshPublicInformationCheckPrefixPreviewSolutionsPreviewKirshPublicInformationCheckPostResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return __content; - } - catch (global::System.Exception __ex) - { - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __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::AI21.ApiException( - message: __content ?? __response.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/AI21/Generated/AI21.Ai21Client.KirshPublicInformationCheckSolutionsKirshPublicInformationCheckPost.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.KirshPublicInformationCheckSolutionsKirshPublicInformationCheckPost.g.cs deleted file mode 100644 index 9bc7a736..00000000 --- a/src/libs/AI21/Generated/AI21.Ai21Client.KirshPublicInformationCheckSolutionsKirshPublicInformationCheckPost.g.cs +++ /dev/null @@ -1,188 +0,0 @@ - -#nullable enable - -namespace AI21 -{ - public partial class Ai21Client - { - - - private static readonly global::AI21.EndPointSecurityRequirement s_KirshPublicInformationCheckSolutionsKirshPublicInformationCheckPostSecurityRequirement0 = - new global::AI21.EndPointSecurityRequirement - { - Authorizations = new global::AI21.EndPointAuthorizationRequirement[] - { new global::AI21.EndPointAuthorizationRequirement - { - Type = "Http", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::AI21.EndPointSecurityRequirement[] s_KirshPublicInformationCheckSolutionsKirshPublicInformationCheckPostSecurityRequirements = - new global::AI21.EndPointSecurityRequirement[] - { s_KirshPublicInformationCheckSolutionsKirshPublicInformationCheckPostSecurityRequirement0, - }; - partial void PrepareKirshPublicInformationCheckSolutionsKirshPublicInformationCheckPostArguments( - global::System.Net.Http.HttpClient httpClient); - partial void PrepareKirshPublicInformationCheckSolutionsKirshPublicInformationCheckPostRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage); - partial void ProcessKirshPublicInformationCheckSolutionsKirshPublicInformationCheckPostResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessKirshPublicInformationCheckSolutionsKirshPublicInformationCheckPostResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Kirsh Public Information Check - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task KirshPublicInformationCheckSolutionsKirshPublicInformationCheckPostAsync( - global::System.Threading.CancellationToken cancellationToken = default) - { - PrepareArguments( - client: HttpClient); - PrepareKirshPublicInformationCheckSolutionsKirshPublicInformationCheckPostArguments( - httpClient: HttpClient); - - - var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_KirshPublicInformationCheckSolutionsKirshPublicInformationCheckPostSecurityRequirements, - operationName: "KirshPublicInformationCheckSolutionsKirshPublicInformationCheckPostAsync"); - - var __pathBuilder = new global::AI21.PathBuilder( - path: "/solutions/kirsh/public-information-check", - 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); - } - } - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareKirshPublicInformationCheckSolutionsKirshPublicInformationCheckPostRequest( - 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); - ProcessKirshPublicInformationCheckSolutionsKirshPublicInformationCheckPostResponse( - 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); - ProcessKirshPublicInformationCheckSolutionsKirshPublicInformationCheckPostResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return __content; - } - catch (global::System.Exception __ex) - { - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __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::AI21.ApiException( - message: __content ?? __response.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/AI21/Generated/AI21.Ai21Client.ListAgentsGatewaySettingsAgentsGet.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.ListAgentsGatewaySettingsAgentsGet.g.cs new file mode 100644 index 00000000..9775fff5 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Ai21Client.ListAgentsGatewaySettingsAgentsGet.g.cs @@ -0,0 +1,415 @@ + +#nullable enable + +namespace AI21 +{ + public partial class Ai21Client + { + + + private static readonly global::AI21.EndPointSecurityRequirement s_ListAgentsGatewaySettingsAgentsGetSecurityRequirement0 = + new global::AI21.EndPointSecurityRequirement + { + Authorizations = new global::AI21.EndPointAuthorizationRequirement[] + { new global::AI21.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::AI21.EndPointSecurityRequirement[] s_ListAgentsGatewaySettingsAgentsGetSecurityRequirements = + new global::AI21.EndPointSecurityRequirement[] + { s_ListAgentsGatewaySettingsAgentsGetSecurityRequirement0, + }; + partial void PrepareListAgentsGatewaySettingsAgentsGetArguments( + global::System.Net.Http.HttpClient httpClient); + partial void PrepareListAgentsGatewaySettingsAgentsGetRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage); + partial void ProcessListAgentsGatewaySettingsAgentsGetResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessListAgentsGatewaySettingsAgentsGetResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// List Agents + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> ListAgentsGatewaySettingsAgentsGetAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ListAgentsGatewaySettingsAgentsGetAsResponseAsync( + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// List Agents + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task>> ListAgentsGatewaySettingsAgentsGetAsResponseAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareListAgentsGatewaySettingsAgentsGetArguments( + httpClient: HttpClient); + + + var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_ListAgentsGatewaySettingsAgentsGetSecurityRequirements, + operationName: "ListAgentsGatewaySettingsAgentsGetAsync"); + + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: "/gateway/settings/agents", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.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::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareListAgentsGatewaySettingsAgentsGetRequest( + 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::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ListAgentsGatewaySettingsAgentsGet", + methodName: "ListAgentsGatewaySettingsAgentsGetAsync", + pathTemplate: "\"/gateway/settings/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::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ListAgentsGatewaySettingsAgentsGet", + methodName: "ListAgentsGatewaySettingsAgentsGetAsync", + pathTemplate: "\"/gateway/settings/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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ListAgentsGatewaySettingsAgentsGet", + methodName: "ListAgentsGatewaySettingsAgentsGetAsync", + pathTemplate: "\"/gateway/settings/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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessListAgentsGatewaySettingsAgentsGetResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ListAgentsGatewaySettingsAgentsGet", + methodName: "ListAgentsGatewaySettingsAgentsGetAsync", + pathTemplate: "\"/gateway/settings/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::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ListAgentsGatewaySettingsAgentsGet", + methodName: "ListAgentsGatewaySettingsAgentsGetAsync", + pathTemplate: "\"/gateway/settings/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); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessListAgentsGatewaySettingsAgentsGetResponseContent( + 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::AI21.AutoSDKHttpResponse>( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => 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::AI21.AutoSDKHttpResponse>( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.ListAgentsTokenwiseSettingsAgentsGet.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.ListAgentsTokenwiseSettingsAgentsGet.g.cs new file mode 100644 index 00000000..bff4dbf5 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Ai21Client.ListAgentsTokenwiseSettingsAgentsGet.g.cs @@ -0,0 +1,415 @@ + +#nullable enable + +namespace AI21 +{ + public partial class Ai21Client + { + + + private static readonly global::AI21.EndPointSecurityRequirement s_ListAgentsTokenwiseSettingsAgentsGetSecurityRequirement0 = + new global::AI21.EndPointSecurityRequirement + { + Authorizations = new global::AI21.EndPointAuthorizationRequirement[] + { new global::AI21.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::AI21.EndPointSecurityRequirement[] s_ListAgentsTokenwiseSettingsAgentsGetSecurityRequirements = + new global::AI21.EndPointSecurityRequirement[] + { s_ListAgentsTokenwiseSettingsAgentsGetSecurityRequirement0, + }; + partial void PrepareListAgentsTokenwiseSettingsAgentsGetArguments( + global::System.Net.Http.HttpClient httpClient); + partial void PrepareListAgentsTokenwiseSettingsAgentsGetRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage); + partial void ProcessListAgentsTokenwiseSettingsAgentsGetResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessListAgentsTokenwiseSettingsAgentsGetResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// List Agents + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> ListAgentsTokenwiseSettingsAgentsGetAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ListAgentsTokenwiseSettingsAgentsGetAsResponseAsync( + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// List Agents + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task>> ListAgentsTokenwiseSettingsAgentsGetAsResponseAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareListAgentsTokenwiseSettingsAgentsGetArguments( + httpClient: HttpClient); + + + var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_ListAgentsTokenwiseSettingsAgentsGetSecurityRequirements, + operationName: "ListAgentsTokenwiseSettingsAgentsGetAsync"); + + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: "/tokenwise/settings/agents", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.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::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareListAgentsTokenwiseSettingsAgentsGetRequest( + 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::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ListAgentsTokenwiseSettingsAgentsGet", + methodName: "ListAgentsTokenwiseSettingsAgentsGetAsync", + pathTemplate: "\"/tokenwise/settings/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::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ListAgentsTokenwiseSettingsAgentsGet", + methodName: "ListAgentsTokenwiseSettingsAgentsGetAsync", + pathTemplate: "\"/tokenwise/settings/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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ListAgentsTokenwiseSettingsAgentsGet", + methodName: "ListAgentsTokenwiseSettingsAgentsGetAsync", + pathTemplate: "\"/tokenwise/settings/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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessListAgentsTokenwiseSettingsAgentsGetResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ListAgentsTokenwiseSettingsAgentsGet", + methodName: "ListAgentsTokenwiseSettingsAgentsGetAsync", + pathTemplate: "\"/tokenwise/settings/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::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ListAgentsTokenwiseSettingsAgentsGet", + methodName: "ListAgentsTokenwiseSettingsAgentsGetAsync", + pathTemplate: "\"/tokenwise/settings/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); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessListAgentsTokenwiseSettingsAgentsGetResponseContent( + 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::AI21.AutoSDKHttpResponse>( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => 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::AI21.AutoSDKHttpResponse>( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.ListConfigsGatewaySettingsConfigsGet.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.ListConfigsGatewaySettingsConfigsGet.g.cs new file mode 100644 index 00000000..3addc3f1 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Ai21Client.ListConfigsGatewaySettingsConfigsGet.g.cs @@ -0,0 +1,415 @@ + +#nullable enable + +namespace AI21 +{ + public partial class Ai21Client + { + + + private static readonly global::AI21.EndPointSecurityRequirement s_ListConfigsGatewaySettingsConfigsGetSecurityRequirement0 = + new global::AI21.EndPointSecurityRequirement + { + Authorizations = new global::AI21.EndPointAuthorizationRequirement[] + { new global::AI21.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::AI21.EndPointSecurityRequirement[] s_ListConfigsGatewaySettingsConfigsGetSecurityRequirements = + new global::AI21.EndPointSecurityRequirement[] + { s_ListConfigsGatewaySettingsConfigsGetSecurityRequirement0, + }; + partial void PrepareListConfigsGatewaySettingsConfigsGetArguments( + global::System.Net.Http.HttpClient httpClient); + partial void PrepareListConfigsGatewaySettingsConfigsGetRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage); + partial void ProcessListConfigsGatewaySettingsConfigsGetResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessListConfigsGatewaySettingsConfigsGetResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// List Configs + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> ListConfigsGatewaySettingsConfigsGetAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ListConfigsGatewaySettingsConfigsGetAsResponseAsync( + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// List Configs + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task>> ListConfigsGatewaySettingsConfigsGetAsResponseAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareListConfigsGatewaySettingsConfigsGetArguments( + httpClient: HttpClient); + + + var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_ListConfigsGatewaySettingsConfigsGetSecurityRequirements, + operationName: "ListConfigsGatewaySettingsConfigsGetAsync"); + + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: "/gateway/settings/configs", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.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::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareListConfigsGatewaySettingsConfigsGetRequest( + 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::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ListConfigsGatewaySettingsConfigsGet", + methodName: "ListConfigsGatewaySettingsConfigsGetAsync", + pathTemplate: "\"/gateway/settings/configs\"", + 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::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ListConfigsGatewaySettingsConfigsGet", + methodName: "ListConfigsGatewaySettingsConfigsGetAsync", + pathTemplate: "\"/gateway/settings/configs\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ListConfigsGatewaySettingsConfigsGet", + methodName: "ListConfigsGatewaySettingsConfigsGetAsync", + pathTemplate: "\"/gateway/settings/configs\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessListConfigsGatewaySettingsConfigsGetResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ListConfigsGatewaySettingsConfigsGet", + methodName: "ListConfigsGatewaySettingsConfigsGetAsync", + pathTemplate: "\"/gateway/settings/configs\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ListConfigsGatewaySettingsConfigsGet", + methodName: "ListConfigsGatewaySettingsConfigsGetAsync", + pathTemplate: "\"/gateway/settings/configs\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: __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); + ProcessListConfigsGatewaySettingsConfigsGetResponseContent( + 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::AI21.AutoSDKHttpResponse>( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => 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::AI21.AutoSDKHttpResponse>( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.ListConfigsTokenwiseSettingsConfigsGet.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.ListConfigsTokenwiseSettingsConfigsGet.g.cs new file mode 100644 index 00000000..30fa19ee --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Ai21Client.ListConfigsTokenwiseSettingsConfigsGet.g.cs @@ -0,0 +1,415 @@ + +#nullable enable + +namespace AI21 +{ + public partial class Ai21Client + { + + + private static readonly global::AI21.EndPointSecurityRequirement s_ListConfigsTokenwiseSettingsConfigsGetSecurityRequirement0 = + new global::AI21.EndPointSecurityRequirement + { + Authorizations = new global::AI21.EndPointAuthorizationRequirement[] + { new global::AI21.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::AI21.EndPointSecurityRequirement[] s_ListConfigsTokenwiseSettingsConfigsGetSecurityRequirements = + new global::AI21.EndPointSecurityRequirement[] + { s_ListConfigsTokenwiseSettingsConfigsGetSecurityRequirement0, + }; + partial void PrepareListConfigsTokenwiseSettingsConfigsGetArguments( + global::System.Net.Http.HttpClient httpClient); + partial void PrepareListConfigsTokenwiseSettingsConfigsGetRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage); + partial void ProcessListConfigsTokenwiseSettingsConfigsGetResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessListConfigsTokenwiseSettingsConfigsGetResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// List Configs + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> ListConfigsTokenwiseSettingsConfigsGetAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ListConfigsTokenwiseSettingsConfigsGetAsResponseAsync( + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// List Configs + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task>> ListConfigsTokenwiseSettingsConfigsGetAsResponseAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareListConfigsTokenwiseSettingsConfigsGetArguments( + httpClient: HttpClient); + + + var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_ListConfigsTokenwiseSettingsConfigsGetSecurityRequirements, + operationName: "ListConfigsTokenwiseSettingsConfigsGetAsync"); + + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: "/tokenwise/settings/configs", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.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::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareListConfigsTokenwiseSettingsConfigsGetRequest( + 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::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ListConfigsTokenwiseSettingsConfigsGet", + methodName: "ListConfigsTokenwiseSettingsConfigsGetAsync", + pathTemplate: "\"/tokenwise/settings/configs\"", + 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::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ListConfigsTokenwiseSettingsConfigsGet", + methodName: "ListConfigsTokenwiseSettingsConfigsGetAsync", + pathTemplate: "\"/tokenwise/settings/configs\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ListConfigsTokenwiseSettingsConfigsGet", + methodName: "ListConfigsTokenwiseSettingsConfigsGetAsync", + pathTemplate: "\"/tokenwise/settings/configs\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessListConfigsTokenwiseSettingsConfigsGetResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ListConfigsTokenwiseSettingsConfigsGet", + methodName: "ListConfigsTokenwiseSettingsConfigsGetAsync", + pathTemplate: "\"/tokenwise/settings/configs\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ListConfigsTokenwiseSettingsConfigsGet", + methodName: "ListConfigsTokenwiseSettingsConfigsGetAsync", + pathTemplate: "\"/tokenwise/settings/configs\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: __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); + ProcessListConfigsTokenwiseSettingsConfigsGetResponseContent( + 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::AI21.AutoSDKHttpResponse>( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => 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::AI21.AutoSDKHttpResponse>( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.ListDemosStudioV1DemosGet.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.ListDemosStudioV1DemosGet.g.cs index 002ca4a3..47cf6939 100644 --- a/src/libs/AI21/Generated/AI21.Ai21Client.ListDemosStudioV1DemosGet.g.cs +++ b/src/libs/AI21/Generated/AI21.Ai21Client.ListDemosStudioV1DemosGet.g.cs @@ -14,6 +14,7 @@ public partial class Ai21Client { new global::AI21.EndPointAuthorizationRequirement { Type = "Http", + SchemeId = "HttpBearer", Location = "Header", Name = "Bearer", FriendlyName = "Bearer", @@ -42,9 +43,29 @@ partial void ProcessListDemosStudioV1DemosGetResponseContent( /// List Demos
/// List all available demos. ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// public async global::System.Threading.Tasks.Task> ListDemosStudioV1DemosGetAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ListDemosStudioV1DemosGetAsResponseAsync( + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// List Demos
+ /// List all available demos. + ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task>> ListDemosStudioV1DemosGetAsResponseAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( @@ -58,22 +79,44 @@ partial void ProcessListDemosStudioV1DemosGetResponseContent( securityRequirements: s_ListDemosStudioV1DemosGetSecurityRequirements, operationName: "ListDemosStudioV1DemosGetAsync"); - var __pathBuilder = new global::AI21.PathBuilder( - path: "/studio/v1/demos", - 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)); + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: "/studio/v1/demos", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.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; + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; #endif foreach (var __authorization in __authorizations) { if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2") + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") { __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( scheme: __authorization.Name, @@ -83,111 +126,292 @@ partial void ProcessListDemosStudioV1DemosGetResponseContent( __authorization.Location == "Header") { __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } + } } + global::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareListDemosStudioV1DemosGetRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareListDemosStudioV1DemosGetRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest); - ProcessResponse( - client: HttpClient, - response: __response); - ProcessListDemosStudioV1DemosGetResponse( - httpClient: HttpClient, - httpResponseMessage: __response); + return __httpRequest; + } - if (ReadResponseAsString) + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ListDemosStudioV1DemosGet", + methodName: "ListDemosStudioV1DemosGetAsync", + pathTemplate: "\"/studio/v1/demos\"", + 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::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ListDemosStudioV1DemosGet", + methodName: "ListDemosStudioV1DemosGetAsync", + pathTemplate: "\"/studio/v1/demos\"", + 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; + } - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessListDemosStudioV1DemosGetResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } - try - { - __response.EnsureSuccessStatusCode(); + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ListDemosStudioV1DemosGet", + methodName: "ListDemosStudioV1DemosGetAsync", + pathTemplate: "\"/studio/v1/demos\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } - 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}\" "); + break; } - catch (global::System.Exception __ex) + + if (__response == null) { - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; + throw new global::System.InvalidOperationException("No response received."); } - } - else - { - try + + using (__response) { - __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."); + ProcessResponse( + client: HttpClient, + response: __response); + ProcessListDemosStudioV1DemosGetResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ListDemosStudioV1DemosGet", + methodName: "ListDemosStudioV1DemosGetAsync", + pathTemplate: "\"/studio/v1/demos\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } - catch (global::System.Exception __ex) + else { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ListDemosStudioV1DemosGet", + methodName: "ListDemosStudioV1DemosGetAsync", + pathTemplate: "\"/studio/v1/demos\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: __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); + ProcessListDemosStudioV1DemosGetResponseContent( + 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::AI21.AutoSDKHttpResponse>( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => 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::AI21.AutoSDKHttpResponse>( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; } } + finally + { + __httpRequest?.Dispose(); + } } } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.ListMcpStorageStudioV1McpStorageGet.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.ListMcpStorageStudioV1McpStorageGet.g.cs index b62dac54..6f0f129d 100644 --- a/src/libs/AI21/Generated/AI21.Ai21Client.ListMcpStorageStudioV1McpStorageGet.g.cs +++ b/src/libs/AI21/Generated/AI21.Ai21Client.ListMcpStorageStudioV1McpStorageGet.g.cs @@ -14,6 +14,7 @@ public partial class Ai21Client { new global::AI21.EndPointAuthorizationRequirement { Type = "Http", + SchemeId = "HttpBearer", Location = "Header", Name = "Bearer", FriendlyName = "Bearer", @@ -44,10 +45,32 @@ partial void ProcessListMcpStorageStudioV1McpStorageGetResponseContent( /// List Mcp Storage /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// public async global::System.Threading.Tasks.Task ListMcpStorageStudioV1McpStorageGetAsync( global::System.Guid? workspaceId = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ListMcpStorageStudioV1McpStorageGetAsResponseAsync( + workspaceId: workspaceId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// List Mcp Storage + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> ListMcpStorageStudioV1McpStorageGetAsResponseAsync( + global::System.Guid? workspaceId = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( @@ -62,25 +85,47 @@ partial void ProcessListMcpStorageStudioV1McpStorageGetResponseContent( securityRequirements: s_ListMcpStorageStudioV1McpStorageGetSecurityRequirements, operationName: "ListMcpStorageStudioV1McpStorageGetAsync"); - var __pathBuilder = new global::AI21.PathBuilder( - path: "/studio/v1/mcp/storage", - baseUri: HttpClient.BaseAddress); - __pathBuilder - .AddOptionalParameter("workspace_id", workspaceId?.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)); + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: "/studio/v1/mcp/storage", + baseUri: HttpClient.BaseAddress); + __pathBuilder + .AddOptionalParameter("workspace_id", workspaceId?.ToString()) + ; + var __path = __pathBuilder.ToString(); + __path = global::AI21.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; + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; #endif foreach (var __authorization in __authorizations) { if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2") + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") { __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( scheme: __authorization.Name, @@ -90,150 +135,330 @@ partial void ProcessListMcpStorageStudioV1McpStorageGetResponseContent( __authorization.Location == "Header") { __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } + } } + global::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareListMcpStorageStudioV1McpStorageGetRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - workspaceId: workspaceId); + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareListMcpStorageStudioV1McpStorageGetRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + workspaceId: workspaceId); - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); + return __httpRequest; + } - ProcessResponse( - client: HttpClient, - response: __response); - ProcessListMcpStorageStudioV1McpStorageGetResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Validation Error - if ((int)__response.StatusCode == 422) + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::AI21.HTTPValidationError? __value_422 = null; - try + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) { - if (ReadResponseAsString) + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ListMcpStorageStudioV1McpStorageGet", + methodName: "ListMcpStorageStudioV1McpStorageGetAsync", + pathTemplate: "\"/studio/v1/mcp/storage\"", + 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 { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); } - else + catch (global::System.Net.Http.HttpRequestException __exception) { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ListMcpStorageStudioV1McpStorageGet", + methodName: "ListMcpStorageStudioV1McpStorageGetAsync", + pathTemplate: "\"/studio/v1/mcp/storage\"", + 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; + } - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ListMcpStorageStudioV1McpStorageGet", + methodName: "ListMcpStorageStudioV1McpStorageGetAsync", + pathTemplate: "\"/studio/v1/mcp/storage\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; } - catch (global::System.Exception __ex) + + if (__response == null) { - __exception_422 = __ex; + throw new global::System.InvalidOperationException("No response received."); } - throw new global::AI21.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) + using (__response) { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - ProcessResponseContent( + ProcessResponse( client: HttpClient, - response: __response, - content: ref __content); - ProcessListMcpStorageStudioV1McpStorageGetResponseContent( + response: __response); + ProcessListMcpStorageStudioV1McpStorageGetResponse( httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) { - __response.EnsureSuccessStatusCode(); - - return - global::AI21.ListMCPsStorageResponse.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ListMcpStorageStudioV1McpStorageGet", + methodName: "ListMcpStorageStudioV1McpStorageGetAsync", + pathTemplate: "\"/studio/v1/mcp/storage\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } - catch (global::System.Exception __ex) + else { - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ListMcpStorageStudioV1McpStorageGet", + methodName: "ListMcpStorageStudioV1McpStorageGetAsync", + pathTemplate: "\"/studio/v1/mcp/storage\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - using var __content = await __response.Content.ReadAsStreamAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::AI21.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - return - await global::AI21.ListMCPsStorageResponse.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) - { - } + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessListMcpStorageStudioV1McpStorageGetResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::AI21.ListMCPsStorageResponse.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => 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::AI21.ListMCPsStorageResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; } } + finally + { + __httpRequest?.Dispose(); + } } } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.McpToolDiscoveryStudioV1McpDiscoverPost.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.McpToolDiscoveryStudioV1McpDiscoverPost.g.cs deleted file mode 100644 index 7db18bf4..00000000 --- a/src/libs/AI21/Generated/AI21.Ai21Client.McpToolDiscoveryStudioV1McpDiscoverPost.g.cs +++ /dev/null @@ -1,270 +0,0 @@ - -#nullable enable - -namespace AI21 -{ - public partial class Ai21Client - { - - - private static readonly global::AI21.EndPointSecurityRequirement s_McpToolDiscoveryStudioV1McpDiscoverPostSecurityRequirement0 = - new global::AI21.EndPointSecurityRequirement - { - Authorizations = new global::AI21.EndPointAuthorizationRequirement[] - { new global::AI21.EndPointAuthorizationRequirement - { - Type = "Http", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::AI21.EndPointSecurityRequirement[] s_McpToolDiscoveryStudioV1McpDiscoverPostSecurityRequirements = - new global::AI21.EndPointSecurityRequirement[] - { s_McpToolDiscoveryStudioV1McpDiscoverPostSecurityRequirement0, - }; - partial void PrepareMcpToolDiscoveryStudioV1McpDiscoverPostArguments( - global::System.Net.Http.HttpClient httpClient, - global::AI21.MCPDefinition request); - partial void PrepareMcpToolDiscoveryStudioV1McpDiscoverPostRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - global::AI21.MCPDefinition request); - partial void ProcessMcpToolDiscoveryStudioV1McpDiscoverPostResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessMcpToolDiscoveryStudioV1McpDiscoverPostResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Mcp Tool Discovery - /// - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task McpToolDiscoveryStudioV1McpDiscoverPostAsync( - - global::AI21.MCPDefinition request, - global::System.Threading.CancellationToken cancellationToken = default) - { - request = request ?? throw new global::System.ArgumentNullException(nameof(request)); - - PrepareArguments( - client: HttpClient); - PrepareMcpToolDiscoveryStudioV1McpDiscoverPostArguments( - httpClient: HttpClient, - request: request); - - - var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_McpToolDiscoveryStudioV1McpDiscoverPostSecurityRequirements, - operationName: "McpToolDiscoveryStudioV1McpDiscoverPostAsync"); - - var __pathBuilder = new global::AI21.PathBuilder( - path: "/studio/v1/mcp/discover", - 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); - PrepareMcpToolDiscoveryStudioV1McpDiscoverPostRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - 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); - ProcessMcpToolDiscoveryStudioV1McpDiscoverPostResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Validation Error - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::AI21.HTTPValidationError? __value_422 = null; - try - { - if (ReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - throw new global::AI21.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) - { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessMcpToolDiscoveryStudioV1McpDiscoverPostResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return - global::AI21.MCPDiscoveryResponse.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - } - catch (global::System.Exception __ex) - { - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __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::AI21.MCPDiscoveryResponse.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::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - } - /// - /// Mcp Tool Discovery - /// - /// - /// - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task McpToolDiscoveryStudioV1McpDiscoverPostAsync( - string serverUrl, - string? serverLabel = default, - object? headers = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __request = new global::AI21.MCPDefinition - { - ServerUrl = serverUrl, - ServerLabel = serverLabel, - Headers = headers, - }; - - return await McpToolDiscoveryStudioV1McpDiscoverPostAsync( - request: __request, - cancellationToken: cancellationToken).ConfigureAwait(false); - } - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.ParsePdfStudioV1DemosDocumentModifierParsePdfPost.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.ParsePdfStudioV1DemosDocumentModifierParsePdfPost.g.cs index fb2c133e..dcc37960 100644 --- a/src/libs/AI21/Generated/AI21.Ai21Client.ParsePdfStudioV1DemosDocumentModifierParsePdfPost.g.cs +++ b/src/libs/AI21/Generated/AI21.Ai21Client.ParsePdfStudioV1DemosDocumentModifierParsePdfPost.g.cs @@ -14,6 +14,7 @@ public partial class Ai21Client { new global::AI21.EndPointAuthorizationRequirement { Type = "Http", + SchemeId = "HttpBearer", Location = "Header", Name = "Bearer", FriendlyName = "Bearer", @@ -45,11 +46,36 @@ partial void ProcessParsePdfStudioV1DemosDocumentModifierParsePdfPostResponseCon /// Parse a PDF file and return its contents. /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// public async global::System.Threading.Tasks.Task ParsePdfStudioV1DemosDocumentModifierParsePdfPostAsync( global::AI21.BodyParsePdfStudioV1DemosDocumentModifierParsePdfPost request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ParsePdfStudioV1DemosDocumentModifierParsePdfPostAsResponseAsync( + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Parse Pdf
+ /// Parse a PDF file and return its contents. + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> ParsePdfStudioV1DemosDocumentModifierParsePdfPostAsResponseAsync( + + global::AI21.BodyParsePdfStudioV1DemosDocumentModifierParsePdfPost request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) { request = request ?? throw new global::System.ArgumentNullException(nameof(request)); @@ -66,22 +92,44 @@ partial void ProcessParsePdfStudioV1DemosDocumentModifierParsePdfPostResponseCon securityRequirements: s_ParsePdfStudioV1DemosDocumentModifierParsePdfPostSecurityRequirements, operationName: "ParsePdfStudioV1DemosDocumentModifierParsePdfPostAsync"); - var __pathBuilder = new global::AI21.PathBuilder( - path: "/studio/v1/demos/document-modifier/parse-pdf", - 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)); + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: false); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: "/studio/v1/demos/document-modifier/parse-pdf", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.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; + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; #endif foreach (var __authorization in __authorizations) { if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2") + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") { __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( scheme: __authorization.Name, @@ -91,180 +139,1279 @@ partial void ProcessParsePdfStudioV1DemosDocumentModifierParsePdfPostResponseCon __authorization.Location == "Header") { __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - using var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); - 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; + } } - __httpRequest.Content = __httpRequestContent; - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareParsePdfStudioV1DemosDocumentModifierParsePdfPostRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - request: request); + var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); + var __contentFile = new global::System.Net.Http.ByteArrayContent(request.File ?? global::System.Array.Empty()); + __contentFile.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( + request.Filename is null + ? "application/octet-stream" + : (global::System.IO.Path.GetExtension(request.Filename) ?? string.Empty).ToLowerInvariant() switch + { + ".aac" => "audio/aac", + ".flac" => "audio/flac", + ".gif" => "image/gif", + ".jpeg" => "image/jpeg", + ".jpg" => "image/jpeg", + ".json" => "application/json", + ".m4a" => "audio/mp4", + ".mp3" => "audio/mpeg", + ".mp4" => "video/mp4", + ".mpeg" => "audio/mpeg", + ".mpga" => "audio/mpeg", + ".oga" => "audio/ogg", + ".ogg" => "audio/ogg", + ".opus" => "audio/ogg", + ".pdf" => "application/pdf", + ".png" => "image/png", + ".txt" => "text/plain", + ".wav" => "audio/wav", + ".weba" => "audio/webm", + ".webm" => "video/webm", + ".webp" => "image/webp", + _ => "application/octet-stream", + }); + __httpRequestContent.Add( + content: __contentFile, + name: "\"file\"", + fileName: request.Filename != null ? $"\"{request.Filename}\"" : string.Empty); + if (__contentFile.Headers.ContentDisposition != null) + { + __contentFile.Headers.ContentDisposition.FileNameStar = null; + } - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); + __httpRequest.Content = __httpRequestContent; - ProcessResponse( - client: HttpClient, - response: __response); - ProcessParsePdfStudioV1DemosDocumentModifierParsePdfPostResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Validation Error - if ((int)__response.StatusCode == 422) + global::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareParsePdfStudioV1DemosDocumentModifierParsePdfPostRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + request: request); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::AI21.HTTPValidationError? __value_422 = null; - try + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) { - if (ReadResponseAsString) + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ParsePdfStudioV1DemosDocumentModifierParsePdfPost", + methodName: "ParsePdfStudioV1DemosDocumentModifierParsePdfPostAsync", + pathTemplate: "\"/studio/v1/demos/document-modifier/parse-pdf\"", + 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 { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); } - else + catch (global::System.Net.Http.HttpRequestException __exception) { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ParsePdfStudioV1DemosDocumentModifierParsePdfPost", + methodName: "ParsePdfStudioV1DemosDocumentModifierParsePdfPostAsync", + pathTemplate: "\"/studio/v1/demos/document-modifier/parse-pdf\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ParsePdfStudioV1DemosDocumentModifierParsePdfPost", + methodName: "ParsePdfStudioV1DemosDocumentModifierParsePdfPostAsync", + pathTemplate: "\"/studio/v1/demos/document-modifier/parse-pdf\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; } + + break; } - catch (global::System.Exception __ex) + + if (__response == null) { - __exception_422 = __ex; + throw new global::System.InvalidOperationException("No response received."); } - throw new global::AI21.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) + using (__response) { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( + ProcessResponse( client: HttpClient, - response: __response, - content: ref __content); - ProcessParsePdfStudioV1DemosDocumentModifierParsePdfPostResponseContent( + response: __response); + ProcessParsePdfStudioV1DemosDocumentModifierParsePdfPostResponse( httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) { - __response.EnsureSuccessStatusCode(); - - return __content; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ParsePdfStudioV1DemosDocumentModifierParsePdfPost", + methodName: "ParsePdfStudioV1DemosDocumentModifierParsePdfPostAsync", + pathTemplate: "\"/studio/v1/demos/document-modifier/parse-pdf\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } - catch (global::System.Exception __ex) + else { - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ParsePdfStudioV1DemosDocumentModifierParsePdfPost", + methodName: "ParsePdfStudioV1DemosDocumentModifierParsePdfPostAsync", + pathTemplate: "\"/studio/v1/demos/document-modifier/parse-pdf\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __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::AI21.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessParsePdfStudioV1DemosDocumentModifierParsePdfPostResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? 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::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.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::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + } } - else + finally { - try - { - __response.EnsureSuccessStatusCode(); - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken + __httpRequest?.Dispose(); + } + } + /// + /// Parse Pdf
+ /// Parse a PDF file and return its contents. + ///
+ /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task ParsePdfStudioV1DemosDocumentModifierParsePdfPostAsync( + byte[] file, + string filename, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __request = new global::AI21.BodyParsePdfStudioV1DemosDocumentModifierParsePdfPost + { + File = file, + Filename = filename, + }; + + return await ParsePdfStudioV1DemosDocumentModifierParsePdfPostAsync( + request: __request, + requestOptions: requestOptions, + cancellationToken: cancellationToken).ConfigureAwait(false); + } + + /// + /// Parse Pdf
+ /// Parse a PDF file and return its contents. + ///
+ /// + /// The stream to send as the multipart 'file' 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 ParsePdfStudioV1DemosDocumentModifierParsePdfPostAsync( + global::System.IO.Stream file, + string filename, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + + file = file ?? throw new global::System.ArgumentNullException(nameof(file)); + var request = new global::AI21.BodyParsePdfStudioV1DemosDocumentModifierParsePdfPost + { + File = global::System.Array.Empty(), + Filename = filename, + }; + PrepareArguments( + client: HttpClient); + PrepareParsePdfStudioV1DemosDocumentModifierParsePdfPostArguments( + httpClient: HttpClient, + request: request); + + + var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_ParsePdfStudioV1DemosDocumentModifierParsePdfPostSecurityRequirements, + operationName: "ParsePdfStudioV1DemosDocumentModifierParsePdfPostAsync"); + + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: false); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: "/studio/v1/demos/document-modifier/parse-pdf", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.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 - ).ConfigureAwait(false); - return __content; + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); } - catch (global::System.Exception __ex) + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + + var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); + var __contentFile = new global::System.Net.Http.StreamContent(file); + __contentFile.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( + request.Filename is null + ? "application/octet-stream" + : (global::System.IO.Path.GetExtension(request.Filename) ?? string.Empty).ToLowerInvariant() switch + { + ".aac" => "audio/aac", + ".flac" => "audio/flac", + ".gif" => "image/gif", + ".jpeg" => "image/jpeg", + ".jpg" => "image/jpeg", + ".json" => "application/json", + ".m4a" => "audio/mp4", + ".mp3" => "audio/mpeg", + ".mp4" => "video/mp4", + ".mpeg" => "audio/mpeg", + ".mpga" => "audio/mpeg", + ".oga" => "audio/ogg", + ".ogg" => "audio/ogg", + ".opus" => "audio/ogg", + ".pdf" => "application/pdf", + ".png" => "image/png", + ".txt" => "text/plain", + ".wav" => "audio/wav", + ".weba" => "audio/webm", + ".webm" => "video/webm", + ".webp" => "image/webp", + _ => "application/octet-stream", + }); + __httpRequestContent.Add( + content: __contentFile, + name: "\"file\"", + fileName: request.Filename != null ? $"\"{request.Filename}\"" : string.Empty); + if (__contentFile.Headers.ContentDisposition != null) + { + __contentFile.Headers.ContentDisposition.FileNameStar = null; + } + + __httpRequest.Content = __httpRequestContent; + + global::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareParsePdfStudioV1DemosDocumentModifierParsePdfPostRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + request: request); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) { - string? __content = null; + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ParsePdfStudioV1DemosDocumentModifierParsePdfPost", + methodName: "ParsePdfStudioV1DemosDocumentModifierParsePdfPostAsync", + pathTemplate: "\"/studio/v1/demos/document-modifier/parse-pdf\"", + 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 { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); } - catch (global::System.Exception) + catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ParsePdfStudioV1DemosDocumentModifierParsePdfPost", + methodName: "ParsePdfStudioV1DemosDocumentModifierParsePdfPostAsync", + pathTemplate: "\"/studio/v1/demos/document-modifier/parse-pdf\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; } - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ParsePdfStudioV1DemosDocumentModifierParsePdfPost", + methodName: "ParsePdfStudioV1DemosDocumentModifierParsePdfPostAsync", + pathTemplate: "\"/studio/v1/demos/document-modifier/parse-pdf\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessParsePdfStudioV1DemosDocumentModifierParsePdfPostResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ParsePdfStudioV1DemosDocumentModifierParsePdfPost", + methodName: "ParsePdfStudioV1DemosDocumentModifierParsePdfPostAsync", + pathTemplate: "\"/studio/v1/demos/document-modifier/parse-pdf\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ParsePdfStudioV1DemosDocumentModifierParsePdfPost", + methodName: "ParsePdfStudioV1DemosDocumentModifierParsePdfPostAsync", + pathTemplate: "\"/studio/v1/demos/document-modifier/parse-pdf\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __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::AI21.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessParsePdfStudioV1DemosDocumentModifierParsePdfPostResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return __content; + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? 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::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + } } + finally + { + __httpRequest?.Dispose(); + } } /// /// Parse Pdf
/// Parse a PDF file and return its contents. ///
- /// + /// + /// The stream to send as the multipart 'file' 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 ParsePdfStudioV1DemosDocumentModifierParsePdfPostAsync( - byte[] file, + /// + public async global::System.Threading.Tasks.Task> ParsePdfStudioV1DemosDocumentModifierParsePdfPostAsResponseAsync( + global::System.IO.Stream file, string filename, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) { - var __request = new global::AI21.BodyParsePdfStudioV1DemosDocumentModifierParsePdfPost + + file = file ?? throw new global::System.ArgumentNullException(nameof(file)); + var request = new global::AI21.BodyParsePdfStudioV1DemosDocumentModifierParsePdfPost { - File = file, + File = global::System.Array.Empty(), Filename = filename, }; + PrepareArguments( + client: HttpClient); + PrepareParsePdfStudioV1DemosDocumentModifierParsePdfPostArguments( + httpClient: HttpClient, + request: request); - return await ParsePdfStudioV1DemosDocumentModifierParsePdfPostAsync( - request: __request, - cancellationToken: cancellationToken).ConfigureAwait(false); + + var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_ParsePdfStudioV1DemosDocumentModifierParsePdfPostSecurityRequirements, + operationName: "ParsePdfStudioV1DemosDocumentModifierParsePdfPostAsync"); + + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: false); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: "/studio/v1/demos/document-modifier/parse-pdf", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Post, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + + var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); + var __contentFile = new global::System.Net.Http.StreamContent(file); + __contentFile.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( + request.Filename is null + ? "application/octet-stream" + : (global::System.IO.Path.GetExtension(request.Filename) ?? string.Empty).ToLowerInvariant() switch + { + ".aac" => "audio/aac", + ".flac" => "audio/flac", + ".gif" => "image/gif", + ".jpeg" => "image/jpeg", + ".jpg" => "image/jpeg", + ".json" => "application/json", + ".m4a" => "audio/mp4", + ".mp3" => "audio/mpeg", + ".mp4" => "video/mp4", + ".mpeg" => "audio/mpeg", + ".mpga" => "audio/mpeg", + ".oga" => "audio/ogg", + ".ogg" => "audio/ogg", + ".opus" => "audio/ogg", + ".pdf" => "application/pdf", + ".png" => "image/png", + ".txt" => "text/plain", + ".wav" => "audio/wav", + ".weba" => "audio/webm", + ".webm" => "video/webm", + ".webp" => "image/webp", + _ => "application/octet-stream", + }); + __httpRequestContent.Add( + content: __contentFile, + name: "\"file\"", + fileName: request.Filename != null ? $"\"{request.Filename}\"" : string.Empty); + if (__contentFile.Headers.ContentDisposition != null) + { + __contentFile.Headers.ContentDisposition.FileNameStar = null; + } + + __httpRequest.Content = __httpRequestContent; + + global::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareParsePdfStudioV1DemosDocumentModifierParsePdfPostRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + request: request); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ParsePdfStudioV1DemosDocumentModifierParsePdfPost", + methodName: "ParsePdfStudioV1DemosDocumentModifierParsePdfPostAsync", + pathTemplate: "\"/studio/v1/demos/document-modifier/parse-pdf\"", + 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::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ParsePdfStudioV1DemosDocumentModifierParsePdfPost", + methodName: "ParsePdfStudioV1DemosDocumentModifierParsePdfPostAsync", + pathTemplate: "\"/studio/v1/demos/document-modifier/parse-pdf\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ParsePdfStudioV1DemosDocumentModifierParsePdfPost", + methodName: "ParsePdfStudioV1DemosDocumentModifierParsePdfPostAsync", + pathTemplate: "\"/studio/v1/demos/document-modifier/parse-pdf\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessParsePdfStudioV1DemosDocumentModifierParsePdfPostResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ParsePdfStudioV1DemosDocumentModifierParsePdfPost", + methodName: "ParsePdfStudioV1DemosDocumentModifierParsePdfPostAsync", + pathTemplate: "\"/studio/v1/demos/document-modifier/parse-pdf\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ParsePdfStudioV1DemosDocumentModifierParsePdfPost", + methodName: "ParsePdfStudioV1DemosDocumentModifierParsePdfPostAsync", + pathTemplate: "\"/studio/v1/demos/document-modifier/parse-pdf\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __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::AI21.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessParsePdfStudioV1DemosDocumentModifierParsePdfPostResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? 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::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.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::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } } } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.PostWebsiteConnectorStudioV1ConnectorsWebsitePost.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.PostWebsiteConnectorStudioV1ConnectorsWebsitePost.g.cs deleted file mode 100644 index 7fce17e0..00000000 --- a/src/libs/AI21/Generated/AI21.Ai21Client.PostWebsiteConnectorStudioV1ConnectorsWebsitePost.g.cs +++ /dev/null @@ -1,263 +0,0 @@ - -#nullable enable - -namespace AI21 -{ - public partial class Ai21Client - { - - - private static readonly global::AI21.EndPointSecurityRequirement s_PostWebsiteConnectorStudioV1ConnectorsWebsitePostSecurityRequirement0 = - new global::AI21.EndPointSecurityRequirement - { - Authorizations = new global::AI21.EndPointAuthorizationRequirement[] - { new global::AI21.EndPointAuthorizationRequirement - { - Type = "Http", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::AI21.EndPointSecurityRequirement[] s_PostWebsiteConnectorStudioV1ConnectorsWebsitePostSecurityRequirements = - new global::AI21.EndPointSecurityRequirement[] - { s_PostWebsiteConnectorStudioV1ConnectorsWebsitePostSecurityRequirement0, - }; - partial void PreparePostWebsiteConnectorStudioV1ConnectorsWebsitePostArguments( - global::System.Net.Http.HttpClient httpClient, - global::AI21.WebsiteConnectorPayload request); - partial void PreparePostWebsiteConnectorStudioV1ConnectorsWebsitePostRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - global::AI21.WebsiteConnectorPayload request); - partial void ProcessPostWebsiteConnectorStudioV1ConnectorsWebsitePostResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessPostWebsiteConnectorStudioV1ConnectorsWebsitePostResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Post Website Connector - /// - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task PostWebsiteConnectorStudioV1ConnectorsWebsitePostAsync( - - global::AI21.WebsiteConnectorPayload request, - global::System.Threading.CancellationToken cancellationToken = default) - { - request = request ?? throw new global::System.ArgumentNullException(nameof(request)); - - PrepareArguments( - client: HttpClient); - PreparePostWebsiteConnectorStudioV1ConnectorsWebsitePostArguments( - httpClient: HttpClient, - request: request); - - - var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_PostWebsiteConnectorStudioV1ConnectorsWebsitePostSecurityRequirements, - operationName: "PostWebsiteConnectorStudioV1ConnectorsWebsitePostAsync"); - - var __pathBuilder = new global::AI21.PathBuilder( - path: "/studio/v1/connectors/website", - 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); - PreparePostWebsiteConnectorStudioV1ConnectorsWebsitePostRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - 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); - ProcessPostWebsiteConnectorStudioV1ConnectorsWebsitePostResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Validation Error - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::AI21.HTTPValidationError? __value_422 = null; - try - { - if (ReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - throw new global::AI21.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) - { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessPostWebsiteConnectorStudioV1ConnectorsWebsitePostResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return __content; - } - catch (global::System.Exception __ex) - { - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __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::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - } - /// - /// Post Website Connector - /// - /// - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task PostWebsiteConnectorStudioV1ConnectorsWebsitePostAsync( - global::AI21.WebsiteConnectorPayloadType type, - global::AI21.AnyOf> value, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __request = new global::AI21.WebsiteConnectorPayload - { - Type = type, - Value = value, - }; - - return await PostWebsiteConnectorStudioV1ConnectorsWebsitePostAsync( - request: __request, - cancellationToken: cancellationToken).ConfigureAwait(false); - } - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.ProcessRfiDocumentStudioV1DemosRfiProcessRfiPost.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.ProcessRfiDocumentStudioV1DemosRfiProcessRfiPost.g.cs index e3174905..0b2d6f2d 100644 --- a/src/libs/AI21/Generated/AI21.Ai21Client.ProcessRfiDocumentStudioV1DemosRfiProcessRfiPost.g.cs +++ b/src/libs/AI21/Generated/AI21.Ai21Client.ProcessRfiDocumentStudioV1DemosRfiProcessRfiPost.g.cs @@ -14,6 +14,7 @@ public partial class Ai21Client { new global::AI21.EndPointAuthorizationRequirement { Type = "Http", + SchemeId = "HttpBearer", Location = "Header", Name = "Bearer", FriendlyName = "Bearer", @@ -44,11 +45,35 @@ partial void ProcessProcessRfiDocumentStudioV1DemosRfiProcessRfiPostResponseCont /// Process Rfi Document /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// public async global::System.Threading.Tasks.Task> ProcessRfiDocumentStudioV1DemosRfiProcessRfiPostAsync( global::AI21.BodyProcessRfiDocumentStudioV1DemosRfiProcessRfiPost request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ProcessRfiDocumentStudioV1DemosRfiProcessRfiPostAsResponseAsync( + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Process Rfi Document + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task>> ProcessRfiDocumentStudioV1DemosRfiProcessRfiPostAsResponseAsync( + + global::AI21.BodyProcessRfiDocumentStudioV1DemosRfiProcessRfiPost request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) { request = request ?? throw new global::System.ArgumentNullException(nameof(request)); @@ -65,22 +90,44 @@ partial void ProcessProcessRfiDocumentStudioV1DemosRfiProcessRfiPostResponseCont securityRequirements: s_ProcessRfiDocumentStudioV1DemosRfiProcessRfiPostSecurityRequirements, operationName: "ProcessRfiDocumentStudioV1DemosRfiProcessRfiPostAsync"); - var __pathBuilder = new global::AI21.PathBuilder( - path: "/studio/v1/demos/rfi/process-rfi", - 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)); + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: false); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: "/studio/v1/demos/rfi/process-rfi", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.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; + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; #endif foreach (var __authorization in __authorizations) { if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2") + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") { __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( scheme: __authorization.Name, @@ -90,174 +137,900 @@ partial void ProcessProcessRfiDocumentStudioV1DemosRfiProcessRfiPostResponseCont __authorization.Location == "Header") { __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - using var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); - 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; + } } - if (request.Budget != default) - { - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent($"{request.Budget}"), - name: "\"budget\""); - } - if (request.VectorStoreId != default) - { + var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); + var __contentFile = new global::System.Net.Http.ByteArrayContent(request.File ?? global::System.Array.Empty()); + __contentFile.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( + request.Filename is null + ? "application/octet-stream" + : (global::System.IO.Path.GetExtension(request.Filename) ?? string.Empty).ToLowerInvariant() switch + { + ".aac" => "audio/aac", + ".flac" => "audio/flac", + ".gif" => "image/gif", + ".jpeg" => "image/jpeg", + ".jpg" => "image/jpeg", + ".json" => "application/json", + ".m4a" => "audio/mp4", + ".mp3" => "audio/mpeg", + ".mp4" => "video/mp4", + ".mpeg" => "audio/mpeg", + ".mpga" => "audio/mpeg", + ".oga" => "audio/ogg", + ".ogg" => "audio/ogg", + ".opus" => "audio/ogg", + ".pdf" => "application/pdf", + ".png" => "image/png", + ".txt" => "text/plain", + ".wav" => "audio/wav", + ".weba" => "audio/webm", + ".webm" => "video/webm", + ".webp" => "image/webp", + _ => "application/octet-stream", + }); + __httpRequestContent.Add( + content: __contentFile, + name: "\"file\"", + fileName: request.Filename != null ? $"\"{request.Filename}\"" : string.Empty); + if (__contentFile.Headers.ContentDisposition != null) + { + __contentFile.Headers.ContentDisposition.FileNameStar = null; + } - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent($"{request.VectorStoreId}"), - name: "\"vector_store_id\""); - } - __httpRequest.Content = __httpRequestContent; + if (request.Budget != default) + { - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareProcessRfiDocumentStudioV1DemosRfiProcessRfiPostRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - request: request); + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.Budget ?? string.Empty), + name: "\"budget\""); - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); + } + if (request.VectorStoreId != default) + { - ProcessResponse( - client: HttpClient, - response: __response); - ProcessProcessRfiDocumentStudioV1DemosRfiProcessRfiPostResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Validation Error - if ((int)__response.StatusCode == 422) + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.VectorStoreId ?? string.Empty), + name: "\"vector_store_id\""); + + } + + __httpRequest.Content = __httpRequestContent; + + global::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareProcessRfiDocumentStudioV1DemosRfiProcessRfiPostRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + request: request); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::AI21.HTTPValidationError? __value_422 = null; - try + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) { - if (ReadResponseAsString) + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ProcessRfiDocumentStudioV1DemosRfiProcessRfiPost", + methodName: "ProcessRfiDocumentStudioV1DemosRfiProcessRfiPostAsync", + pathTemplate: "\"/studio/v1/demos/rfi/process-rfi\"", + 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 { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); } - else + catch (global::System.Net.Http.HttpRequestException __exception) { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ProcessRfiDocumentStudioV1DemosRfiProcessRfiPost", + methodName: "ProcessRfiDocumentStudioV1DemosRfiProcessRfiPostAsync", + pathTemplate: "\"/studio/v1/demos/rfi/process-rfi\"", + 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; + } - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ProcessRfiDocumentStudioV1DemosRfiProcessRfiPost", + methodName: "ProcessRfiDocumentStudioV1DemosRfiProcessRfiPostAsync", + pathTemplate: "\"/studio/v1/demos/rfi/process-rfi\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; } + + break; } - catch (global::System.Exception __ex) + + if (__response == null) { - __exception_422 = __ex; + throw new global::System.InvalidOperationException("No response received."); } - throw new global::AI21.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) + using (__response) { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( + ProcessResponse( client: HttpClient, - response: __response, - content: ref __content); - ProcessProcessRfiDocumentStudioV1DemosRfiProcessRfiPostResponseContent( + response: __response); + ProcessProcessRfiDocumentStudioV1DemosRfiProcessRfiPostResponse( httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) { - __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}\" "); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ProcessRfiDocumentStudioV1DemosRfiProcessRfiPost", + methodName: "ProcessRfiDocumentStudioV1DemosRfiProcessRfiPostAsync", + pathTemplate: "\"/studio/v1/demos/rfi/process-rfi\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } - catch (global::System.Exception __ex) + else { - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ProcessRfiDocumentStudioV1DemosRfiProcessRfiPost", + methodName: "ProcessRfiDocumentStudioV1DemosRfiProcessRfiPostAsync", + pathTemplate: "\"/studio/v1/demos/rfi/process-rfi\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __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::AI21.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessProcessRfiDocumentStudioV1DemosRfiProcessRfiPostResponseContent( + 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::AI21.AutoSDKHttpResponse>( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => 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::AI21.AutoSDKHttpResponse>( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + } } - else + finally { - try - { - __response.EnsureSuccessStatusCode(); - using var __content = await __response.Content.ReadAsStreamAsync( -#if NET5_0_OR_GREATER - cancellationToken + __httpRequest?.Dispose(); + } + } + /// + /// Process Rfi Document + /// + /// + /// RFI document file (PDF supported) + /// + /// + /// RFI document file (PDF supported) + /// + /// + /// Budget level: LOW, MEDIUM, or HIGH
+ /// Default Value: MEDIUM + /// + /// + /// Vector store ID to use for RFI processing + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> ProcessRfiDocumentStudioV1DemosRfiProcessRfiPostAsync( + byte[] file, + string filename, + string? budget = default, + string? vectorStoreId = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __request = new global::AI21.BodyProcessRfiDocumentStudioV1DemosRfiProcessRfiPost + { + File = file, + Filename = filename, + Budget = budget, + VectorStoreId = vectorStoreId, + }; + + return await ProcessRfiDocumentStudioV1DemosRfiProcessRfiPostAsync( + request: __request, + requestOptions: requestOptions, + cancellationToken: cancellationToken).ConfigureAwait(false); + } + + /// + /// Process Rfi Document + /// + /// + /// RFI document file (PDF supported) + /// + /// + /// RFI document file (PDF supported) + /// + /// + /// Budget level: LOW, MEDIUM, or HIGH
+ /// Default Value: MEDIUM + /// + /// + /// Vector store ID to use for RFI processing + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> ProcessRfiDocumentStudioV1DemosRfiProcessRfiPostAsync( + global::System.IO.Stream file, + string filename, + string? budget = default, + string? vectorStoreId = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + + file = file ?? throw new global::System.ArgumentNullException(nameof(file)); + var request = new global::AI21.BodyProcessRfiDocumentStudioV1DemosRfiProcessRfiPost + { + File = global::System.Array.Empty(), + Filename = filename, + Budget = budget, + VectorStoreId = vectorStoreId, + }; + PrepareArguments( + client: HttpClient); + PrepareProcessRfiDocumentStudioV1DemosRfiProcessRfiPostArguments( + httpClient: HttpClient, + request: request); + + + var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_ProcessRfiDocumentStudioV1DemosRfiProcessRfiPostSecurityRequirements, + operationName: "ProcessRfiDocumentStudioV1DemosRfiProcessRfiPostAsync"); + + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: false); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: "/studio/v1/demos/rfi/process-rfi", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.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 - ).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."); + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); } - catch (global::System.Exception __ex) + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + + var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); + var __contentFile = new global::System.Net.Http.StreamContent(file); + __contentFile.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( + request.Filename is null + ? "application/octet-stream" + : (global::System.IO.Path.GetExtension(request.Filename) ?? string.Empty).ToLowerInvariant() switch + { + ".aac" => "audio/aac", + ".flac" => "audio/flac", + ".gif" => "image/gif", + ".jpeg" => "image/jpeg", + ".jpg" => "image/jpeg", + ".json" => "application/json", + ".m4a" => "audio/mp4", + ".mp3" => "audio/mpeg", + ".mp4" => "video/mp4", + ".mpeg" => "audio/mpeg", + ".mpga" => "audio/mpeg", + ".oga" => "audio/ogg", + ".ogg" => "audio/ogg", + ".opus" => "audio/ogg", + ".pdf" => "application/pdf", + ".png" => "image/png", + ".txt" => "text/plain", + ".wav" => "audio/wav", + ".weba" => "audio/webm", + ".webm" => "video/webm", + ".webp" => "image/webp", + _ => "application/octet-stream", + }); + __httpRequestContent.Add( + content: __contentFile, + name: "\"file\"", + fileName: request.Filename != null ? $"\"{request.Filename}\"" : string.Empty); + if (__contentFile.Headers.ContentDisposition != null) + { + __contentFile.Headers.ContentDisposition.FileNameStar = null; + } + + if (request.Budget != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.Budget ?? string.Empty), + name: "\"budget\""); + + } + if (request.VectorStoreId != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.VectorStoreId ?? string.Empty), + name: "\"vector_store_id\""); + + } + + __httpRequest.Content = __httpRequestContent; + + global::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareProcessRfiDocumentStudioV1DemosRfiProcessRfiPostRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + request: request); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) { - string? __content = null; + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ProcessRfiDocumentStudioV1DemosRfiProcessRfiPost", + methodName: "ProcessRfiDocumentStudioV1DemosRfiProcessRfiPostAsync", + pathTemplate: "\"/studio/v1/demos/rfi/process-rfi\"", + 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 { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); } - catch (global::System.Exception) + catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ProcessRfiDocumentStudioV1DemosRfiProcessRfiPost", + methodName: "ProcessRfiDocumentStudioV1DemosRfiProcessRfiPostAsync", + pathTemplate: "\"/studio/v1/demos/rfi/process-rfi\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; } - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ProcessRfiDocumentStudioV1DemosRfiProcessRfiPost", + methodName: "ProcessRfiDocumentStudioV1DemosRfiProcessRfiPostAsync", + pathTemplate: "\"/studio/v1/demos/rfi/process-rfi\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessProcessRfiDocumentStudioV1DemosRfiProcessRfiPostResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ProcessRfiDocumentStudioV1DemosRfiProcessRfiPost", + methodName: "ProcessRfiDocumentStudioV1DemosRfiProcessRfiPostAsync", + pathTemplate: "\"/studio/v1/demos/rfi/process-rfi\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ProcessRfiDocumentStudioV1DemosRfiProcessRfiPost", + methodName: "ProcessRfiDocumentStudioV1DemosRfiProcessRfiPostAsync", + pathTemplate: "\"/studio/v1/demos/rfi/process-rfi\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __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::AI21.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessProcessRfiDocumentStudioV1DemosRfiProcessRfiPostResponseContent( + 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 global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.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 + (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 + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); } } /// @@ -276,26 +1049,468 @@ partial void ProcessProcessRfiDocumentStudioV1DemosRfiProcessRfiPostResponseCont /// /// Vector store ID to use for RFI processing /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task> ProcessRfiDocumentStudioV1DemosRfiProcessRfiPostAsync( - byte[] file, + /// + public async global::System.Threading.Tasks.Task>> ProcessRfiDocumentStudioV1DemosRfiProcessRfiPostAsResponseAsync( + global::System.IO.Stream file, string filename, string? budget = default, string? vectorStoreId = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) { - var __request = new global::AI21.BodyProcessRfiDocumentStudioV1DemosRfiProcessRfiPost + + file = file ?? throw new global::System.ArgumentNullException(nameof(file)); + var request = new global::AI21.BodyProcessRfiDocumentStudioV1DemosRfiProcessRfiPost { - File = file, + File = global::System.Array.Empty(), Filename = filename, Budget = budget, VectorStoreId = vectorStoreId, }; + PrepareArguments( + client: HttpClient); + PrepareProcessRfiDocumentStudioV1DemosRfiProcessRfiPostArguments( + httpClient: HttpClient, + request: request); - return await ProcessRfiDocumentStudioV1DemosRfiProcessRfiPostAsync( - request: __request, - cancellationToken: cancellationToken).ConfigureAwait(false); + + var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_ProcessRfiDocumentStudioV1DemosRfiProcessRfiPostSecurityRequirements, + operationName: "ProcessRfiDocumentStudioV1DemosRfiProcessRfiPostAsync"); + + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: false); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: "/studio/v1/demos/rfi/process-rfi", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Post, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + + var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); + var __contentFile = new global::System.Net.Http.StreamContent(file); + __contentFile.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( + request.Filename is null + ? "application/octet-stream" + : (global::System.IO.Path.GetExtension(request.Filename) ?? string.Empty).ToLowerInvariant() switch + { + ".aac" => "audio/aac", + ".flac" => "audio/flac", + ".gif" => "image/gif", + ".jpeg" => "image/jpeg", + ".jpg" => "image/jpeg", + ".json" => "application/json", + ".m4a" => "audio/mp4", + ".mp3" => "audio/mpeg", + ".mp4" => "video/mp4", + ".mpeg" => "audio/mpeg", + ".mpga" => "audio/mpeg", + ".oga" => "audio/ogg", + ".ogg" => "audio/ogg", + ".opus" => "audio/ogg", + ".pdf" => "application/pdf", + ".png" => "image/png", + ".txt" => "text/plain", + ".wav" => "audio/wav", + ".weba" => "audio/webm", + ".webm" => "video/webm", + ".webp" => "image/webp", + _ => "application/octet-stream", + }); + __httpRequestContent.Add( + content: __contentFile, + name: "\"file\"", + fileName: request.Filename != null ? $"\"{request.Filename}\"" : string.Empty); + if (__contentFile.Headers.ContentDisposition != null) + { + __contentFile.Headers.ContentDisposition.FileNameStar = null; + } + + if (request.Budget != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.Budget ?? string.Empty), + name: "\"budget\""); + + } + if (request.VectorStoreId != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.VectorStoreId ?? string.Empty), + name: "\"vector_store_id\""); + + } + + __httpRequest.Content = __httpRequestContent; + + global::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareProcessRfiDocumentStudioV1DemosRfiProcessRfiPostRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + request: request); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ProcessRfiDocumentStudioV1DemosRfiProcessRfiPost", + methodName: "ProcessRfiDocumentStudioV1DemosRfiProcessRfiPostAsync", + pathTemplate: "\"/studio/v1/demos/rfi/process-rfi\"", + 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::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ProcessRfiDocumentStudioV1DemosRfiProcessRfiPost", + methodName: "ProcessRfiDocumentStudioV1DemosRfiProcessRfiPostAsync", + pathTemplate: "\"/studio/v1/demos/rfi/process-rfi\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ProcessRfiDocumentStudioV1DemosRfiProcessRfiPost", + methodName: "ProcessRfiDocumentStudioV1DemosRfiProcessRfiPostAsync", + pathTemplate: "\"/studio/v1/demos/rfi/process-rfi\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessProcessRfiDocumentStudioV1DemosRfiProcessRfiPostResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ProcessRfiDocumentStudioV1DemosRfiProcessRfiPost", + methodName: "ProcessRfiDocumentStudioV1DemosRfiProcessRfiPostAsync", + pathTemplate: "\"/studio/v1/demos/rfi/process-rfi\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ProcessRfiDocumentStudioV1DemosRfiProcessRfiPost", + methodName: "ProcessRfiDocumentStudioV1DemosRfiProcessRfiPostAsync", + pathTemplate: "\"/studio/v1/demos/rfi/process-rfi\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __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::AI21.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessProcessRfiDocumentStudioV1DemosRfiProcessRfiPostResponseContent( + 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::AI21.AutoSDKHttpResponse>( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => 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::AI21.AutoSDKHttpResponse>( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } } } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.ProxyOffV1GatewayOffV1PathGet.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.ProxyOffV1GatewayOffV1PathGet.g.cs new file mode 100644 index 00000000..cbda781e --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Ai21Client.ProxyOffV1GatewayOffV1PathGet.g.cs @@ -0,0 +1,474 @@ + +#nullable enable + +namespace AI21 +{ + public partial class Ai21Client + { + + + private static readonly global::AI21.EndPointSecurityRequirement s_ProxyOffV1GatewayOffV1PathGetSecurityRequirement0 = + new global::AI21.EndPointSecurityRequirement + { + Authorizations = new global::AI21.EndPointAuthorizationRequirement[] + { new global::AI21.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::AI21.EndPointSecurityRequirement[] s_ProxyOffV1GatewayOffV1PathGetSecurityRequirements = + new global::AI21.EndPointSecurityRequirement[] + { s_ProxyOffV1GatewayOffV1PathGetSecurityRequirement0, + }; + partial void PrepareProxyOffV1GatewayOffV1PathGetArguments( + global::System.Net.Http.HttpClient httpClient, + ref string path, + ref string? xAi21Key); + partial void PrepareProxyOffV1GatewayOffV1PathGetRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string path, + string? xAi21Key); + partial void ProcessProxyOffV1GatewayOffV1PathGetResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessProxyOffV1GatewayOffV1PathGetResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Proxy Off V1
+ /// A/B off-arm — forces gateway transformers off for this request 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 ProxyOffV1GatewayOffV1PathGetAsync( + string path, + string? xAi21Key = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ProxyOffV1GatewayOffV1PathGetAsResponseAsync( + path: path, + xAi21Key: xAi21Key, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Proxy Off V1
+ /// A/B off-arm — forces gateway transformers off for this request 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> ProxyOffV1GatewayOffV1PathGetAsResponseAsync( + string path, + string? xAi21Key = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareProxyOffV1GatewayOffV1PathGetArguments( + httpClient: HttpClient, + path: ref path, + xAi21Key: ref xAi21Key); + + + var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_ProxyOffV1GatewayOffV1PathGetSecurityRequirements, + operationName: "ProxyOffV1GatewayOffV1PathGetAsync"); + + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: $"/gateway/off/v1/{path}", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.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 (xAi21Key != default) + { + __httpRequest.Headers.TryAddWithoutValidation("X-AI21-Key", xAi21Key.ToString()); + } + + global::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareProxyOffV1GatewayOffV1PathGetRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + path: path!, + xAi21Key: xAi21Key); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ProxyOffV1GatewayOffV1PathGet", + methodName: "ProxyOffV1GatewayOffV1PathGetAsync", + pathTemplate: "$\"/gateway/off/v1/{path}\"", + 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::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ProxyOffV1GatewayOffV1PathGet", + methodName: "ProxyOffV1GatewayOffV1PathGetAsync", + pathTemplate: "$\"/gateway/off/v1/{path}\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ProxyOffV1GatewayOffV1PathGet", + methodName: "ProxyOffV1GatewayOffV1PathGetAsync", + pathTemplate: "$\"/gateway/off/v1/{path}\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessProxyOffV1GatewayOffV1PathGetResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ProxyOffV1GatewayOffV1PathGet", + methodName: "ProxyOffV1GatewayOffV1PathGetAsync", + pathTemplate: "$\"/gateway/off/v1/{path}\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ProxyOffV1GatewayOffV1PathGet", + methodName: "ProxyOffV1GatewayOffV1PathGetAsync", + pathTemplate: "$\"/gateway/off/v1/{path}\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: __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::AI21.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessProxyOffV1GatewayOffV1PathGetResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? 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::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.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::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.ProxyOffV1GatewayOffV1PathGet2.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.ProxyOffV1GatewayOffV1PathGet2.g.cs new file mode 100644 index 00000000..b32e4bdc --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Ai21Client.ProxyOffV1GatewayOffV1PathGet2.g.cs @@ -0,0 +1,474 @@ + +#nullable enable + +namespace AI21 +{ + public partial class Ai21Client + { + + + private static readonly global::AI21.EndPointSecurityRequirement s_ProxyOffV1GatewayOffV1PathGet2SecurityRequirement0 = + new global::AI21.EndPointSecurityRequirement + { + Authorizations = new global::AI21.EndPointAuthorizationRequirement[] + { new global::AI21.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::AI21.EndPointSecurityRequirement[] s_ProxyOffV1GatewayOffV1PathGet2SecurityRequirements = + new global::AI21.EndPointSecurityRequirement[] + { s_ProxyOffV1GatewayOffV1PathGet2SecurityRequirement0, + }; + partial void PrepareProxyOffV1GatewayOffV1PathGet2Arguments( + global::System.Net.Http.HttpClient httpClient, + ref string path, + ref string? xAi21Key); + partial void PrepareProxyOffV1GatewayOffV1PathGet2Request( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string path, + string? xAi21Key); + partial void ProcessProxyOffV1GatewayOffV1PathGet2Response( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessProxyOffV1GatewayOffV1PathGet2ResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Proxy Off V1
+ /// A/B off-arm — forces gateway transformers off for this request 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 ProxyOffV1GatewayOffV1PathGet2Async( + string path, + string? xAi21Key = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ProxyOffV1GatewayOffV1PathGet2AsResponseAsync( + path: path, + xAi21Key: xAi21Key, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Proxy Off V1
+ /// A/B off-arm — forces gateway transformers off for this request 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> ProxyOffV1GatewayOffV1PathGet2AsResponseAsync( + string path, + string? xAi21Key = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareProxyOffV1GatewayOffV1PathGet2Arguments( + httpClient: HttpClient, + path: ref path, + xAi21Key: ref xAi21Key); + + + var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_ProxyOffV1GatewayOffV1PathGet2SecurityRequirements, + operationName: "ProxyOffV1GatewayOffV1PathGet2Async"); + + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: $"/gateway/off/v1/{path}", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.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 (xAi21Key != default) + { + __httpRequest.Headers.TryAddWithoutValidation("X-AI21-Key", xAi21Key.ToString()); + } + + global::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareProxyOffV1GatewayOffV1PathGet2Request( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + path: path!, + xAi21Key: xAi21Key); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ProxyOffV1GatewayOffV1PathGet2", + methodName: "ProxyOffV1GatewayOffV1PathGet2Async", + pathTemplate: "$\"/gateway/off/v1/{path}\"", + 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::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ProxyOffV1GatewayOffV1PathGet2", + methodName: "ProxyOffV1GatewayOffV1PathGet2Async", + pathTemplate: "$\"/gateway/off/v1/{path}\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ProxyOffV1GatewayOffV1PathGet2", + methodName: "ProxyOffV1GatewayOffV1PathGet2Async", + pathTemplate: "$\"/gateway/off/v1/{path}\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessProxyOffV1GatewayOffV1PathGet2Response( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ProxyOffV1GatewayOffV1PathGet2", + methodName: "ProxyOffV1GatewayOffV1PathGet2Async", + pathTemplate: "$\"/gateway/off/v1/{path}\"", + 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::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ProxyOffV1GatewayOffV1PathGet2", + methodName: "ProxyOffV1GatewayOffV1PathGet2Async", + pathTemplate: "$\"/gateway/off/v1/{path}\"", + 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); + } + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::AI21.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessProxyOffV1GatewayOffV1PathGet2ResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? 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::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.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::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.ProxyOffV1GatewayOffV1PathGet3.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.ProxyOffV1GatewayOffV1PathGet3.g.cs new file mode 100644 index 00000000..753222b3 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Ai21Client.ProxyOffV1GatewayOffV1PathGet3.g.cs @@ -0,0 +1,474 @@ + +#nullable enable + +namespace AI21 +{ + public partial class Ai21Client + { + + + private static readonly global::AI21.EndPointSecurityRequirement s_ProxyOffV1GatewayOffV1PathGet3SecurityRequirement0 = + new global::AI21.EndPointSecurityRequirement + { + Authorizations = new global::AI21.EndPointAuthorizationRequirement[] + { new global::AI21.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::AI21.EndPointSecurityRequirement[] s_ProxyOffV1GatewayOffV1PathGet3SecurityRequirements = + new global::AI21.EndPointSecurityRequirement[] + { s_ProxyOffV1GatewayOffV1PathGet3SecurityRequirement0, + }; + partial void PrepareProxyOffV1GatewayOffV1PathGet3Arguments( + global::System.Net.Http.HttpClient httpClient, + ref string path, + ref string? xAi21Key); + partial void PrepareProxyOffV1GatewayOffV1PathGet3Request( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string path, + string? xAi21Key); + partial void ProcessProxyOffV1GatewayOffV1PathGet3Response( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessProxyOffV1GatewayOffV1PathGet3ResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Proxy Off V1
+ /// A/B off-arm — forces gateway transformers off for this request 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 ProxyOffV1GatewayOffV1PathGet3Async( + string path, + string? xAi21Key = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ProxyOffV1GatewayOffV1PathGet3AsResponseAsync( + path: path, + xAi21Key: xAi21Key, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Proxy Off V1
+ /// A/B off-arm — forces gateway transformers off for this request 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> ProxyOffV1GatewayOffV1PathGet3AsResponseAsync( + string path, + string? xAi21Key = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareProxyOffV1GatewayOffV1PathGet3Arguments( + httpClient: HttpClient, + path: ref path, + xAi21Key: ref xAi21Key); + + + var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_ProxyOffV1GatewayOffV1PathGet3SecurityRequirements, + operationName: "ProxyOffV1GatewayOffV1PathGet3Async"); + + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: $"/gateway/off/v1/{path}", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.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 (xAi21Key != default) + { + __httpRequest.Headers.TryAddWithoutValidation("X-AI21-Key", xAi21Key.ToString()); + } + + global::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareProxyOffV1GatewayOffV1PathGet3Request( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + path: path!, + xAi21Key: xAi21Key); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ProxyOffV1GatewayOffV1PathGet3", + methodName: "ProxyOffV1GatewayOffV1PathGet3Async", + pathTemplate: "$\"/gateway/off/v1/{path}\"", + 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::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ProxyOffV1GatewayOffV1PathGet3", + methodName: "ProxyOffV1GatewayOffV1PathGet3Async", + pathTemplate: "$\"/gateway/off/v1/{path}\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ProxyOffV1GatewayOffV1PathGet3", + methodName: "ProxyOffV1GatewayOffV1PathGet3Async", + pathTemplate: "$\"/gateway/off/v1/{path}\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessProxyOffV1GatewayOffV1PathGet3Response( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ProxyOffV1GatewayOffV1PathGet3", + methodName: "ProxyOffV1GatewayOffV1PathGet3Async", + pathTemplate: "$\"/gateway/off/v1/{path}\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ProxyOffV1GatewayOffV1PathGet3", + methodName: "ProxyOffV1GatewayOffV1PathGet3Async", + pathTemplate: "$\"/gateway/off/v1/{path}\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __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::AI21.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessProxyOffV1GatewayOffV1PathGet3ResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? 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::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.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::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.ProxyOffV1GatewayOffV1PathGet4.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.ProxyOffV1GatewayOffV1PathGet4.g.cs new file mode 100644 index 00000000..c91563d9 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Ai21Client.ProxyOffV1GatewayOffV1PathGet4.g.cs @@ -0,0 +1,474 @@ + +#nullable enable + +namespace AI21 +{ + public partial class Ai21Client + { + + + private static readonly global::AI21.EndPointSecurityRequirement s_ProxyOffV1GatewayOffV1PathGet4SecurityRequirement0 = + new global::AI21.EndPointSecurityRequirement + { + Authorizations = new global::AI21.EndPointAuthorizationRequirement[] + { new global::AI21.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::AI21.EndPointSecurityRequirement[] s_ProxyOffV1GatewayOffV1PathGet4SecurityRequirements = + new global::AI21.EndPointSecurityRequirement[] + { s_ProxyOffV1GatewayOffV1PathGet4SecurityRequirement0, + }; + partial void PrepareProxyOffV1GatewayOffV1PathGet4Arguments( + global::System.Net.Http.HttpClient httpClient, + ref string path, + ref string? xAi21Key); + partial void PrepareProxyOffV1GatewayOffV1PathGet4Request( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string path, + string? xAi21Key); + partial void ProcessProxyOffV1GatewayOffV1PathGet4Response( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessProxyOffV1GatewayOffV1PathGet4ResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Proxy Off V1
+ /// A/B off-arm — forces gateway transformers off for this request 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 ProxyOffV1GatewayOffV1PathGet4Async( + string path, + string? xAi21Key = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ProxyOffV1GatewayOffV1PathGet4AsResponseAsync( + path: path, + xAi21Key: xAi21Key, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Proxy Off V1
+ /// A/B off-arm — forces gateway transformers off for this request 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> ProxyOffV1GatewayOffV1PathGet4AsResponseAsync( + string path, + string? xAi21Key = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareProxyOffV1GatewayOffV1PathGet4Arguments( + httpClient: HttpClient, + path: ref path, + xAi21Key: ref xAi21Key); + + + var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_ProxyOffV1GatewayOffV1PathGet4SecurityRequirements, + operationName: "ProxyOffV1GatewayOffV1PathGet4Async"); + + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: $"/gateway/off/v1/{path}", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.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 (xAi21Key != default) + { + __httpRequest.Headers.TryAddWithoutValidation("X-AI21-Key", xAi21Key.ToString()); + } + + global::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareProxyOffV1GatewayOffV1PathGet4Request( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + path: path!, + xAi21Key: xAi21Key); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ProxyOffV1GatewayOffV1PathGet4", + methodName: "ProxyOffV1GatewayOffV1PathGet4Async", + pathTemplate: "$\"/gateway/off/v1/{path}\"", + 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::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ProxyOffV1GatewayOffV1PathGet4", + methodName: "ProxyOffV1GatewayOffV1PathGet4Async", + pathTemplate: "$\"/gateway/off/v1/{path}\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ProxyOffV1GatewayOffV1PathGet4", + methodName: "ProxyOffV1GatewayOffV1PathGet4Async", + pathTemplate: "$\"/gateway/off/v1/{path}\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessProxyOffV1GatewayOffV1PathGet4Response( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ProxyOffV1GatewayOffV1PathGet4", + methodName: "ProxyOffV1GatewayOffV1PathGet4Async", + pathTemplate: "$\"/gateway/off/v1/{path}\"", + 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::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ProxyOffV1GatewayOffV1PathGet4", + methodName: "ProxyOffV1GatewayOffV1PathGet4Async", + pathTemplate: "$\"/gateway/off/v1/{path}\"", + 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::AI21.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessProxyOffV1GatewayOffV1PathGet4ResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? 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::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.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::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.ProxyOffV1GatewayOffV1PathGet5.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.ProxyOffV1GatewayOffV1PathGet5.g.cs new file mode 100644 index 00000000..6e26b91d --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Ai21Client.ProxyOffV1GatewayOffV1PathGet5.g.cs @@ -0,0 +1,474 @@ + +#nullable enable + +namespace AI21 +{ + public partial class Ai21Client + { + + + private static readonly global::AI21.EndPointSecurityRequirement s_ProxyOffV1GatewayOffV1PathGet5SecurityRequirement0 = + new global::AI21.EndPointSecurityRequirement + { + Authorizations = new global::AI21.EndPointAuthorizationRequirement[] + { new global::AI21.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::AI21.EndPointSecurityRequirement[] s_ProxyOffV1GatewayOffV1PathGet5SecurityRequirements = + new global::AI21.EndPointSecurityRequirement[] + { s_ProxyOffV1GatewayOffV1PathGet5SecurityRequirement0, + }; + partial void PrepareProxyOffV1GatewayOffV1PathGet5Arguments( + global::System.Net.Http.HttpClient httpClient, + ref string path, + ref string? xAi21Key); + partial void PrepareProxyOffV1GatewayOffV1PathGet5Request( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string path, + string? xAi21Key); + partial void ProcessProxyOffV1GatewayOffV1PathGet5Response( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessProxyOffV1GatewayOffV1PathGet5ResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Proxy Off V1
+ /// A/B off-arm — forces gateway transformers off for this request 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 ProxyOffV1GatewayOffV1PathGet5Async( + string path, + string? xAi21Key = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ProxyOffV1GatewayOffV1PathGet5AsResponseAsync( + path: path, + xAi21Key: xAi21Key, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Proxy Off V1
+ /// A/B off-arm — forces gateway transformers off for this request 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> ProxyOffV1GatewayOffV1PathGet5AsResponseAsync( + string path, + string? xAi21Key = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareProxyOffV1GatewayOffV1PathGet5Arguments( + httpClient: HttpClient, + path: ref path, + xAi21Key: ref xAi21Key); + + + var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_ProxyOffV1GatewayOffV1PathGet5SecurityRequirements, + operationName: "ProxyOffV1GatewayOffV1PathGet5Async"); + + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: $"/gateway/off/v1/{path}", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Options, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + + if (xAi21Key != default) + { + __httpRequest.Headers.TryAddWithoutValidation("X-AI21-Key", xAi21Key.ToString()); + } + + global::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareProxyOffV1GatewayOffV1PathGet5Request( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + path: path!, + xAi21Key: xAi21Key); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ProxyOffV1GatewayOffV1PathGet5", + methodName: "ProxyOffV1GatewayOffV1PathGet5Async", + pathTemplate: "$\"/gateway/off/v1/{path}\"", + httpMethod: "OPTIONS", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ProxyOffV1GatewayOffV1PathGet5", + methodName: "ProxyOffV1GatewayOffV1PathGet5Async", + pathTemplate: "$\"/gateway/off/v1/{path}\"", + httpMethod: "OPTIONS", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ProxyOffV1GatewayOffV1PathGet5", + methodName: "ProxyOffV1GatewayOffV1PathGet5Async", + pathTemplate: "$\"/gateway/off/v1/{path}\"", + httpMethod: "OPTIONS", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessProxyOffV1GatewayOffV1PathGet5Response( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ProxyOffV1GatewayOffV1PathGet5", + methodName: "ProxyOffV1GatewayOffV1PathGet5Async", + pathTemplate: "$\"/gateway/off/v1/{path}\"", + httpMethod: "OPTIONS", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ProxyOffV1GatewayOffV1PathGet5", + methodName: "ProxyOffV1GatewayOffV1PathGet5Async", + pathTemplate: "$\"/gateway/off/v1/{path}\"", + httpMethod: "OPTIONS", + baseUri: BaseUri, + request: __httpRequest!, + response: __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::AI21.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessProxyOffV1GatewayOffV1PathGet5ResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? 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::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.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::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.ProxyOffV1GatewayOffV1PathGet6.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.ProxyOffV1GatewayOffV1PathGet6.g.cs new file mode 100644 index 00000000..ab83156e --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Ai21Client.ProxyOffV1GatewayOffV1PathGet6.g.cs @@ -0,0 +1,474 @@ + +#nullable enable + +namespace AI21 +{ + public partial class Ai21Client + { + + + private static readonly global::AI21.EndPointSecurityRequirement s_ProxyOffV1GatewayOffV1PathGet6SecurityRequirement0 = + new global::AI21.EndPointSecurityRequirement + { + Authorizations = new global::AI21.EndPointAuthorizationRequirement[] + { new global::AI21.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::AI21.EndPointSecurityRequirement[] s_ProxyOffV1GatewayOffV1PathGet6SecurityRequirements = + new global::AI21.EndPointSecurityRequirement[] + { s_ProxyOffV1GatewayOffV1PathGet6SecurityRequirement0, + }; + partial void PrepareProxyOffV1GatewayOffV1PathGet6Arguments( + global::System.Net.Http.HttpClient httpClient, + ref string path, + ref string? xAi21Key); + partial void PrepareProxyOffV1GatewayOffV1PathGet6Request( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string path, + string? xAi21Key); + partial void ProcessProxyOffV1GatewayOffV1PathGet6Response( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessProxyOffV1GatewayOffV1PathGet6ResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Proxy Off V1
+ /// A/B off-arm — forces gateway transformers off for this request 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 ProxyOffV1GatewayOffV1PathGet6Async( + string path, + string? xAi21Key = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ProxyOffV1GatewayOffV1PathGet6AsResponseAsync( + path: path, + xAi21Key: xAi21Key, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Proxy Off V1
+ /// A/B off-arm — forces gateway transformers off for this request 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> ProxyOffV1GatewayOffV1PathGet6AsResponseAsync( + string path, + string? xAi21Key = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareProxyOffV1GatewayOffV1PathGet6Arguments( + httpClient: HttpClient, + path: ref path, + xAi21Key: ref xAi21Key); + + + var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_ProxyOffV1GatewayOffV1PathGet6SecurityRequirements, + operationName: "ProxyOffV1GatewayOffV1PathGet6Async"); + + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: $"/gateway/off/v1/{path}", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.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 (xAi21Key != default) + { + __httpRequest.Headers.TryAddWithoutValidation("X-AI21-Key", xAi21Key.ToString()); + } + + global::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareProxyOffV1GatewayOffV1PathGet6Request( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + path: path!, + xAi21Key: xAi21Key); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ProxyOffV1GatewayOffV1PathGet6", + methodName: "ProxyOffV1GatewayOffV1PathGet6Async", + pathTemplate: "$\"/gateway/off/v1/{path}\"", + 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::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ProxyOffV1GatewayOffV1PathGet6", + methodName: "ProxyOffV1GatewayOffV1PathGet6Async", + pathTemplate: "$\"/gateway/off/v1/{path}\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ProxyOffV1GatewayOffV1PathGet6", + methodName: "ProxyOffV1GatewayOffV1PathGet6Async", + pathTemplate: "$\"/gateway/off/v1/{path}\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessProxyOffV1GatewayOffV1PathGet6Response( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ProxyOffV1GatewayOffV1PathGet6", + methodName: "ProxyOffV1GatewayOffV1PathGet6Async", + pathTemplate: "$\"/gateway/off/v1/{path}\"", + 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::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ProxyOffV1GatewayOffV1PathGet6", + methodName: "ProxyOffV1GatewayOffV1PathGet6Async", + pathTemplate: "$\"/gateway/off/v1/{path}\"", + 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::AI21.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessProxyOffV1GatewayOffV1PathGet6ResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? 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::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.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::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.ProxyOffV1TokenwiseOffV1PathGet.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.ProxyOffV1TokenwiseOffV1PathGet.g.cs new file mode 100644 index 00000000..4b792443 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Ai21Client.ProxyOffV1TokenwiseOffV1PathGet.g.cs @@ -0,0 +1,474 @@ + +#nullable enable + +namespace AI21 +{ + public partial class Ai21Client + { + + + private static readonly global::AI21.EndPointSecurityRequirement s_ProxyOffV1TokenwiseOffV1PathGetSecurityRequirement0 = + new global::AI21.EndPointSecurityRequirement + { + Authorizations = new global::AI21.EndPointAuthorizationRequirement[] + { new global::AI21.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::AI21.EndPointSecurityRequirement[] s_ProxyOffV1TokenwiseOffV1PathGetSecurityRequirements = + new global::AI21.EndPointSecurityRequirement[] + { s_ProxyOffV1TokenwiseOffV1PathGetSecurityRequirement0, + }; + partial void PrepareProxyOffV1TokenwiseOffV1PathGetArguments( + global::System.Net.Http.HttpClient httpClient, + ref string path, + ref string? xAi21Key); + partial void PrepareProxyOffV1TokenwiseOffV1PathGetRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string path, + string? xAi21Key); + partial void ProcessProxyOffV1TokenwiseOffV1PathGetResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessProxyOffV1TokenwiseOffV1PathGetResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Proxy Off V1
+ /// A/B off-arm — forces gateway transformers off for this request 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 ProxyOffV1TokenwiseOffV1PathGetAsync( + string path, + string? xAi21Key = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ProxyOffV1TokenwiseOffV1PathGetAsResponseAsync( + path: path, + xAi21Key: xAi21Key, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Proxy Off V1
+ /// A/B off-arm — forces gateway transformers off for this request 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> ProxyOffV1TokenwiseOffV1PathGetAsResponseAsync( + string path, + string? xAi21Key = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareProxyOffV1TokenwiseOffV1PathGetArguments( + httpClient: HttpClient, + path: ref path, + xAi21Key: ref xAi21Key); + + + var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_ProxyOffV1TokenwiseOffV1PathGetSecurityRequirements, + operationName: "ProxyOffV1TokenwiseOffV1PathGetAsync"); + + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: $"/tokenwise/off/v1/{path}", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.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 (xAi21Key != default) + { + __httpRequest.Headers.TryAddWithoutValidation("X-AI21-Key", xAi21Key.ToString()); + } + + global::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareProxyOffV1TokenwiseOffV1PathGetRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + path: path!, + xAi21Key: xAi21Key); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ProxyOffV1TokenwiseOffV1PathGet", + methodName: "ProxyOffV1TokenwiseOffV1PathGetAsync", + pathTemplate: "$\"/tokenwise/off/v1/{path}\"", + 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::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ProxyOffV1TokenwiseOffV1PathGet", + methodName: "ProxyOffV1TokenwiseOffV1PathGetAsync", + pathTemplate: "$\"/tokenwise/off/v1/{path}\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ProxyOffV1TokenwiseOffV1PathGet", + methodName: "ProxyOffV1TokenwiseOffV1PathGetAsync", + pathTemplate: "$\"/tokenwise/off/v1/{path}\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessProxyOffV1TokenwiseOffV1PathGetResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ProxyOffV1TokenwiseOffV1PathGet", + methodName: "ProxyOffV1TokenwiseOffV1PathGetAsync", + pathTemplate: "$\"/tokenwise/off/v1/{path}\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ProxyOffV1TokenwiseOffV1PathGet", + methodName: "ProxyOffV1TokenwiseOffV1PathGetAsync", + pathTemplate: "$\"/tokenwise/off/v1/{path}\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: __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::AI21.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessProxyOffV1TokenwiseOffV1PathGetResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? 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::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.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::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.ProxyOffV1TokenwiseOffV1PathGet2.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.ProxyOffV1TokenwiseOffV1PathGet2.g.cs new file mode 100644 index 00000000..b19f0dc4 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Ai21Client.ProxyOffV1TokenwiseOffV1PathGet2.g.cs @@ -0,0 +1,474 @@ + +#nullable enable + +namespace AI21 +{ + public partial class Ai21Client + { + + + private static readonly global::AI21.EndPointSecurityRequirement s_ProxyOffV1TokenwiseOffV1PathGet2SecurityRequirement0 = + new global::AI21.EndPointSecurityRequirement + { + Authorizations = new global::AI21.EndPointAuthorizationRequirement[] + { new global::AI21.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::AI21.EndPointSecurityRequirement[] s_ProxyOffV1TokenwiseOffV1PathGet2SecurityRequirements = + new global::AI21.EndPointSecurityRequirement[] + { s_ProxyOffV1TokenwiseOffV1PathGet2SecurityRequirement0, + }; + partial void PrepareProxyOffV1TokenwiseOffV1PathGet2Arguments( + global::System.Net.Http.HttpClient httpClient, + ref string path, + ref string? xAi21Key); + partial void PrepareProxyOffV1TokenwiseOffV1PathGet2Request( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string path, + string? xAi21Key); + partial void ProcessProxyOffV1TokenwiseOffV1PathGet2Response( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessProxyOffV1TokenwiseOffV1PathGet2ResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Proxy Off V1
+ /// A/B off-arm — forces gateway transformers off for this request 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 ProxyOffV1TokenwiseOffV1PathGet2Async( + string path, + string? xAi21Key = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ProxyOffV1TokenwiseOffV1PathGet2AsResponseAsync( + path: path, + xAi21Key: xAi21Key, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Proxy Off V1
+ /// A/B off-arm — forces gateway transformers off for this request 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> ProxyOffV1TokenwiseOffV1PathGet2AsResponseAsync( + string path, + string? xAi21Key = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareProxyOffV1TokenwiseOffV1PathGet2Arguments( + httpClient: HttpClient, + path: ref path, + xAi21Key: ref xAi21Key); + + + var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_ProxyOffV1TokenwiseOffV1PathGet2SecurityRequirements, + operationName: "ProxyOffV1TokenwiseOffV1PathGet2Async"); + + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: $"/tokenwise/off/v1/{path}", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.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 (xAi21Key != default) + { + __httpRequest.Headers.TryAddWithoutValidation("X-AI21-Key", xAi21Key.ToString()); + } + + global::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareProxyOffV1TokenwiseOffV1PathGet2Request( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + path: path!, + xAi21Key: xAi21Key); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ProxyOffV1TokenwiseOffV1PathGet2", + methodName: "ProxyOffV1TokenwiseOffV1PathGet2Async", + pathTemplate: "$\"/tokenwise/off/v1/{path}\"", + 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::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ProxyOffV1TokenwiseOffV1PathGet2", + methodName: "ProxyOffV1TokenwiseOffV1PathGet2Async", + pathTemplate: "$\"/tokenwise/off/v1/{path}\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ProxyOffV1TokenwiseOffV1PathGet2", + methodName: "ProxyOffV1TokenwiseOffV1PathGet2Async", + pathTemplate: "$\"/tokenwise/off/v1/{path}\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessProxyOffV1TokenwiseOffV1PathGet2Response( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ProxyOffV1TokenwiseOffV1PathGet2", + methodName: "ProxyOffV1TokenwiseOffV1PathGet2Async", + pathTemplate: "$\"/tokenwise/off/v1/{path}\"", + 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::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ProxyOffV1TokenwiseOffV1PathGet2", + methodName: "ProxyOffV1TokenwiseOffV1PathGet2Async", + pathTemplate: "$\"/tokenwise/off/v1/{path}\"", + 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); + } + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::AI21.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessProxyOffV1TokenwiseOffV1PathGet2ResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? 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::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.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::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.ProxyOffV1TokenwiseOffV1PathGet3.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.ProxyOffV1TokenwiseOffV1PathGet3.g.cs new file mode 100644 index 00000000..7c27f090 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Ai21Client.ProxyOffV1TokenwiseOffV1PathGet3.g.cs @@ -0,0 +1,474 @@ + +#nullable enable + +namespace AI21 +{ + public partial class Ai21Client + { + + + private static readonly global::AI21.EndPointSecurityRequirement s_ProxyOffV1TokenwiseOffV1PathGet3SecurityRequirement0 = + new global::AI21.EndPointSecurityRequirement + { + Authorizations = new global::AI21.EndPointAuthorizationRequirement[] + { new global::AI21.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::AI21.EndPointSecurityRequirement[] s_ProxyOffV1TokenwiseOffV1PathGet3SecurityRequirements = + new global::AI21.EndPointSecurityRequirement[] + { s_ProxyOffV1TokenwiseOffV1PathGet3SecurityRequirement0, + }; + partial void PrepareProxyOffV1TokenwiseOffV1PathGet3Arguments( + global::System.Net.Http.HttpClient httpClient, + ref string path, + ref string? xAi21Key); + partial void PrepareProxyOffV1TokenwiseOffV1PathGet3Request( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string path, + string? xAi21Key); + partial void ProcessProxyOffV1TokenwiseOffV1PathGet3Response( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessProxyOffV1TokenwiseOffV1PathGet3ResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Proxy Off V1
+ /// A/B off-arm — forces gateway transformers off for this request 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 ProxyOffV1TokenwiseOffV1PathGet3Async( + string path, + string? xAi21Key = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ProxyOffV1TokenwiseOffV1PathGet3AsResponseAsync( + path: path, + xAi21Key: xAi21Key, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Proxy Off V1
+ /// A/B off-arm — forces gateway transformers off for this request 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> ProxyOffV1TokenwiseOffV1PathGet3AsResponseAsync( + string path, + string? xAi21Key = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareProxyOffV1TokenwiseOffV1PathGet3Arguments( + httpClient: HttpClient, + path: ref path, + xAi21Key: ref xAi21Key); + + + var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_ProxyOffV1TokenwiseOffV1PathGet3SecurityRequirements, + operationName: "ProxyOffV1TokenwiseOffV1PathGet3Async"); + + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: $"/tokenwise/off/v1/{path}", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.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 (xAi21Key != default) + { + __httpRequest.Headers.TryAddWithoutValidation("X-AI21-Key", xAi21Key.ToString()); + } + + global::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareProxyOffV1TokenwiseOffV1PathGet3Request( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + path: path!, + xAi21Key: xAi21Key); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ProxyOffV1TokenwiseOffV1PathGet3", + methodName: "ProxyOffV1TokenwiseOffV1PathGet3Async", + pathTemplate: "$\"/tokenwise/off/v1/{path}\"", + 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::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ProxyOffV1TokenwiseOffV1PathGet3", + methodName: "ProxyOffV1TokenwiseOffV1PathGet3Async", + pathTemplate: "$\"/tokenwise/off/v1/{path}\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ProxyOffV1TokenwiseOffV1PathGet3", + methodName: "ProxyOffV1TokenwiseOffV1PathGet3Async", + pathTemplate: "$\"/tokenwise/off/v1/{path}\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessProxyOffV1TokenwiseOffV1PathGet3Response( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ProxyOffV1TokenwiseOffV1PathGet3", + methodName: "ProxyOffV1TokenwiseOffV1PathGet3Async", + pathTemplate: "$\"/tokenwise/off/v1/{path}\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ProxyOffV1TokenwiseOffV1PathGet3", + methodName: "ProxyOffV1TokenwiseOffV1PathGet3Async", + pathTemplate: "$\"/tokenwise/off/v1/{path}\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __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::AI21.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessProxyOffV1TokenwiseOffV1PathGet3ResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? 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::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.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::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.ProxyOffV1TokenwiseOffV1PathGet4.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.ProxyOffV1TokenwiseOffV1PathGet4.g.cs new file mode 100644 index 00000000..01edb62f --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Ai21Client.ProxyOffV1TokenwiseOffV1PathGet4.g.cs @@ -0,0 +1,474 @@ + +#nullable enable + +namespace AI21 +{ + public partial class Ai21Client + { + + + private static readonly global::AI21.EndPointSecurityRequirement s_ProxyOffV1TokenwiseOffV1PathGet4SecurityRequirement0 = + new global::AI21.EndPointSecurityRequirement + { + Authorizations = new global::AI21.EndPointAuthorizationRequirement[] + { new global::AI21.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::AI21.EndPointSecurityRequirement[] s_ProxyOffV1TokenwiseOffV1PathGet4SecurityRequirements = + new global::AI21.EndPointSecurityRequirement[] + { s_ProxyOffV1TokenwiseOffV1PathGet4SecurityRequirement0, + }; + partial void PrepareProxyOffV1TokenwiseOffV1PathGet4Arguments( + global::System.Net.Http.HttpClient httpClient, + ref string path, + ref string? xAi21Key); + partial void PrepareProxyOffV1TokenwiseOffV1PathGet4Request( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string path, + string? xAi21Key); + partial void ProcessProxyOffV1TokenwiseOffV1PathGet4Response( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessProxyOffV1TokenwiseOffV1PathGet4ResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Proxy Off V1
+ /// A/B off-arm — forces gateway transformers off for this request 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 ProxyOffV1TokenwiseOffV1PathGet4Async( + string path, + string? xAi21Key = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ProxyOffV1TokenwiseOffV1PathGet4AsResponseAsync( + path: path, + xAi21Key: xAi21Key, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Proxy Off V1
+ /// A/B off-arm — forces gateway transformers off for this request 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> ProxyOffV1TokenwiseOffV1PathGet4AsResponseAsync( + string path, + string? xAi21Key = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareProxyOffV1TokenwiseOffV1PathGet4Arguments( + httpClient: HttpClient, + path: ref path, + xAi21Key: ref xAi21Key); + + + var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_ProxyOffV1TokenwiseOffV1PathGet4SecurityRequirements, + operationName: "ProxyOffV1TokenwiseOffV1PathGet4Async"); + + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: $"/tokenwise/off/v1/{path}", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.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 (xAi21Key != default) + { + __httpRequest.Headers.TryAddWithoutValidation("X-AI21-Key", xAi21Key.ToString()); + } + + global::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareProxyOffV1TokenwiseOffV1PathGet4Request( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + path: path!, + xAi21Key: xAi21Key); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ProxyOffV1TokenwiseOffV1PathGet4", + methodName: "ProxyOffV1TokenwiseOffV1PathGet4Async", + pathTemplate: "$\"/tokenwise/off/v1/{path}\"", + 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::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ProxyOffV1TokenwiseOffV1PathGet4", + methodName: "ProxyOffV1TokenwiseOffV1PathGet4Async", + pathTemplate: "$\"/tokenwise/off/v1/{path}\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ProxyOffV1TokenwiseOffV1PathGet4", + methodName: "ProxyOffV1TokenwiseOffV1PathGet4Async", + pathTemplate: "$\"/tokenwise/off/v1/{path}\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessProxyOffV1TokenwiseOffV1PathGet4Response( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ProxyOffV1TokenwiseOffV1PathGet4", + methodName: "ProxyOffV1TokenwiseOffV1PathGet4Async", + pathTemplate: "$\"/tokenwise/off/v1/{path}\"", + 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::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ProxyOffV1TokenwiseOffV1PathGet4", + methodName: "ProxyOffV1TokenwiseOffV1PathGet4Async", + pathTemplate: "$\"/tokenwise/off/v1/{path}\"", + 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::AI21.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessProxyOffV1TokenwiseOffV1PathGet4ResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? 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::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.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::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.ProxyOffV1TokenwiseOffV1PathGet5.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.ProxyOffV1TokenwiseOffV1PathGet5.g.cs new file mode 100644 index 00000000..2cd95ef3 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Ai21Client.ProxyOffV1TokenwiseOffV1PathGet5.g.cs @@ -0,0 +1,474 @@ + +#nullable enable + +namespace AI21 +{ + public partial class Ai21Client + { + + + private static readonly global::AI21.EndPointSecurityRequirement s_ProxyOffV1TokenwiseOffV1PathGet5SecurityRequirement0 = + new global::AI21.EndPointSecurityRequirement + { + Authorizations = new global::AI21.EndPointAuthorizationRequirement[] + { new global::AI21.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::AI21.EndPointSecurityRequirement[] s_ProxyOffV1TokenwiseOffV1PathGet5SecurityRequirements = + new global::AI21.EndPointSecurityRequirement[] + { s_ProxyOffV1TokenwiseOffV1PathGet5SecurityRequirement0, + }; + partial void PrepareProxyOffV1TokenwiseOffV1PathGet5Arguments( + global::System.Net.Http.HttpClient httpClient, + ref string path, + ref string? xAi21Key); + partial void PrepareProxyOffV1TokenwiseOffV1PathGet5Request( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string path, + string? xAi21Key); + partial void ProcessProxyOffV1TokenwiseOffV1PathGet5Response( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessProxyOffV1TokenwiseOffV1PathGet5ResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Proxy Off V1
+ /// A/B off-arm — forces gateway transformers off for this request 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 ProxyOffV1TokenwiseOffV1PathGet5Async( + string path, + string? xAi21Key = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ProxyOffV1TokenwiseOffV1PathGet5AsResponseAsync( + path: path, + xAi21Key: xAi21Key, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Proxy Off V1
+ /// A/B off-arm — forces gateway transformers off for this request 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> ProxyOffV1TokenwiseOffV1PathGet5AsResponseAsync( + string path, + string? xAi21Key = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareProxyOffV1TokenwiseOffV1PathGet5Arguments( + httpClient: HttpClient, + path: ref path, + xAi21Key: ref xAi21Key); + + + var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_ProxyOffV1TokenwiseOffV1PathGet5SecurityRequirements, + operationName: "ProxyOffV1TokenwiseOffV1PathGet5Async"); + + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: $"/tokenwise/off/v1/{path}", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Options, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + + if (xAi21Key != default) + { + __httpRequest.Headers.TryAddWithoutValidation("X-AI21-Key", xAi21Key.ToString()); + } + + global::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareProxyOffV1TokenwiseOffV1PathGet5Request( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + path: path!, + xAi21Key: xAi21Key); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ProxyOffV1TokenwiseOffV1PathGet5", + methodName: "ProxyOffV1TokenwiseOffV1PathGet5Async", + pathTemplate: "$\"/tokenwise/off/v1/{path}\"", + httpMethod: "OPTIONS", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ProxyOffV1TokenwiseOffV1PathGet5", + methodName: "ProxyOffV1TokenwiseOffV1PathGet5Async", + pathTemplate: "$\"/tokenwise/off/v1/{path}\"", + httpMethod: "OPTIONS", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ProxyOffV1TokenwiseOffV1PathGet5", + methodName: "ProxyOffV1TokenwiseOffV1PathGet5Async", + pathTemplate: "$\"/tokenwise/off/v1/{path}\"", + httpMethod: "OPTIONS", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessProxyOffV1TokenwiseOffV1PathGet5Response( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ProxyOffV1TokenwiseOffV1PathGet5", + methodName: "ProxyOffV1TokenwiseOffV1PathGet5Async", + pathTemplate: "$\"/tokenwise/off/v1/{path}\"", + httpMethod: "OPTIONS", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ProxyOffV1TokenwiseOffV1PathGet5", + methodName: "ProxyOffV1TokenwiseOffV1PathGet5Async", + pathTemplate: "$\"/tokenwise/off/v1/{path}\"", + httpMethod: "OPTIONS", + baseUri: BaseUri, + request: __httpRequest!, + response: __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::AI21.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessProxyOffV1TokenwiseOffV1PathGet5ResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? 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::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.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::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.ProxyOffV1TokenwiseOffV1PathGet6.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.ProxyOffV1TokenwiseOffV1PathGet6.g.cs new file mode 100644 index 00000000..102635aa --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Ai21Client.ProxyOffV1TokenwiseOffV1PathGet6.g.cs @@ -0,0 +1,474 @@ + +#nullable enable + +namespace AI21 +{ + public partial class Ai21Client + { + + + private static readonly global::AI21.EndPointSecurityRequirement s_ProxyOffV1TokenwiseOffV1PathGet6SecurityRequirement0 = + new global::AI21.EndPointSecurityRequirement + { + Authorizations = new global::AI21.EndPointAuthorizationRequirement[] + { new global::AI21.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::AI21.EndPointSecurityRequirement[] s_ProxyOffV1TokenwiseOffV1PathGet6SecurityRequirements = + new global::AI21.EndPointSecurityRequirement[] + { s_ProxyOffV1TokenwiseOffV1PathGet6SecurityRequirement0, + }; + partial void PrepareProxyOffV1TokenwiseOffV1PathGet6Arguments( + global::System.Net.Http.HttpClient httpClient, + ref string path, + ref string? xAi21Key); + partial void PrepareProxyOffV1TokenwiseOffV1PathGet6Request( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string path, + string? xAi21Key); + partial void ProcessProxyOffV1TokenwiseOffV1PathGet6Response( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessProxyOffV1TokenwiseOffV1PathGet6ResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Proxy Off V1
+ /// A/B off-arm — forces gateway transformers off for this request 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 ProxyOffV1TokenwiseOffV1PathGet6Async( + string path, + string? xAi21Key = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ProxyOffV1TokenwiseOffV1PathGet6AsResponseAsync( + path: path, + xAi21Key: xAi21Key, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Proxy Off V1
+ /// A/B off-arm — forces gateway transformers off for this request 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> ProxyOffV1TokenwiseOffV1PathGet6AsResponseAsync( + string path, + string? xAi21Key = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareProxyOffV1TokenwiseOffV1PathGet6Arguments( + httpClient: HttpClient, + path: ref path, + xAi21Key: ref xAi21Key); + + + var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_ProxyOffV1TokenwiseOffV1PathGet6SecurityRequirements, + operationName: "ProxyOffV1TokenwiseOffV1PathGet6Async"); + + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: $"/tokenwise/off/v1/{path}", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.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 (xAi21Key != default) + { + __httpRequest.Headers.TryAddWithoutValidation("X-AI21-Key", xAi21Key.ToString()); + } + + global::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareProxyOffV1TokenwiseOffV1PathGet6Request( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + path: path!, + xAi21Key: xAi21Key); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ProxyOffV1TokenwiseOffV1PathGet6", + methodName: "ProxyOffV1TokenwiseOffV1PathGet6Async", + pathTemplate: "$\"/tokenwise/off/v1/{path}\"", + 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::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ProxyOffV1TokenwiseOffV1PathGet6", + methodName: "ProxyOffV1TokenwiseOffV1PathGet6Async", + pathTemplate: "$\"/tokenwise/off/v1/{path}\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ProxyOffV1TokenwiseOffV1PathGet6", + methodName: "ProxyOffV1TokenwiseOffV1PathGet6Async", + pathTemplate: "$\"/tokenwise/off/v1/{path}\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessProxyOffV1TokenwiseOffV1PathGet6Response( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ProxyOffV1TokenwiseOffV1PathGet6", + methodName: "ProxyOffV1TokenwiseOffV1PathGet6Async", + pathTemplate: "$\"/tokenwise/off/v1/{path}\"", + 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::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ProxyOffV1TokenwiseOffV1PathGet6", + methodName: "ProxyOffV1TokenwiseOffV1PathGet6Async", + pathTemplate: "$\"/tokenwise/off/v1/{path}\"", + 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::AI21.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessProxyOffV1TokenwiseOffV1PathGet6ResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? 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::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.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::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.ProxyOnV1GatewayOnV1PathGet.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.ProxyOnV1GatewayOnV1PathGet.g.cs new file mode 100644 index 00000000..063d81ba --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Ai21Client.ProxyOnV1GatewayOnV1PathGet.g.cs @@ -0,0 +1,474 @@ + +#nullable enable + +namespace AI21 +{ + public partial class Ai21Client + { + + + private static readonly global::AI21.EndPointSecurityRequirement s_ProxyOnV1GatewayOnV1PathGetSecurityRequirement0 = + new global::AI21.EndPointSecurityRequirement + { + Authorizations = new global::AI21.EndPointAuthorizationRequirement[] + { new global::AI21.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::AI21.EndPointSecurityRequirement[] s_ProxyOnV1GatewayOnV1PathGetSecurityRequirements = + new global::AI21.EndPointSecurityRequirement[] + { s_ProxyOnV1GatewayOnV1PathGetSecurityRequirement0, + }; + partial void PrepareProxyOnV1GatewayOnV1PathGetArguments( + global::System.Net.Http.HttpClient httpClient, + ref string path, + ref string? xAi21Key); + partial void PrepareProxyOnV1GatewayOnV1PathGetRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string path, + string? xAi21Key); + partial void ProcessProxyOnV1GatewayOnV1PathGetResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessProxyOnV1GatewayOnV1PathGetResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Proxy On V1
+ /// A/B on-arm — forces gateway transformers on for this request 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 ProxyOnV1GatewayOnV1PathGetAsync( + string path, + string? xAi21Key = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ProxyOnV1GatewayOnV1PathGetAsResponseAsync( + path: path, + xAi21Key: xAi21Key, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Proxy On V1
+ /// A/B on-arm — forces gateway transformers on for this request 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> ProxyOnV1GatewayOnV1PathGetAsResponseAsync( + string path, + string? xAi21Key = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareProxyOnV1GatewayOnV1PathGetArguments( + httpClient: HttpClient, + path: ref path, + xAi21Key: ref xAi21Key); + + + var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_ProxyOnV1GatewayOnV1PathGetSecurityRequirements, + operationName: "ProxyOnV1GatewayOnV1PathGetAsync"); + + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: $"/gateway/on/v1/{path}", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.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 (xAi21Key != default) + { + __httpRequest.Headers.TryAddWithoutValidation("X-AI21-Key", xAi21Key.ToString()); + } + + global::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareProxyOnV1GatewayOnV1PathGetRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + path: path!, + xAi21Key: xAi21Key); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ProxyOnV1GatewayOnV1PathGet", + methodName: "ProxyOnV1GatewayOnV1PathGetAsync", + pathTemplate: "$\"/gateway/on/v1/{path}\"", + 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::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ProxyOnV1GatewayOnV1PathGet", + methodName: "ProxyOnV1GatewayOnV1PathGetAsync", + pathTemplate: "$\"/gateway/on/v1/{path}\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ProxyOnV1GatewayOnV1PathGet", + methodName: "ProxyOnV1GatewayOnV1PathGetAsync", + pathTemplate: "$\"/gateway/on/v1/{path}\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessProxyOnV1GatewayOnV1PathGetResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ProxyOnV1GatewayOnV1PathGet", + methodName: "ProxyOnV1GatewayOnV1PathGetAsync", + pathTemplate: "$\"/gateway/on/v1/{path}\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ProxyOnV1GatewayOnV1PathGet", + methodName: "ProxyOnV1GatewayOnV1PathGetAsync", + pathTemplate: "$\"/gateway/on/v1/{path}\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: __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::AI21.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessProxyOnV1GatewayOnV1PathGetResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? 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::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.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::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.ProxyOnV1GatewayOnV1PathGet2.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.ProxyOnV1GatewayOnV1PathGet2.g.cs new file mode 100644 index 00000000..19d144d2 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Ai21Client.ProxyOnV1GatewayOnV1PathGet2.g.cs @@ -0,0 +1,474 @@ + +#nullable enable + +namespace AI21 +{ + public partial class Ai21Client + { + + + private static readonly global::AI21.EndPointSecurityRequirement s_ProxyOnV1GatewayOnV1PathGet2SecurityRequirement0 = + new global::AI21.EndPointSecurityRequirement + { + Authorizations = new global::AI21.EndPointAuthorizationRequirement[] + { new global::AI21.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::AI21.EndPointSecurityRequirement[] s_ProxyOnV1GatewayOnV1PathGet2SecurityRequirements = + new global::AI21.EndPointSecurityRequirement[] + { s_ProxyOnV1GatewayOnV1PathGet2SecurityRequirement0, + }; + partial void PrepareProxyOnV1GatewayOnV1PathGet2Arguments( + global::System.Net.Http.HttpClient httpClient, + ref string path, + ref string? xAi21Key); + partial void PrepareProxyOnV1GatewayOnV1PathGet2Request( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string path, + string? xAi21Key); + partial void ProcessProxyOnV1GatewayOnV1PathGet2Response( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessProxyOnV1GatewayOnV1PathGet2ResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Proxy On V1
+ /// A/B on-arm — forces gateway transformers on for this request 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 ProxyOnV1GatewayOnV1PathGet2Async( + string path, + string? xAi21Key = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ProxyOnV1GatewayOnV1PathGet2AsResponseAsync( + path: path, + xAi21Key: xAi21Key, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Proxy On V1
+ /// A/B on-arm — forces gateway transformers on for this request 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> ProxyOnV1GatewayOnV1PathGet2AsResponseAsync( + string path, + string? xAi21Key = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareProxyOnV1GatewayOnV1PathGet2Arguments( + httpClient: HttpClient, + path: ref path, + xAi21Key: ref xAi21Key); + + + var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_ProxyOnV1GatewayOnV1PathGet2SecurityRequirements, + operationName: "ProxyOnV1GatewayOnV1PathGet2Async"); + + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: $"/gateway/on/v1/{path}", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.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 (xAi21Key != default) + { + __httpRequest.Headers.TryAddWithoutValidation("X-AI21-Key", xAi21Key.ToString()); + } + + global::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareProxyOnV1GatewayOnV1PathGet2Request( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + path: path!, + xAi21Key: xAi21Key); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ProxyOnV1GatewayOnV1PathGet2", + methodName: "ProxyOnV1GatewayOnV1PathGet2Async", + pathTemplate: "$\"/gateway/on/v1/{path}\"", + 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::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ProxyOnV1GatewayOnV1PathGet2", + methodName: "ProxyOnV1GatewayOnV1PathGet2Async", + pathTemplate: "$\"/gateway/on/v1/{path}\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ProxyOnV1GatewayOnV1PathGet2", + methodName: "ProxyOnV1GatewayOnV1PathGet2Async", + pathTemplate: "$\"/gateway/on/v1/{path}\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessProxyOnV1GatewayOnV1PathGet2Response( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ProxyOnV1GatewayOnV1PathGet2", + methodName: "ProxyOnV1GatewayOnV1PathGet2Async", + pathTemplate: "$\"/gateway/on/v1/{path}\"", + 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::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ProxyOnV1GatewayOnV1PathGet2", + methodName: "ProxyOnV1GatewayOnV1PathGet2Async", + pathTemplate: "$\"/gateway/on/v1/{path}\"", + 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); + } + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::AI21.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessProxyOnV1GatewayOnV1PathGet2ResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? 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::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.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::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.ProxyOnV1GatewayOnV1PathGet3.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.ProxyOnV1GatewayOnV1PathGet3.g.cs new file mode 100644 index 00000000..da4f36f9 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Ai21Client.ProxyOnV1GatewayOnV1PathGet3.g.cs @@ -0,0 +1,474 @@ + +#nullable enable + +namespace AI21 +{ + public partial class Ai21Client + { + + + private static readonly global::AI21.EndPointSecurityRequirement s_ProxyOnV1GatewayOnV1PathGet3SecurityRequirement0 = + new global::AI21.EndPointSecurityRequirement + { + Authorizations = new global::AI21.EndPointAuthorizationRequirement[] + { new global::AI21.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::AI21.EndPointSecurityRequirement[] s_ProxyOnV1GatewayOnV1PathGet3SecurityRequirements = + new global::AI21.EndPointSecurityRequirement[] + { s_ProxyOnV1GatewayOnV1PathGet3SecurityRequirement0, + }; + partial void PrepareProxyOnV1GatewayOnV1PathGet3Arguments( + global::System.Net.Http.HttpClient httpClient, + ref string path, + ref string? xAi21Key); + partial void PrepareProxyOnV1GatewayOnV1PathGet3Request( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string path, + string? xAi21Key); + partial void ProcessProxyOnV1GatewayOnV1PathGet3Response( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessProxyOnV1GatewayOnV1PathGet3ResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Proxy On V1
+ /// A/B on-arm — forces gateway transformers on for this request 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 ProxyOnV1GatewayOnV1PathGet3Async( + string path, + string? xAi21Key = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ProxyOnV1GatewayOnV1PathGet3AsResponseAsync( + path: path, + xAi21Key: xAi21Key, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Proxy On V1
+ /// A/B on-arm — forces gateway transformers on for this request 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> ProxyOnV1GatewayOnV1PathGet3AsResponseAsync( + string path, + string? xAi21Key = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareProxyOnV1GatewayOnV1PathGet3Arguments( + httpClient: HttpClient, + path: ref path, + xAi21Key: ref xAi21Key); + + + var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_ProxyOnV1GatewayOnV1PathGet3SecurityRequirements, + operationName: "ProxyOnV1GatewayOnV1PathGet3Async"); + + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: $"/gateway/on/v1/{path}", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.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 (xAi21Key != default) + { + __httpRequest.Headers.TryAddWithoutValidation("X-AI21-Key", xAi21Key.ToString()); + } + + global::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareProxyOnV1GatewayOnV1PathGet3Request( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + path: path!, + xAi21Key: xAi21Key); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ProxyOnV1GatewayOnV1PathGet3", + methodName: "ProxyOnV1GatewayOnV1PathGet3Async", + pathTemplate: "$\"/gateway/on/v1/{path}\"", + 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::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ProxyOnV1GatewayOnV1PathGet3", + methodName: "ProxyOnV1GatewayOnV1PathGet3Async", + pathTemplate: "$\"/gateway/on/v1/{path}\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ProxyOnV1GatewayOnV1PathGet3", + methodName: "ProxyOnV1GatewayOnV1PathGet3Async", + pathTemplate: "$\"/gateway/on/v1/{path}\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessProxyOnV1GatewayOnV1PathGet3Response( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ProxyOnV1GatewayOnV1PathGet3", + methodName: "ProxyOnV1GatewayOnV1PathGet3Async", + pathTemplate: "$\"/gateway/on/v1/{path}\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ProxyOnV1GatewayOnV1PathGet3", + methodName: "ProxyOnV1GatewayOnV1PathGet3Async", + pathTemplate: "$\"/gateway/on/v1/{path}\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __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::AI21.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessProxyOnV1GatewayOnV1PathGet3ResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? 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::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.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::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.ProxyOnV1GatewayOnV1PathGet4.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.ProxyOnV1GatewayOnV1PathGet4.g.cs new file mode 100644 index 00000000..33811f95 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Ai21Client.ProxyOnV1GatewayOnV1PathGet4.g.cs @@ -0,0 +1,474 @@ + +#nullable enable + +namespace AI21 +{ + public partial class Ai21Client + { + + + private static readonly global::AI21.EndPointSecurityRequirement s_ProxyOnV1GatewayOnV1PathGet4SecurityRequirement0 = + new global::AI21.EndPointSecurityRequirement + { + Authorizations = new global::AI21.EndPointAuthorizationRequirement[] + { new global::AI21.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::AI21.EndPointSecurityRequirement[] s_ProxyOnV1GatewayOnV1PathGet4SecurityRequirements = + new global::AI21.EndPointSecurityRequirement[] + { s_ProxyOnV1GatewayOnV1PathGet4SecurityRequirement0, + }; + partial void PrepareProxyOnV1GatewayOnV1PathGet4Arguments( + global::System.Net.Http.HttpClient httpClient, + ref string path, + ref string? xAi21Key); + partial void PrepareProxyOnV1GatewayOnV1PathGet4Request( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string path, + string? xAi21Key); + partial void ProcessProxyOnV1GatewayOnV1PathGet4Response( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessProxyOnV1GatewayOnV1PathGet4ResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Proxy On V1
+ /// A/B on-arm — forces gateway transformers on for this request 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 ProxyOnV1GatewayOnV1PathGet4Async( + string path, + string? xAi21Key = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ProxyOnV1GatewayOnV1PathGet4AsResponseAsync( + path: path, + xAi21Key: xAi21Key, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Proxy On V1
+ /// A/B on-arm — forces gateway transformers on for this request 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> ProxyOnV1GatewayOnV1PathGet4AsResponseAsync( + string path, + string? xAi21Key = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareProxyOnV1GatewayOnV1PathGet4Arguments( + httpClient: HttpClient, + path: ref path, + xAi21Key: ref xAi21Key); + + + var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_ProxyOnV1GatewayOnV1PathGet4SecurityRequirements, + operationName: "ProxyOnV1GatewayOnV1PathGet4Async"); + + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: $"/gateway/on/v1/{path}", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.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 (xAi21Key != default) + { + __httpRequest.Headers.TryAddWithoutValidation("X-AI21-Key", xAi21Key.ToString()); + } + + global::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareProxyOnV1GatewayOnV1PathGet4Request( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + path: path!, + xAi21Key: xAi21Key); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ProxyOnV1GatewayOnV1PathGet4", + methodName: "ProxyOnV1GatewayOnV1PathGet4Async", + pathTemplate: "$\"/gateway/on/v1/{path}\"", + 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::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ProxyOnV1GatewayOnV1PathGet4", + methodName: "ProxyOnV1GatewayOnV1PathGet4Async", + pathTemplate: "$\"/gateway/on/v1/{path}\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ProxyOnV1GatewayOnV1PathGet4", + methodName: "ProxyOnV1GatewayOnV1PathGet4Async", + pathTemplate: "$\"/gateway/on/v1/{path}\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessProxyOnV1GatewayOnV1PathGet4Response( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ProxyOnV1GatewayOnV1PathGet4", + methodName: "ProxyOnV1GatewayOnV1PathGet4Async", + pathTemplate: "$\"/gateway/on/v1/{path}\"", + 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::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ProxyOnV1GatewayOnV1PathGet4", + methodName: "ProxyOnV1GatewayOnV1PathGet4Async", + pathTemplate: "$\"/gateway/on/v1/{path}\"", + 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::AI21.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessProxyOnV1GatewayOnV1PathGet4ResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? 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::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.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::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.ProxyOnV1GatewayOnV1PathGet5.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.ProxyOnV1GatewayOnV1PathGet5.g.cs new file mode 100644 index 00000000..238abf15 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Ai21Client.ProxyOnV1GatewayOnV1PathGet5.g.cs @@ -0,0 +1,474 @@ + +#nullable enable + +namespace AI21 +{ + public partial class Ai21Client + { + + + private static readonly global::AI21.EndPointSecurityRequirement s_ProxyOnV1GatewayOnV1PathGet5SecurityRequirement0 = + new global::AI21.EndPointSecurityRequirement + { + Authorizations = new global::AI21.EndPointAuthorizationRequirement[] + { new global::AI21.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::AI21.EndPointSecurityRequirement[] s_ProxyOnV1GatewayOnV1PathGet5SecurityRequirements = + new global::AI21.EndPointSecurityRequirement[] + { s_ProxyOnV1GatewayOnV1PathGet5SecurityRequirement0, + }; + partial void PrepareProxyOnV1GatewayOnV1PathGet5Arguments( + global::System.Net.Http.HttpClient httpClient, + ref string path, + ref string? xAi21Key); + partial void PrepareProxyOnV1GatewayOnV1PathGet5Request( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string path, + string? xAi21Key); + partial void ProcessProxyOnV1GatewayOnV1PathGet5Response( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessProxyOnV1GatewayOnV1PathGet5ResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Proxy On V1
+ /// A/B on-arm — forces gateway transformers on for this request 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 ProxyOnV1GatewayOnV1PathGet5Async( + string path, + string? xAi21Key = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ProxyOnV1GatewayOnV1PathGet5AsResponseAsync( + path: path, + xAi21Key: xAi21Key, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Proxy On V1
+ /// A/B on-arm — forces gateway transformers on for this request 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> ProxyOnV1GatewayOnV1PathGet5AsResponseAsync( + string path, + string? xAi21Key = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareProxyOnV1GatewayOnV1PathGet5Arguments( + httpClient: HttpClient, + path: ref path, + xAi21Key: ref xAi21Key); + + + var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_ProxyOnV1GatewayOnV1PathGet5SecurityRequirements, + operationName: "ProxyOnV1GatewayOnV1PathGet5Async"); + + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: $"/gateway/on/v1/{path}", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Options, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + + if (xAi21Key != default) + { + __httpRequest.Headers.TryAddWithoutValidation("X-AI21-Key", xAi21Key.ToString()); + } + + global::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareProxyOnV1GatewayOnV1PathGet5Request( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + path: path!, + xAi21Key: xAi21Key); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ProxyOnV1GatewayOnV1PathGet5", + methodName: "ProxyOnV1GatewayOnV1PathGet5Async", + pathTemplate: "$\"/gateway/on/v1/{path}\"", + httpMethod: "OPTIONS", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ProxyOnV1GatewayOnV1PathGet5", + methodName: "ProxyOnV1GatewayOnV1PathGet5Async", + pathTemplate: "$\"/gateway/on/v1/{path}\"", + httpMethod: "OPTIONS", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ProxyOnV1GatewayOnV1PathGet5", + methodName: "ProxyOnV1GatewayOnV1PathGet5Async", + pathTemplate: "$\"/gateway/on/v1/{path}\"", + httpMethod: "OPTIONS", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessProxyOnV1GatewayOnV1PathGet5Response( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ProxyOnV1GatewayOnV1PathGet5", + methodName: "ProxyOnV1GatewayOnV1PathGet5Async", + pathTemplate: "$\"/gateway/on/v1/{path}\"", + httpMethod: "OPTIONS", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ProxyOnV1GatewayOnV1PathGet5", + methodName: "ProxyOnV1GatewayOnV1PathGet5Async", + pathTemplate: "$\"/gateway/on/v1/{path}\"", + httpMethod: "OPTIONS", + baseUri: BaseUri, + request: __httpRequest!, + response: __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::AI21.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessProxyOnV1GatewayOnV1PathGet5ResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? 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::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.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::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.ProxyOnV1GatewayOnV1PathGet6.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.ProxyOnV1GatewayOnV1PathGet6.g.cs new file mode 100644 index 00000000..ead51419 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Ai21Client.ProxyOnV1GatewayOnV1PathGet6.g.cs @@ -0,0 +1,474 @@ + +#nullable enable + +namespace AI21 +{ + public partial class Ai21Client + { + + + private static readonly global::AI21.EndPointSecurityRequirement s_ProxyOnV1GatewayOnV1PathGet6SecurityRequirement0 = + new global::AI21.EndPointSecurityRequirement + { + Authorizations = new global::AI21.EndPointAuthorizationRequirement[] + { new global::AI21.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::AI21.EndPointSecurityRequirement[] s_ProxyOnV1GatewayOnV1PathGet6SecurityRequirements = + new global::AI21.EndPointSecurityRequirement[] + { s_ProxyOnV1GatewayOnV1PathGet6SecurityRequirement0, + }; + partial void PrepareProxyOnV1GatewayOnV1PathGet6Arguments( + global::System.Net.Http.HttpClient httpClient, + ref string path, + ref string? xAi21Key); + partial void PrepareProxyOnV1GatewayOnV1PathGet6Request( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string path, + string? xAi21Key); + partial void ProcessProxyOnV1GatewayOnV1PathGet6Response( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessProxyOnV1GatewayOnV1PathGet6ResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Proxy On V1
+ /// A/B on-arm — forces gateway transformers on for this request 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 ProxyOnV1GatewayOnV1PathGet6Async( + string path, + string? xAi21Key = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ProxyOnV1GatewayOnV1PathGet6AsResponseAsync( + path: path, + xAi21Key: xAi21Key, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Proxy On V1
+ /// A/B on-arm — forces gateway transformers on for this request 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> ProxyOnV1GatewayOnV1PathGet6AsResponseAsync( + string path, + string? xAi21Key = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareProxyOnV1GatewayOnV1PathGet6Arguments( + httpClient: HttpClient, + path: ref path, + xAi21Key: ref xAi21Key); + + + var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_ProxyOnV1GatewayOnV1PathGet6SecurityRequirements, + operationName: "ProxyOnV1GatewayOnV1PathGet6Async"); + + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: $"/gateway/on/v1/{path}", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.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 (xAi21Key != default) + { + __httpRequest.Headers.TryAddWithoutValidation("X-AI21-Key", xAi21Key.ToString()); + } + + global::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareProxyOnV1GatewayOnV1PathGet6Request( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + path: path!, + xAi21Key: xAi21Key); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ProxyOnV1GatewayOnV1PathGet6", + methodName: "ProxyOnV1GatewayOnV1PathGet6Async", + pathTemplate: "$\"/gateway/on/v1/{path}\"", + 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::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ProxyOnV1GatewayOnV1PathGet6", + methodName: "ProxyOnV1GatewayOnV1PathGet6Async", + pathTemplate: "$\"/gateway/on/v1/{path}\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ProxyOnV1GatewayOnV1PathGet6", + methodName: "ProxyOnV1GatewayOnV1PathGet6Async", + pathTemplate: "$\"/gateway/on/v1/{path}\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessProxyOnV1GatewayOnV1PathGet6Response( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ProxyOnV1GatewayOnV1PathGet6", + methodName: "ProxyOnV1GatewayOnV1PathGet6Async", + pathTemplate: "$\"/gateway/on/v1/{path}\"", + 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::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ProxyOnV1GatewayOnV1PathGet6", + methodName: "ProxyOnV1GatewayOnV1PathGet6Async", + pathTemplate: "$\"/gateway/on/v1/{path}\"", + 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::AI21.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessProxyOnV1GatewayOnV1PathGet6ResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? 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::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.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::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.ProxyOnV1TokenwiseOnV1PathGet.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.ProxyOnV1TokenwiseOnV1PathGet.g.cs new file mode 100644 index 00000000..39ca7488 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Ai21Client.ProxyOnV1TokenwiseOnV1PathGet.g.cs @@ -0,0 +1,474 @@ + +#nullable enable + +namespace AI21 +{ + public partial class Ai21Client + { + + + private static readonly global::AI21.EndPointSecurityRequirement s_ProxyOnV1TokenwiseOnV1PathGetSecurityRequirement0 = + new global::AI21.EndPointSecurityRequirement + { + Authorizations = new global::AI21.EndPointAuthorizationRequirement[] + { new global::AI21.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::AI21.EndPointSecurityRequirement[] s_ProxyOnV1TokenwiseOnV1PathGetSecurityRequirements = + new global::AI21.EndPointSecurityRequirement[] + { s_ProxyOnV1TokenwiseOnV1PathGetSecurityRequirement0, + }; + partial void PrepareProxyOnV1TokenwiseOnV1PathGetArguments( + global::System.Net.Http.HttpClient httpClient, + ref string path, + ref string? xAi21Key); + partial void PrepareProxyOnV1TokenwiseOnV1PathGetRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string path, + string? xAi21Key); + partial void ProcessProxyOnV1TokenwiseOnV1PathGetResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessProxyOnV1TokenwiseOnV1PathGetResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Proxy On V1
+ /// A/B on-arm — forces gateway transformers on for this request 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 ProxyOnV1TokenwiseOnV1PathGetAsync( + string path, + string? xAi21Key = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ProxyOnV1TokenwiseOnV1PathGetAsResponseAsync( + path: path, + xAi21Key: xAi21Key, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Proxy On V1
+ /// A/B on-arm — forces gateway transformers on for this request 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> ProxyOnV1TokenwiseOnV1PathGetAsResponseAsync( + string path, + string? xAi21Key = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareProxyOnV1TokenwiseOnV1PathGetArguments( + httpClient: HttpClient, + path: ref path, + xAi21Key: ref xAi21Key); + + + var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_ProxyOnV1TokenwiseOnV1PathGetSecurityRequirements, + operationName: "ProxyOnV1TokenwiseOnV1PathGetAsync"); + + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: $"/tokenwise/on/v1/{path}", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.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 (xAi21Key != default) + { + __httpRequest.Headers.TryAddWithoutValidation("X-AI21-Key", xAi21Key.ToString()); + } + + global::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareProxyOnV1TokenwiseOnV1PathGetRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + path: path!, + xAi21Key: xAi21Key); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ProxyOnV1TokenwiseOnV1PathGet", + methodName: "ProxyOnV1TokenwiseOnV1PathGetAsync", + pathTemplate: "$\"/tokenwise/on/v1/{path}\"", + 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::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ProxyOnV1TokenwiseOnV1PathGet", + methodName: "ProxyOnV1TokenwiseOnV1PathGetAsync", + pathTemplate: "$\"/tokenwise/on/v1/{path}\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ProxyOnV1TokenwiseOnV1PathGet", + methodName: "ProxyOnV1TokenwiseOnV1PathGetAsync", + pathTemplate: "$\"/tokenwise/on/v1/{path}\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessProxyOnV1TokenwiseOnV1PathGetResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ProxyOnV1TokenwiseOnV1PathGet", + methodName: "ProxyOnV1TokenwiseOnV1PathGetAsync", + pathTemplate: "$\"/tokenwise/on/v1/{path}\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ProxyOnV1TokenwiseOnV1PathGet", + methodName: "ProxyOnV1TokenwiseOnV1PathGetAsync", + pathTemplate: "$\"/tokenwise/on/v1/{path}\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: __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::AI21.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessProxyOnV1TokenwiseOnV1PathGetResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? 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::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.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::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.ProxyOnV1TokenwiseOnV1PathGet2.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.ProxyOnV1TokenwiseOnV1PathGet2.g.cs new file mode 100644 index 00000000..bc3a8d24 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Ai21Client.ProxyOnV1TokenwiseOnV1PathGet2.g.cs @@ -0,0 +1,474 @@ + +#nullable enable + +namespace AI21 +{ + public partial class Ai21Client + { + + + private static readonly global::AI21.EndPointSecurityRequirement s_ProxyOnV1TokenwiseOnV1PathGet2SecurityRequirement0 = + new global::AI21.EndPointSecurityRequirement + { + Authorizations = new global::AI21.EndPointAuthorizationRequirement[] + { new global::AI21.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::AI21.EndPointSecurityRequirement[] s_ProxyOnV1TokenwiseOnV1PathGet2SecurityRequirements = + new global::AI21.EndPointSecurityRequirement[] + { s_ProxyOnV1TokenwiseOnV1PathGet2SecurityRequirement0, + }; + partial void PrepareProxyOnV1TokenwiseOnV1PathGet2Arguments( + global::System.Net.Http.HttpClient httpClient, + ref string path, + ref string? xAi21Key); + partial void PrepareProxyOnV1TokenwiseOnV1PathGet2Request( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string path, + string? xAi21Key); + partial void ProcessProxyOnV1TokenwiseOnV1PathGet2Response( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessProxyOnV1TokenwiseOnV1PathGet2ResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Proxy On V1
+ /// A/B on-arm — forces gateway transformers on for this request 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 ProxyOnV1TokenwiseOnV1PathGet2Async( + string path, + string? xAi21Key = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ProxyOnV1TokenwiseOnV1PathGet2AsResponseAsync( + path: path, + xAi21Key: xAi21Key, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Proxy On V1
+ /// A/B on-arm — forces gateway transformers on for this request 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> ProxyOnV1TokenwiseOnV1PathGet2AsResponseAsync( + string path, + string? xAi21Key = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareProxyOnV1TokenwiseOnV1PathGet2Arguments( + httpClient: HttpClient, + path: ref path, + xAi21Key: ref xAi21Key); + + + var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_ProxyOnV1TokenwiseOnV1PathGet2SecurityRequirements, + operationName: "ProxyOnV1TokenwiseOnV1PathGet2Async"); + + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: $"/tokenwise/on/v1/{path}", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.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 (xAi21Key != default) + { + __httpRequest.Headers.TryAddWithoutValidation("X-AI21-Key", xAi21Key.ToString()); + } + + global::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareProxyOnV1TokenwiseOnV1PathGet2Request( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + path: path!, + xAi21Key: xAi21Key); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ProxyOnV1TokenwiseOnV1PathGet2", + methodName: "ProxyOnV1TokenwiseOnV1PathGet2Async", + pathTemplate: "$\"/tokenwise/on/v1/{path}\"", + 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::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ProxyOnV1TokenwiseOnV1PathGet2", + methodName: "ProxyOnV1TokenwiseOnV1PathGet2Async", + pathTemplate: "$\"/tokenwise/on/v1/{path}\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ProxyOnV1TokenwiseOnV1PathGet2", + methodName: "ProxyOnV1TokenwiseOnV1PathGet2Async", + pathTemplate: "$\"/tokenwise/on/v1/{path}\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessProxyOnV1TokenwiseOnV1PathGet2Response( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ProxyOnV1TokenwiseOnV1PathGet2", + methodName: "ProxyOnV1TokenwiseOnV1PathGet2Async", + pathTemplate: "$\"/tokenwise/on/v1/{path}\"", + 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::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ProxyOnV1TokenwiseOnV1PathGet2", + methodName: "ProxyOnV1TokenwiseOnV1PathGet2Async", + pathTemplate: "$\"/tokenwise/on/v1/{path}\"", + 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); + } + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::AI21.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessProxyOnV1TokenwiseOnV1PathGet2ResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? 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::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.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::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.ProxyOnV1TokenwiseOnV1PathGet3.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.ProxyOnV1TokenwiseOnV1PathGet3.g.cs new file mode 100644 index 00000000..31cbc38c --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Ai21Client.ProxyOnV1TokenwiseOnV1PathGet3.g.cs @@ -0,0 +1,474 @@ + +#nullable enable + +namespace AI21 +{ + public partial class Ai21Client + { + + + private static readonly global::AI21.EndPointSecurityRequirement s_ProxyOnV1TokenwiseOnV1PathGet3SecurityRequirement0 = + new global::AI21.EndPointSecurityRequirement + { + Authorizations = new global::AI21.EndPointAuthorizationRequirement[] + { new global::AI21.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::AI21.EndPointSecurityRequirement[] s_ProxyOnV1TokenwiseOnV1PathGet3SecurityRequirements = + new global::AI21.EndPointSecurityRequirement[] + { s_ProxyOnV1TokenwiseOnV1PathGet3SecurityRequirement0, + }; + partial void PrepareProxyOnV1TokenwiseOnV1PathGet3Arguments( + global::System.Net.Http.HttpClient httpClient, + ref string path, + ref string? xAi21Key); + partial void PrepareProxyOnV1TokenwiseOnV1PathGet3Request( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string path, + string? xAi21Key); + partial void ProcessProxyOnV1TokenwiseOnV1PathGet3Response( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessProxyOnV1TokenwiseOnV1PathGet3ResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Proxy On V1
+ /// A/B on-arm — forces gateway transformers on for this request 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 ProxyOnV1TokenwiseOnV1PathGet3Async( + string path, + string? xAi21Key = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ProxyOnV1TokenwiseOnV1PathGet3AsResponseAsync( + path: path, + xAi21Key: xAi21Key, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Proxy On V1
+ /// A/B on-arm — forces gateway transformers on for this request 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> ProxyOnV1TokenwiseOnV1PathGet3AsResponseAsync( + string path, + string? xAi21Key = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareProxyOnV1TokenwiseOnV1PathGet3Arguments( + httpClient: HttpClient, + path: ref path, + xAi21Key: ref xAi21Key); + + + var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_ProxyOnV1TokenwiseOnV1PathGet3SecurityRequirements, + operationName: "ProxyOnV1TokenwiseOnV1PathGet3Async"); + + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: $"/tokenwise/on/v1/{path}", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.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 (xAi21Key != default) + { + __httpRequest.Headers.TryAddWithoutValidation("X-AI21-Key", xAi21Key.ToString()); + } + + global::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareProxyOnV1TokenwiseOnV1PathGet3Request( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + path: path!, + xAi21Key: xAi21Key); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ProxyOnV1TokenwiseOnV1PathGet3", + methodName: "ProxyOnV1TokenwiseOnV1PathGet3Async", + pathTemplate: "$\"/tokenwise/on/v1/{path}\"", + 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::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ProxyOnV1TokenwiseOnV1PathGet3", + methodName: "ProxyOnV1TokenwiseOnV1PathGet3Async", + pathTemplate: "$\"/tokenwise/on/v1/{path}\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ProxyOnV1TokenwiseOnV1PathGet3", + methodName: "ProxyOnV1TokenwiseOnV1PathGet3Async", + pathTemplate: "$\"/tokenwise/on/v1/{path}\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessProxyOnV1TokenwiseOnV1PathGet3Response( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ProxyOnV1TokenwiseOnV1PathGet3", + methodName: "ProxyOnV1TokenwiseOnV1PathGet3Async", + pathTemplate: "$\"/tokenwise/on/v1/{path}\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ProxyOnV1TokenwiseOnV1PathGet3", + methodName: "ProxyOnV1TokenwiseOnV1PathGet3Async", + pathTemplate: "$\"/tokenwise/on/v1/{path}\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __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::AI21.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessProxyOnV1TokenwiseOnV1PathGet3ResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? 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::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.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::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.ProxyOnV1TokenwiseOnV1PathGet4.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.ProxyOnV1TokenwiseOnV1PathGet4.g.cs new file mode 100644 index 00000000..f516786d --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Ai21Client.ProxyOnV1TokenwiseOnV1PathGet4.g.cs @@ -0,0 +1,474 @@ + +#nullable enable + +namespace AI21 +{ + public partial class Ai21Client + { + + + private static readonly global::AI21.EndPointSecurityRequirement s_ProxyOnV1TokenwiseOnV1PathGet4SecurityRequirement0 = + new global::AI21.EndPointSecurityRequirement + { + Authorizations = new global::AI21.EndPointAuthorizationRequirement[] + { new global::AI21.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::AI21.EndPointSecurityRequirement[] s_ProxyOnV1TokenwiseOnV1PathGet4SecurityRequirements = + new global::AI21.EndPointSecurityRequirement[] + { s_ProxyOnV1TokenwiseOnV1PathGet4SecurityRequirement0, + }; + partial void PrepareProxyOnV1TokenwiseOnV1PathGet4Arguments( + global::System.Net.Http.HttpClient httpClient, + ref string path, + ref string? xAi21Key); + partial void PrepareProxyOnV1TokenwiseOnV1PathGet4Request( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string path, + string? xAi21Key); + partial void ProcessProxyOnV1TokenwiseOnV1PathGet4Response( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessProxyOnV1TokenwiseOnV1PathGet4ResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Proxy On V1
+ /// A/B on-arm — forces gateway transformers on for this request 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 ProxyOnV1TokenwiseOnV1PathGet4Async( + string path, + string? xAi21Key = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ProxyOnV1TokenwiseOnV1PathGet4AsResponseAsync( + path: path, + xAi21Key: xAi21Key, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Proxy On V1
+ /// A/B on-arm — forces gateway transformers on for this request 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> ProxyOnV1TokenwiseOnV1PathGet4AsResponseAsync( + string path, + string? xAi21Key = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareProxyOnV1TokenwiseOnV1PathGet4Arguments( + httpClient: HttpClient, + path: ref path, + xAi21Key: ref xAi21Key); + + + var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_ProxyOnV1TokenwiseOnV1PathGet4SecurityRequirements, + operationName: "ProxyOnV1TokenwiseOnV1PathGet4Async"); + + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: $"/tokenwise/on/v1/{path}", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.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 (xAi21Key != default) + { + __httpRequest.Headers.TryAddWithoutValidation("X-AI21-Key", xAi21Key.ToString()); + } + + global::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareProxyOnV1TokenwiseOnV1PathGet4Request( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + path: path!, + xAi21Key: xAi21Key); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ProxyOnV1TokenwiseOnV1PathGet4", + methodName: "ProxyOnV1TokenwiseOnV1PathGet4Async", + pathTemplate: "$\"/tokenwise/on/v1/{path}\"", + 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::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ProxyOnV1TokenwiseOnV1PathGet4", + methodName: "ProxyOnV1TokenwiseOnV1PathGet4Async", + pathTemplate: "$\"/tokenwise/on/v1/{path}\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ProxyOnV1TokenwiseOnV1PathGet4", + methodName: "ProxyOnV1TokenwiseOnV1PathGet4Async", + pathTemplate: "$\"/tokenwise/on/v1/{path}\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessProxyOnV1TokenwiseOnV1PathGet4Response( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ProxyOnV1TokenwiseOnV1PathGet4", + methodName: "ProxyOnV1TokenwiseOnV1PathGet4Async", + pathTemplate: "$\"/tokenwise/on/v1/{path}\"", + 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::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ProxyOnV1TokenwiseOnV1PathGet4", + methodName: "ProxyOnV1TokenwiseOnV1PathGet4Async", + pathTemplate: "$\"/tokenwise/on/v1/{path}\"", + 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::AI21.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessProxyOnV1TokenwiseOnV1PathGet4ResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? 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::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.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::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.ProxyOnV1TokenwiseOnV1PathGet5.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.ProxyOnV1TokenwiseOnV1PathGet5.g.cs new file mode 100644 index 00000000..8484a0bb --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Ai21Client.ProxyOnV1TokenwiseOnV1PathGet5.g.cs @@ -0,0 +1,474 @@ + +#nullable enable + +namespace AI21 +{ + public partial class Ai21Client + { + + + private static readonly global::AI21.EndPointSecurityRequirement s_ProxyOnV1TokenwiseOnV1PathGet5SecurityRequirement0 = + new global::AI21.EndPointSecurityRequirement + { + Authorizations = new global::AI21.EndPointAuthorizationRequirement[] + { new global::AI21.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::AI21.EndPointSecurityRequirement[] s_ProxyOnV1TokenwiseOnV1PathGet5SecurityRequirements = + new global::AI21.EndPointSecurityRequirement[] + { s_ProxyOnV1TokenwiseOnV1PathGet5SecurityRequirement0, + }; + partial void PrepareProxyOnV1TokenwiseOnV1PathGet5Arguments( + global::System.Net.Http.HttpClient httpClient, + ref string path, + ref string? xAi21Key); + partial void PrepareProxyOnV1TokenwiseOnV1PathGet5Request( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string path, + string? xAi21Key); + partial void ProcessProxyOnV1TokenwiseOnV1PathGet5Response( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessProxyOnV1TokenwiseOnV1PathGet5ResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Proxy On V1
+ /// A/B on-arm — forces gateway transformers on for this request 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 ProxyOnV1TokenwiseOnV1PathGet5Async( + string path, + string? xAi21Key = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ProxyOnV1TokenwiseOnV1PathGet5AsResponseAsync( + path: path, + xAi21Key: xAi21Key, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Proxy On V1
+ /// A/B on-arm — forces gateway transformers on for this request 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> ProxyOnV1TokenwiseOnV1PathGet5AsResponseAsync( + string path, + string? xAi21Key = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareProxyOnV1TokenwiseOnV1PathGet5Arguments( + httpClient: HttpClient, + path: ref path, + xAi21Key: ref xAi21Key); + + + var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_ProxyOnV1TokenwiseOnV1PathGet5SecurityRequirements, + operationName: "ProxyOnV1TokenwiseOnV1PathGet5Async"); + + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: $"/tokenwise/on/v1/{path}", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Options, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + + if (xAi21Key != default) + { + __httpRequest.Headers.TryAddWithoutValidation("X-AI21-Key", xAi21Key.ToString()); + } + + global::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareProxyOnV1TokenwiseOnV1PathGet5Request( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + path: path!, + xAi21Key: xAi21Key); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ProxyOnV1TokenwiseOnV1PathGet5", + methodName: "ProxyOnV1TokenwiseOnV1PathGet5Async", + pathTemplate: "$\"/tokenwise/on/v1/{path}\"", + httpMethod: "OPTIONS", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ProxyOnV1TokenwiseOnV1PathGet5", + methodName: "ProxyOnV1TokenwiseOnV1PathGet5Async", + pathTemplate: "$\"/tokenwise/on/v1/{path}\"", + httpMethod: "OPTIONS", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ProxyOnV1TokenwiseOnV1PathGet5", + methodName: "ProxyOnV1TokenwiseOnV1PathGet5Async", + pathTemplate: "$\"/tokenwise/on/v1/{path}\"", + httpMethod: "OPTIONS", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessProxyOnV1TokenwiseOnV1PathGet5Response( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ProxyOnV1TokenwiseOnV1PathGet5", + methodName: "ProxyOnV1TokenwiseOnV1PathGet5Async", + pathTemplate: "$\"/tokenwise/on/v1/{path}\"", + httpMethod: "OPTIONS", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ProxyOnV1TokenwiseOnV1PathGet5", + methodName: "ProxyOnV1TokenwiseOnV1PathGet5Async", + pathTemplate: "$\"/tokenwise/on/v1/{path}\"", + httpMethod: "OPTIONS", + baseUri: BaseUri, + request: __httpRequest!, + response: __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::AI21.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessProxyOnV1TokenwiseOnV1PathGet5ResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? 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::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.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::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.ProxyOnV1TokenwiseOnV1PathGet6.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.ProxyOnV1TokenwiseOnV1PathGet6.g.cs new file mode 100644 index 00000000..d81659fc --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Ai21Client.ProxyOnV1TokenwiseOnV1PathGet6.g.cs @@ -0,0 +1,474 @@ + +#nullable enable + +namespace AI21 +{ + public partial class Ai21Client + { + + + private static readonly global::AI21.EndPointSecurityRequirement s_ProxyOnV1TokenwiseOnV1PathGet6SecurityRequirement0 = + new global::AI21.EndPointSecurityRequirement + { + Authorizations = new global::AI21.EndPointAuthorizationRequirement[] + { new global::AI21.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::AI21.EndPointSecurityRequirement[] s_ProxyOnV1TokenwiseOnV1PathGet6SecurityRequirements = + new global::AI21.EndPointSecurityRequirement[] + { s_ProxyOnV1TokenwiseOnV1PathGet6SecurityRequirement0, + }; + partial void PrepareProxyOnV1TokenwiseOnV1PathGet6Arguments( + global::System.Net.Http.HttpClient httpClient, + ref string path, + ref string? xAi21Key); + partial void PrepareProxyOnV1TokenwiseOnV1PathGet6Request( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string path, + string? xAi21Key); + partial void ProcessProxyOnV1TokenwiseOnV1PathGet6Response( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessProxyOnV1TokenwiseOnV1PathGet6ResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Proxy On V1
+ /// A/B on-arm — forces gateway transformers on for this request 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 ProxyOnV1TokenwiseOnV1PathGet6Async( + string path, + string? xAi21Key = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ProxyOnV1TokenwiseOnV1PathGet6AsResponseAsync( + path: path, + xAi21Key: xAi21Key, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Proxy On V1
+ /// A/B on-arm — forces gateway transformers on for this request 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> ProxyOnV1TokenwiseOnV1PathGet6AsResponseAsync( + string path, + string? xAi21Key = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareProxyOnV1TokenwiseOnV1PathGet6Arguments( + httpClient: HttpClient, + path: ref path, + xAi21Key: ref xAi21Key); + + + var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_ProxyOnV1TokenwiseOnV1PathGet6SecurityRequirements, + operationName: "ProxyOnV1TokenwiseOnV1PathGet6Async"); + + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: $"/tokenwise/on/v1/{path}", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.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 (xAi21Key != default) + { + __httpRequest.Headers.TryAddWithoutValidation("X-AI21-Key", xAi21Key.ToString()); + } + + global::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareProxyOnV1TokenwiseOnV1PathGet6Request( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + path: path!, + xAi21Key: xAi21Key); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ProxyOnV1TokenwiseOnV1PathGet6", + methodName: "ProxyOnV1TokenwiseOnV1PathGet6Async", + pathTemplate: "$\"/tokenwise/on/v1/{path}\"", + 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::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ProxyOnV1TokenwiseOnV1PathGet6", + methodName: "ProxyOnV1TokenwiseOnV1PathGet6Async", + pathTemplate: "$\"/tokenwise/on/v1/{path}\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ProxyOnV1TokenwiseOnV1PathGet6", + methodName: "ProxyOnV1TokenwiseOnV1PathGet6Async", + pathTemplate: "$\"/tokenwise/on/v1/{path}\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessProxyOnV1TokenwiseOnV1PathGet6Response( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ProxyOnV1TokenwiseOnV1PathGet6", + methodName: "ProxyOnV1TokenwiseOnV1PathGet6Async", + pathTemplate: "$\"/tokenwise/on/v1/{path}\"", + 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::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ProxyOnV1TokenwiseOnV1PathGet6", + methodName: "ProxyOnV1TokenwiseOnV1PathGet6Async", + pathTemplate: "$\"/tokenwise/on/v1/{path}\"", + 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::AI21.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessProxyOnV1TokenwiseOnV1PathGet6ResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? 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::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.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::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.ProxyV1GatewayV1PathGet.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.ProxyV1GatewayV1PathGet.g.cs new file mode 100644 index 00000000..8db0edfa --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Ai21Client.ProxyV1GatewayV1PathGet.g.cs @@ -0,0 +1,478 @@ + +#nullable enable + +namespace AI21 +{ + public partial class Ai21Client + { + + + private static readonly global::AI21.EndPointSecurityRequirement s_ProxyV1GatewayV1PathGetSecurityRequirement0 = + new global::AI21.EndPointSecurityRequirement + { + Authorizations = new global::AI21.EndPointAuthorizationRequirement[] + { new global::AI21.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::AI21.EndPointSecurityRequirement[] s_ProxyV1GatewayV1PathGetSecurityRequirements = + new global::AI21.EndPointSecurityRequirement[] + { s_ProxyV1GatewayV1PathGetSecurityRequirement0, + }; + partial void PrepareProxyV1GatewayV1PathGetArguments( + global::System.Net.Http.HttpClient httpClient, + ref string path, + ref string? xAi21Key); + partial void PrepareProxyV1GatewayV1PathGetRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string path, + string? xAi21Key); + partial void ProcessProxyV1GatewayV1PathGetResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessProxyV1GatewayV1PathGetResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Proxy V1
+ /// Catch-all for the Anthropic-compatible surface (``/v1/messages``, etc.).
+ /// Gated on a Tokenwise subscription (OPSS-55); the A/B ``/on`` and ``/off`` arms are
+ /// intentionally left ungated. + ///
+ /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task ProxyV1GatewayV1PathGetAsync( + string path, + string? xAi21Key = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ProxyV1GatewayV1PathGetAsResponseAsync( + path: path, + xAi21Key: xAi21Key, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Proxy V1
+ /// Catch-all for the Anthropic-compatible surface (``/v1/messages``, etc.).
+ /// Gated on a Tokenwise subscription (OPSS-55); the A/B ``/on`` and ``/off`` arms are
+ /// intentionally left ungated. + ///
+ /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> ProxyV1GatewayV1PathGetAsResponseAsync( + string path, + string? xAi21Key = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareProxyV1GatewayV1PathGetArguments( + httpClient: HttpClient, + path: ref path, + xAi21Key: ref xAi21Key); + + + var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_ProxyV1GatewayV1PathGetSecurityRequirements, + operationName: "ProxyV1GatewayV1PathGetAsync"); + + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: $"/gateway/v1/{path}", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.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 (xAi21Key != default) + { + __httpRequest.Headers.TryAddWithoutValidation("X-AI21-Key", xAi21Key.ToString()); + } + + global::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareProxyV1GatewayV1PathGetRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + path: path!, + xAi21Key: xAi21Key); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ProxyV1GatewayV1PathGet", + methodName: "ProxyV1GatewayV1PathGetAsync", + pathTemplate: "$\"/gateway/v1/{path}\"", + 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::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ProxyV1GatewayV1PathGet", + methodName: "ProxyV1GatewayV1PathGetAsync", + pathTemplate: "$\"/gateway/v1/{path}\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ProxyV1GatewayV1PathGet", + methodName: "ProxyV1GatewayV1PathGetAsync", + pathTemplate: "$\"/gateway/v1/{path}\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessProxyV1GatewayV1PathGetResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ProxyV1GatewayV1PathGet", + methodName: "ProxyV1GatewayV1PathGetAsync", + pathTemplate: "$\"/gateway/v1/{path}\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ProxyV1GatewayV1PathGet", + methodName: "ProxyV1GatewayV1PathGetAsync", + pathTemplate: "$\"/gateway/v1/{path}\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: __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::AI21.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessProxyV1GatewayV1PathGetResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? 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::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.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::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.ProxyV1GatewayV1PathGet2.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.ProxyV1GatewayV1PathGet2.g.cs new file mode 100644 index 00000000..584f9bf8 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Ai21Client.ProxyV1GatewayV1PathGet2.g.cs @@ -0,0 +1,478 @@ + +#nullable enable + +namespace AI21 +{ + public partial class Ai21Client + { + + + private static readonly global::AI21.EndPointSecurityRequirement s_ProxyV1GatewayV1PathGet2SecurityRequirement0 = + new global::AI21.EndPointSecurityRequirement + { + Authorizations = new global::AI21.EndPointAuthorizationRequirement[] + { new global::AI21.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::AI21.EndPointSecurityRequirement[] s_ProxyV1GatewayV1PathGet2SecurityRequirements = + new global::AI21.EndPointSecurityRequirement[] + { s_ProxyV1GatewayV1PathGet2SecurityRequirement0, + }; + partial void PrepareProxyV1GatewayV1PathGet2Arguments( + global::System.Net.Http.HttpClient httpClient, + ref string path, + ref string? xAi21Key); + partial void PrepareProxyV1GatewayV1PathGet2Request( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string path, + string? xAi21Key); + partial void ProcessProxyV1GatewayV1PathGet2Response( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessProxyV1GatewayV1PathGet2ResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Proxy V1
+ /// Catch-all for the Anthropic-compatible surface (``/v1/messages``, etc.).
+ /// Gated on a Tokenwise subscription (OPSS-55); the A/B ``/on`` and ``/off`` arms are
+ /// intentionally left ungated. + ///
+ /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task ProxyV1GatewayV1PathGet2Async( + string path, + string? xAi21Key = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ProxyV1GatewayV1PathGet2AsResponseAsync( + path: path, + xAi21Key: xAi21Key, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Proxy V1
+ /// Catch-all for the Anthropic-compatible surface (``/v1/messages``, etc.).
+ /// Gated on a Tokenwise subscription (OPSS-55); the A/B ``/on`` and ``/off`` arms are
+ /// intentionally left ungated. + ///
+ /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> ProxyV1GatewayV1PathGet2AsResponseAsync( + string path, + string? xAi21Key = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareProxyV1GatewayV1PathGet2Arguments( + httpClient: HttpClient, + path: ref path, + xAi21Key: ref xAi21Key); + + + var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_ProxyV1GatewayV1PathGet2SecurityRequirements, + operationName: "ProxyV1GatewayV1PathGet2Async"); + + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: $"/gateway/v1/{path}", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.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 (xAi21Key != default) + { + __httpRequest.Headers.TryAddWithoutValidation("X-AI21-Key", xAi21Key.ToString()); + } + + global::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareProxyV1GatewayV1PathGet2Request( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + path: path!, + xAi21Key: xAi21Key); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ProxyV1GatewayV1PathGet2", + methodName: "ProxyV1GatewayV1PathGet2Async", + pathTemplate: "$\"/gateway/v1/{path}\"", + 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::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ProxyV1GatewayV1PathGet2", + methodName: "ProxyV1GatewayV1PathGet2Async", + pathTemplate: "$\"/gateway/v1/{path}\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ProxyV1GatewayV1PathGet2", + methodName: "ProxyV1GatewayV1PathGet2Async", + pathTemplate: "$\"/gateway/v1/{path}\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessProxyV1GatewayV1PathGet2Response( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ProxyV1GatewayV1PathGet2", + methodName: "ProxyV1GatewayV1PathGet2Async", + pathTemplate: "$\"/gateway/v1/{path}\"", + 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::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ProxyV1GatewayV1PathGet2", + methodName: "ProxyV1GatewayV1PathGet2Async", + pathTemplate: "$\"/gateway/v1/{path}\"", + 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); + } + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::AI21.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessProxyV1GatewayV1PathGet2ResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? 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::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.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::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.ProxyV1GatewayV1PathGet3.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.ProxyV1GatewayV1PathGet3.g.cs new file mode 100644 index 00000000..a5eaa204 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Ai21Client.ProxyV1GatewayV1PathGet3.g.cs @@ -0,0 +1,478 @@ + +#nullable enable + +namespace AI21 +{ + public partial class Ai21Client + { + + + private static readonly global::AI21.EndPointSecurityRequirement s_ProxyV1GatewayV1PathGet3SecurityRequirement0 = + new global::AI21.EndPointSecurityRequirement + { + Authorizations = new global::AI21.EndPointAuthorizationRequirement[] + { new global::AI21.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::AI21.EndPointSecurityRequirement[] s_ProxyV1GatewayV1PathGet3SecurityRequirements = + new global::AI21.EndPointSecurityRequirement[] + { s_ProxyV1GatewayV1PathGet3SecurityRequirement0, + }; + partial void PrepareProxyV1GatewayV1PathGet3Arguments( + global::System.Net.Http.HttpClient httpClient, + ref string path, + ref string? xAi21Key); + partial void PrepareProxyV1GatewayV1PathGet3Request( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string path, + string? xAi21Key); + partial void ProcessProxyV1GatewayV1PathGet3Response( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessProxyV1GatewayV1PathGet3ResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Proxy V1
+ /// Catch-all for the Anthropic-compatible surface (``/v1/messages``, etc.).
+ /// Gated on a Tokenwise subscription (OPSS-55); the A/B ``/on`` and ``/off`` arms are
+ /// intentionally left ungated. + ///
+ /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task ProxyV1GatewayV1PathGet3Async( + string path, + string? xAi21Key = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ProxyV1GatewayV1PathGet3AsResponseAsync( + path: path, + xAi21Key: xAi21Key, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Proxy V1
+ /// Catch-all for the Anthropic-compatible surface (``/v1/messages``, etc.).
+ /// Gated on a Tokenwise subscription (OPSS-55); the A/B ``/on`` and ``/off`` arms are
+ /// intentionally left ungated. + ///
+ /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> ProxyV1GatewayV1PathGet3AsResponseAsync( + string path, + string? xAi21Key = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareProxyV1GatewayV1PathGet3Arguments( + httpClient: HttpClient, + path: ref path, + xAi21Key: ref xAi21Key); + + + var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_ProxyV1GatewayV1PathGet3SecurityRequirements, + operationName: "ProxyV1GatewayV1PathGet3Async"); + + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: $"/gateway/v1/{path}", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.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 (xAi21Key != default) + { + __httpRequest.Headers.TryAddWithoutValidation("X-AI21-Key", xAi21Key.ToString()); + } + + global::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareProxyV1GatewayV1PathGet3Request( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + path: path!, + xAi21Key: xAi21Key); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ProxyV1GatewayV1PathGet3", + methodName: "ProxyV1GatewayV1PathGet3Async", + pathTemplate: "$\"/gateway/v1/{path}\"", + 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::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ProxyV1GatewayV1PathGet3", + methodName: "ProxyV1GatewayV1PathGet3Async", + pathTemplate: "$\"/gateway/v1/{path}\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ProxyV1GatewayV1PathGet3", + methodName: "ProxyV1GatewayV1PathGet3Async", + pathTemplate: "$\"/gateway/v1/{path}\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessProxyV1GatewayV1PathGet3Response( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ProxyV1GatewayV1PathGet3", + methodName: "ProxyV1GatewayV1PathGet3Async", + pathTemplate: "$\"/gateway/v1/{path}\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ProxyV1GatewayV1PathGet3", + methodName: "ProxyV1GatewayV1PathGet3Async", + pathTemplate: "$\"/gateway/v1/{path}\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __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::AI21.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessProxyV1GatewayV1PathGet3ResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? 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::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.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::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.ProxyV1GatewayV1PathGet4.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.ProxyV1GatewayV1PathGet4.g.cs new file mode 100644 index 00000000..d0ce0210 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Ai21Client.ProxyV1GatewayV1PathGet4.g.cs @@ -0,0 +1,478 @@ + +#nullable enable + +namespace AI21 +{ + public partial class Ai21Client + { + + + private static readonly global::AI21.EndPointSecurityRequirement s_ProxyV1GatewayV1PathGet4SecurityRequirement0 = + new global::AI21.EndPointSecurityRequirement + { + Authorizations = new global::AI21.EndPointAuthorizationRequirement[] + { new global::AI21.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::AI21.EndPointSecurityRequirement[] s_ProxyV1GatewayV1PathGet4SecurityRequirements = + new global::AI21.EndPointSecurityRequirement[] + { s_ProxyV1GatewayV1PathGet4SecurityRequirement0, + }; + partial void PrepareProxyV1GatewayV1PathGet4Arguments( + global::System.Net.Http.HttpClient httpClient, + ref string path, + ref string? xAi21Key); + partial void PrepareProxyV1GatewayV1PathGet4Request( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string path, + string? xAi21Key); + partial void ProcessProxyV1GatewayV1PathGet4Response( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessProxyV1GatewayV1PathGet4ResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Proxy V1
+ /// Catch-all for the Anthropic-compatible surface (``/v1/messages``, etc.).
+ /// Gated on a Tokenwise subscription (OPSS-55); the A/B ``/on`` and ``/off`` arms are
+ /// intentionally left ungated. + ///
+ /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task ProxyV1GatewayV1PathGet4Async( + string path, + string? xAi21Key = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ProxyV1GatewayV1PathGet4AsResponseAsync( + path: path, + xAi21Key: xAi21Key, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Proxy V1
+ /// Catch-all for the Anthropic-compatible surface (``/v1/messages``, etc.).
+ /// Gated on a Tokenwise subscription (OPSS-55); the A/B ``/on`` and ``/off`` arms are
+ /// intentionally left ungated. + ///
+ /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> ProxyV1GatewayV1PathGet4AsResponseAsync( + string path, + string? xAi21Key = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareProxyV1GatewayV1PathGet4Arguments( + httpClient: HttpClient, + path: ref path, + xAi21Key: ref xAi21Key); + + + var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_ProxyV1GatewayV1PathGet4SecurityRequirements, + operationName: "ProxyV1GatewayV1PathGet4Async"); + + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: $"/gateway/v1/{path}", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.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 (xAi21Key != default) + { + __httpRequest.Headers.TryAddWithoutValidation("X-AI21-Key", xAi21Key.ToString()); + } + + global::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareProxyV1GatewayV1PathGet4Request( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + path: path!, + xAi21Key: xAi21Key); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ProxyV1GatewayV1PathGet4", + methodName: "ProxyV1GatewayV1PathGet4Async", + pathTemplate: "$\"/gateway/v1/{path}\"", + 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::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ProxyV1GatewayV1PathGet4", + methodName: "ProxyV1GatewayV1PathGet4Async", + pathTemplate: "$\"/gateway/v1/{path}\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ProxyV1GatewayV1PathGet4", + methodName: "ProxyV1GatewayV1PathGet4Async", + pathTemplate: "$\"/gateway/v1/{path}\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessProxyV1GatewayV1PathGet4Response( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ProxyV1GatewayV1PathGet4", + methodName: "ProxyV1GatewayV1PathGet4Async", + pathTemplate: "$\"/gateway/v1/{path}\"", + 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::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ProxyV1GatewayV1PathGet4", + methodName: "ProxyV1GatewayV1PathGet4Async", + pathTemplate: "$\"/gateway/v1/{path}\"", + 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::AI21.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessProxyV1GatewayV1PathGet4ResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? 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::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.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::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.ProxyV1GatewayV1PathGet5.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.ProxyV1GatewayV1PathGet5.g.cs new file mode 100644 index 00000000..7e05d778 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Ai21Client.ProxyV1GatewayV1PathGet5.g.cs @@ -0,0 +1,478 @@ + +#nullable enable + +namespace AI21 +{ + public partial class Ai21Client + { + + + private static readonly global::AI21.EndPointSecurityRequirement s_ProxyV1GatewayV1PathGet5SecurityRequirement0 = + new global::AI21.EndPointSecurityRequirement + { + Authorizations = new global::AI21.EndPointAuthorizationRequirement[] + { new global::AI21.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::AI21.EndPointSecurityRequirement[] s_ProxyV1GatewayV1PathGet5SecurityRequirements = + new global::AI21.EndPointSecurityRequirement[] + { s_ProxyV1GatewayV1PathGet5SecurityRequirement0, + }; + partial void PrepareProxyV1GatewayV1PathGet5Arguments( + global::System.Net.Http.HttpClient httpClient, + ref string path, + ref string? xAi21Key); + partial void PrepareProxyV1GatewayV1PathGet5Request( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string path, + string? xAi21Key); + partial void ProcessProxyV1GatewayV1PathGet5Response( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessProxyV1GatewayV1PathGet5ResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Proxy V1
+ /// Catch-all for the Anthropic-compatible surface (``/v1/messages``, etc.).
+ /// Gated on a Tokenwise subscription (OPSS-55); the A/B ``/on`` and ``/off`` arms are
+ /// intentionally left ungated. + ///
+ /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task ProxyV1GatewayV1PathGet5Async( + string path, + string? xAi21Key = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ProxyV1GatewayV1PathGet5AsResponseAsync( + path: path, + xAi21Key: xAi21Key, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Proxy V1
+ /// Catch-all for the Anthropic-compatible surface (``/v1/messages``, etc.).
+ /// Gated on a Tokenwise subscription (OPSS-55); the A/B ``/on`` and ``/off`` arms are
+ /// intentionally left ungated. + ///
+ /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> ProxyV1GatewayV1PathGet5AsResponseAsync( + string path, + string? xAi21Key = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareProxyV1GatewayV1PathGet5Arguments( + httpClient: HttpClient, + path: ref path, + xAi21Key: ref xAi21Key); + + + var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_ProxyV1GatewayV1PathGet5SecurityRequirements, + operationName: "ProxyV1GatewayV1PathGet5Async"); + + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: $"/gateway/v1/{path}", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Options, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + + if (xAi21Key != default) + { + __httpRequest.Headers.TryAddWithoutValidation("X-AI21-Key", xAi21Key.ToString()); + } + + global::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareProxyV1GatewayV1PathGet5Request( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + path: path!, + xAi21Key: xAi21Key); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ProxyV1GatewayV1PathGet5", + methodName: "ProxyV1GatewayV1PathGet5Async", + pathTemplate: "$\"/gateway/v1/{path}\"", + httpMethod: "OPTIONS", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ProxyV1GatewayV1PathGet5", + methodName: "ProxyV1GatewayV1PathGet5Async", + pathTemplate: "$\"/gateway/v1/{path}\"", + httpMethod: "OPTIONS", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ProxyV1GatewayV1PathGet5", + methodName: "ProxyV1GatewayV1PathGet5Async", + pathTemplate: "$\"/gateway/v1/{path}\"", + httpMethod: "OPTIONS", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessProxyV1GatewayV1PathGet5Response( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ProxyV1GatewayV1PathGet5", + methodName: "ProxyV1GatewayV1PathGet5Async", + pathTemplate: "$\"/gateway/v1/{path}\"", + httpMethod: "OPTIONS", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ProxyV1GatewayV1PathGet5", + methodName: "ProxyV1GatewayV1PathGet5Async", + pathTemplate: "$\"/gateway/v1/{path}\"", + httpMethod: "OPTIONS", + baseUri: BaseUri, + request: __httpRequest!, + response: __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::AI21.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessProxyV1GatewayV1PathGet5ResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? 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::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.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::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.ProxyV1GatewayV1PathGet6.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.ProxyV1GatewayV1PathGet6.g.cs new file mode 100644 index 00000000..29bcb019 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Ai21Client.ProxyV1GatewayV1PathGet6.g.cs @@ -0,0 +1,478 @@ + +#nullable enable + +namespace AI21 +{ + public partial class Ai21Client + { + + + private static readonly global::AI21.EndPointSecurityRequirement s_ProxyV1GatewayV1PathGet6SecurityRequirement0 = + new global::AI21.EndPointSecurityRequirement + { + Authorizations = new global::AI21.EndPointAuthorizationRequirement[] + { new global::AI21.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::AI21.EndPointSecurityRequirement[] s_ProxyV1GatewayV1PathGet6SecurityRequirements = + new global::AI21.EndPointSecurityRequirement[] + { s_ProxyV1GatewayV1PathGet6SecurityRequirement0, + }; + partial void PrepareProxyV1GatewayV1PathGet6Arguments( + global::System.Net.Http.HttpClient httpClient, + ref string path, + ref string? xAi21Key); + partial void PrepareProxyV1GatewayV1PathGet6Request( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string path, + string? xAi21Key); + partial void ProcessProxyV1GatewayV1PathGet6Response( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessProxyV1GatewayV1PathGet6ResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Proxy V1
+ /// Catch-all for the Anthropic-compatible surface (``/v1/messages``, etc.).
+ /// Gated on a Tokenwise subscription (OPSS-55); the A/B ``/on`` and ``/off`` arms are
+ /// intentionally left ungated. + ///
+ /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task ProxyV1GatewayV1PathGet6Async( + string path, + string? xAi21Key = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ProxyV1GatewayV1PathGet6AsResponseAsync( + path: path, + xAi21Key: xAi21Key, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Proxy V1
+ /// Catch-all for the Anthropic-compatible surface (``/v1/messages``, etc.).
+ /// Gated on a Tokenwise subscription (OPSS-55); the A/B ``/on`` and ``/off`` arms are
+ /// intentionally left ungated. + ///
+ /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> ProxyV1GatewayV1PathGet6AsResponseAsync( + string path, + string? xAi21Key = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareProxyV1GatewayV1PathGet6Arguments( + httpClient: HttpClient, + path: ref path, + xAi21Key: ref xAi21Key); + + + var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_ProxyV1GatewayV1PathGet6SecurityRequirements, + operationName: "ProxyV1GatewayV1PathGet6Async"); + + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: $"/gateway/v1/{path}", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.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 (xAi21Key != default) + { + __httpRequest.Headers.TryAddWithoutValidation("X-AI21-Key", xAi21Key.ToString()); + } + + global::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareProxyV1GatewayV1PathGet6Request( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + path: path!, + xAi21Key: xAi21Key); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ProxyV1GatewayV1PathGet6", + methodName: "ProxyV1GatewayV1PathGet6Async", + pathTemplate: "$\"/gateway/v1/{path}\"", + 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::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ProxyV1GatewayV1PathGet6", + methodName: "ProxyV1GatewayV1PathGet6Async", + pathTemplate: "$\"/gateway/v1/{path}\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ProxyV1GatewayV1PathGet6", + methodName: "ProxyV1GatewayV1PathGet6Async", + pathTemplate: "$\"/gateway/v1/{path}\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessProxyV1GatewayV1PathGet6Response( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ProxyV1GatewayV1PathGet6", + methodName: "ProxyV1GatewayV1PathGet6Async", + pathTemplate: "$\"/gateway/v1/{path}\"", + 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::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ProxyV1GatewayV1PathGet6", + methodName: "ProxyV1GatewayV1PathGet6Async", + pathTemplate: "$\"/gateway/v1/{path}\"", + 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::AI21.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessProxyV1GatewayV1PathGet6ResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? 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::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.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::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.ProxyV1TokenwiseV1PathGet.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.ProxyV1TokenwiseV1PathGet.g.cs new file mode 100644 index 00000000..5d25cb61 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Ai21Client.ProxyV1TokenwiseV1PathGet.g.cs @@ -0,0 +1,478 @@ + +#nullable enable + +namespace AI21 +{ + public partial class Ai21Client + { + + + private static readonly global::AI21.EndPointSecurityRequirement s_ProxyV1TokenwiseV1PathGetSecurityRequirement0 = + new global::AI21.EndPointSecurityRequirement + { + Authorizations = new global::AI21.EndPointAuthorizationRequirement[] + { new global::AI21.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::AI21.EndPointSecurityRequirement[] s_ProxyV1TokenwiseV1PathGetSecurityRequirements = + new global::AI21.EndPointSecurityRequirement[] + { s_ProxyV1TokenwiseV1PathGetSecurityRequirement0, + }; + partial void PrepareProxyV1TokenwiseV1PathGetArguments( + global::System.Net.Http.HttpClient httpClient, + ref string path, + ref string? xAi21Key); + partial void PrepareProxyV1TokenwiseV1PathGetRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string path, + string? xAi21Key); + partial void ProcessProxyV1TokenwiseV1PathGetResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessProxyV1TokenwiseV1PathGetResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Proxy V1
+ /// Catch-all for the Anthropic-compatible surface (``/v1/messages``, etc.).
+ /// Gated on a Tokenwise subscription (OPSS-55); the A/B ``/on`` and ``/off`` arms are
+ /// intentionally left ungated. + ///
+ /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task ProxyV1TokenwiseV1PathGetAsync( + string path, + string? xAi21Key = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ProxyV1TokenwiseV1PathGetAsResponseAsync( + path: path, + xAi21Key: xAi21Key, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Proxy V1
+ /// Catch-all for the Anthropic-compatible surface (``/v1/messages``, etc.).
+ /// Gated on a Tokenwise subscription (OPSS-55); the A/B ``/on`` and ``/off`` arms are
+ /// intentionally left ungated. + ///
+ /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> ProxyV1TokenwiseV1PathGetAsResponseAsync( + string path, + string? xAi21Key = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareProxyV1TokenwiseV1PathGetArguments( + httpClient: HttpClient, + path: ref path, + xAi21Key: ref xAi21Key); + + + var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_ProxyV1TokenwiseV1PathGetSecurityRequirements, + operationName: "ProxyV1TokenwiseV1PathGetAsync"); + + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: $"/tokenwise/v1/{path}", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.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 (xAi21Key != default) + { + __httpRequest.Headers.TryAddWithoutValidation("X-AI21-Key", xAi21Key.ToString()); + } + + global::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareProxyV1TokenwiseV1PathGetRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + path: path!, + xAi21Key: xAi21Key); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ProxyV1TokenwiseV1PathGet", + methodName: "ProxyV1TokenwiseV1PathGetAsync", + pathTemplate: "$\"/tokenwise/v1/{path}\"", + 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::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ProxyV1TokenwiseV1PathGet", + methodName: "ProxyV1TokenwiseV1PathGetAsync", + pathTemplate: "$\"/tokenwise/v1/{path}\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ProxyV1TokenwiseV1PathGet", + methodName: "ProxyV1TokenwiseV1PathGetAsync", + pathTemplate: "$\"/tokenwise/v1/{path}\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessProxyV1TokenwiseV1PathGetResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ProxyV1TokenwiseV1PathGet", + methodName: "ProxyV1TokenwiseV1PathGetAsync", + pathTemplate: "$\"/tokenwise/v1/{path}\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ProxyV1TokenwiseV1PathGet", + methodName: "ProxyV1TokenwiseV1PathGetAsync", + pathTemplate: "$\"/tokenwise/v1/{path}\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: __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::AI21.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessProxyV1TokenwiseV1PathGetResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? 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::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.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::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.ProxyV1TokenwiseV1PathGet2.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.ProxyV1TokenwiseV1PathGet2.g.cs new file mode 100644 index 00000000..ea82a42a --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Ai21Client.ProxyV1TokenwiseV1PathGet2.g.cs @@ -0,0 +1,478 @@ + +#nullable enable + +namespace AI21 +{ + public partial class Ai21Client + { + + + private static readonly global::AI21.EndPointSecurityRequirement s_ProxyV1TokenwiseV1PathGet2SecurityRequirement0 = + new global::AI21.EndPointSecurityRequirement + { + Authorizations = new global::AI21.EndPointAuthorizationRequirement[] + { new global::AI21.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::AI21.EndPointSecurityRequirement[] s_ProxyV1TokenwiseV1PathGet2SecurityRequirements = + new global::AI21.EndPointSecurityRequirement[] + { s_ProxyV1TokenwiseV1PathGet2SecurityRequirement0, + }; + partial void PrepareProxyV1TokenwiseV1PathGet2Arguments( + global::System.Net.Http.HttpClient httpClient, + ref string path, + ref string? xAi21Key); + partial void PrepareProxyV1TokenwiseV1PathGet2Request( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string path, + string? xAi21Key); + partial void ProcessProxyV1TokenwiseV1PathGet2Response( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessProxyV1TokenwiseV1PathGet2ResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Proxy V1
+ /// Catch-all for the Anthropic-compatible surface (``/v1/messages``, etc.).
+ /// Gated on a Tokenwise subscription (OPSS-55); the A/B ``/on`` and ``/off`` arms are
+ /// intentionally left ungated. + ///
+ /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task ProxyV1TokenwiseV1PathGet2Async( + string path, + string? xAi21Key = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ProxyV1TokenwiseV1PathGet2AsResponseAsync( + path: path, + xAi21Key: xAi21Key, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Proxy V1
+ /// Catch-all for the Anthropic-compatible surface (``/v1/messages``, etc.).
+ /// Gated on a Tokenwise subscription (OPSS-55); the A/B ``/on`` and ``/off`` arms are
+ /// intentionally left ungated. + ///
+ /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> ProxyV1TokenwiseV1PathGet2AsResponseAsync( + string path, + string? xAi21Key = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareProxyV1TokenwiseV1PathGet2Arguments( + httpClient: HttpClient, + path: ref path, + xAi21Key: ref xAi21Key); + + + var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_ProxyV1TokenwiseV1PathGet2SecurityRequirements, + operationName: "ProxyV1TokenwiseV1PathGet2Async"); + + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: $"/tokenwise/v1/{path}", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.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 (xAi21Key != default) + { + __httpRequest.Headers.TryAddWithoutValidation("X-AI21-Key", xAi21Key.ToString()); + } + + global::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareProxyV1TokenwiseV1PathGet2Request( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + path: path!, + xAi21Key: xAi21Key); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ProxyV1TokenwiseV1PathGet2", + methodName: "ProxyV1TokenwiseV1PathGet2Async", + pathTemplate: "$\"/tokenwise/v1/{path}\"", + 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::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ProxyV1TokenwiseV1PathGet2", + methodName: "ProxyV1TokenwiseV1PathGet2Async", + pathTemplate: "$\"/tokenwise/v1/{path}\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ProxyV1TokenwiseV1PathGet2", + methodName: "ProxyV1TokenwiseV1PathGet2Async", + pathTemplate: "$\"/tokenwise/v1/{path}\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessProxyV1TokenwiseV1PathGet2Response( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ProxyV1TokenwiseV1PathGet2", + methodName: "ProxyV1TokenwiseV1PathGet2Async", + pathTemplate: "$\"/tokenwise/v1/{path}\"", + 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::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ProxyV1TokenwiseV1PathGet2", + methodName: "ProxyV1TokenwiseV1PathGet2Async", + pathTemplate: "$\"/tokenwise/v1/{path}\"", + 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); + } + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::AI21.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessProxyV1TokenwiseV1PathGet2ResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? 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::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.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::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.ProxyV1TokenwiseV1PathGet3.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.ProxyV1TokenwiseV1PathGet3.g.cs new file mode 100644 index 00000000..9ab76f3c --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Ai21Client.ProxyV1TokenwiseV1PathGet3.g.cs @@ -0,0 +1,478 @@ + +#nullable enable + +namespace AI21 +{ + public partial class Ai21Client + { + + + private static readonly global::AI21.EndPointSecurityRequirement s_ProxyV1TokenwiseV1PathGet3SecurityRequirement0 = + new global::AI21.EndPointSecurityRequirement + { + Authorizations = new global::AI21.EndPointAuthorizationRequirement[] + { new global::AI21.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::AI21.EndPointSecurityRequirement[] s_ProxyV1TokenwiseV1PathGet3SecurityRequirements = + new global::AI21.EndPointSecurityRequirement[] + { s_ProxyV1TokenwiseV1PathGet3SecurityRequirement0, + }; + partial void PrepareProxyV1TokenwiseV1PathGet3Arguments( + global::System.Net.Http.HttpClient httpClient, + ref string path, + ref string? xAi21Key); + partial void PrepareProxyV1TokenwiseV1PathGet3Request( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string path, + string? xAi21Key); + partial void ProcessProxyV1TokenwiseV1PathGet3Response( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessProxyV1TokenwiseV1PathGet3ResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Proxy V1
+ /// Catch-all for the Anthropic-compatible surface (``/v1/messages``, etc.).
+ /// Gated on a Tokenwise subscription (OPSS-55); the A/B ``/on`` and ``/off`` arms are
+ /// intentionally left ungated. + ///
+ /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task ProxyV1TokenwiseV1PathGet3Async( + string path, + string? xAi21Key = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ProxyV1TokenwiseV1PathGet3AsResponseAsync( + path: path, + xAi21Key: xAi21Key, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Proxy V1
+ /// Catch-all for the Anthropic-compatible surface (``/v1/messages``, etc.).
+ /// Gated on a Tokenwise subscription (OPSS-55); the A/B ``/on`` and ``/off`` arms are
+ /// intentionally left ungated. + ///
+ /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> ProxyV1TokenwiseV1PathGet3AsResponseAsync( + string path, + string? xAi21Key = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareProxyV1TokenwiseV1PathGet3Arguments( + httpClient: HttpClient, + path: ref path, + xAi21Key: ref xAi21Key); + + + var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_ProxyV1TokenwiseV1PathGet3SecurityRequirements, + operationName: "ProxyV1TokenwiseV1PathGet3Async"); + + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: $"/tokenwise/v1/{path}", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.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 (xAi21Key != default) + { + __httpRequest.Headers.TryAddWithoutValidation("X-AI21-Key", xAi21Key.ToString()); + } + + global::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareProxyV1TokenwiseV1PathGet3Request( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + path: path!, + xAi21Key: xAi21Key); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ProxyV1TokenwiseV1PathGet3", + methodName: "ProxyV1TokenwiseV1PathGet3Async", + pathTemplate: "$\"/tokenwise/v1/{path}\"", + 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::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ProxyV1TokenwiseV1PathGet3", + methodName: "ProxyV1TokenwiseV1PathGet3Async", + pathTemplate: "$\"/tokenwise/v1/{path}\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ProxyV1TokenwiseV1PathGet3", + methodName: "ProxyV1TokenwiseV1PathGet3Async", + pathTemplate: "$\"/tokenwise/v1/{path}\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessProxyV1TokenwiseV1PathGet3Response( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ProxyV1TokenwiseV1PathGet3", + methodName: "ProxyV1TokenwiseV1PathGet3Async", + pathTemplate: "$\"/tokenwise/v1/{path}\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ProxyV1TokenwiseV1PathGet3", + methodName: "ProxyV1TokenwiseV1PathGet3Async", + pathTemplate: "$\"/tokenwise/v1/{path}\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __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::AI21.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessProxyV1TokenwiseV1PathGet3ResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? 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::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.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::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.ProxyV1TokenwiseV1PathGet4.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.ProxyV1TokenwiseV1PathGet4.g.cs new file mode 100644 index 00000000..fe334f95 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Ai21Client.ProxyV1TokenwiseV1PathGet4.g.cs @@ -0,0 +1,478 @@ + +#nullable enable + +namespace AI21 +{ + public partial class Ai21Client + { + + + private static readonly global::AI21.EndPointSecurityRequirement s_ProxyV1TokenwiseV1PathGet4SecurityRequirement0 = + new global::AI21.EndPointSecurityRequirement + { + Authorizations = new global::AI21.EndPointAuthorizationRequirement[] + { new global::AI21.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::AI21.EndPointSecurityRequirement[] s_ProxyV1TokenwiseV1PathGet4SecurityRequirements = + new global::AI21.EndPointSecurityRequirement[] + { s_ProxyV1TokenwiseV1PathGet4SecurityRequirement0, + }; + partial void PrepareProxyV1TokenwiseV1PathGet4Arguments( + global::System.Net.Http.HttpClient httpClient, + ref string path, + ref string? xAi21Key); + partial void PrepareProxyV1TokenwiseV1PathGet4Request( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string path, + string? xAi21Key); + partial void ProcessProxyV1TokenwiseV1PathGet4Response( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessProxyV1TokenwiseV1PathGet4ResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Proxy V1
+ /// Catch-all for the Anthropic-compatible surface (``/v1/messages``, etc.).
+ /// Gated on a Tokenwise subscription (OPSS-55); the A/B ``/on`` and ``/off`` arms are
+ /// intentionally left ungated. + ///
+ /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task ProxyV1TokenwiseV1PathGet4Async( + string path, + string? xAi21Key = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ProxyV1TokenwiseV1PathGet4AsResponseAsync( + path: path, + xAi21Key: xAi21Key, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Proxy V1
+ /// Catch-all for the Anthropic-compatible surface (``/v1/messages``, etc.).
+ /// Gated on a Tokenwise subscription (OPSS-55); the A/B ``/on`` and ``/off`` arms are
+ /// intentionally left ungated. + ///
+ /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> ProxyV1TokenwiseV1PathGet4AsResponseAsync( + string path, + string? xAi21Key = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareProxyV1TokenwiseV1PathGet4Arguments( + httpClient: HttpClient, + path: ref path, + xAi21Key: ref xAi21Key); + + + var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_ProxyV1TokenwiseV1PathGet4SecurityRequirements, + operationName: "ProxyV1TokenwiseV1PathGet4Async"); + + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: $"/tokenwise/v1/{path}", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.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 (xAi21Key != default) + { + __httpRequest.Headers.TryAddWithoutValidation("X-AI21-Key", xAi21Key.ToString()); + } + + global::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareProxyV1TokenwiseV1PathGet4Request( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + path: path!, + xAi21Key: xAi21Key); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ProxyV1TokenwiseV1PathGet4", + methodName: "ProxyV1TokenwiseV1PathGet4Async", + pathTemplate: "$\"/tokenwise/v1/{path}\"", + 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::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ProxyV1TokenwiseV1PathGet4", + methodName: "ProxyV1TokenwiseV1PathGet4Async", + pathTemplate: "$\"/tokenwise/v1/{path}\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ProxyV1TokenwiseV1PathGet4", + methodName: "ProxyV1TokenwiseV1PathGet4Async", + pathTemplate: "$\"/tokenwise/v1/{path}\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessProxyV1TokenwiseV1PathGet4Response( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ProxyV1TokenwiseV1PathGet4", + methodName: "ProxyV1TokenwiseV1PathGet4Async", + pathTemplate: "$\"/tokenwise/v1/{path}\"", + 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::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ProxyV1TokenwiseV1PathGet4", + methodName: "ProxyV1TokenwiseV1PathGet4Async", + pathTemplate: "$\"/tokenwise/v1/{path}\"", + 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::AI21.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessProxyV1TokenwiseV1PathGet4ResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? 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::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.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::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.ProxyV1TokenwiseV1PathGet5.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.ProxyV1TokenwiseV1PathGet5.g.cs new file mode 100644 index 00000000..97a8e0df --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Ai21Client.ProxyV1TokenwiseV1PathGet5.g.cs @@ -0,0 +1,478 @@ + +#nullable enable + +namespace AI21 +{ + public partial class Ai21Client + { + + + private static readonly global::AI21.EndPointSecurityRequirement s_ProxyV1TokenwiseV1PathGet5SecurityRequirement0 = + new global::AI21.EndPointSecurityRequirement + { + Authorizations = new global::AI21.EndPointAuthorizationRequirement[] + { new global::AI21.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::AI21.EndPointSecurityRequirement[] s_ProxyV1TokenwiseV1PathGet5SecurityRequirements = + new global::AI21.EndPointSecurityRequirement[] + { s_ProxyV1TokenwiseV1PathGet5SecurityRequirement0, + }; + partial void PrepareProxyV1TokenwiseV1PathGet5Arguments( + global::System.Net.Http.HttpClient httpClient, + ref string path, + ref string? xAi21Key); + partial void PrepareProxyV1TokenwiseV1PathGet5Request( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string path, + string? xAi21Key); + partial void ProcessProxyV1TokenwiseV1PathGet5Response( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessProxyV1TokenwiseV1PathGet5ResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Proxy V1
+ /// Catch-all for the Anthropic-compatible surface (``/v1/messages``, etc.).
+ /// Gated on a Tokenwise subscription (OPSS-55); the A/B ``/on`` and ``/off`` arms are
+ /// intentionally left ungated. + ///
+ /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task ProxyV1TokenwiseV1PathGet5Async( + string path, + string? xAi21Key = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ProxyV1TokenwiseV1PathGet5AsResponseAsync( + path: path, + xAi21Key: xAi21Key, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Proxy V1
+ /// Catch-all for the Anthropic-compatible surface (``/v1/messages``, etc.).
+ /// Gated on a Tokenwise subscription (OPSS-55); the A/B ``/on`` and ``/off`` arms are
+ /// intentionally left ungated. + ///
+ /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> ProxyV1TokenwiseV1PathGet5AsResponseAsync( + string path, + string? xAi21Key = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareProxyV1TokenwiseV1PathGet5Arguments( + httpClient: HttpClient, + path: ref path, + xAi21Key: ref xAi21Key); + + + var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_ProxyV1TokenwiseV1PathGet5SecurityRequirements, + operationName: "ProxyV1TokenwiseV1PathGet5Async"); + + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: $"/tokenwise/v1/{path}", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Options, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + + if (xAi21Key != default) + { + __httpRequest.Headers.TryAddWithoutValidation("X-AI21-Key", xAi21Key.ToString()); + } + + global::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareProxyV1TokenwiseV1PathGet5Request( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + path: path!, + xAi21Key: xAi21Key); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ProxyV1TokenwiseV1PathGet5", + methodName: "ProxyV1TokenwiseV1PathGet5Async", + pathTemplate: "$\"/tokenwise/v1/{path}\"", + httpMethod: "OPTIONS", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ProxyV1TokenwiseV1PathGet5", + methodName: "ProxyV1TokenwiseV1PathGet5Async", + pathTemplate: "$\"/tokenwise/v1/{path}\"", + httpMethod: "OPTIONS", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ProxyV1TokenwiseV1PathGet5", + methodName: "ProxyV1TokenwiseV1PathGet5Async", + pathTemplate: "$\"/tokenwise/v1/{path}\"", + httpMethod: "OPTIONS", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessProxyV1TokenwiseV1PathGet5Response( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ProxyV1TokenwiseV1PathGet5", + methodName: "ProxyV1TokenwiseV1PathGet5Async", + pathTemplate: "$\"/tokenwise/v1/{path}\"", + httpMethod: "OPTIONS", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ProxyV1TokenwiseV1PathGet5", + methodName: "ProxyV1TokenwiseV1PathGet5Async", + pathTemplate: "$\"/tokenwise/v1/{path}\"", + httpMethod: "OPTIONS", + baseUri: BaseUri, + request: __httpRequest!, + response: __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::AI21.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessProxyV1TokenwiseV1PathGet5ResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? 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::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.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::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.ProxyV1TokenwiseV1PathGet6.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.ProxyV1TokenwiseV1PathGet6.g.cs new file mode 100644 index 00000000..084615e1 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Ai21Client.ProxyV1TokenwiseV1PathGet6.g.cs @@ -0,0 +1,478 @@ + +#nullable enable + +namespace AI21 +{ + public partial class Ai21Client + { + + + private static readonly global::AI21.EndPointSecurityRequirement s_ProxyV1TokenwiseV1PathGet6SecurityRequirement0 = + new global::AI21.EndPointSecurityRequirement + { + Authorizations = new global::AI21.EndPointAuthorizationRequirement[] + { new global::AI21.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::AI21.EndPointSecurityRequirement[] s_ProxyV1TokenwiseV1PathGet6SecurityRequirements = + new global::AI21.EndPointSecurityRequirement[] + { s_ProxyV1TokenwiseV1PathGet6SecurityRequirement0, + }; + partial void PrepareProxyV1TokenwiseV1PathGet6Arguments( + global::System.Net.Http.HttpClient httpClient, + ref string path, + ref string? xAi21Key); + partial void PrepareProxyV1TokenwiseV1PathGet6Request( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string path, + string? xAi21Key); + partial void ProcessProxyV1TokenwiseV1PathGet6Response( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessProxyV1TokenwiseV1PathGet6ResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Proxy V1
+ /// Catch-all for the Anthropic-compatible surface (``/v1/messages``, etc.).
+ /// Gated on a Tokenwise subscription (OPSS-55); the A/B ``/on`` and ``/off`` arms are
+ /// intentionally left ungated. + ///
+ /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task ProxyV1TokenwiseV1PathGet6Async( + string path, + string? xAi21Key = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ProxyV1TokenwiseV1PathGet6AsResponseAsync( + path: path, + xAi21Key: xAi21Key, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Proxy V1
+ /// Catch-all for the Anthropic-compatible surface (``/v1/messages``, etc.).
+ /// Gated on a Tokenwise subscription (OPSS-55); the A/B ``/on`` and ``/off`` arms are
+ /// intentionally left ungated. + ///
+ /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> ProxyV1TokenwiseV1PathGet6AsResponseAsync( + string path, + string? xAi21Key = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareProxyV1TokenwiseV1PathGet6Arguments( + httpClient: HttpClient, + path: ref path, + xAi21Key: ref xAi21Key); + + + var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_ProxyV1TokenwiseV1PathGet6SecurityRequirements, + operationName: "ProxyV1TokenwiseV1PathGet6Async"); + + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: $"/tokenwise/v1/{path}", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.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 (xAi21Key != default) + { + __httpRequest.Headers.TryAddWithoutValidation("X-AI21-Key", xAi21Key.ToString()); + } + + global::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareProxyV1TokenwiseV1PathGet6Request( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + path: path!, + xAi21Key: xAi21Key); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ProxyV1TokenwiseV1PathGet6", + methodName: "ProxyV1TokenwiseV1PathGet6Async", + pathTemplate: "$\"/tokenwise/v1/{path}\"", + 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::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ProxyV1TokenwiseV1PathGet6", + methodName: "ProxyV1TokenwiseV1PathGet6Async", + pathTemplate: "$\"/tokenwise/v1/{path}\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ProxyV1TokenwiseV1PathGet6", + methodName: "ProxyV1TokenwiseV1PathGet6Async", + pathTemplate: "$\"/tokenwise/v1/{path}\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessProxyV1TokenwiseV1PathGet6Response( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ProxyV1TokenwiseV1PathGet6", + methodName: "ProxyV1TokenwiseV1PathGet6Async", + pathTemplate: "$\"/tokenwise/v1/{path}\"", + 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::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ProxyV1TokenwiseV1PathGet6", + methodName: "ProxyV1TokenwiseV1PathGet6Async", + pathTemplate: "$\"/tokenwise/v1/{path}\"", + 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::AI21.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessProxyV1TokenwiseV1PathGet6ResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? 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::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.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::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.RunSyncStudioV1ConnectorsConnectedUsersDataSourcesSyncsPost.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.RunSyncStudioV1ConnectorsConnectedUsersDataSourcesSyncsPost.g.cs deleted file mode 100644 index adc0c1aa..00000000 --- a/src/libs/AI21/Generated/AI21.Ai21Client.RunSyncStudioV1ConnectorsConnectedUsersDataSourcesSyncsPost.g.cs +++ /dev/null @@ -1,275 +0,0 @@ - -#nullable enable - -namespace AI21 -{ - public partial class Ai21Client - { - - - private static readonly global::AI21.EndPointSecurityRequirement s_RunSyncStudioV1ConnectorsConnectedUsersDataSourcesSyncsPostSecurityRequirement0 = - new global::AI21.EndPointSecurityRequirement - { - Authorizations = new global::AI21.EndPointAuthorizationRequirement[] - { new global::AI21.EndPointAuthorizationRequirement - { - Type = "Http", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::AI21.EndPointSecurityRequirement[] s_RunSyncStudioV1ConnectorsConnectedUsersDataSourcesSyncsPostSecurityRequirements = - new global::AI21.EndPointSecurityRequirement[] - { s_RunSyncStudioV1ConnectorsConnectedUsersDataSourcesSyncsPostSecurityRequirement0, - }; - partial void PrepareRunSyncStudioV1ConnectorsConnectedUsersDataSourcesSyncsPostArguments( - global::System.Net.Http.HttpClient httpClient, - global::AI21.ConnectorsSyncParams request); - partial void PrepareRunSyncStudioV1ConnectorsConnectedUsersDataSourcesSyncsPostRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - global::AI21.ConnectorsSyncParams request); - partial void ProcessRunSyncStudioV1ConnectorsConnectedUsersDataSourcesSyncsPostResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessRunSyncStudioV1ConnectorsConnectedUsersDataSourcesSyncsPostResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Run Sync - /// - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task RunSyncStudioV1ConnectorsConnectedUsersDataSourcesSyncsPostAsync( - - global::AI21.ConnectorsSyncParams request, - global::System.Threading.CancellationToken cancellationToken = default) - { - request = request ?? throw new global::System.ArgumentNullException(nameof(request)); - - PrepareArguments( - client: HttpClient); - PrepareRunSyncStudioV1ConnectorsConnectedUsersDataSourcesSyncsPostArguments( - httpClient: HttpClient, - request: request); - - - var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_RunSyncStudioV1ConnectorsConnectedUsersDataSourcesSyncsPostSecurityRequirements, - operationName: "RunSyncStudioV1ConnectorsConnectedUsersDataSourcesSyncsPostAsync"); - - var __pathBuilder = new global::AI21.PathBuilder( - path: "/studio/v1/connectors/connected-users/data-sources/syncs", - 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); - PrepareRunSyncStudioV1ConnectorsConnectedUsersDataSourcesSyncsPostRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - 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); - ProcessRunSyncStudioV1ConnectorsConnectedUsersDataSourcesSyncsPostResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Validation Error - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::AI21.HTTPValidationError? __value_422 = null; - try - { - if (ReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - throw new global::AI21.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) - { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessRunSyncStudioV1ConnectorsConnectedUsersDataSourcesSyncsPostResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return __content; - } - catch (global::System.Exception __ex) - { - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __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::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - } - /// - /// Run Sync - /// - /// - /// - /// - /// - /// - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task RunSyncStudioV1ConnectorsConnectedUsersDataSourcesSyncsPostAsync( - string token, - string dataSource, - string organizationId, - string pipeline, - object? configuration = default, - string? configurationName = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __request = new global::AI21.ConnectorsSyncParams - { - Token = token, - DataSource = dataSource, - OrganizationId = organizationId, - Pipeline = pipeline, - Configuration = configuration, - ConfigurationName = configurationName, - }; - - return await RunSyncStudioV1ConnectorsConnectedUsersDataSourcesSyncsPostAsync( - request: __request, - cancellationToken: cancellationToken).ConfigureAwait(false); - } - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.RunWorkflowStudioV1ConnectorsConnectedUsersEntityIdDataSourcesDataSourceWorkflowsWorkflowNameRunPost.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.RunWorkflowStudioV1ConnectorsConnectedUsersEntityIdDataSourcesDataSourceWorkflowsWorkflowNameRunPost.g.cs deleted file mode 100644 index 5605f248..00000000 --- a/src/libs/AI21/Generated/AI21.Ai21Client.RunWorkflowStudioV1ConnectorsConnectedUsersEntityIdDataSourcesDataSourceWorkflowsWorkflowNameRunPost.g.cs +++ /dev/null @@ -1,244 +0,0 @@ - -#nullable enable - -namespace AI21 -{ - public partial class Ai21Client - { - - - private static readonly global::AI21.EndPointSecurityRequirement s_RunWorkflowStudioV1ConnectorsConnectedUsersEntityIdDataSourcesDataSourceWorkflowsWorkflowNameRunPostSecurityRequirement0 = - new global::AI21.EndPointSecurityRequirement - { - Authorizations = new global::AI21.EndPointAuthorizationRequirement[] - { new global::AI21.EndPointAuthorizationRequirement - { - Type = "Http", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::AI21.EndPointSecurityRequirement[] s_RunWorkflowStudioV1ConnectorsConnectedUsersEntityIdDataSourcesDataSourceWorkflowsWorkflowNameRunPostSecurityRequirements = - new global::AI21.EndPointSecurityRequirement[] - { s_RunWorkflowStudioV1ConnectorsConnectedUsersEntityIdDataSourcesDataSourceWorkflowsWorkflowNameRunPostSecurityRequirement0, - }; - partial void PrepareRunWorkflowStudioV1ConnectorsConnectedUsersEntityIdDataSourcesDataSourceWorkflowsWorkflowNameRunPostArguments( - global::System.Net.Http.HttpClient httpClient, - ref string entityId, - ref string dataSource, - ref string workflowName); - partial void PrepareRunWorkflowStudioV1ConnectorsConnectedUsersEntityIdDataSourcesDataSourceWorkflowsWorkflowNameRunPostRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - string entityId, - string dataSource, - string workflowName); - partial void ProcessRunWorkflowStudioV1ConnectorsConnectedUsersEntityIdDataSourcesDataSourceWorkflowsWorkflowNameRunPostResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessRunWorkflowStudioV1ConnectorsConnectedUsersEntityIdDataSourcesDataSourceWorkflowsWorkflowNameRunPostResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Run Workflow - /// - /// - /// - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task RunWorkflowStudioV1ConnectorsConnectedUsersEntityIdDataSourcesDataSourceWorkflowsWorkflowNameRunPostAsync( - string entityId, - string dataSource, - string workflowName, - global::System.Threading.CancellationToken cancellationToken = default) - { - PrepareArguments( - client: HttpClient); - PrepareRunWorkflowStudioV1ConnectorsConnectedUsersEntityIdDataSourcesDataSourceWorkflowsWorkflowNameRunPostArguments( - httpClient: HttpClient, - entityId: ref entityId, - dataSource: ref dataSource, - workflowName: ref workflowName); - - - var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_RunWorkflowStudioV1ConnectorsConnectedUsersEntityIdDataSourcesDataSourceWorkflowsWorkflowNameRunPostSecurityRequirements, - operationName: "RunWorkflowStudioV1ConnectorsConnectedUsersEntityIdDataSourcesDataSourceWorkflowsWorkflowNameRunPostAsync"); - - var __pathBuilder = new global::AI21.PathBuilder( - path: $"/studio/v1/connectors/connected-users/{entityId}/data-sources/{dataSource}/workflows/{workflowName}/run", - 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); - } - } - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareRunWorkflowStudioV1ConnectorsConnectedUsersEntityIdDataSourcesDataSourceWorkflowsWorkflowNameRunPostRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - entityId: entityId, - dataSource: dataSource, - workflowName: workflowName); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessRunWorkflowStudioV1ConnectorsConnectedUsersEntityIdDataSourcesDataSourceWorkflowsWorkflowNameRunPostResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Validation Error - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::AI21.HTTPValidationError? __value_422 = null; - try - { - if (ReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - throw new global::AI21.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) - { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessRunWorkflowStudioV1ConnectorsConnectedUsersEntityIdDataSourcesDataSourceWorkflowsWorkflowNameRunPostResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return __content; - } - catch (global::System.Exception __ex) - { - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __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::AI21.ApiException( - message: __content ?? __response.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/AI21/Generated/AI21.Ai21Client.SyncWebsiteStudioV1ConnectorsWebsiteConnectorIdSyncPost.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.SyncWebsiteStudioV1ConnectorsWebsiteConnectorIdSyncPost.g.cs deleted file mode 100644 index 68a86cf5..00000000 --- a/src/libs/AI21/Generated/AI21.Ai21Client.SyncWebsiteStudioV1ConnectorsWebsiteConnectorIdSyncPost.g.cs +++ /dev/null @@ -1,232 +0,0 @@ - -#nullable enable - -namespace AI21 -{ - public partial class Ai21Client - { - - - private static readonly global::AI21.EndPointSecurityRequirement s_SyncWebsiteStudioV1ConnectorsWebsiteConnectorIdSyncPostSecurityRequirement0 = - new global::AI21.EndPointSecurityRequirement - { - Authorizations = new global::AI21.EndPointAuthorizationRequirement[] - { new global::AI21.EndPointAuthorizationRequirement - { - Type = "Http", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::AI21.EndPointSecurityRequirement[] s_SyncWebsiteStudioV1ConnectorsWebsiteConnectorIdSyncPostSecurityRequirements = - new global::AI21.EndPointSecurityRequirement[] - { s_SyncWebsiteStudioV1ConnectorsWebsiteConnectorIdSyncPostSecurityRequirement0, - }; - partial void PrepareSyncWebsiteStudioV1ConnectorsWebsiteConnectorIdSyncPostArguments( - global::System.Net.Http.HttpClient httpClient, - ref string connectorId); - partial void PrepareSyncWebsiteStudioV1ConnectorsWebsiteConnectorIdSyncPostRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - string connectorId); - partial void ProcessSyncWebsiteStudioV1ConnectorsWebsiteConnectorIdSyncPostResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessSyncWebsiteStudioV1ConnectorsWebsiteConnectorIdSyncPostResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Sync Website - /// - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task SyncWebsiteStudioV1ConnectorsWebsiteConnectorIdSyncPostAsync( - string connectorId, - global::System.Threading.CancellationToken cancellationToken = default) - { - PrepareArguments( - client: HttpClient); - PrepareSyncWebsiteStudioV1ConnectorsWebsiteConnectorIdSyncPostArguments( - httpClient: HttpClient, - connectorId: ref connectorId); - - - var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_SyncWebsiteStudioV1ConnectorsWebsiteConnectorIdSyncPostSecurityRequirements, - operationName: "SyncWebsiteStudioV1ConnectorsWebsiteConnectorIdSyncPostAsync"); - - var __pathBuilder = new global::AI21.PathBuilder( - path: $"/studio/v1/connectors/website/{connectorId}/sync", - 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); - } - } - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareSyncWebsiteStudioV1ConnectorsWebsiteConnectorIdSyncPostRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - connectorId: connectorId); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessSyncWebsiteStudioV1ConnectorsWebsiteConnectorIdSyncPostResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Validation Error - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::AI21.HTTPValidationError? __value_422 = null; - try - { - if (ReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - throw new global::AI21.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) - { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessSyncWebsiteStudioV1ConnectorsWebsiteConnectorIdSyncPostResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return __content; - } - catch (global::System.Exception __ex) - { - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __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::AI21.ApiException( - message: __content ?? __response.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/AI21/Generated/AI21.Ai21Client.TlvConvragPrefixPreviewSolutionsPreviewTlvMunicipalityConvragPost.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.TlvConvragPrefixPreviewSolutionsPreviewTlvMunicipalityConvragPost.g.cs deleted file mode 100644 index a1c07989..00000000 --- a/src/libs/AI21/Generated/AI21.Ai21Client.TlvConvragPrefixPreviewSolutionsPreviewTlvMunicipalityConvragPost.g.cs +++ /dev/null @@ -1,188 +0,0 @@ - -#nullable enable - -namespace AI21 -{ - public partial class Ai21Client - { - - - private static readonly global::AI21.EndPointSecurityRequirement s_TlvConvragPrefixPreviewSolutionsPreviewTlvMunicipalityConvragPostSecurityRequirement0 = - new global::AI21.EndPointSecurityRequirement - { - Authorizations = new global::AI21.EndPointAuthorizationRequirement[] - { new global::AI21.EndPointAuthorizationRequirement - { - Type = "Http", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::AI21.EndPointSecurityRequirement[] s_TlvConvragPrefixPreviewSolutionsPreviewTlvMunicipalityConvragPostSecurityRequirements = - new global::AI21.EndPointSecurityRequirement[] - { s_TlvConvragPrefixPreviewSolutionsPreviewTlvMunicipalityConvragPostSecurityRequirement0, - }; - partial void PrepareTlvConvragPrefixPreviewSolutionsPreviewTlvMunicipalityConvragPostArguments( - global::System.Net.Http.HttpClient httpClient); - partial void PrepareTlvConvragPrefixPreviewSolutionsPreviewTlvMunicipalityConvragPostRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage); - partial void ProcessTlvConvragPrefixPreviewSolutionsPreviewTlvMunicipalityConvragPostResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessTlvConvragPrefixPreviewSolutionsPreviewTlvMunicipalityConvragPostResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Tlv Convrag Prefix Preview - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task TlvConvragPrefixPreviewSolutionsPreviewTlvMunicipalityConvragPostAsync( - global::System.Threading.CancellationToken cancellationToken = default) - { - PrepareArguments( - client: HttpClient); - PrepareTlvConvragPrefixPreviewSolutionsPreviewTlvMunicipalityConvragPostArguments( - httpClient: HttpClient); - - - var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_TlvConvragPrefixPreviewSolutionsPreviewTlvMunicipalityConvragPostSecurityRequirements, - operationName: "TlvConvragPrefixPreviewSolutionsPreviewTlvMunicipalityConvragPostAsync"); - - var __pathBuilder = new global::AI21.PathBuilder( - path: "/solutions-preview/tlv_municipality/convrag", - 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); - } - } - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareTlvConvragPrefixPreviewSolutionsPreviewTlvMunicipalityConvragPostRequest( - 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); - ProcessTlvConvragPrefixPreviewSolutionsPreviewTlvMunicipalityConvragPostResponse( - 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); - ProcessTlvConvragPrefixPreviewSolutionsPreviewTlvMunicipalityConvragPostResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return __content; - } - catch (global::System.Exception __ex) - { - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __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::AI21.ApiException( - message: __content ?? __response.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/AI21/Generated/AI21.Ai21Client.TlvConvragSolutionsTlvMunicipalityConvragPost.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.TlvConvragSolutionsTlvMunicipalityConvragPost.g.cs deleted file mode 100644 index d635f04c..00000000 --- a/src/libs/AI21/Generated/AI21.Ai21Client.TlvConvragSolutionsTlvMunicipalityConvragPost.g.cs +++ /dev/null @@ -1,188 +0,0 @@ - -#nullable enable - -namespace AI21 -{ - public partial class Ai21Client - { - - - private static readonly global::AI21.EndPointSecurityRequirement s_TlvConvragSolutionsTlvMunicipalityConvragPostSecurityRequirement0 = - new global::AI21.EndPointSecurityRequirement - { - Authorizations = new global::AI21.EndPointAuthorizationRequirement[] - { new global::AI21.EndPointAuthorizationRequirement - { - Type = "Http", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::AI21.EndPointSecurityRequirement[] s_TlvConvragSolutionsTlvMunicipalityConvragPostSecurityRequirements = - new global::AI21.EndPointSecurityRequirement[] - { s_TlvConvragSolutionsTlvMunicipalityConvragPostSecurityRequirement0, - }; - partial void PrepareTlvConvragSolutionsTlvMunicipalityConvragPostArguments( - global::System.Net.Http.HttpClient httpClient); - partial void PrepareTlvConvragSolutionsTlvMunicipalityConvragPostRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage); - partial void ProcessTlvConvragSolutionsTlvMunicipalityConvragPostResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessTlvConvragSolutionsTlvMunicipalityConvragPostResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Tlv Convrag - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task TlvConvragSolutionsTlvMunicipalityConvragPostAsync( - global::System.Threading.CancellationToken cancellationToken = default) - { - PrepareArguments( - client: HttpClient); - PrepareTlvConvragSolutionsTlvMunicipalityConvragPostArguments( - httpClient: HttpClient); - - - var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_TlvConvragSolutionsTlvMunicipalityConvragPostSecurityRequirements, - operationName: "TlvConvragSolutionsTlvMunicipalityConvragPostAsync"); - - var __pathBuilder = new global::AI21.PathBuilder( - path: "/solutions/tlv_municipality/convrag", - 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); - } - } - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareTlvConvragSolutionsTlvMunicipalityConvragPostRequest( - 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); - ProcessTlvConvragSolutionsTlvMunicipalityConvragPostResponse( - 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); - ProcessTlvConvragSolutionsTlvMunicipalityConvragPostResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return __content; - } - catch (global::System.Exception __ex) - { - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __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::AI21.ApiException( - message: __content ?? __response.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/AI21/Generated/AI21.Ai21Client.UpdateAgentGatewaySettingsAgentsAgentIdPut.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.UpdateAgentGatewaySettingsAgentsAgentIdPut.g.cs new file mode 100644 index 00000000..ec8a2f7e --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Ai21Client.UpdateAgentGatewaySettingsAgentsAgentIdPut.g.cs @@ -0,0 +1,518 @@ + +#nullable enable + +namespace AI21 +{ + public partial class Ai21Client + { + + + private static readonly global::AI21.EndPointSecurityRequirement s_UpdateAgentGatewaySettingsAgentsAgentIdPutSecurityRequirement0 = + new global::AI21.EndPointSecurityRequirement + { + Authorizations = new global::AI21.EndPointAuthorizationRequirement[] + { new global::AI21.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::AI21.EndPointSecurityRequirement[] s_UpdateAgentGatewaySettingsAgentsAgentIdPutSecurityRequirements = + new global::AI21.EndPointSecurityRequirement[] + { s_UpdateAgentGatewaySettingsAgentsAgentIdPutSecurityRequirement0, + }; + partial void PrepareUpdateAgentGatewaySettingsAgentsAgentIdPutArguments( + global::System.Net.Http.HttpClient httpClient, + ref string agentId, + global::AI21.AgentUpdate request); + partial void PrepareUpdateAgentGatewaySettingsAgentsAgentIdPutRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string agentId, + global::AI21.AgentUpdate request); + partial void ProcessUpdateAgentGatewaySettingsAgentsAgentIdPutResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessUpdateAgentGatewaySettingsAgentsAgentIdPutResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Update Agent + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task UpdateAgentGatewaySettingsAgentsAgentIdPutAsync( + string agentId, + + global::AI21.AgentUpdate request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await UpdateAgentGatewaySettingsAgentsAgentIdPutAsResponseAsync( + agentId: agentId, + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Update Agent + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> UpdateAgentGatewaySettingsAgentsAgentIdPutAsResponseAsync( + string agentId, + + global::AI21.AgentUpdate request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + request = request ?? throw new global::System.ArgumentNullException(nameof(request)); + + PrepareArguments( + client: HttpClient); + PrepareUpdateAgentGatewaySettingsAgentsAgentIdPutArguments( + httpClient: HttpClient, + agentId: ref agentId, + request: request); + + + var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_UpdateAgentGatewaySettingsAgentsAgentIdPutSecurityRequirements, + operationName: "UpdateAgentGatewaySettingsAgentsAgentIdPutAsync"); + + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: $"/gateway/settings/agents/{agentId}", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.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); + } + } + 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::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareUpdateAgentGatewaySettingsAgentsAgentIdPutRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + agentId: agentId!, + 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::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "UpdateAgentGatewaySettingsAgentsAgentIdPut", + methodName: "UpdateAgentGatewaySettingsAgentsAgentIdPutAsync", + pathTemplate: "$\"/gateway/settings/agents/{agentId}\"", + 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::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "UpdateAgentGatewaySettingsAgentsAgentIdPut", + methodName: "UpdateAgentGatewaySettingsAgentsAgentIdPutAsync", + pathTemplate: "$\"/gateway/settings/agents/{agentId}\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "UpdateAgentGatewaySettingsAgentsAgentIdPut", + methodName: "UpdateAgentGatewaySettingsAgentsAgentIdPutAsync", + pathTemplate: "$\"/gateway/settings/agents/{agentId}\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessUpdateAgentGatewaySettingsAgentsAgentIdPutResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "UpdateAgentGatewaySettingsAgentsAgentIdPut", + methodName: "UpdateAgentGatewaySettingsAgentsAgentIdPutAsync", + pathTemplate: "$\"/gateway/settings/agents/{agentId}\"", + 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::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "UpdateAgentGatewaySettingsAgentsAgentIdPut", + methodName: "UpdateAgentGatewaySettingsAgentsAgentIdPutAsync", + pathTemplate: "$\"/gateway/settings/agents/{agentId}\"", + 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); + } + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::AI21.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessUpdateAgentGatewaySettingsAgentsAgentIdPutResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::AI21.AgentOut.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => 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::AI21.AgentOut.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.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 Agent + /// + /// + /// + /// + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task UpdateAgentGatewaySettingsAgentsAgentIdPutAsync( + string agentId, + string? name = default, + string? kind = default, + string? description = default, + string? configId = default, + bool? enabled = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __request = new global::AI21.AgentUpdate + { + Name = name, + Kind = kind, + Description = description, + ConfigId = configId, + Enabled = enabled, + }; + + return await UpdateAgentGatewaySettingsAgentsAgentIdPutAsync( + agentId: agentId, + request: __request, + requestOptions: requestOptions, + cancellationToken: cancellationToken).ConfigureAwait(false); + } + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.UpdateAgentTokenwiseSettingsAgentsAgentIdPut.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.UpdateAgentTokenwiseSettingsAgentsAgentIdPut.g.cs new file mode 100644 index 00000000..61fd8e30 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Ai21Client.UpdateAgentTokenwiseSettingsAgentsAgentIdPut.g.cs @@ -0,0 +1,518 @@ + +#nullable enable + +namespace AI21 +{ + public partial class Ai21Client + { + + + private static readonly global::AI21.EndPointSecurityRequirement s_UpdateAgentTokenwiseSettingsAgentsAgentIdPutSecurityRequirement0 = + new global::AI21.EndPointSecurityRequirement + { + Authorizations = new global::AI21.EndPointAuthorizationRequirement[] + { new global::AI21.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::AI21.EndPointSecurityRequirement[] s_UpdateAgentTokenwiseSettingsAgentsAgentIdPutSecurityRequirements = + new global::AI21.EndPointSecurityRequirement[] + { s_UpdateAgentTokenwiseSettingsAgentsAgentIdPutSecurityRequirement0, + }; + partial void PrepareUpdateAgentTokenwiseSettingsAgentsAgentIdPutArguments( + global::System.Net.Http.HttpClient httpClient, + ref string agentId, + global::AI21.AgentUpdate request); + partial void PrepareUpdateAgentTokenwiseSettingsAgentsAgentIdPutRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string agentId, + global::AI21.AgentUpdate request); + partial void ProcessUpdateAgentTokenwiseSettingsAgentsAgentIdPutResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessUpdateAgentTokenwiseSettingsAgentsAgentIdPutResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Update Agent + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task UpdateAgentTokenwiseSettingsAgentsAgentIdPutAsync( + string agentId, + + global::AI21.AgentUpdate request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await UpdateAgentTokenwiseSettingsAgentsAgentIdPutAsResponseAsync( + agentId: agentId, + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Update Agent + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> UpdateAgentTokenwiseSettingsAgentsAgentIdPutAsResponseAsync( + string agentId, + + global::AI21.AgentUpdate request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + request = request ?? throw new global::System.ArgumentNullException(nameof(request)); + + PrepareArguments( + client: HttpClient); + PrepareUpdateAgentTokenwiseSettingsAgentsAgentIdPutArguments( + httpClient: HttpClient, + agentId: ref agentId, + request: request); + + + var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_UpdateAgentTokenwiseSettingsAgentsAgentIdPutSecurityRequirements, + operationName: "UpdateAgentTokenwiseSettingsAgentsAgentIdPutAsync"); + + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: $"/tokenwise/settings/agents/{agentId}", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.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); + } + } + 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::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareUpdateAgentTokenwiseSettingsAgentsAgentIdPutRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + agentId: agentId!, + 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::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "UpdateAgentTokenwiseSettingsAgentsAgentIdPut", + methodName: "UpdateAgentTokenwiseSettingsAgentsAgentIdPutAsync", + pathTemplate: "$\"/tokenwise/settings/agents/{agentId}\"", + 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::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "UpdateAgentTokenwiseSettingsAgentsAgentIdPut", + methodName: "UpdateAgentTokenwiseSettingsAgentsAgentIdPutAsync", + pathTemplate: "$\"/tokenwise/settings/agents/{agentId}\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "UpdateAgentTokenwiseSettingsAgentsAgentIdPut", + methodName: "UpdateAgentTokenwiseSettingsAgentsAgentIdPutAsync", + pathTemplate: "$\"/tokenwise/settings/agents/{agentId}\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessUpdateAgentTokenwiseSettingsAgentsAgentIdPutResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "UpdateAgentTokenwiseSettingsAgentsAgentIdPut", + methodName: "UpdateAgentTokenwiseSettingsAgentsAgentIdPutAsync", + pathTemplate: "$\"/tokenwise/settings/agents/{agentId}\"", + 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::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "UpdateAgentTokenwiseSettingsAgentsAgentIdPut", + methodName: "UpdateAgentTokenwiseSettingsAgentsAgentIdPutAsync", + pathTemplate: "$\"/tokenwise/settings/agents/{agentId}\"", + 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); + } + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::AI21.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessUpdateAgentTokenwiseSettingsAgentsAgentIdPutResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::AI21.AgentOut.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => 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::AI21.AgentOut.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.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 Agent + /// + /// + /// + /// + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task UpdateAgentTokenwiseSettingsAgentsAgentIdPutAsync( + string agentId, + string? name = default, + string? kind = default, + string? description = default, + string? configId = default, + bool? enabled = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __request = new global::AI21.AgentUpdate + { + Name = name, + Kind = kind, + Description = description, + ConfigId = configId, + Enabled = enabled, + }; + + return await UpdateAgentTokenwiseSettingsAgentsAgentIdPutAsync( + agentId: agentId, + request: __request, + requestOptions: requestOptions, + cancellationToken: cancellationToken).ConfigureAwait(false); + } + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.UpdateConfigGatewaySettingsConfigsConfigIdPut.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.UpdateConfigGatewaySettingsConfigsConfigIdPut.g.cs new file mode 100644 index 00000000..16db0973 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Ai21Client.UpdateConfigGatewaySettingsConfigsConfigIdPut.g.cs @@ -0,0 +1,515 @@ + +#nullable enable + +namespace AI21 +{ + public partial class Ai21Client + { + + + private static readonly global::AI21.EndPointSecurityRequirement s_UpdateConfigGatewaySettingsConfigsConfigIdPutSecurityRequirement0 = + new global::AI21.EndPointSecurityRequirement + { + Authorizations = new global::AI21.EndPointAuthorizationRequirement[] + { new global::AI21.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::AI21.EndPointSecurityRequirement[] s_UpdateConfigGatewaySettingsConfigsConfigIdPutSecurityRequirements = + new global::AI21.EndPointSecurityRequirement[] + { s_UpdateConfigGatewaySettingsConfigsConfigIdPutSecurityRequirement0, + }; + partial void PrepareUpdateConfigGatewaySettingsConfigsConfigIdPutArguments( + global::System.Net.Http.HttpClient httpClient, + ref string configId, + global::AI21.ConfigProfileUpdate request); + partial void PrepareUpdateConfigGatewaySettingsConfigsConfigIdPutRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string configId, + global::AI21.ConfigProfileUpdate request); + partial void ProcessUpdateConfigGatewaySettingsConfigsConfigIdPutResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessUpdateConfigGatewaySettingsConfigsConfigIdPutResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Update 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 UpdateConfigGatewaySettingsConfigsConfigIdPutAsync( + string configId, + + global::AI21.ConfigProfileUpdate request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await UpdateConfigGatewaySettingsConfigsConfigIdPutAsResponseAsync( + configId: configId, + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Update 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> UpdateConfigGatewaySettingsConfigsConfigIdPutAsResponseAsync( + string configId, + + global::AI21.ConfigProfileUpdate request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + request = request ?? throw new global::System.ArgumentNullException(nameof(request)); + + PrepareArguments( + client: HttpClient); + PrepareUpdateConfigGatewaySettingsConfigsConfigIdPutArguments( + httpClient: HttpClient, + configId: ref configId, + request: request); + + + var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_UpdateConfigGatewaySettingsConfigsConfigIdPutSecurityRequirements, + operationName: "UpdateConfigGatewaySettingsConfigsConfigIdPutAsync"); + + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: $"/gateway/settings/configs/{configId}", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.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); + } + } + 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::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareUpdateConfigGatewaySettingsConfigsConfigIdPutRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + configId: configId!, + 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::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "UpdateConfigGatewaySettingsConfigsConfigIdPut", + methodName: "UpdateConfigGatewaySettingsConfigsConfigIdPutAsync", + pathTemplate: "$\"/gateway/settings/configs/{configId}\"", + 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::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "UpdateConfigGatewaySettingsConfigsConfigIdPut", + methodName: "UpdateConfigGatewaySettingsConfigsConfigIdPutAsync", + pathTemplate: "$\"/gateway/settings/configs/{configId}\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "UpdateConfigGatewaySettingsConfigsConfigIdPut", + methodName: "UpdateConfigGatewaySettingsConfigsConfigIdPutAsync", + pathTemplate: "$\"/gateway/settings/configs/{configId}\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessUpdateConfigGatewaySettingsConfigsConfigIdPutResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "UpdateConfigGatewaySettingsConfigsConfigIdPut", + methodName: "UpdateConfigGatewaySettingsConfigsConfigIdPutAsync", + pathTemplate: "$\"/gateway/settings/configs/{configId}\"", + 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::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "UpdateConfigGatewaySettingsConfigsConfigIdPut", + methodName: "UpdateConfigGatewaySettingsConfigsConfigIdPutAsync", + pathTemplate: "$\"/gateway/settings/configs/{configId}\"", + 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); + } + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::AI21.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessUpdateConfigGatewaySettingsConfigsConfigIdPutResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::AI21.ConfigProfileOut.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => 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::AI21.ConfigProfileOut.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.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 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 UpdateConfigGatewaySettingsConfigsConfigIdPutAsync( + string configId, + string? name = default, + string? description = default, + object? overrides = default, + bool? enabled = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __request = new global::AI21.ConfigProfileUpdate + { + Name = name, + Description = description, + Overrides = overrides, + Enabled = enabled, + }; + + return await UpdateConfigGatewaySettingsConfigsConfigIdPutAsync( + configId: configId, + request: __request, + requestOptions: requestOptions, + cancellationToken: cancellationToken).ConfigureAwait(false); + } + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.UpdateConfigTokenwiseSettingsConfigsConfigIdPut.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.UpdateConfigTokenwiseSettingsConfigsConfigIdPut.g.cs new file mode 100644 index 00000000..2b35d151 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Ai21Client.UpdateConfigTokenwiseSettingsConfigsConfigIdPut.g.cs @@ -0,0 +1,515 @@ + +#nullable enable + +namespace AI21 +{ + public partial class Ai21Client + { + + + private static readonly global::AI21.EndPointSecurityRequirement s_UpdateConfigTokenwiseSettingsConfigsConfigIdPutSecurityRequirement0 = + new global::AI21.EndPointSecurityRequirement + { + Authorizations = new global::AI21.EndPointAuthorizationRequirement[] + { new global::AI21.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::AI21.EndPointSecurityRequirement[] s_UpdateConfigTokenwiseSettingsConfigsConfigIdPutSecurityRequirements = + new global::AI21.EndPointSecurityRequirement[] + { s_UpdateConfigTokenwiseSettingsConfigsConfigIdPutSecurityRequirement0, + }; + partial void PrepareUpdateConfigTokenwiseSettingsConfigsConfigIdPutArguments( + global::System.Net.Http.HttpClient httpClient, + ref string configId, + global::AI21.ConfigProfileUpdate request); + partial void PrepareUpdateConfigTokenwiseSettingsConfigsConfigIdPutRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string configId, + global::AI21.ConfigProfileUpdate request); + partial void ProcessUpdateConfigTokenwiseSettingsConfigsConfigIdPutResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessUpdateConfigTokenwiseSettingsConfigsConfigIdPutResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Update 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 UpdateConfigTokenwiseSettingsConfigsConfigIdPutAsync( + string configId, + + global::AI21.ConfigProfileUpdate request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await UpdateConfigTokenwiseSettingsConfigsConfigIdPutAsResponseAsync( + configId: configId, + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Update 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> UpdateConfigTokenwiseSettingsConfigsConfigIdPutAsResponseAsync( + string configId, + + global::AI21.ConfigProfileUpdate request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + request = request ?? throw new global::System.ArgumentNullException(nameof(request)); + + PrepareArguments( + client: HttpClient); + PrepareUpdateConfigTokenwiseSettingsConfigsConfigIdPutArguments( + httpClient: HttpClient, + configId: ref configId, + request: request); + + + var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_UpdateConfigTokenwiseSettingsConfigsConfigIdPutSecurityRequirements, + operationName: "UpdateConfigTokenwiseSettingsConfigsConfigIdPutAsync"); + + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: $"/tokenwise/settings/configs/{configId}", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.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); + } + } + 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::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareUpdateConfigTokenwiseSettingsConfigsConfigIdPutRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + configId: configId!, + 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::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "UpdateConfigTokenwiseSettingsConfigsConfigIdPut", + methodName: "UpdateConfigTokenwiseSettingsConfigsConfigIdPutAsync", + pathTemplate: "$\"/tokenwise/settings/configs/{configId}\"", + 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::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "UpdateConfigTokenwiseSettingsConfigsConfigIdPut", + methodName: "UpdateConfigTokenwiseSettingsConfigsConfigIdPutAsync", + pathTemplate: "$\"/tokenwise/settings/configs/{configId}\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "UpdateConfigTokenwiseSettingsConfigsConfigIdPut", + methodName: "UpdateConfigTokenwiseSettingsConfigsConfigIdPutAsync", + pathTemplate: "$\"/tokenwise/settings/configs/{configId}\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessUpdateConfigTokenwiseSettingsConfigsConfigIdPutResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "UpdateConfigTokenwiseSettingsConfigsConfigIdPut", + methodName: "UpdateConfigTokenwiseSettingsConfigsConfigIdPutAsync", + pathTemplate: "$\"/tokenwise/settings/configs/{configId}\"", + 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::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "UpdateConfigTokenwiseSettingsConfigsConfigIdPut", + methodName: "UpdateConfigTokenwiseSettingsConfigsConfigIdPutAsync", + pathTemplate: "$\"/tokenwise/settings/configs/{configId}\"", + 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); + } + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::AI21.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessUpdateConfigTokenwiseSettingsConfigsConfigIdPutResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::AI21.ConfigProfileOut.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => 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::AI21.ConfigProfileOut.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.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 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 UpdateConfigTokenwiseSettingsConfigsConfigIdPutAsync( + string configId, + string? name = default, + string? description = default, + object? overrides = default, + bool? enabled = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __request = new global::AI21.ConfigProfileUpdate + { + Name = name, + Description = description, + Overrides = overrides, + Enabled = enabled, + }; + + return await UpdateConfigTokenwiseSettingsConfigsConfigIdPutAsync( + configId: configId, + request: __request, + requestOptions: requestOptions, + cancellationToken: cancellationToken).ConfigureAwait(false); + } + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.UpdateDemoStudioV1DemosDemoIdPut.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.UpdateDemoStudioV1DemosDemoIdPut.g.cs index c334b08a..8aab4254 100644 --- a/src/libs/AI21/Generated/AI21.Ai21Client.UpdateDemoStudioV1DemosDemoIdPut.g.cs +++ b/src/libs/AI21/Generated/AI21.Ai21Client.UpdateDemoStudioV1DemosDemoIdPut.g.cs @@ -14,6 +14,7 @@ public partial class Ai21Client { new global::AI21.EndPointAuthorizationRequirement { Type = "Http", + SchemeId = "HttpBearer", Location = "Header", Name = "Bearer", FriendlyName = "Bearer", @@ -48,12 +49,40 @@ partial void ProcessUpdateDemoStudioV1DemosDemoIdPutResponseContent( ///
/// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// public async global::System.Threading.Tasks.Task UpdateDemoStudioV1DemosDemoIdPutAsync( string demoId, global::AI21.DemoUpdate request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await UpdateDemoStudioV1DemosDemoIdPutAsResponseAsync( + demoId: demoId, + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Update Demo
+ /// Update an existing demo. + ///
+ /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> UpdateDemoStudioV1DemosDemoIdPutAsResponseAsync( + string demoId, + + global::AI21.DemoUpdate request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) { request = request ?? throw new global::System.ArgumentNullException(nameof(request)); @@ -71,22 +100,44 @@ partial void ProcessUpdateDemoStudioV1DemosDemoIdPutResponseContent( securityRequirements: s_UpdateDemoStudioV1DemosDemoIdPutSecurityRequirements, operationName: "UpdateDemoStudioV1DemosDemoIdPutAsync"); - var __pathBuilder = new global::AI21.PathBuilder( - path: $"/studio/v1/demos/{demoId}", - 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)); + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: $"/studio/v1/demos/{demoId}", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.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; + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; #endif foreach (var __authorization in __authorizations) { if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2") + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") { __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( scheme: __authorization.Name, @@ -96,157 +147,337 @@ partial void ProcessUpdateDemoStudioV1DemosDemoIdPutResponseContent( __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); - PrepareUpdateDemoStudioV1DemosDemoIdPutRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - demoId: demoId, - request: request); + 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::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareUpdateDemoStudioV1DemosDemoIdPutRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + demoId: demoId!, + request: request); - ProcessResponse( - client: HttpClient, - response: __response); - ProcessUpdateDemoStudioV1DemosDemoIdPutResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Validation Error - if ((int)__response.StatusCode == 422) + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::AI21.HTTPValidationError? __value_422 = null; - try + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) { - if (ReadResponseAsString) + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "UpdateDemoStudioV1DemosDemoIdPut", + methodName: "UpdateDemoStudioV1DemosDemoIdPutAsync", + pathTemplate: "$\"/studio/v1/demos/{demoId}\"", + 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 { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); } - else + catch (global::System.Net.Http.HttpRequestException __exception) { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "UpdateDemoStudioV1DemosDemoIdPut", + methodName: "UpdateDemoStudioV1DemosDemoIdPutAsync", + pathTemplate: "$\"/studio/v1/demos/{demoId}\"", + 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; + } - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "UpdateDemoStudioV1DemosDemoIdPut", + methodName: "UpdateDemoStudioV1DemosDemoIdPutAsync", + pathTemplate: "$\"/studio/v1/demos/{demoId}\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; } - catch (global::System.Exception __ex) + + if (__response == null) { - __exception_422 = __ex; + throw new global::System.InvalidOperationException("No response received."); } - throw new global::AI21.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) + using (__response) { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - ProcessResponseContent( + ProcessResponse( client: HttpClient, - response: __response, - content: ref __content); - ProcessUpdateDemoStudioV1DemosDemoIdPutResponseContent( + response: __response); + ProcessUpdateDemoStudioV1DemosDemoIdPutResponse( httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) { - __response.EnsureSuccessStatusCode(); - - return - global::AI21.Demo.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "UpdateDemoStudioV1DemosDemoIdPut", + methodName: "UpdateDemoStudioV1DemosDemoIdPutAsync", + pathTemplate: "$\"/studio/v1/demos/{demoId}\"", + 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); } - catch (global::System.Exception __ex) + else { - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "UpdateDemoStudioV1DemosDemoIdPut", + methodName: "UpdateDemoStudioV1DemosDemoIdPutAsync", + pathTemplate: "$\"/studio/v1/demos/{demoId}\"", + 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 - { - try - { - __response.EnsureSuccessStatusCode(); - using var __content = await __response.Content.ReadAsStreamAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::AI21.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - return - await global::AI21.Demo.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) - { - } + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessUpdateDemoStudioV1DemosDemoIdPutResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::AI21.Demo.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => 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::AI21.Demo.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; } } + finally + { + __httpRequest?.Dispose(); + } } /// /// Update Demo
@@ -268,6 +499,7 @@ partial void ProcessUpdateDemoStudioV1DemosDemoIdPutResponseContent( /// /// Name of the UI component /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// public async global::System.Threading.Tasks.Task UpdateDemoStudioV1DemosDemoIdPutAsync( @@ -277,6 +509,7 @@ partial void ProcessUpdateDemoStudioV1DemosDemoIdPutResponseContent( global::AI21.DemoStatus? status = default, object? config = default, string? uiComponentName = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) { var __request = new global::AI21.DemoUpdate @@ -291,6 +524,7 @@ partial void ProcessUpdateDemoStudioV1DemosDemoIdPutResponseContent( return await UpdateDemoStudioV1DemosDemoIdPutAsync( demoId: demoId, request: __request, + requestOptions: requestOptions, cancellationToken: cancellationToken).ConfigureAwait(false); } } diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.UpdateMcpStorageStudioV1McpStorageMcpIdPatch.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.UpdateMcpStorageStudioV1McpStorageMcpIdPatch.g.cs index 9f183ee4..c5e0e1c2 100644 --- a/src/libs/AI21/Generated/AI21.Ai21Client.UpdateMcpStorageStudioV1McpStorageMcpIdPatch.g.cs +++ b/src/libs/AI21/Generated/AI21.Ai21Client.UpdateMcpStorageStudioV1McpStorageMcpIdPatch.g.cs @@ -14,6 +14,7 @@ public partial class Ai21Client { new global::AI21.EndPointAuthorizationRequirement { Type = "Http", + SchemeId = "HttpBearer", Location = "Header", Name = "Bearer", FriendlyName = "Bearer", @@ -47,12 +48,39 @@ partial void ProcessUpdateMcpStorageStudioV1McpStorageMcpIdPatchResponseContent( ///
/// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// public async global::System.Threading.Tasks.Task UpdateMcpStorageStudioV1McpStorageMcpIdPatchAsync( string mcpId, global::AI21.UpdateMCPStorageRequest request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await UpdateMcpStorageStudioV1McpStorageMcpIdPatchAsResponseAsync( + mcpId: mcpId, + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Update Mcp Storage + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> UpdateMcpStorageStudioV1McpStorageMcpIdPatchAsResponseAsync( + string mcpId, + + global::AI21.UpdateMCPStorageRequest request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) { request = request ?? throw new global::System.ArgumentNullException(nameof(request)); @@ -70,22 +98,44 @@ partial void ProcessUpdateMcpStorageStudioV1McpStorageMcpIdPatchResponseContent( securityRequirements: s_UpdateMcpStorageStudioV1McpStorageMcpIdPatchSecurityRequirements, operationName: "UpdateMcpStorageStudioV1McpStorageMcpIdPatchAsync"); - var __pathBuilder = new global::AI21.PathBuilder( - path: $"/studio/v1/mcp/storage/{mcpId}", - 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)); + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: $"/studio/v1/mcp/storage/{mcpId}", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.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; + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; #endif foreach (var __authorization in __authorizations) { if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2") + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") { __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( scheme: __authorization.Name, @@ -95,168 +145,350 @@ partial void ProcessUpdateMcpStorageStudioV1McpStorageMcpIdPatchResponseContent( __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); - PrepareUpdateMcpStorageStudioV1McpStorageMcpIdPatchRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - mcpId: mcpId, - request: request); + 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::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareUpdateMcpStorageStudioV1McpStorageMcpIdPatchRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + mcpId: mcpId!, + request: request); - ProcessResponse( - client: HttpClient, - response: __response); - ProcessUpdateMcpStorageStudioV1McpStorageMcpIdPatchResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Validation Error - if ((int)__response.StatusCode == 422) + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::AI21.HTTPValidationError? __value_422 = null; - try + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) { - if (ReadResponseAsString) + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "UpdateMcpStorageStudioV1McpStorageMcpIdPatch", + methodName: "UpdateMcpStorageStudioV1McpStorageMcpIdPatchAsync", + pathTemplate: "$\"/studio/v1/mcp/storage/{mcpId}\"", + 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 { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); } - else + catch (global::System.Net.Http.HttpRequestException __exception) { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "UpdateMcpStorageStudioV1McpStorageMcpIdPatch", + methodName: "UpdateMcpStorageStudioV1McpStorageMcpIdPatchAsync", + pathTemplate: "$\"/studio/v1/mcp/storage/{mcpId}\"", + 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; + } - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "UpdateMcpStorageStudioV1McpStorageMcpIdPatch", + methodName: "UpdateMcpStorageStudioV1McpStorageMcpIdPatchAsync", + pathTemplate: "$\"/studio/v1/mcp/storage/{mcpId}\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; } - catch (global::System.Exception __ex) + + if (__response == null) { - __exception_422 = __ex; + throw new global::System.InvalidOperationException("No response received."); } - throw new global::AI21.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) + using (__response) { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( + ProcessResponse( client: HttpClient, - response: __response, - content: ref __content); - ProcessUpdateMcpStorageStudioV1McpStorageMcpIdPatchResponseContent( + response: __response); + ProcessUpdateMcpStorageStudioV1McpStorageMcpIdPatchResponse( httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) { - __response.EnsureSuccessStatusCode(); - - return - global::AI21.MCPStorageResponse.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "UpdateMcpStorageStudioV1McpStorageMcpIdPatch", + methodName: "UpdateMcpStorageStudioV1McpStorageMcpIdPatchAsync", + pathTemplate: "$\"/studio/v1/mcp/storage/{mcpId}\"", + 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); } - catch (global::System.Exception __ex) + else { - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "UpdateMcpStorageStudioV1McpStorageMcpIdPatch", + methodName: "UpdateMcpStorageStudioV1McpStorageMcpIdPatchAsync", + pathTemplate: "$\"/studio/v1/mcp/storage/{mcpId}\"", + 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 - { - try - { - __response.EnsureSuccessStatusCode(); - using var __content = await __response.Content.ReadAsStreamAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::AI21.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - return - await global::AI21.MCPStorageResponse.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) - { - } + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessUpdateMcpStorageStudioV1McpStorageMcpIdPatchResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::AI21.MCPStorageResponse.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => 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::AI21.MCPStorageResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; } } + finally + { + __httpRequest?.Dispose(); + } } /// /// Update Mcp Storage /// /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// public async global::System.Threading.Tasks.Task UpdateMcpStorageStudioV1McpStorageMcpIdPatchAsync( string mcpId, string serverLabel, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) { var __request = new global::AI21.UpdateMCPStorageRequest @@ -267,6 +499,7 @@ partial void ProcessUpdateMcpStorageStudioV1McpStorageMcpIdPatchResponseContent( return await UpdateMcpStorageStudioV1McpStorageMcpIdPatchAsync( mcpId: mcpId, request: __request, + requestOptions: requestOptions, cancellationToken: cancellationToken).ConfigureAwait(false); } } diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.UpdateWorkspaceModelEndpointStudioV1SettingsModelsNamePatch.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.UpdateWorkspaceModelEndpointStudioV1SettingsModelsNamePatch.g.cs index d882e995..5ea13c15 100644 --- a/src/libs/AI21/Generated/AI21.Ai21Client.UpdateWorkspaceModelEndpointStudioV1SettingsModelsNamePatch.g.cs +++ b/src/libs/AI21/Generated/AI21.Ai21Client.UpdateWorkspaceModelEndpointStudioV1SettingsModelsNamePatch.g.cs @@ -14,6 +14,7 @@ public partial class Ai21Client { new global::AI21.EndPointAuthorizationRequirement { Type = "Http", + SchemeId = "HttpBearer", Location = "Header", Name = "Bearer", FriendlyName = "Bearer", @@ -47,12 +48,39 @@ partial void ProcessUpdateWorkspaceModelEndpointStudioV1SettingsModelsNamePatchR /// /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// public async global::System.Threading.Tasks.Task UpdateWorkspaceModelEndpointStudioV1SettingsModelsNamePatchAsync( string name, global::AI21.WorkspaceModelUpdate request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await UpdateWorkspaceModelEndpointStudioV1SettingsModelsNamePatchAsResponseAsync( + name: name, + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Update Workspace Model Endpoint + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> UpdateWorkspaceModelEndpointStudioV1SettingsModelsNamePatchAsResponseAsync( + string name, + + global::AI21.WorkspaceModelUpdate request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) { request = request ?? throw new global::System.ArgumentNullException(nameof(request)); @@ -70,22 +98,44 @@ partial void ProcessUpdateWorkspaceModelEndpointStudioV1SettingsModelsNamePatchR securityRequirements: s_UpdateWorkspaceModelEndpointStudioV1SettingsModelsNamePatchSecurityRequirements, operationName: "UpdateWorkspaceModelEndpointStudioV1SettingsModelsNamePatchAsync"); - var __pathBuilder = new global::AI21.PathBuilder( - path: $"/studio/v1/settings/models/{name}", - 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)); + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: $"/studio/v1/settings/models/{name}", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.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; + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; #endif foreach (var __authorization in __authorizations) { if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2") + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") { __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( scheme: __authorization.Name, @@ -95,157 +145,337 @@ partial void ProcessUpdateWorkspaceModelEndpointStudioV1SettingsModelsNamePatchR __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); - PrepareUpdateWorkspaceModelEndpointStudioV1SettingsModelsNamePatchRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - name: name, - request: request); + 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::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareUpdateWorkspaceModelEndpointStudioV1SettingsModelsNamePatchRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + name: name!, + request: request); - ProcessResponse( - client: HttpClient, - response: __response); - ProcessUpdateWorkspaceModelEndpointStudioV1SettingsModelsNamePatchResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Validation Error - if ((int)__response.StatusCode == 422) + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::AI21.HTTPValidationError? __value_422 = null; - try + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) { - if (ReadResponseAsString) + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "UpdateWorkspaceModelEndpointStudioV1SettingsModelsNamePatch", + methodName: "UpdateWorkspaceModelEndpointStudioV1SettingsModelsNamePatchAsync", + pathTemplate: "$\"/studio/v1/settings/models/{name}\"", + 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 { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); } - else + catch (global::System.Net.Http.HttpRequestException __exception) { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "UpdateWorkspaceModelEndpointStudioV1SettingsModelsNamePatch", + methodName: "UpdateWorkspaceModelEndpointStudioV1SettingsModelsNamePatchAsync", + pathTemplate: "$\"/studio/v1/settings/models/{name}\"", + 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; + } - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "UpdateWorkspaceModelEndpointStudioV1SettingsModelsNamePatch", + methodName: "UpdateWorkspaceModelEndpointStudioV1SettingsModelsNamePatchAsync", + pathTemplate: "$\"/studio/v1/settings/models/{name}\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; } - catch (global::System.Exception __ex) + + if (__response == null) { - __exception_422 = __ex; + throw new global::System.InvalidOperationException("No response received."); } - throw new global::AI21.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) + using (__response) { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( + ProcessResponse( client: HttpClient, - response: __response, - content: ref __content); - ProcessUpdateWorkspaceModelEndpointStudioV1SettingsModelsNamePatchResponseContent( + response: __response); + ProcessUpdateWorkspaceModelEndpointStudioV1SettingsModelsNamePatchResponse( httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) { - __response.EnsureSuccessStatusCode(); - - return - global::AI21.WorkspaceModelResponse.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "UpdateWorkspaceModelEndpointStudioV1SettingsModelsNamePatch", + methodName: "UpdateWorkspaceModelEndpointStudioV1SettingsModelsNamePatchAsync", + pathTemplate: "$\"/studio/v1/settings/models/{name}\"", + 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); } - catch (global::System.Exception __ex) + else { - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "UpdateWorkspaceModelEndpointStudioV1SettingsModelsNamePatch", + methodName: "UpdateWorkspaceModelEndpointStudioV1SettingsModelsNamePatchAsync", + pathTemplate: "$\"/studio/v1/settings/models/{name}\"", + 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 - { - try - { - __response.EnsureSuccessStatusCode(); - using var __content = await __response.Content.ReadAsStreamAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::AI21.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - return - await global::AI21.WorkspaceModelResponse.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) - { - } + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessUpdateWorkspaceModelEndpointStudioV1SettingsModelsNamePatchResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::AI21.WorkspaceModelResponse.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => 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::AI21.WorkspaceModelResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; } } + finally + { + __httpRequest?.Dispose(); + } } /// /// Update Workspace Model Endpoint @@ -254,6 +484,7 @@ partial void ProcessUpdateWorkspaceModelEndpointStudioV1SettingsModelsNamePatchR /// /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// public async global::System.Threading.Tasks.Task UpdateWorkspaceModelEndpointStudioV1SettingsModelsNamePatchAsync( @@ -261,6 +492,7 @@ partial void ProcessUpdateWorkspaceModelEndpointStudioV1SettingsModelsNamePatchR string? requestName = default, string? modelType = default, string? secretId = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) { var __request = new global::AI21.WorkspaceModelUpdate @@ -273,6 +505,7 @@ partial void ProcessUpdateWorkspaceModelEndpointStudioV1SettingsModelsNamePatchR return await UpdateWorkspaceModelEndpointStudioV1SettingsModelsNamePatchAsync( name: name, request: __request, + requestOptions: requestOptions, cancellationToken: cancellationToken).ConfigureAwait(false); } } diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.UploadCheckComplianceStudioV1DemosRegulationsUploadCheckCompliancePost.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.UploadCheckComplianceStudioV1DemosRegulationsUploadCheckCompliancePost.g.cs index 2d85a1f1..ae11792c 100644 --- a/src/libs/AI21/Generated/AI21.Ai21Client.UploadCheckComplianceStudioV1DemosRegulationsUploadCheckCompliancePost.g.cs +++ b/src/libs/AI21/Generated/AI21.Ai21Client.UploadCheckComplianceStudioV1DemosRegulationsUploadCheckCompliancePost.g.cs @@ -14,6 +14,7 @@ public partial class Ai21Client { new global::AI21.EndPointAuthorizationRequirement { Type = "Http", + SchemeId = "HttpBearer", Location = "Header", Name = "Bearer", FriendlyName = "Bearer", @@ -45,11 +46,36 @@ partial void ProcessUploadCheckComplianceStudioV1DemosRegulationsUploadCheckComp /// Check compliance of a document file against regulatory requirements. /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// public async global::System.Threading.Tasks.Task UploadCheckComplianceStudioV1DemosRegulationsUploadCheckCompliancePostAsync( global::AI21.BodyUploadCheckComplianceStudioV1DemosRegulationsUploadCheckCompliancePost request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await UploadCheckComplianceStudioV1DemosRegulationsUploadCheckCompliancePostAsResponseAsync( + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Upload Check Compliance
+ /// Check compliance of a document file against regulatory requirements. + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> UploadCheckComplianceStudioV1DemosRegulationsUploadCheckCompliancePostAsResponseAsync( + + global::AI21.BodyUploadCheckComplianceStudioV1DemosRegulationsUploadCheckCompliancePost request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) { request = request ?? throw new global::System.ArgumentNullException(nameof(request)); @@ -66,22 +92,44 @@ partial void ProcessUploadCheckComplianceStudioV1DemosRegulationsUploadCheckComp securityRequirements: s_UploadCheckComplianceStudioV1DemosRegulationsUploadCheckCompliancePostSecurityRequirements, operationName: "UploadCheckComplianceStudioV1DemosRegulationsUploadCheckCompliancePostAsync"); - var __pathBuilder = new global::AI21.PathBuilder( - path: "/studio/v1/demos/regulations/upload-check-compliance", - 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)); + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: false); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: "/studio/v1/demos/regulations/upload-check-compliance", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.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; + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; #endif foreach (var __authorization in __authorizations) { if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2") + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") { __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( scheme: __authorization.Name, @@ -91,177 +139,895 @@ partial void ProcessUploadCheckComplianceStudioV1DemosRegulationsUploadCheckComp __authorization.Location == "Header") { __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - using var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); - 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; + } } - if (request.Budget != default) - { - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent($"{request.Budget}"), - name: "\"budget\""); - } - if (request.VectorStoreId != default) - { + var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); + var __contentFile = new global::System.Net.Http.ByteArrayContent(request.File ?? global::System.Array.Empty()); + __contentFile.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( + request.Filename is null + ? "application/octet-stream" + : (global::System.IO.Path.GetExtension(request.Filename) ?? string.Empty).ToLowerInvariant() switch + { + ".aac" => "audio/aac", + ".flac" => "audio/flac", + ".gif" => "image/gif", + ".jpeg" => "image/jpeg", + ".jpg" => "image/jpeg", + ".json" => "application/json", + ".m4a" => "audio/mp4", + ".mp3" => "audio/mpeg", + ".mp4" => "video/mp4", + ".mpeg" => "audio/mpeg", + ".mpga" => "audio/mpeg", + ".oga" => "audio/ogg", + ".ogg" => "audio/ogg", + ".opus" => "audio/ogg", + ".pdf" => "application/pdf", + ".png" => "image/png", + ".txt" => "text/plain", + ".wav" => "audio/wav", + ".weba" => "audio/webm", + ".webm" => "video/webm", + ".webp" => "image/webp", + _ => "application/octet-stream", + }); + __httpRequestContent.Add( + content: __contentFile, + name: "\"file\"", + fileName: request.Filename != null ? $"\"{request.Filename}\"" : string.Empty); + if (__contentFile.Headers.ContentDisposition != null) + { + __contentFile.Headers.ContentDisposition.FileNameStar = null; + } - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent($"{request.VectorStoreId}"), - name: "\"vector_store_id\""); - } - __httpRequest.Content = __httpRequestContent; + if (request.Budget != default) + { - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareUploadCheckComplianceStudioV1DemosRegulationsUploadCheckCompliancePostRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - request: request); + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.Budget ?? string.Empty), + name: "\"budget\""); - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); + } + if (request.VectorStoreId != default) + { - ProcessResponse( - client: HttpClient, - response: __response); - ProcessUploadCheckComplianceStudioV1DemosRegulationsUploadCheckCompliancePostResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Validation Error - if ((int)__response.StatusCode == 422) + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.VectorStoreId ?? string.Empty), + name: "\"vector_store_id\""); + + } + + __httpRequest.Content = __httpRequestContent; + + global::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareUploadCheckComplianceStudioV1DemosRegulationsUploadCheckCompliancePostRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + request: request); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::AI21.HTTPValidationError? __value_422 = null; - try + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) { - if (ReadResponseAsString) + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "UploadCheckComplianceStudioV1DemosRegulationsUploadCheckCompliancePost", + methodName: "UploadCheckComplianceStudioV1DemosRegulationsUploadCheckCompliancePostAsync", + pathTemplate: "\"/studio/v1/demos/regulations/upload-check-compliance\"", + 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 { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); } - else + catch (global::System.Net.Http.HttpRequestException __exception) { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "UploadCheckComplianceStudioV1DemosRegulationsUploadCheckCompliancePost", + methodName: "UploadCheckComplianceStudioV1DemosRegulationsUploadCheckCompliancePostAsync", + pathTemplate: "\"/studio/v1/demos/regulations/upload-check-compliance\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "UploadCheckComplianceStudioV1DemosRegulationsUploadCheckCompliancePost", + methodName: "UploadCheckComplianceStudioV1DemosRegulationsUploadCheckCompliancePostAsync", + pathTemplate: "\"/studio/v1/demos/regulations/upload-check-compliance\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; } + + break; } - catch (global::System.Exception __ex) + + if (__response == null) { - __exception_422 = __ex; + throw new global::System.InvalidOperationException("No response received."); } - throw new global::AI21.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) + using (__response) { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( + ProcessResponse( client: HttpClient, - response: __response, - content: ref __content); - ProcessUploadCheckComplianceStudioV1DemosRegulationsUploadCheckCompliancePostResponseContent( + response: __response); + ProcessUploadCheckComplianceStudioV1DemosRegulationsUploadCheckCompliancePostResponse( httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) { - __response.EnsureSuccessStatusCode(); - - return __content; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "UploadCheckComplianceStudioV1DemosRegulationsUploadCheckCompliancePost", + methodName: "UploadCheckComplianceStudioV1DemosRegulationsUploadCheckCompliancePostAsync", + pathTemplate: "\"/studio/v1/demos/regulations/upload-check-compliance\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } - catch (global::System.Exception __ex) + else { - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "UploadCheckComplianceStudioV1DemosRegulationsUploadCheckCompliancePost", + methodName: "UploadCheckComplianceStudioV1DemosRegulationsUploadCheckCompliancePostAsync", + pathTemplate: "\"/studio/v1/demos/regulations/upload-check-compliance\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __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::AI21.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessUploadCheckComplianceStudioV1DemosRegulationsUploadCheckCompliancePostResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? 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::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.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::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + } } - else + finally { - try - { - __response.EnsureSuccessStatusCode(); - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken + __httpRequest?.Dispose(); + } + } + /// + /// Upload Check Compliance
+ /// Check compliance of a document file against regulatory requirements. + ///
+ /// + /// + /// + /// Default Value: MEDIUM + /// + /// + /// Vector store ID to use for RFI processing + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task UploadCheckComplianceStudioV1DemosRegulationsUploadCheckCompliancePostAsync( + byte[] file, + string filename, + string? budget = default, + string? vectorStoreId = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __request = new global::AI21.BodyUploadCheckComplianceStudioV1DemosRegulationsUploadCheckCompliancePost + { + File = file, + Filename = filename, + Budget = budget, + VectorStoreId = vectorStoreId, + }; + + return await UploadCheckComplianceStudioV1DemosRegulationsUploadCheckCompliancePostAsync( + request: __request, + requestOptions: requestOptions, + cancellationToken: cancellationToken).ConfigureAwait(false); + } + + /// + /// Upload Check Compliance
+ /// Check compliance of a document file against regulatory requirements. + ///
+ /// + /// The stream to send as the multipart 'file' file part. + /// + /// + /// + /// Default Value: MEDIUM + /// + /// + /// Vector store ID to use for RFI processing + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task UploadCheckComplianceStudioV1DemosRegulationsUploadCheckCompliancePostAsync( + global::System.IO.Stream file, + string filename, + string? budget = default, + string? vectorStoreId = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + + file = file ?? throw new global::System.ArgumentNullException(nameof(file)); + var request = new global::AI21.BodyUploadCheckComplianceStudioV1DemosRegulationsUploadCheckCompliancePost + { + File = global::System.Array.Empty(), + Filename = filename, + Budget = budget, + VectorStoreId = vectorStoreId, + }; + PrepareArguments( + client: HttpClient); + PrepareUploadCheckComplianceStudioV1DemosRegulationsUploadCheckCompliancePostArguments( + httpClient: HttpClient, + request: request); + + + var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_UploadCheckComplianceStudioV1DemosRegulationsUploadCheckCompliancePostSecurityRequirements, + operationName: "UploadCheckComplianceStudioV1DemosRegulationsUploadCheckCompliancePostAsync"); + + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: false); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: "/studio/v1/demos/regulations/upload-check-compliance", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.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 - ).ConfigureAwait(false); - return __content; + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); } - catch (global::System.Exception __ex) + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + + var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); + var __contentFile = new global::System.Net.Http.StreamContent(file); + __contentFile.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( + request.Filename is null + ? "application/octet-stream" + : (global::System.IO.Path.GetExtension(request.Filename) ?? string.Empty).ToLowerInvariant() switch + { + ".aac" => "audio/aac", + ".flac" => "audio/flac", + ".gif" => "image/gif", + ".jpeg" => "image/jpeg", + ".jpg" => "image/jpeg", + ".json" => "application/json", + ".m4a" => "audio/mp4", + ".mp3" => "audio/mpeg", + ".mp4" => "video/mp4", + ".mpeg" => "audio/mpeg", + ".mpga" => "audio/mpeg", + ".oga" => "audio/ogg", + ".ogg" => "audio/ogg", + ".opus" => "audio/ogg", + ".pdf" => "application/pdf", + ".png" => "image/png", + ".txt" => "text/plain", + ".wav" => "audio/wav", + ".weba" => "audio/webm", + ".webm" => "video/webm", + ".webp" => "image/webp", + _ => "application/octet-stream", + }); + __httpRequestContent.Add( + content: __contentFile, + name: "\"file\"", + fileName: request.Filename != null ? $"\"{request.Filename}\"" : string.Empty); + if (__contentFile.Headers.ContentDisposition != null) + { + __contentFile.Headers.ContentDisposition.FileNameStar = null; + } + + if (request.Budget != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.Budget ?? string.Empty), + name: "\"budget\""); + + } + if (request.VectorStoreId != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.VectorStoreId ?? string.Empty), + name: "\"vector_store_id\""); + + } + + __httpRequest.Content = __httpRequestContent; + + global::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareUploadCheckComplianceStudioV1DemosRegulationsUploadCheckCompliancePostRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + request: request); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) { - string? __content = null; + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "UploadCheckComplianceStudioV1DemosRegulationsUploadCheckCompliancePost", + methodName: "UploadCheckComplianceStudioV1DemosRegulationsUploadCheckCompliancePostAsync", + pathTemplate: "\"/studio/v1/demos/regulations/upload-check-compliance\"", + 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 { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); } - catch (global::System.Exception) + catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "UploadCheckComplianceStudioV1DemosRegulationsUploadCheckCompliancePost", + methodName: "UploadCheckComplianceStudioV1DemosRegulationsUploadCheckCompliancePostAsync", + pathTemplate: "\"/studio/v1/demos/regulations/upload-check-compliance\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; } - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "UploadCheckComplianceStudioV1DemosRegulationsUploadCheckCompliancePost", + methodName: "UploadCheckComplianceStudioV1DemosRegulationsUploadCheckCompliancePostAsync", + pathTemplate: "\"/studio/v1/demos/regulations/upload-check-compliance\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessUploadCheckComplianceStudioV1DemosRegulationsUploadCheckCompliancePostResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "UploadCheckComplianceStudioV1DemosRegulationsUploadCheckCompliancePost", + methodName: "UploadCheckComplianceStudioV1DemosRegulationsUploadCheckCompliancePostAsync", + pathTemplate: "\"/studio/v1/demos/regulations/upload-check-compliance\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "UploadCheckComplianceStudioV1DemosRegulationsUploadCheckCompliancePost", + methodName: "UploadCheckComplianceStudioV1DemosRegulationsUploadCheckCompliancePostAsync", + pathTemplate: "\"/studio/v1/demos/regulations/upload-check-compliance\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __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::AI21.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessUploadCheckComplianceStudioV1DemosRegulationsUploadCheckCompliancePostResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return __content; + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? 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::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.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 Check Compliance
/// Check compliance of a document file against regulatory requirements. ///
- /// + /// + /// The stream to send as the multipart 'file' file part. + /// /// /// /// Default Value: MEDIUM @@ -269,26 +1035,464 @@ partial void ProcessUploadCheckComplianceStudioV1DemosRegulationsUploadCheckComp /// /// Vector store ID to use for RFI processing /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task UploadCheckComplianceStudioV1DemosRegulationsUploadCheckCompliancePostAsync( - byte[] file, + /// + public async global::System.Threading.Tasks.Task> UploadCheckComplianceStudioV1DemosRegulationsUploadCheckCompliancePostAsResponseAsync( + global::System.IO.Stream file, string filename, string? budget = default, string? vectorStoreId = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) { - var __request = new global::AI21.BodyUploadCheckComplianceStudioV1DemosRegulationsUploadCheckCompliancePost + + file = file ?? throw new global::System.ArgumentNullException(nameof(file)); + var request = new global::AI21.BodyUploadCheckComplianceStudioV1DemosRegulationsUploadCheckCompliancePost { - File = file, + File = global::System.Array.Empty(), Filename = filename, Budget = budget, VectorStoreId = vectorStoreId, }; + PrepareArguments( + client: HttpClient); + PrepareUploadCheckComplianceStudioV1DemosRegulationsUploadCheckCompliancePostArguments( + httpClient: HttpClient, + request: request); - return await UploadCheckComplianceStudioV1DemosRegulationsUploadCheckCompliancePostAsync( - request: __request, - cancellationToken: cancellationToken).ConfigureAwait(false); + + var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_UploadCheckComplianceStudioV1DemosRegulationsUploadCheckCompliancePostSecurityRequirements, + operationName: "UploadCheckComplianceStudioV1DemosRegulationsUploadCheckCompliancePostAsync"); + + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: false); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: "/studio/v1/demos/regulations/upload-check-compliance", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Post, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + + var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); + var __contentFile = new global::System.Net.Http.StreamContent(file); + __contentFile.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( + request.Filename is null + ? "application/octet-stream" + : (global::System.IO.Path.GetExtension(request.Filename) ?? string.Empty).ToLowerInvariant() switch + { + ".aac" => "audio/aac", + ".flac" => "audio/flac", + ".gif" => "image/gif", + ".jpeg" => "image/jpeg", + ".jpg" => "image/jpeg", + ".json" => "application/json", + ".m4a" => "audio/mp4", + ".mp3" => "audio/mpeg", + ".mp4" => "video/mp4", + ".mpeg" => "audio/mpeg", + ".mpga" => "audio/mpeg", + ".oga" => "audio/ogg", + ".ogg" => "audio/ogg", + ".opus" => "audio/ogg", + ".pdf" => "application/pdf", + ".png" => "image/png", + ".txt" => "text/plain", + ".wav" => "audio/wav", + ".weba" => "audio/webm", + ".webm" => "video/webm", + ".webp" => "image/webp", + _ => "application/octet-stream", + }); + __httpRequestContent.Add( + content: __contentFile, + name: "\"file\"", + fileName: request.Filename != null ? $"\"{request.Filename}\"" : string.Empty); + if (__contentFile.Headers.ContentDisposition != null) + { + __contentFile.Headers.ContentDisposition.FileNameStar = null; + } + + if (request.Budget != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.Budget ?? string.Empty), + name: "\"budget\""); + + } + if (request.VectorStoreId != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.VectorStoreId ?? string.Empty), + name: "\"vector_store_id\""); + + } + + __httpRequest.Content = __httpRequestContent; + + global::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareUploadCheckComplianceStudioV1DemosRegulationsUploadCheckCompliancePostRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + request: request); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "UploadCheckComplianceStudioV1DemosRegulationsUploadCheckCompliancePost", + methodName: "UploadCheckComplianceStudioV1DemosRegulationsUploadCheckCompliancePostAsync", + pathTemplate: "\"/studio/v1/demos/regulations/upload-check-compliance\"", + 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::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "UploadCheckComplianceStudioV1DemosRegulationsUploadCheckCompliancePost", + methodName: "UploadCheckComplianceStudioV1DemosRegulationsUploadCheckCompliancePostAsync", + pathTemplate: "\"/studio/v1/demos/regulations/upload-check-compliance\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "UploadCheckComplianceStudioV1DemosRegulationsUploadCheckCompliancePost", + methodName: "UploadCheckComplianceStudioV1DemosRegulationsUploadCheckCompliancePostAsync", + pathTemplate: "\"/studio/v1/demos/regulations/upload-check-compliance\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessUploadCheckComplianceStudioV1DemosRegulationsUploadCheckCompliancePostResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "UploadCheckComplianceStudioV1DemosRegulationsUploadCheckCompliancePost", + methodName: "UploadCheckComplianceStudioV1DemosRegulationsUploadCheckCompliancePostAsync", + pathTemplate: "\"/studio/v1/demos/regulations/upload-check-compliance\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "UploadCheckComplianceStudioV1DemosRegulationsUploadCheckCompliancePost", + methodName: "UploadCheckComplianceStudioV1DemosRegulationsUploadCheckCompliancePostAsync", + pathTemplate: "\"/studio/v1/demos/regulations/upload-check-compliance\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __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::AI21.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessUploadCheckComplianceStudioV1DemosRegulationsUploadCheckCompliancePostResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? 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::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.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::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } } } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.V1CreateAssistant.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.V1CreateAssistant.g.cs index 414c44b1..92076d56 100644 --- a/src/libs/AI21/Generated/AI21.Ai21Client.V1CreateAssistant.g.cs +++ b/src/libs/AI21/Generated/AI21.Ai21Client.V1CreateAssistant.g.cs @@ -14,6 +14,7 @@ public partial class Ai21Client { new global::AI21.EndPointAuthorizationRequirement { Type = "Http", + SchemeId = "HttpBearer", Location = "Header", Name = "Bearer", FriendlyName = "Bearer", @@ -44,11 +45,35 @@ partial void ProcessV1CreateAssistantResponseContent( /// Create Assistant /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// public async global::System.Threading.Tasks.Task V1CreateAssistantAsync( global::AI21.CreateAssistantRequest request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await V1CreateAssistantAsResponseAsync( + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Create Assistant + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> V1CreateAssistantAsResponseAsync( + + global::AI21.CreateAssistantRequest request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) { request = request ?? throw new global::System.ArgumentNullException(nameof(request)); @@ -65,22 +90,44 @@ partial void ProcessV1CreateAssistantResponseContent( securityRequirements: s_V1CreateAssistantSecurityRequirements, operationName: "V1CreateAssistantAsync"); - var __pathBuilder = new global::AI21.PathBuilder( - path: "/studio/v1/assistants", - 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)); + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: "/studio/v1/assistants", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.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; + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; #endif foreach (var __authorization in __authorizations) { if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2") + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") { __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( scheme: __authorization.Name, @@ -90,156 +137,336 @@ partial void ProcessV1CreateAssistantResponseContent( __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); - PrepareV1CreateAssistantRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - request: request); + 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::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareV1CreateAssistantRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + request: request); - ProcessResponse( - client: HttpClient, - response: __response); - ProcessV1CreateAssistantResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Validation Error - if ((int)__response.StatusCode == 422) + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::AI21.HTTPValidationError? __value_422 = null; - try + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) { - if (ReadResponseAsString) + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1CreateAssistant", + methodName: "V1CreateAssistantAsync", + pathTemplate: "\"/studio/v1/assistants\"", + 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 { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); } - else + catch (global::System.Net.Http.HttpRequestException __exception) { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1CreateAssistant", + methodName: "V1CreateAssistantAsync", + pathTemplate: "\"/studio/v1/assistants\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1CreateAssistant", + methodName: "V1CreateAssistantAsync", + pathTemplate: "\"/studio/v1/assistants\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; } + + break; } - catch (global::System.Exception __ex) + + if (__response == null) { - __exception_422 = __ex; + throw new global::System.InvalidOperationException("No response received."); } - throw new global::AI21.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) + using (__response) { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - ProcessResponseContent( + ProcessResponse( client: HttpClient, - response: __response, - content: ref __content); - ProcessV1CreateAssistantResponseContent( + response: __response); + ProcessV1CreateAssistantResponse( httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) { - __response.EnsureSuccessStatusCode(); - - return - global::AI21.Assistant.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1CreateAssistant", + methodName: "V1CreateAssistantAsync", + pathTemplate: "\"/studio/v1/assistants\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } - catch (global::System.Exception __ex) + else { - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1CreateAssistant", + methodName: "V1CreateAssistantAsync", + pathTemplate: "\"/studio/v1/assistants\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - using var __content = await __response.Content.ReadAsStreamAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::AI21.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - return - await global::AI21.Assistant.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) - { - } + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessV1CreateAssistantResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::AI21.Assistant.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => 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::AI21.Assistant.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; } } + finally + { + __httpRequest?.Dispose(); + } } /// /// Create Assistant @@ -261,6 +488,7 @@ partial void ProcessV1CreateAssistantResponseContent( /// /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// public async global::System.Threading.Tasks.Task V1CreateAssistantAsync( @@ -277,6 +505,7 @@ partial void ProcessV1CreateAssistantResponseContent( string? systemPrompt = default, global::AI21.WorkflowConfig? workflowConfig = default, object? configOverrides = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) { var __request = new global::AI21.CreateAssistantRequest @@ -298,6 +527,7 @@ partial void ProcessV1CreateAssistantResponseContent( return await V1CreateAssistantAsync( request: __request, + requestOptions: requestOptions, cancellationToken: cancellationToken).ConfigureAwait(false); } } diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.V1CreatePlan.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.V1CreatePlan.g.cs index be4dd5be..4f6d3485 100644 --- a/src/libs/AI21/Generated/AI21.Ai21Client.V1CreatePlan.g.cs +++ b/src/libs/AI21/Generated/AI21.Ai21Client.V1CreatePlan.g.cs @@ -14,6 +14,7 @@ public partial class Ai21Client { new global::AI21.EndPointAuthorizationRequirement { Type = "Http", + SchemeId = "HttpBearer", Location = "Header", Name = "Bearer", FriendlyName = "Bearer", @@ -47,12 +48,39 @@ partial void ProcessV1CreatePlanResponseContent( /// /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// public async global::System.Threading.Tasks.Task V1CreatePlanAsync( string assistantId, global::AI21.CreatePlanPayload request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await V1CreatePlanAsResponseAsync( + assistantId: assistantId, + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Create Plan + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> V1CreatePlanAsResponseAsync( + string assistantId, + + global::AI21.CreatePlanPayload request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) { request = request ?? throw new global::System.ArgumentNullException(nameof(request)); @@ -70,22 +98,44 @@ partial void ProcessV1CreatePlanResponseContent( securityRequirements: s_V1CreatePlanSecurityRequirements, operationName: "V1CreatePlanAsync"); - var __pathBuilder = new global::AI21.PathBuilder( - path: $"/studio/v1/assistants/{assistantId}/plans", - 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)); + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: $"/studio/v1/assistants/{assistantId}/plans", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.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; + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; #endif foreach (var __authorization in __authorizations) { if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2") + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") { __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( scheme: __authorization.Name, @@ -95,157 +145,337 @@ partial void ProcessV1CreatePlanResponseContent( __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); - PrepareV1CreatePlanRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - assistantId: assistantId, - request: request); + 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::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareV1CreatePlanRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + assistantId: assistantId!, + request: request); - ProcessResponse( - client: HttpClient, - response: __response); - ProcessV1CreatePlanResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Validation Error - if ((int)__response.StatusCode == 422) + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::AI21.HTTPValidationError? __value_422 = null; - try + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) { - if (ReadResponseAsString) + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1CreatePlan", + methodName: "V1CreatePlanAsync", + pathTemplate: "$\"/studio/v1/assistants/{assistantId}/plans\"", + 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 { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); } - else + catch (global::System.Net.Http.HttpRequestException __exception) { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1CreatePlan", + methodName: "V1CreatePlanAsync", + pathTemplate: "$\"/studio/v1/assistants/{assistantId}/plans\"", + 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; + } - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1CreatePlan", + methodName: "V1CreatePlanAsync", + pathTemplate: "$\"/studio/v1/assistants/{assistantId}/plans\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; } - catch (global::System.Exception __ex) + + if (__response == null) { - __exception_422 = __ex; + throw new global::System.InvalidOperationException("No response received."); } - throw new global::AI21.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) + using (__response) { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( + ProcessResponse( client: HttpClient, - response: __response, - content: ref __content); - ProcessV1CreatePlanResponseContent( + response: __response); + ProcessV1CreatePlanResponse( httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) { - __response.EnsureSuccessStatusCode(); - - return - global::AI21.Plan.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1CreatePlan", + methodName: "V1CreatePlanAsync", + pathTemplate: "$\"/studio/v1/assistants/{assistantId}/plans\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } - catch (global::System.Exception __ex) + else { - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1CreatePlan", + methodName: "V1CreatePlanAsync", + pathTemplate: "$\"/studio/v1/assistants/{assistantId}/plans\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - using var __content = await __response.Content.ReadAsStreamAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::AI21.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - return - await global::AI21.Plan.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) - { - } + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessV1CreatePlanResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::AI21.Plan.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => 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::AI21.Plan.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; } } + finally + { + __httpRequest?.Dispose(); + } } /// /// Create Plan @@ -253,12 +483,14 @@ partial void ProcessV1CreatePlanResponseContent( /// /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// public async global::System.Threading.Tasks.Task V1CreatePlanAsync( string assistantId, string code, global::System.Collections.Generic.IList? schemas = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) { var __request = new global::AI21.CreatePlanPayload @@ -270,6 +502,7 @@ partial void ProcessV1CreatePlanResponseContent( return await V1CreatePlanAsync( assistantId: assistantId, request: __request, + requestOptions: requestOptions, cancellationToken: cancellationToken).ConfigureAwait(false); } } diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.V1CreateRoute.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.V1CreateRoute.g.cs index a9cce046..4ce9ddd1 100644 --- a/src/libs/AI21/Generated/AI21.Ai21Client.V1CreateRoute.g.cs +++ b/src/libs/AI21/Generated/AI21.Ai21Client.V1CreateRoute.g.cs @@ -14,6 +14,7 @@ public partial class Ai21Client { new global::AI21.EndPointAuthorizationRequirement { Type = "Http", + SchemeId = "HttpBearer", Location = "Header", Name = "Bearer", FriendlyName = "Bearer", @@ -47,12 +48,39 @@ partial void ProcessV1CreateRouteResponseContent( /// /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// public async global::System.Threading.Tasks.Task V1CreateRouteAsync( string assistantId, global::AI21.CreateRoutePayload request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await V1CreateRouteAsResponseAsync( + assistantId: assistantId, + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Create Route + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> V1CreateRouteAsResponseAsync( + string assistantId, + + global::AI21.CreateRoutePayload request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) { request = request ?? throw new global::System.ArgumentNullException(nameof(request)); @@ -70,22 +98,44 @@ partial void ProcessV1CreateRouteResponseContent( securityRequirements: s_V1CreateRouteSecurityRequirements, operationName: "V1CreateRouteAsync"); - var __pathBuilder = new global::AI21.PathBuilder( - path: $"/studio/v1/assistants/{assistantId}/routes", - 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)); + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: $"/studio/v1/assistants/{assistantId}/routes", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.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; + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; #endif foreach (var __authorization in __authorizations) { if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2") + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") { __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( scheme: __authorization.Name, @@ -95,157 +145,337 @@ partial void ProcessV1CreateRouteResponseContent( __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); - PrepareV1CreateRouteRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - assistantId: assistantId, - request: request); + 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::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareV1CreateRouteRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + assistantId: assistantId!, + request: request); - ProcessResponse( - client: HttpClient, - response: __response); - ProcessV1CreateRouteResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Validation Error - if ((int)__response.StatusCode == 422) + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::AI21.HTTPValidationError? __value_422 = null; - try + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) { - if (ReadResponseAsString) + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1CreateRoute", + methodName: "V1CreateRouteAsync", + pathTemplate: "$\"/studio/v1/assistants/{assistantId}/routes\"", + 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 { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); } - else + catch (global::System.Net.Http.HttpRequestException __exception) { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1CreateRoute", + methodName: "V1CreateRouteAsync", + pathTemplate: "$\"/studio/v1/assistants/{assistantId}/routes\"", + 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; + } - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1CreateRoute", + methodName: "V1CreateRouteAsync", + pathTemplate: "$\"/studio/v1/assistants/{assistantId}/routes\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; } - catch (global::System.Exception __ex) + + if (__response == null) { - __exception_422 = __ex; + throw new global::System.InvalidOperationException("No response received."); } - throw new global::AI21.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) + using (__response) { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( + ProcessResponse( client: HttpClient, - response: __response, - content: ref __content); - ProcessV1CreateRouteResponseContent( + response: __response); + ProcessV1CreateRouteResponse( httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) { - __response.EnsureSuccessStatusCode(); - - return - global::AI21.AssistantRoute.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1CreateRoute", + methodName: "V1CreateRouteAsync", + pathTemplate: "$\"/studio/v1/assistants/{assistantId}/routes\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } - catch (global::System.Exception __ex) + else { - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1CreateRoute", + methodName: "V1CreateRouteAsync", + pathTemplate: "$\"/studio/v1/assistants/{assistantId}/routes\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - using var __content = await __response.Content.ReadAsStreamAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::AI21.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - return - await global::AI21.AssistantRoute.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) - { - } + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessV1CreateRouteResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::AI21.AssistantRoute.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => 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::AI21.AssistantRoute.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; } } + finally + { + __httpRequest?.Dispose(); + } } /// /// Create Route @@ -255,6 +485,7 @@ partial void ProcessV1CreateRouteResponseContent( /// /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// public async global::System.Threading.Tasks.Task V1CreateRouteAsync( @@ -263,6 +494,7 @@ partial void ProcessV1CreateRouteResponseContent( string name, string description, global::System.Collections.Generic.IList examples, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) { var __request = new global::AI21.CreateRoutePayload @@ -276,6 +508,7 @@ partial void ProcessV1CreateRouteResponseContent( return await V1CreateRouteAsync( assistantId: assistantId, request: __request, + requestOptions: requestOptions, cancellationToken: cancellationToken).ConfigureAwait(false); } } diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.V1DeleteAssistant.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.V1DeleteAssistant.g.cs index 7da4a25c..92fb1022 100644 --- a/src/libs/AI21/Generated/AI21.Ai21Client.V1DeleteAssistant.g.cs +++ b/src/libs/AI21/Generated/AI21.Ai21Client.V1DeleteAssistant.g.cs @@ -14,6 +14,7 @@ public partial class Ai21Client { new global::AI21.EndPointAuthorizationRequirement { Type = "Http", + SchemeId = "HttpBearer", Location = "Header", Name = "Bearer", FriendlyName = "Bearer", @@ -44,10 +45,32 @@ partial void ProcessV1DeleteAssistantResponseContent( /// Delete Assistant /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// public async global::System.Threading.Tasks.Task V1DeleteAssistantAsync( string assistantId, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await V1DeleteAssistantAsResponseAsync( + assistantId: assistantId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Delete Assistant + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> V1DeleteAssistantAsResponseAsync( + string assistantId, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( @@ -62,22 +85,44 @@ partial void ProcessV1DeleteAssistantResponseContent( securityRequirements: s_V1DeleteAssistantSecurityRequirements, operationName: "V1DeleteAssistantAsync"); - var __pathBuilder = new global::AI21.PathBuilder( - path: $"/studio/v1/assistants/{assistantId}", - 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)); + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: $"/studio/v1/assistants/{assistantId}", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.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; + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; #endif foreach (var __authorization in __authorizations) { if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2") + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") { __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( scheme: __authorization.Name, @@ -87,150 +132,330 @@ partial void ProcessV1DeleteAssistantResponseContent( __authorization.Location == "Header") { __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } + } } + global::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareV1DeleteAssistantRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - assistantId: assistantId); + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareV1DeleteAssistantRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + assistantId: assistantId!); - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); + return __httpRequest; + } - ProcessResponse( - client: HttpClient, - response: __response); - ProcessV1DeleteAssistantResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Validation Error - if ((int)__response.StatusCode == 422) + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::AI21.HTTPValidationError? __value_422 = null; - try + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) { - if (ReadResponseAsString) + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1DeleteAssistant", + methodName: "V1DeleteAssistantAsync", + pathTemplate: "$\"/studio/v1/assistants/{assistantId}\"", + 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 { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); } - else + catch (global::System.Net.Http.HttpRequestException __exception) { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1DeleteAssistant", + methodName: "V1DeleteAssistantAsync", + pathTemplate: "$\"/studio/v1/assistants/{assistantId}\"", + 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; + } - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1DeleteAssistant", + methodName: "V1DeleteAssistantAsync", + pathTemplate: "$\"/studio/v1/assistants/{assistantId}\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; } - catch (global::System.Exception __ex) + + if (__response == null) { - __exception_422 = __ex; + throw new global::System.InvalidOperationException("No response received."); } - throw new global::AI21.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) + using (__response) { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - ProcessResponseContent( + ProcessResponse( client: HttpClient, - response: __response, - content: ref __content); - ProcessV1DeleteAssistantResponseContent( + response: __response); + ProcessV1DeleteAssistantResponse( httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) { - __response.EnsureSuccessStatusCode(); - - return - global::AI21.DeleteAssistantResponse.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1DeleteAssistant", + methodName: "V1DeleteAssistantAsync", + pathTemplate: "$\"/studio/v1/assistants/{assistantId}\"", + 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); } - catch (global::System.Exception __ex) + else { - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1DeleteAssistant", + methodName: "V1DeleteAssistantAsync", + pathTemplate: "$\"/studio/v1/assistants/{assistantId}\"", + 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 - { - try - { - __response.EnsureSuccessStatusCode(); - using var __content = await __response.Content.ReadAsStreamAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::AI21.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - return - await global::AI21.DeleteAssistantResponse.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) - { - } + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessV1DeleteAssistantResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::AI21.DeleteAssistantResponse.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => 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::AI21.DeleteAssistantResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; } } + finally + { + __httpRequest?.Dispose(); + } } } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.V1DeleteRoute.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.V1DeleteRoute.g.cs index bbcc1a52..8265e308 100644 --- a/src/libs/AI21/Generated/AI21.Ai21Client.V1DeleteRoute.g.cs +++ b/src/libs/AI21/Generated/AI21.Ai21Client.V1DeleteRoute.g.cs @@ -14,6 +14,7 @@ public partial class Ai21Client { new global::AI21.EndPointAuthorizationRequirement { Type = "Http", + SchemeId = "HttpBearer", Location = "Header", Name = "Bearer", FriendlyName = "Bearer", @@ -47,11 +48,36 @@ partial void ProcessV1DeleteRouteResponseContent( /// /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// public async global::System.Threading.Tasks.Task V1DeleteRouteAsync( string routeId, string assistantId, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await V1DeleteRouteAsResponseAsync( + routeId: routeId, + assistantId: assistantId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Delete Route + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> V1DeleteRouteAsResponseAsync( + string routeId, + string assistantId, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( @@ -67,22 +93,44 @@ partial void ProcessV1DeleteRouteResponseContent( securityRequirements: s_V1DeleteRouteSecurityRequirements, operationName: "V1DeleteRouteAsync"); - var __pathBuilder = new global::AI21.PathBuilder( - path: $"/studio/v1/assistants/{assistantId}/routes/{routeId}", - 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)); + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: $"/studio/v1/assistants/{assistantId}/routes/{routeId}", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.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; + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; #endif foreach (var __authorization in __authorizations) { if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2") + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") { __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( scheme: __authorization.Name, @@ -92,147 +140,327 @@ partial void ProcessV1DeleteRouteResponseContent( __authorization.Location == "Header") { __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } + } } + global::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareV1DeleteRouteRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - routeId: routeId, - assistantId: assistantId); + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareV1DeleteRouteRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + routeId: routeId!, + assistantId: assistantId!); - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); + return __httpRequest; + } - ProcessResponse( - client: HttpClient, - response: __response); - ProcessV1DeleteRouteResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Validation Error - if ((int)__response.StatusCode == 422) + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::AI21.HTTPValidationError? __value_422 = null; - try + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) { - if (ReadResponseAsString) + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1DeleteRoute", + methodName: "V1DeleteRouteAsync", + pathTemplate: "$\"/studio/v1/assistants/{assistantId}/routes/{routeId}\"", + 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 { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); } - else + catch (global::System.Net.Http.HttpRequestException __exception) { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1DeleteRoute", + methodName: "V1DeleteRouteAsync", + pathTemplate: "$\"/studio/v1/assistants/{assistantId}/routes/{routeId}\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1DeleteRoute", + methodName: "V1DeleteRouteAsync", + pathTemplate: "$\"/studio/v1/assistants/{assistantId}/routes/{routeId}\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; } + + break; } - catch (global::System.Exception __ex) + + if (__response == null) { - __exception_422 = __ex; + throw new global::System.InvalidOperationException("No response received."); } - throw new global::AI21.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) + using (__response) { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - ProcessResponseContent( + ProcessResponse( client: HttpClient, - response: __response, - content: ref __content); - ProcessV1DeleteRouteResponseContent( + response: __response); + ProcessV1DeleteRouteResponse( httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) { - __response.EnsureSuccessStatusCode(); - - return __content; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1DeleteRoute", + methodName: "V1DeleteRouteAsync", + pathTemplate: "$\"/studio/v1/assistants/{assistantId}/routes/{routeId}\"", + 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); } - catch (global::System.Exception __ex) + else { - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1DeleteRoute", + methodName: "V1DeleteRouteAsync", + pathTemplate: "$\"/studio/v1/assistants/{assistantId}/routes/{routeId}\"", + 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 - { - try - { - __response.EnsureSuccessStatusCode(); - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::AI21.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).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) - { - } + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessV1DeleteRouteResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? 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::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.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::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; } } + finally + { + __httpRequest?.Dispose(); + } } } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.V1GenerateAssistant.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.V1GenerateAssistant.g.cs index 1c481435..c0003c7b 100644 --- a/src/libs/AI21/Generated/AI21.Ai21Client.V1GenerateAssistant.g.cs +++ b/src/libs/AI21/Generated/AI21.Ai21Client.V1GenerateAssistant.g.cs @@ -14,6 +14,7 @@ public partial class Ai21Client { new global::AI21.EndPointAuthorizationRequirement { Type = "Http", + SchemeId = "HttpBearer", Location = "Header", Name = "Bearer", FriendlyName = "Bearer", @@ -44,11 +45,35 @@ partial void ProcessV1GenerateAssistantResponseContent( /// Generate Assistant /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// public async global::System.Threading.Tasks.Task V1GenerateAssistantAsync( global::AI21.GenerateAssistantRequest request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await V1GenerateAssistantAsResponseAsync( + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Generate Assistant + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> V1GenerateAssistantAsResponseAsync( + + global::AI21.GenerateAssistantRequest request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) { request = request ?? throw new global::System.ArgumentNullException(nameof(request)); @@ -65,22 +90,44 @@ partial void ProcessV1GenerateAssistantResponseContent( securityRequirements: s_V1GenerateAssistantSecurityRequirements, operationName: "V1GenerateAssistantAsync"); - var __pathBuilder = new global::AI21.PathBuilder( - path: "/studio/v1/assistants/generate", - 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)); + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: "/studio/v1/assistants/generate", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.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; + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; #endif foreach (var __authorization in __authorizations) { if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2") + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") { __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( scheme: __authorization.Name, @@ -90,167 +137,349 @@ partial void ProcessV1GenerateAssistantResponseContent( __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); - PrepareV1GenerateAssistantRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - request: request); + 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::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareV1GenerateAssistantRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + request: request); - ProcessResponse( - client: HttpClient, - response: __response); - ProcessV1GenerateAssistantResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Validation Error - if ((int)__response.StatusCode == 422) + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::AI21.HTTPValidationError? __value_422 = null; - try + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) { - if (ReadResponseAsString) + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1GenerateAssistant", + methodName: "V1GenerateAssistantAsync", + pathTemplate: "\"/studio/v1/assistants/generate\"", + 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 { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); } - else + catch (global::System.Net.Http.HttpRequestException __exception) { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1GenerateAssistant", + methodName: "V1GenerateAssistantAsync", + pathTemplate: "\"/studio/v1/assistants/generate\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1GenerateAssistant", + methodName: "V1GenerateAssistantAsync", + pathTemplate: "\"/studio/v1/assistants/generate\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; } + + break; } - catch (global::System.Exception __ex) + + if (__response == null) { - __exception_422 = __ex; + throw new global::System.InvalidOperationException("No response received."); } - throw new global::AI21.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) + using (__response) { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - ProcessResponseContent( + ProcessResponse( client: HttpClient, - response: __response, - content: ref __content); - ProcessV1GenerateAssistantResponseContent( + response: __response); + ProcessV1GenerateAssistantResponse( httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) { - __response.EnsureSuccessStatusCode(); - - return - global::AI21.GenerateAssistantResponse.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1GenerateAssistant", + methodName: "V1GenerateAssistantAsync", + pathTemplate: "\"/studio/v1/assistants/generate\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } - catch (global::System.Exception __ex) + else { - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1GenerateAssistant", + methodName: "V1GenerateAssistantAsync", + pathTemplate: "\"/studio/v1/assistants/generate\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - using var __content = await __response.Content.ReadAsStreamAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::AI21.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - return - await global::AI21.GenerateAssistantResponse.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) - { - } + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessV1GenerateAssistantResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::AI21.GenerateAssistantResponse.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => 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::AI21.GenerateAssistantResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; } } + finally + { + __httpRequest?.Dispose(); + } } /// /// Generate Assistant /// /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// public async global::System.Threading.Tasks.Task V1GenerateAssistantAsync( string prompt, string? avatar = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) { var __request = new global::AI21.GenerateAssistantRequest @@ -261,6 +490,7 @@ partial void ProcessV1GenerateAssistantResponseContent( return await V1GenerateAssistantAsync( request: __request, + requestOptions: requestOptions, cancellationToken: cancellationToken).ConfigureAwait(false); } } diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.V1GetAssistant.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.V1GetAssistant.g.cs index 0242b6d8..a83a175e 100644 --- a/src/libs/AI21/Generated/AI21.Ai21Client.V1GetAssistant.g.cs +++ b/src/libs/AI21/Generated/AI21.Ai21Client.V1GetAssistant.g.cs @@ -14,6 +14,7 @@ public partial class Ai21Client { new global::AI21.EndPointAuthorizationRequirement { Type = "Http", + SchemeId = "HttpBearer", Location = "Header", Name = "Bearer", FriendlyName = "Bearer", @@ -44,10 +45,32 @@ partial void ProcessV1GetAssistantResponseContent( /// Get Assistant /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// public async global::System.Threading.Tasks.Task V1GetAssistantAsync( string assistantId, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await V1GetAssistantAsResponseAsync( + assistantId: assistantId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Get Assistant + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> V1GetAssistantAsResponseAsync( + string assistantId, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( @@ -62,22 +85,44 @@ partial void ProcessV1GetAssistantResponseContent( securityRequirements: s_V1GetAssistantSecurityRequirements, operationName: "V1GetAssistantAsync"); - var __pathBuilder = new global::AI21.PathBuilder( - path: $"/studio/v1/assistants/{assistantId}", - 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)); + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: $"/studio/v1/assistants/{assistantId}", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.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; + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; #endif foreach (var __authorization in __authorizations) { if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2") + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") { __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( scheme: __authorization.Name, @@ -87,150 +132,330 @@ partial void ProcessV1GetAssistantResponseContent( __authorization.Location == "Header") { __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } + } } + global::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareV1GetAssistantRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - assistantId: assistantId); + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareV1GetAssistantRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + assistantId: assistantId!); - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); + return __httpRequest; + } - ProcessResponse( - client: HttpClient, - response: __response); - ProcessV1GetAssistantResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Validation Error - if ((int)__response.StatusCode == 422) + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::AI21.HTTPValidationError? __value_422 = null; - try + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) { - if (ReadResponseAsString) + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1GetAssistant", + methodName: "V1GetAssistantAsync", + pathTemplate: "$\"/studio/v1/assistants/{assistantId}\"", + 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 { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); } - else + catch (global::System.Net.Http.HttpRequestException __exception) { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1GetAssistant", + methodName: "V1GetAssistantAsync", + pathTemplate: "$\"/studio/v1/assistants/{assistantId}\"", + 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; + } - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1GetAssistant", + methodName: "V1GetAssistantAsync", + pathTemplate: "$\"/studio/v1/assistants/{assistantId}\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; } - catch (global::System.Exception __ex) + + if (__response == null) { - __exception_422 = __ex; + throw new global::System.InvalidOperationException("No response received."); } - throw new global::AI21.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) + using (__response) { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - ProcessResponseContent( + ProcessResponse( client: HttpClient, - response: __response, - content: ref __content); - ProcessV1GetAssistantResponseContent( + response: __response); + ProcessV1GetAssistantResponse( httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) { - __response.EnsureSuccessStatusCode(); - - return - global::AI21.Assistant.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1GetAssistant", + methodName: "V1GetAssistantAsync", + pathTemplate: "$\"/studio/v1/assistants/{assistantId}\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } - catch (global::System.Exception __ex) + else { - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1GetAssistant", + methodName: "V1GetAssistantAsync", + pathTemplate: "$\"/studio/v1/assistants/{assistantId}\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - using var __content = await __response.Content.ReadAsStreamAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::AI21.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - return - await global::AI21.Assistant.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) - { - } + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessV1GetAssistantResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::AI21.Assistant.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => 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::AI21.Assistant.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; } } + finally + { + __httpRequest?.Dispose(); + } } } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.V1GetMaestroRun.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.V1GetMaestroRun.g.cs index 209273ee..4dd54e93 100644 --- a/src/libs/AI21/Generated/AI21.Ai21Client.V1GetMaestroRun.g.cs +++ b/src/libs/AI21/Generated/AI21.Ai21Client.V1GetMaestroRun.g.cs @@ -14,6 +14,7 @@ public partial class Ai21Client { new global::AI21.EndPointAuthorizationRequirement { Type = "Http", + SchemeId = "HttpBearer", Location = "Header", Name = "Bearer", FriendlyName = "Bearer", @@ -44,10 +45,32 @@ partial void ProcessV1GetMaestroRunResponseContent( /// Get Maestro Run /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// public async global::System.Threading.Tasks.Task V1GetMaestroRunAsync( string executionId, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await V1GetMaestroRunAsResponseAsync( + executionId: executionId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Get Maestro Run + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> V1GetMaestroRunAsResponseAsync( + string executionId, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( @@ -62,22 +85,44 @@ partial void ProcessV1GetMaestroRunResponseContent( securityRequirements: s_V1GetMaestroRunSecurityRequirements, operationName: "V1GetMaestroRunAsync"); - var __pathBuilder = new global::AI21.PathBuilder( - path: $"/studio/v1/maestro/runs/{executionId}", - 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)); + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: $"/studio/v1/maestro/runs/{executionId}", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.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; + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; #endif foreach (var __authorization in __authorizations) { if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2") + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") { __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( scheme: __authorization.Name, @@ -87,150 +132,330 @@ partial void ProcessV1GetMaestroRunResponseContent( __authorization.Location == "Header") { __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } + } } + global::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareV1GetMaestroRunRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - executionId: executionId); + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareV1GetMaestroRunRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + executionId: executionId!); - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); + return __httpRequest; + } - ProcessResponse( - client: HttpClient, - response: __response); - ProcessV1GetMaestroRunResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Validation Error - if ((int)__response.StatusCode == 422) + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::AI21.HTTPValidationError? __value_422 = null; - try + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) { - if (ReadResponseAsString) + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1GetMaestroRun", + methodName: "V1GetMaestroRunAsync", + pathTemplate: "$\"/studio/v1/maestro/runs/{executionId}\"", + 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 { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); } - else + catch (global::System.Net.Http.HttpRequestException __exception) { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1GetMaestroRun", + methodName: "V1GetMaestroRunAsync", + pathTemplate: "$\"/studio/v1/maestro/runs/{executionId}\"", + 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; + } - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1GetMaestroRun", + methodName: "V1GetMaestroRunAsync", + pathTemplate: "$\"/studio/v1/maestro/runs/{executionId}\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; } - catch (global::System.Exception __ex) + + if (__response == null) { - __exception_422 = __ex; + throw new global::System.InvalidOperationException("No response received."); } - throw new global::AI21.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) + using (__response) { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - ProcessResponseContent( + ProcessResponse( client: HttpClient, - response: __response, - content: ref __content); - ProcessV1GetMaestroRunResponseContent( + response: __response); + ProcessV1GetMaestroRunResponse( httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) { - __response.EnsureSuccessStatusCode(); - - return - global::AI21.MaestroRunResult.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1GetMaestroRun", + methodName: "V1GetMaestroRunAsync", + pathTemplate: "$\"/studio/v1/maestro/runs/{executionId}\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } - catch (global::System.Exception __ex) + else { - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1GetMaestroRun", + methodName: "V1GetMaestroRunAsync", + pathTemplate: "$\"/studio/v1/maestro/runs/{executionId}\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - using var __content = await __response.Content.ReadAsStreamAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::AI21.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - return - await global::AI21.MaestroRunResult.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) - { - } + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessV1GetMaestroRunResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::AI21.MaestroRunResult.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => 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::AI21.MaestroRunResult.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; } } + finally + { + __httpRequest?.Dispose(); + } } } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.V1GetPlan.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.V1GetPlan.g.cs index 9e03fbb6..c69669f0 100644 --- a/src/libs/AI21/Generated/AI21.Ai21Client.V1GetPlan.g.cs +++ b/src/libs/AI21/Generated/AI21.Ai21Client.V1GetPlan.g.cs @@ -14,6 +14,7 @@ public partial class Ai21Client { new global::AI21.EndPointAuthorizationRequirement { Type = "Http", + SchemeId = "HttpBearer", Location = "Header", Name = "Bearer", FriendlyName = "Bearer", @@ -47,11 +48,36 @@ partial void ProcessV1GetPlanResponseContent( /// /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// public async global::System.Threading.Tasks.Task V1GetPlanAsync( string planId, string assistantId, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await V1GetPlanAsResponseAsync( + planId: planId, + assistantId: assistantId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Get Plan + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> V1GetPlanAsResponseAsync( + string planId, + string assistantId, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( @@ -67,22 +93,44 @@ partial void ProcessV1GetPlanResponseContent( securityRequirements: s_V1GetPlanSecurityRequirements, operationName: "V1GetPlanAsync"); - var __pathBuilder = new global::AI21.PathBuilder( - path: $"/studio/v1/assistants/{assistantId}/plans/{planId}", - 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)); + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: $"/studio/v1/assistants/{assistantId}/plans/{planId}", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.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; + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; #endif foreach (var __authorization in __authorizations) { if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2") + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") { __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( scheme: __authorization.Name, @@ -92,151 +140,331 @@ partial void ProcessV1GetPlanResponseContent( __authorization.Location == "Header") { __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } + } } + global::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareV1GetPlanRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - planId: planId, - assistantId: assistantId); + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareV1GetPlanRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + planId: planId!, + assistantId: assistantId!); - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); + return __httpRequest; + } - ProcessResponse( - client: HttpClient, - response: __response); - ProcessV1GetPlanResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Validation Error - if ((int)__response.StatusCode == 422) + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::AI21.HTTPValidationError? __value_422 = null; - try + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) { - if (ReadResponseAsString) + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1GetPlan", + methodName: "V1GetPlanAsync", + pathTemplate: "$\"/studio/v1/assistants/{assistantId}/plans/{planId}\"", + 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 { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); } - else + catch (global::System.Net.Http.HttpRequestException __exception) { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1GetPlan", + methodName: "V1GetPlanAsync", + pathTemplate: "$\"/studio/v1/assistants/{assistantId}/plans/{planId}\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1GetPlan", + methodName: "V1GetPlanAsync", + pathTemplate: "$\"/studio/v1/assistants/{assistantId}/plans/{planId}\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; } + + break; } - catch (global::System.Exception __ex) + + if (__response == null) { - __exception_422 = __ex; + throw new global::System.InvalidOperationException("No response received."); } - throw new global::AI21.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) + using (__response) { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - ProcessResponseContent( + ProcessResponse( client: HttpClient, - response: __response, - content: ref __content); - ProcessV1GetPlanResponseContent( + response: __response); + ProcessV1GetPlanResponse( httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) { - __response.EnsureSuccessStatusCode(); - - return - global::AI21.Plan.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1GetPlan", + methodName: "V1GetPlanAsync", + pathTemplate: "$\"/studio/v1/assistants/{assistantId}/plans/{planId}\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } - catch (global::System.Exception __ex) + else { - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1GetPlan", + methodName: "V1GetPlanAsync", + pathTemplate: "$\"/studio/v1/assistants/{assistantId}/plans/{planId}\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - using var __content = await __response.Content.ReadAsStreamAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::AI21.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - return - await global::AI21.Plan.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) - { - } + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessV1GetPlanResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::AI21.Plan.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => 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::AI21.Plan.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; } } + finally + { + __httpRequest?.Dispose(); + } } } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.V1GetRoute.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.V1GetRoute.g.cs index 281f7fa6..70f2edeb 100644 --- a/src/libs/AI21/Generated/AI21.Ai21Client.V1GetRoute.g.cs +++ b/src/libs/AI21/Generated/AI21.Ai21Client.V1GetRoute.g.cs @@ -14,6 +14,7 @@ public partial class Ai21Client { new global::AI21.EndPointAuthorizationRequirement { Type = "Http", + SchemeId = "HttpBearer", Location = "Header", Name = "Bearer", FriendlyName = "Bearer", @@ -47,11 +48,36 @@ partial void ProcessV1GetRouteResponseContent( /// /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// public async global::System.Threading.Tasks.Task V1GetRouteAsync( string routeId, string assistantId, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await V1GetRouteAsResponseAsync( + routeId: routeId, + assistantId: assistantId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Get Route + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> V1GetRouteAsResponseAsync( + string routeId, + string assistantId, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( @@ -67,22 +93,44 @@ partial void ProcessV1GetRouteResponseContent( securityRequirements: s_V1GetRouteSecurityRequirements, operationName: "V1GetRouteAsync"); - var __pathBuilder = new global::AI21.PathBuilder( - path: $"/studio/v1/assistants/{assistantId}/routes/{routeId}", - 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)); + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: $"/studio/v1/assistants/{assistantId}/routes/{routeId}", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.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; + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; #endif foreach (var __authorization in __authorizations) { if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2") + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") { __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( scheme: __authorization.Name, @@ -92,151 +140,331 @@ partial void ProcessV1GetRouteResponseContent( __authorization.Location == "Header") { __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } + } } + global::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareV1GetRouteRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - routeId: routeId, - assistantId: assistantId); + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareV1GetRouteRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + routeId: routeId!, + assistantId: assistantId!); - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); + return __httpRequest; + } - ProcessResponse( - client: HttpClient, - response: __response); - ProcessV1GetRouteResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Validation Error - if ((int)__response.StatusCode == 422) + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::AI21.HTTPValidationError? __value_422 = null; - try + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) { - if (ReadResponseAsString) + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1GetRoute", + methodName: "V1GetRouteAsync", + pathTemplate: "$\"/studio/v1/assistants/{assistantId}/routes/{routeId}\"", + 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 { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); } - else + catch (global::System.Net.Http.HttpRequestException __exception) { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1GetRoute", + methodName: "V1GetRouteAsync", + pathTemplate: "$\"/studio/v1/assistants/{assistantId}/routes/{routeId}\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1GetRoute", + methodName: "V1GetRouteAsync", + pathTemplate: "$\"/studio/v1/assistants/{assistantId}/routes/{routeId}\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; } + + break; } - catch (global::System.Exception __ex) + + if (__response == null) { - __exception_422 = __ex; + throw new global::System.InvalidOperationException("No response received."); } - throw new global::AI21.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) + using (__response) { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - ProcessResponseContent( + ProcessResponse( client: HttpClient, - response: __response, - content: ref __content); - ProcessV1GetRouteResponseContent( + response: __response); + ProcessV1GetRouteResponse( httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) { - __response.EnsureSuccessStatusCode(); - - return - global::AI21.AssistantRoute.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1GetRoute", + methodName: "V1GetRouteAsync", + pathTemplate: "$\"/studio/v1/assistants/{assistantId}/routes/{routeId}\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } - catch (global::System.Exception __ex) + else { - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1GetRoute", + methodName: "V1GetRouteAsync", + pathTemplate: "$\"/studio/v1/assistants/{assistantId}/routes/{routeId}\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - using var __content = await __response.Content.ReadAsStreamAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::AI21.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - return - await global::AI21.AssistantRoute.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) - { - } + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessV1GetRouteResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::AI21.AssistantRoute.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => 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::AI21.AssistantRoute.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; } } + finally + { + __httpRequest?.Dispose(); + } } } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.V1ListAssistants.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.V1ListAssistants.g.cs index 2315517f..657e90b1 100644 --- a/src/libs/AI21/Generated/AI21.Ai21Client.V1ListAssistants.g.cs +++ b/src/libs/AI21/Generated/AI21.Ai21Client.V1ListAssistants.g.cs @@ -14,6 +14,7 @@ public partial class Ai21Client { new global::AI21.EndPointAuthorizationRequirement { Type = "Http", + SchemeId = "HttpBearer", Location = "Header", Name = "Bearer", FriendlyName = "Bearer", @@ -44,10 +45,32 @@ partial void ProcessV1ListAssistantsResponseContent( /// Get Assistants /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// public async global::System.Threading.Tasks.Task V1ListAssistantsAsync( global::System.Collections.Generic.IList? workspaceIds = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await V1ListAssistantsAsResponseAsync( + workspaceIds: workspaceIds, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Get Assistants + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> V1ListAssistantsAsResponseAsync( + global::System.Collections.Generic.IList? workspaceIds = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( @@ -62,25 +85,47 @@ partial void ProcessV1ListAssistantsResponseContent( securityRequirements: s_V1ListAssistantsSecurityRequirements, operationName: "V1ListAssistantsAsync"); - var __pathBuilder = new global::AI21.PathBuilder( - path: "/studio/v1/assistants", - baseUri: HttpClient.BaseAddress); - __pathBuilder - .AddOptionalParameter("workspace_ids", workspaceIds, delimiter: ",", explode: true) - ; - 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)); + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: "/studio/v1/assistants", + baseUri: HttpClient.BaseAddress); + __pathBuilder + .AddOptionalParameter("workspace_ids", workspaceIds, delimiter: ",", explode: true) + ; + var __path = __pathBuilder.ToString(); + __path = global::AI21.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; + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; #endif foreach (var __authorization in __authorizations) { if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2") + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") { __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( scheme: __authorization.Name, @@ -90,150 +135,330 @@ partial void ProcessV1ListAssistantsResponseContent( __authorization.Location == "Header") { __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } + } } + global::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareV1ListAssistantsRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - workspaceIds: workspaceIds); + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareV1ListAssistantsRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + workspaceIds: workspaceIds); - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); + return __httpRequest; + } - ProcessResponse( - client: HttpClient, - response: __response); - ProcessV1ListAssistantsResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Validation Error - if ((int)__response.StatusCode == 422) + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::AI21.HTTPValidationError? __value_422 = null; - try + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) { - if (ReadResponseAsString) + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1ListAssistants", + methodName: "V1ListAssistantsAsync", + pathTemplate: "\"/studio/v1/assistants\"", + 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 { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); } - else + catch (global::System.Net.Http.HttpRequestException __exception) { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1ListAssistants", + methodName: "V1ListAssistantsAsync", + pathTemplate: "\"/studio/v1/assistants\"", + 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; + } - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1ListAssistants", + methodName: "V1ListAssistantsAsync", + pathTemplate: "\"/studio/v1/assistants\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; } - catch (global::System.Exception __ex) + + if (__response == null) { - __exception_422 = __ex; + throw new global::System.InvalidOperationException("No response received."); } - throw new global::AI21.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) + using (__response) { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - ProcessResponseContent( + ProcessResponse( client: HttpClient, - response: __response, - content: ref __content); - ProcessV1ListAssistantsResponseContent( + response: __response); + ProcessV1ListAssistantsResponse( httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) { - __response.EnsureSuccessStatusCode(); - - return - global::AI21.ListAssistantsResponse.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1ListAssistants", + methodName: "V1ListAssistantsAsync", + pathTemplate: "\"/studio/v1/assistants\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } - catch (global::System.Exception __ex) + else { - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1ListAssistants", + methodName: "V1ListAssistantsAsync", + pathTemplate: "\"/studio/v1/assistants\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - using var __content = await __response.Content.ReadAsStreamAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::AI21.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - return - await global::AI21.ListAssistantsResponse.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) - { - } + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessV1ListAssistantsResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::AI21.ListAssistantsResponse.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => 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::AI21.ListAssistantsResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; } } + finally + { + __httpRequest?.Dispose(); + } } } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.V1ListModelsInfo.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.V1ListModelsInfo.g.cs index 1857d1a6..0d266b70 100644 --- a/src/libs/AI21/Generated/AI21.Ai21Client.V1ListModelsInfo.g.cs +++ b/src/libs/AI21/Generated/AI21.Ai21Client.V1ListModelsInfo.g.cs @@ -14,6 +14,7 @@ public partial class Ai21Client { new global::AI21.EndPointAuthorizationRequirement { Type = "Http", + SchemeId = "HttpBearer", Location = "Header", Name = "Bearer", FriendlyName = "Bearer", @@ -41,9 +42,28 @@ partial void ProcessV1ListModelsInfoResponseContent( /// /// Get 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 V1ListModelsInfoAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await V1ListModelsInfoAsResponseAsync( + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Get 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> V1ListModelsInfoAsResponseAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( @@ -57,22 +77,44 @@ partial void ProcessV1ListModelsInfoResponseContent( securityRequirements: s_V1ListModelsInfoSecurityRequirements, operationName: "V1ListModelsInfoAsync"); - var __pathBuilder = new global::AI21.PathBuilder( - path: "/studio/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)); + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: "/studio/v1/models", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.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; + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; #endif foreach (var __authorization in __authorizations) { if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2") + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") { __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( scheme: __authorization.Name, @@ -82,111 +124,292 @@ partial void ProcessV1ListModelsInfoResponseContent( __authorization.Location == "Header") { __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } + } } + global::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareV1ListModelsInfoRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareV1ListModelsInfoRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest); - ProcessResponse( - client: HttpClient, - response: __response); - ProcessV1ListModelsInfoResponse( - httpClient: HttpClient, - httpResponseMessage: __response); + return __httpRequest; + } - if (ReadResponseAsString) + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1ListModelsInfo", + methodName: "V1ListModelsInfoAsync", + pathTemplate: "\"/studio/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::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1ListModelsInfo", + methodName: "V1ListModelsInfoAsync", + pathTemplate: "\"/studio/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; + } - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessV1ListModelsInfoResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } - try - { - __response.EnsureSuccessStatusCode(); + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1ListModelsInfo", + methodName: "V1ListModelsInfoAsync", + pathTemplate: "\"/studio/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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } - return - global::AI21.ModelsInfoResponse.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + break; } - catch (global::System.Exception __ex) + + if (__response == null) { - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; + throw new global::System.InvalidOperationException("No response received."); } - } - else - { - try + + using (__response) { - __response.EnsureSuccessStatusCode(); - using var __content = await __response.Content.ReadAsStreamAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - return - await global::AI21.ModelsInfoResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); + ProcessResponse( + client: HttpClient, + response: __response); + ProcessV1ListModelsInfoResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1ListModelsInfo", + methodName: "V1ListModelsInfoAsync", + pathTemplate: "\"/studio/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); } - catch (global::System.Exception __ex) + else { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1ListModelsInfo", + methodName: "V1ListModelsInfoAsync", + pathTemplate: "\"/studio/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); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessV1ListModelsInfoResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::AI21.ModelsInfoResponse.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => 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::AI21.ModelsInfoResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; } } + finally + { + __httpRequest?.Dispose(); + } } } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.V1ListPlans.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.V1ListPlans.g.cs index 320437c3..6fcdce06 100644 --- a/src/libs/AI21/Generated/AI21.Ai21Client.V1ListPlans.g.cs +++ b/src/libs/AI21/Generated/AI21.Ai21Client.V1ListPlans.g.cs @@ -14,6 +14,7 @@ public partial class Ai21Client { new global::AI21.EndPointAuthorizationRequirement { Type = "Http", + SchemeId = "HttpBearer", Location = "Header", Name = "Bearer", FriendlyName = "Bearer", @@ -44,10 +45,32 @@ partial void ProcessV1ListPlansResponseContent( /// List Plans /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// public async global::System.Threading.Tasks.Task V1ListPlansAsync( string assistantId, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await V1ListPlansAsResponseAsync( + assistantId: assistantId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// List Plans + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> V1ListPlansAsResponseAsync( + string assistantId, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( @@ -62,22 +85,44 @@ partial void ProcessV1ListPlansResponseContent( securityRequirements: s_V1ListPlansSecurityRequirements, operationName: "V1ListPlansAsync"); - var __pathBuilder = new global::AI21.PathBuilder( - path: $"/studio/v1/assistants/{assistantId}/plans", - 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)); + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: $"/studio/v1/assistants/{assistantId}/plans", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.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; + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; #endif foreach (var __authorization in __authorizations) { if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2") + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") { __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( scheme: __authorization.Name, @@ -87,150 +132,330 @@ partial void ProcessV1ListPlansResponseContent( __authorization.Location == "Header") { __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } + } } + global::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareV1ListPlansRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - assistantId: assistantId); + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareV1ListPlansRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + assistantId: assistantId!); - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); + return __httpRequest; + } - ProcessResponse( - client: HttpClient, - response: __response); - ProcessV1ListPlansResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Validation Error - if ((int)__response.StatusCode == 422) + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::AI21.HTTPValidationError? __value_422 = null; - try + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) { - if (ReadResponseAsString) + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1ListPlans", + methodName: "V1ListPlansAsync", + pathTemplate: "$\"/studio/v1/assistants/{assistantId}/plans\"", + 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 { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); } - else + catch (global::System.Net.Http.HttpRequestException __exception) { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1ListPlans", + methodName: "V1ListPlansAsync", + pathTemplate: "$\"/studio/v1/assistants/{assistantId}/plans\"", + 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; + } - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1ListPlans", + methodName: "V1ListPlansAsync", + pathTemplate: "$\"/studio/v1/assistants/{assistantId}/plans\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; } - catch (global::System.Exception __ex) + + if (__response == null) { - __exception_422 = __ex; + throw new global::System.InvalidOperationException("No response received."); } - throw new global::AI21.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) + using (__response) { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - ProcessResponseContent( + ProcessResponse( client: HttpClient, - response: __response, - content: ref __content); - ProcessV1ListPlansResponseContent( + response: __response); + ProcessV1ListPlansResponse( httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) { - __response.EnsureSuccessStatusCode(); - - return - global::AI21.ListPlansResponse.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1ListPlans", + methodName: "V1ListPlansAsync", + pathTemplate: "$\"/studio/v1/assistants/{assistantId}/plans\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } - catch (global::System.Exception __ex) + else { - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1ListPlans", + methodName: "V1ListPlansAsync", + pathTemplate: "$\"/studio/v1/assistants/{assistantId}/plans\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - using var __content = await __response.Content.ReadAsStreamAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::AI21.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - return - await global::AI21.ListPlansResponse.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) - { - } + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessV1ListPlansResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::AI21.ListPlansResponse.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => 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::AI21.ListPlansResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; } } + finally + { + __httpRequest?.Dispose(); + } } } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.V1ListRoutes.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.V1ListRoutes.g.cs index 0ac233b6..60fd072f 100644 --- a/src/libs/AI21/Generated/AI21.Ai21Client.V1ListRoutes.g.cs +++ b/src/libs/AI21/Generated/AI21.Ai21Client.V1ListRoutes.g.cs @@ -14,6 +14,7 @@ public partial class Ai21Client { new global::AI21.EndPointAuthorizationRequirement { Type = "Http", + SchemeId = "HttpBearer", Location = "Header", Name = "Bearer", FriendlyName = "Bearer", @@ -47,11 +48,36 @@ partial void ProcessV1ListRoutesResponseContent( /// /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// public async global::System.Threading.Tasks.Task V1ListRoutesAsync( string assistantId, string? name = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await V1ListRoutesAsResponseAsync( + assistantId: assistantId, + name: name, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Get Routes + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> V1ListRoutesAsResponseAsync( + string assistantId, + string? name = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( @@ -67,25 +93,47 @@ partial void ProcessV1ListRoutesResponseContent( securityRequirements: s_V1ListRoutesSecurityRequirements, operationName: "V1ListRoutesAsync"); - var __pathBuilder = new global::AI21.PathBuilder( - path: $"/studio/v1/assistants/{assistantId}/routes", - baseUri: HttpClient.BaseAddress); - __pathBuilder - .AddOptionalParameter("name", name) - ; - 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)); + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: $"/studio/v1/assistants/{assistantId}/routes", + baseUri: HttpClient.BaseAddress); + __pathBuilder + .AddOptionalParameter("name", name) + ; + var __path = __pathBuilder.ToString(); + __path = global::AI21.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; + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; #endif foreach (var __authorization in __authorizations) { if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2") + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") { __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( scheme: __authorization.Name, @@ -95,151 +143,331 @@ partial void ProcessV1ListRoutesResponseContent( __authorization.Location == "Header") { __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } + } } + global::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareV1ListRoutesRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - assistantId: assistantId, - name: name); + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareV1ListRoutesRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + assistantId: assistantId!, + name: name); - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); + return __httpRequest; + } - ProcessResponse( - client: HttpClient, - response: __response); - ProcessV1ListRoutesResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Validation Error - if ((int)__response.StatusCode == 422) + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::AI21.HTTPValidationError? __value_422 = null; - try + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) { - if (ReadResponseAsString) + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1ListRoutes", + methodName: "V1ListRoutesAsync", + pathTemplate: "$\"/studio/v1/assistants/{assistantId}/routes\"", + 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 { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); } - else + catch (global::System.Net.Http.HttpRequestException __exception) { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1ListRoutes", + methodName: "V1ListRoutesAsync", + pathTemplate: "$\"/studio/v1/assistants/{assistantId}/routes\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1ListRoutes", + methodName: "V1ListRoutesAsync", + pathTemplate: "$\"/studio/v1/assistants/{assistantId}/routes\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; } + + break; } - catch (global::System.Exception __ex) + + if (__response == null) { - __exception_422 = __ex; + throw new global::System.InvalidOperationException("No response received."); } - throw new global::AI21.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) + using (__response) { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - ProcessResponseContent( + ProcessResponse( client: HttpClient, - response: __response, - content: ref __content); - ProcessV1ListRoutesResponseContent( + response: __response); + ProcessV1ListRoutesResponse( httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) { - __response.EnsureSuccessStatusCode(); - - return - global::AI21.ListRoutesResponse.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1ListRoutes", + methodName: "V1ListRoutesAsync", + pathTemplate: "$\"/studio/v1/assistants/{assistantId}/routes\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } - catch (global::System.Exception __ex) + else { - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1ListRoutes", + methodName: "V1ListRoutesAsync", + pathTemplate: "$\"/studio/v1/assistants/{assistantId}/routes\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - using var __content = await __response.Content.ReadAsStreamAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::AI21.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - return - await global::AI21.ListRoutesResponse.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) - { - } + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessV1ListRoutesResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::AI21.ListRoutesResponse.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => 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::AI21.ListRoutesResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; } } + finally + { + __httpRequest?.Dispose(); + } } } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.V1MaestroRun.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.V1MaestroRun.g.cs index 775312ef..6131c1ae 100644 --- a/src/libs/AI21/Generated/AI21.Ai21Client.V1MaestroRun.g.cs +++ b/src/libs/AI21/Generated/AI21.Ai21Client.V1MaestroRun.g.cs @@ -14,6 +14,7 @@ public partial class Ai21Client { new global::AI21.EndPointAuthorizationRequirement { Type = "Http", + SchemeId = "HttpBearer", Location = "Header", Name = "Bearer", FriendlyName = "Bearer", @@ -44,11 +45,35 @@ partial void ProcessV1MaestroRunResponseContent( /// Create Maestro Run /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// public async global::System.Threading.Tasks.Task V1MaestroRunAsync( global::AI21.CreateMaestroRunsPayload request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await V1MaestroRunAsResponseAsync( + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Create Maestro Run + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> V1MaestroRunAsResponseAsync( + + global::AI21.CreateMaestroRunsPayload request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) { request = request ?? throw new global::System.ArgumentNullException(nameof(request)); @@ -65,22 +90,44 @@ partial void ProcessV1MaestroRunResponseContent( securityRequirements: s_V1MaestroRunSecurityRequirements, operationName: "V1MaestroRunAsync"); - var __pathBuilder = new global::AI21.PathBuilder( - path: "/studio/v1/maestro/runs", - 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)); + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: false); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: "/studio/v1/maestro/runs", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.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; + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; #endif foreach (var __authorization in __authorizations) { if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2") + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") { __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( scheme: __authorization.Name, @@ -90,156 +137,336 @@ partial void ProcessV1MaestroRunResponseContent( __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); - PrepareV1MaestroRunRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - request: request); + 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::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareV1MaestroRunRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + request: request); - ProcessResponse( - client: HttpClient, - response: __response); - ProcessV1MaestroRunResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Validation Error - if ((int)__response.StatusCode == 422) + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::AI21.HTTPValidationError? __value_422 = null; - try + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) { - if (ReadResponseAsString) + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1MaestroRun", + methodName: "V1MaestroRunAsync", + pathTemplate: "\"/studio/v1/maestro/runs\"", + 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 { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); } - else + catch (global::System.Net.Http.HttpRequestException __exception) { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1MaestroRun", + methodName: "V1MaestroRunAsync", + pathTemplate: "\"/studio/v1/maestro/runs\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1MaestroRun", + methodName: "V1MaestroRunAsync", + pathTemplate: "\"/studio/v1/maestro/runs\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; } + + break; } - catch (global::System.Exception __ex) + + if (__response == null) { - __exception_422 = __ex; + throw new global::System.InvalidOperationException("No response received."); } - throw new global::AI21.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) + using (__response) { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - ProcessResponseContent( + ProcessResponse( client: HttpClient, - response: __response, - content: ref __content); - ProcessV1MaestroRunResponseContent( + response: __response); + ProcessV1MaestroRunResponse( httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) { - __response.EnsureSuccessStatusCode(); - - return - global::AI21.MaestroRunResult.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1MaestroRun", + methodName: "V1MaestroRunAsync", + pathTemplate: "\"/studio/v1/maestro/runs\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } - catch (global::System.Exception __ex) + else { - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1MaestroRun", + methodName: "V1MaestroRunAsync", + pathTemplate: "\"/studio/v1/maestro/runs\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - using var __content = await __response.Content.ReadAsStreamAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::AI21.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - return - await global::AI21.MaestroRunResult.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) - { - } + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessV1MaestroRunResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::AI21.MaestroRunResult.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => 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::AI21.MaestroRunResult.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; } } + finally + { + __httpRequest?.Dispose(); + } } /// /// Create Maestro Run @@ -278,6 +505,7 @@ partial void ProcessV1MaestroRunResponseContent( /// be 1. A streaming response is different than the non-streaming response.
/// 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 V1MaestroRunAsync( @@ -298,6 +526,7 @@ partial void ProcessV1MaestroRunResponseContent( global::AI21.CreateMaestroRunsPayloadResponseLanguage? responseLanguage = default, string? systemPrompt = default, bool? stream = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) { var __request = new global::AI21.CreateMaestroRunsPayload @@ -323,6 +552,7 @@ partial void ProcessV1MaestroRunResponseContent( return await V1MaestroRunAsync( request: __request, + requestOptions: requestOptions, cancellationToken: cancellationToken).ConfigureAwait(false); } } diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.V1ModifyAssistant.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.V1ModifyAssistant.g.cs index 328101e0..1c6cf137 100644 --- a/src/libs/AI21/Generated/AI21.Ai21Client.V1ModifyAssistant.g.cs +++ b/src/libs/AI21/Generated/AI21.Ai21Client.V1ModifyAssistant.g.cs @@ -14,6 +14,7 @@ public partial class Ai21Client { new global::AI21.EndPointAuthorizationRequirement { Type = "Http", + SchemeId = "HttpBearer", Location = "Header", Name = "Bearer", FriendlyName = "Bearer", @@ -47,12 +48,39 @@ partial void ProcessV1ModifyAssistantResponseContent( ///
/// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// public async global::System.Threading.Tasks.Task V1ModifyAssistantAsync( string assistantId, global::AI21.ModifyAssistantRequest request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await V1ModifyAssistantAsResponseAsync( + assistantId: assistantId, + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Modify Assistant + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> V1ModifyAssistantAsResponseAsync( + string assistantId, + + global::AI21.ModifyAssistantRequest request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) { request = request ?? throw new global::System.ArgumentNullException(nameof(request)); @@ -70,22 +98,44 @@ partial void ProcessV1ModifyAssistantResponseContent( securityRequirements: s_V1ModifyAssistantSecurityRequirements, operationName: "V1ModifyAssistantAsync"); - var __pathBuilder = new global::AI21.PathBuilder( - path: $"/studio/v1/assistants/{assistantId}", - 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)); + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: $"/studio/v1/assistants/{assistantId}", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.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; + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; #endif foreach (var __authorization in __authorizations) { if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2") + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") { __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( scheme: __authorization.Name, @@ -95,157 +145,337 @@ partial void ProcessV1ModifyAssistantResponseContent( __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); - PrepareV1ModifyAssistantRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - assistantId: assistantId, - request: request); + 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::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareV1ModifyAssistantRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + assistantId: assistantId!, + request: request); - ProcessResponse( - client: HttpClient, - response: __response); - ProcessV1ModifyAssistantResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Validation Error - if ((int)__response.StatusCode == 422) + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::AI21.HTTPValidationError? __value_422 = null; - try + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) { - if (ReadResponseAsString) + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1ModifyAssistant", + methodName: "V1ModifyAssistantAsync", + pathTemplate: "$\"/studio/v1/assistants/{assistantId}\"", + 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 { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); } - else + catch (global::System.Net.Http.HttpRequestException __exception) { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1ModifyAssistant", + methodName: "V1ModifyAssistantAsync", + pathTemplate: "$\"/studio/v1/assistants/{assistantId}\"", + 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; + } - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1ModifyAssistant", + methodName: "V1ModifyAssistantAsync", + pathTemplate: "$\"/studio/v1/assistants/{assistantId}\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; } - catch (global::System.Exception __ex) + + if (__response == null) { - __exception_422 = __ex; + throw new global::System.InvalidOperationException("No response received."); } - throw new global::AI21.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) + using (__response) { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( + ProcessResponse( client: HttpClient, - response: __response, - content: ref __content); - ProcessV1ModifyAssistantResponseContent( + response: __response); + ProcessV1ModifyAssistantResponse( httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) { - __response.EnsureSuccessStatusCode(); - - return - global::AI21.Assistant.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1ModifyAssistant", + methodName: "V1ModifyAssistantAsync", + pathTemplate: "$\"/studio/v1/assistants/{assistantId}\"", + 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); } - catch (global::System.Exception __ex) + else { - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1ModifyAssistant", + methodName: "V1ModifyAssistantAsync", + pathTemplate: "$\"/studio/v1/assistants/{assistantId}\"", + 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 - { - try - { - __response.EnsureSuccessStatusCode(); - using var __content = await __response.Content.ReadAsStreamAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::AI21.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - return - await global::AI21.Assistant.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) - { - } + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessV1ModifyAssistantResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::AI21.Assistant.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => 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::AI21.Assistant.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; } } + finally + { + __httpRequest?.Dispose(); + } } /// /// Modify Assistant @@ -273,6 +503,7 @@ partial void ProcessV1ModifyAssistantResponseContent( /// /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// public async global::System.Threading.Tasks.Task V1ModifyAssistantAsync( @@ -291,6 +522,7 @@ partial void ProcessV1ModifyAssistantResponseContent( string? systemPrompt = default, global::AI21.WorkflowConfig? workflowConfig = default, object? configOverrides = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) { var __request = new global::AI21.ModifyAssistantRequest @@ -314,6 +546,7 @@ partial void ProcessV1ModifyAssistantResponseContent( return await V1ModifyAssistantAsync( assistantId: assistantId, request: __request, + requestOptions: requestOptions, cancellationToken: cancellationToken).ConfigureAwait(false); } } diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.V1ModifyPlan.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.V1ModifyPlan.g.cs index b1aaa55d..539c658d 100644 --- a/src/libs/AI21/Generated/AI21.Ai21Client.V1ModifyPlan.g.cs +++ b/src/libs/AI21/Generated/AI21.Ai21Client.V1ModifyPlan.g.cs @@ -14,6 +14,7 @@ public partial class Ai21Client { new global::AI21.EndPointAuthorizationRequirement { Type = "Http", + SchemeId = "HttpBearer", Location = "Header", Name = "Bearer", FriendlyName = "Bearer", @@ -50,6 +51,7 @@ partial void ProcessV1ModifyPlanResponseContent( /// /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// public async global::System.Threading.Tasks.Task V1ModifyPlanAsync( @@ -57,6 +59,35 @@ partial void ProcessV1ModifyPlanResponseContent( string assistantId, global::AI21.CreatePlanPayload request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await V1ModifyPlanAsResponseAsync( + planId: planId, + assistantId: assistantId, + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Modify Plan + /// + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> V1ModifyPlanAsResponseAsync( + string planId, + string assistantId, + + global::AI21.CreatePlanPayload request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) { request = request ?? throw new global::System.ArgumentNullException(nameof(request)); @@ -75,22 +106,44 @@ partial void ProcessV1ModifyPlanResponseContent( securityRequirements: s_V1ModifyPlanSecurityRequirements, operationName: "V1ModifyPlanAsync"); - var __pathBuilder = new global::AI21.PathBuilder( - path: $"/studio/v1/assistants/{assistantId}/plans/{planId}", - 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)); + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: $"/studio/v1/assistants/{assistantId}/plans/{planId}", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.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; + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; #endif foreach (var __authorization in __authorizations) { if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2") + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") { __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( scheme: __authorization.Name, @@ -100,158 +153,338 @@ partial void ProcessV1ModifyPlanResponseContent( __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); - PrepareV1ModifyPlanRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - planId: planId, - assistantId: assistantId, - request: request); + 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::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareV1ModifyPlanRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + planId: planId!, + assistantId: assistantId!, + request: request); - ProcessResponse( - client: HttpClient, - response: __response); - ProcessV1ModifyPlanResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Validation Error - if ((int)__response.StatusCode == 422) + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::AI21.HTTPValidationError? __value_422 = null; - try + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) { - if (ReadResponseAsString) + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1ModifyPlan", + methodName: "V1ModifyPlanAsync", + pathTemplate: "$\"/studio/v1/assistants/{assistantId}/plans/{planId}\"", + 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 { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); } - else + catch (global::System.Net.Http.HttpRequestException __exception) { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1ModifyPlan", + methodName: "V1ModifyPlanAsync", + pathTemplate: "$\"/studio/v1/assistants/{assistantId}/plans/{planId}\"", + 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; + } - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1ModifyPlan", + methodName: "V1ModifyPlanAsync", + pathTemplate: "$\"/studio/v1/assistants/{assistantId}/plans/{planId}\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; } - catch (global::System.Exception __ex) + + if (__response == null) { - __exception_422 = __ex; + throw new global::System.InvalidOperationException("No response received."); } - throw new global::AI21.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) + using (__response) { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - ProcessResponseContent( + ProcessResponse( client: HttpClient, - response: __response, - content: ref __content); - ProcessV1ModifyPlanResponseContent( + response: __response); + ProcessV1ModifyPlanResponse( httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) { - __response.EnsureSuccessStatusCode(); - - return - global::AI21.Plan.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1ModifyPlan", + methodName: "V1ModifyPlanAsync", + pathTemplate: "$\"/studio/v1/assistants/{assistantId}/plans/{planId}\"", + 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); } - catch (global::System.Exception __ex) + else { - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1ModifyPlan", + methodName: "V1ModifyPlanAsync", + pathTemplate: "$\"/studio/v1/assistants/{assistantId}/plans/{planId}\"", + 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 - { - try - { - __response.EnsureSuccessStatusCode(); - using var __content = await __response.Content.ReadAsStreamAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::AI21.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - return - await global::AI21.Plan.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) - { - } + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessV1ModifyPlanResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::AI21.Plan.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => 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::AI21.Plan.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; } } + finally + { + __httpRequest?.Dispose(); + } } /// /// Modify Plan @@ -260,6 +493,7 @@ partial void ProcessV1ModifyPlanResponseContent( /// /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// public async global::System.Threading.Tasks.Task V1ModifyPlanAsync( @@ -267,6 +501,7 @@ partial void ProcessV1ModifyPlanResponseContent( string assistantId, string code, global::System.Collections.Generic.IList? schemas = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) { var __request = new global::AI21.CreatePlanPayload @@ -279,6 +514,7 @@ partial void ProcessV1ModifyPlanResponseContent( planId: planId, assistantId: assistantId, request: __request, + requestOptions: requestOptions, cancellationToken: cancellationToken).ConfigureAwait(false); } } diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.V1ModifyRoute.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.V1ModifyRoute.g.cs index af3b476a..20162ed6 100644 --- a/src/libs/AI21/Generated/AI21.Ai21Client.V1ModifyRoute.g.cs +++ b/src/libs/AI21/Generated/AI21.Ai21Client.V1ModifyRoute.g.cs @@ -14,6 +14,7 @@ public partial class Ai21Client { new global::AI21.EndPointAuthorizationRequirement { Type = "Http", + SchemeId = "HttpBearer", Location = "Header", Name = "Bearer", FriendlyName = "Bearer", @@ -50,6 +51,7 @@ partial void ProcessV1ModifyRouteResponseContent( /// /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// public async global::System.Threading.Tasks.Task V1ModifyRouteAsync( @@ -57,6 +59,35 @@ partial void ProcessV1ModifyRouteResponseContent( string assistantId, global::AI21.UpdateRoutePayload request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await V1ModifyRouteAsResponseAsync( + routeId: routeId, + assistantId: assistantId, + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Modify Route + /// + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> V1ModifyRouteAsResponseAsync( + string routeId, + string assistantId, + + global::AI21.UpdateRoutePayload request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) { request = request ?? throw new global::System.ArgumentNullException(nameof(request)); @@ -75,22 +106,44 @@ partial void ProcessV1ModifyRouteResponseContent( securityRequirements: s_V1ModifyRouteSecurityRequirements, operationName: "V1ModifyRouteAsync"); - var __pathBuilder = new global::AI21.PathBuilder( - path: $"/studio/v1/assistants/{assistantId}/routes/{routeId}", - 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)); + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: $"/studio/v1/assistants/{assistantId}/routes/{routeId}", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.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; + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; #endif foreach (var __authorization in __authorizations) { if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2") + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") { __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( scheme: __authorization.Name, @@ -100,158 +153,338 @@ partial void ProcessV1ModifyRouteResponseContent( __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); - PrepareV1ModifyRouteRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - routeId: routeId, - assistantId: assistantId, - request: request); + 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::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareV1ModifyRouteRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + routeId: routeId!, + assistantId: assistantId!, + request: request); - ProcessResponse( - client: HttpClient, - response: __response); - ProcessV1ModifyRouteResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Validation Error - if ((int)__response.StatusCode == 422) + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::AI21.HTTPValidationError? __value_422 = null; - try + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) { - if (ReadResponseAsString) + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1ModifyRoute", + methodName: "V1ModifyRouteAsync", + pathTemplate: "$\"/studio/v1/assistants/{assistantId}/routes/{routeId}\"", + 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 { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); } - else + catch (global::System.Net.Http.HttpRequestException __exception) { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1ModifyRoute", + methodName: "V1ModifyRouteAsync", + pathTemplate: "$\"/studio/v1/assistants/{assistantId}/routes/{routeId}\"", + 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; + } - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1ModifyRoute", + methodName: "V1ModifyRouteAsync", + pathTemplate: "$\"/studio/v1/assistants/{assistantId}/routes/{routeId}\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; } - catch (global::System.Exception __ex) + + if (__response == null) { - __exception_422 = __ex; + throw new global::System.InvalidOperationException("No response received."); } - throw new global::AI21.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) + using (__response) { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - ProcessResponseContent( + ProcessResponse( client: HttpClient, - response: __response, - content: ref __content); - ProcessV1ModifyRouteResponseContent( + response: __response); + ProcessV1ModifyRouteResponse( httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) { - __response.EnsureSuccessStatusCode(); - - return - global::AI21.AssistantRoute.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1ModifyRoute", + methodName: "V1ModifyRouteAsync", + pathTemplate: "$\"/studio/v1/assistants/{assistantId}/routes/{routeId}\"", + 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); } - catch (global::System.Exception __ex) + else { - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1ModifyRoute", + methodName: "V1ModifyRouteAsync", + pathTemplate: "$\"/studio/v1/assistants/{assistantId}/routes/{routeId}\"", + 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 - { - try - { - __response.EnsureSuccessStatusCode(); - using var __content = await __response.Content.ReadAsStreamAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::AI21.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - return - await global::AI21.AssistantRoute.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) - { - } + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessV1ModifyRouteResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::AI21.AssistantRoute.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => 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::AI21.AssistantRoute.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; } } + finally + { + __httpRequest?.Dispose(); + } } /// /// Modify Route @@ -260,6 +493,7 @@ partial void ProcessV1ModifyRouteResponseContent( /// /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// public async global::System.Threading.Tasks.Task V1ModifyRouteAsync( @@ -267,6 +501,7 @@ partial void ProcessV1ModifyRouteResponseContent( string assistantId, string description, global::System.Collections.Generic.IList? examples = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) { var __request = new global::AI21.UpdateRoutePayload @@ -279,6 +514,7 @@ partial void ProcessV1ModifyRouteResponseContent( routeId: routeId, assistantId: assistantId, request: __request, + requestOptions: requestOptions, cancellationToken: cancellationToken).ConfigureAwait(false); } } diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.V1RunAssistant.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.V1RunAssistant.g.cs index 094792fc..407c1f36 100644 --- a/src/libs/AI21/Generated/AI21.Ai21Client.V1RunAssistant.g.cs +++ b/src/libs/AI21/Generated/AI21.Ai21Client.V1RunAssistant.g.cs @@ -14,6 +14,7 @@ public partial class Ai21Client { new global::AI21.EndPointAuthorizationRequirement { Type = "Http", + SchemeId = "HttpBearer", Location = "Header", Name = "Bearer", FriendlyName = "Bearer", @@ -47,12 +48,39 @@ partial void ProcessV1RunAssistantResponseContent( /// /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// public async global::System.Threading.Tasks.Task V1RunAssistantAsync( string assistantId, global::AI21.RunAssistantRequest request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await V1RunAssistantAsResponseAsync( + assistantId: assistantId, + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Run Assistant + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> V1RunAssistantAsResponseAsync( + string assistantId, + + global::AI21.RunAssistantRequest request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) { request = request ?? throw new global::System.ArgumentNullException(nameof(request)); @@ -70,22 +98,44 @@ partial void ProcessV1RunAssistantResponseContent( securityRequirements: s_V1RunAssistantSecurityRequirements, operationName: "V1RunAssistantAsync"); - var __pathBuilder = new global::AI21.PathBuilder( - path: $"/studio/v1/assistants/{assistantId}/run", - 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)); + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: $"/studio/v1/assistants/{assistantId}/run", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.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; + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; #endif foreach (var __authorization in __authorizations) { if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2") + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") { __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( scheme: __authorization.Name, @@ -95,157 +145,337 @@ partial void ProcessV1RunAssistantResponseContent( __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); - PrepareV1RunAssistantRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - assistantId: assistantId, - request: request); + 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::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareV1RunAssistantRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + assistantId: assistantId!, + request: request); - ProcessResponse( - client: HttpClient, - response: __response); - ProcessV1RunAssistantResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Validation Error - if ((int)__response.StatusCode == 422) + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::AI21.HTTPValidationError? __value_422 = null; - try + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) { - if (ReadResponseAsString) + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1RunAssistant", + methodName: "V1RunAssistantAsync", + pathTemplate: "$\"/studio/v1/assistants/{assistantId}/run\"", + 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 { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); } - else + catch (global::System.Net.Http.HttpRequestException __exception) { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1RunAssistant", + methodName: "V1RunAssistantAsync", + pathTemplate: "$\"/studio/v1/assistants/{assistantId}/run\"", + 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; + } - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1RunAssistant", + methodName: "V1RunAssistantAsync", + pathTemplate: "$\"/studio/v1/assistants/{assistantId}/run\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; } - catch (global::System.Exception __ex) + + if (__response == null) { - __exception_422 = __ex; + throw new global::System.InvalidOperationException("No response received."); } - throw new global::AI21.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) + using (__response) { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( + ProcessResponse( client: HttpClient, - response: __response, - content: ref __content); - ProcessV1RunAssistantResponseContent( + response: __response); + ProcessV1RunAssistantResponse( httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) { - __response.EnsureSuccessStatusCode(); - - return - global::AI21.MaestroRunResult.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1RunAssistant", + methodName: "V1RunAssistantAsync", + pathTemplate: "$\"/studio/v1/assistants/{assistantId}/run\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } - catch (global::System.Exception __ex) + else { - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1RunAssistant", + methodName: "V1RunAssistantAsync", + pathTemplate: "$\"/studio/v1/assistants/{assistantId}/run\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - using var __content = await __response.Content.ReadAsStreamAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::AI21.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - return - await global::AI21.MaestroRunResult.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) - { - } + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessV1RunAssistantResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::AI21.MaestroRunResult.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => 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::AI21.MaestroRunResult.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; } } + finally + { + __httpRequest?.Dispose(); + } } /// /// Run Assistant @@ -269,6 +499,7 @@ partial void ProcessV1RunAssistantResponseContent( /// Default Value: unset /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// public async global::System.Threading.Tasks.Task V1RunAssistantAsync( @@ -281,6 +512,7 @@ partial void ProcessV1RunAssistantResponseContent( bool? dynamicPlanningEnabled = default, global::AI21.RunAssistantRequestResponseLanguage? responseLanguage = default, string? systemPrompt = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) { var __request = new global::AI21.RunAssistantRequest @@ -298,6 +530,7 @@ partial void ProcessV1RunAssistantResponseContent( return await V1RunAssistantAsync( assistantId: assistantId, request: __request, + requestOptions: requestOptions, cancellationToken: cancellationToken).ConfigureAwait(false); } } diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsFdBatchesV1Classifications.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsFdBatchesV1Classifications.g.cs new file mode 100644 index 00000000..9a4d1a2d --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsFdBatchesV1Classifications.g.cs @@ -0,0 +1,411 @@ + +#nullable enable + +namespace AI21 +{ + public partial class Ai21Client + { + + + private static readonly global::AI21.EndPointSecurityRequirement s_V1SolutionsFdBatchesV1ClassificationsSecurityRequirement0 = + new global::AI21.EndPointSecurityRequirement + { + Authorizations = new global::AI21.EndPointAuthorizationRequirement[] + { new global::AI21.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::AI21.EndPointSecurityRequirement[] s_V1SolutionsFdBatchesV1ClassificationsSecurityRequirements = + new global::AI21.EndPointSecurityRequirement[] + { s_V1SolutionsFdBatchesV1ClassificationsSecurityRequirement0, + }; + partial void PrepareV1SolutionsFdBatchesV1ClassificationsArguments( + global::System.Net.Http.HttpClient httpClient); + partial void PrepareV1SolutionsFdBatchesV1ClassificationsRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage); + partial void ProcessV1SolutionsFdBatchesV1ClassificationsResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessV1SolutionsFdBatchesV1ClassificationsResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Fnac Batch Classifications + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task V1SolutionsFdBatchesV1ClassificationsAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await V1SolutionsFdBatchesV1ClassificationsAsResponseAsync( + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Fnac Batch Classifications + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> V1SolutionsFdBatchesV1ClassificationsAsResponseAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareV1SolutionsFdBatchesV1ClassificationsArguments( + httpClient: HttpClient); + + + var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_V1SolutionsFdBatchesV1ClassificationsSecurityRequirements, + operationName: "V1SolutionsFdBatchesV1ClassificationsAsync"); + + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: "/solutions/fd/batches/v1/classifications", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.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); + } + } + global::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareV1SolutionsFdBatchesV1ClassificationsRequest( + 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::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsFdBatchesV1Classifications", + methodName: "V1SolutionsFdBatchesV1ClassificationsAsync", + pathTemplate: "\"/solutions/fd/batches/v1/classifications\"", + 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::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsFdBatchesV1Classifications", + methodName: "V1SolutionsFdBatchesV1ClassificationsAsync", + pathTemplate: "\"/solutions/fd/batches/v1/classifications\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsFdBatchesV1Classifications", + methodName: "V1SolutionsFdBatchesV1ClassificationsAsync", + pathTemplate: "\"/solutions/fd/batches/v1/classifications\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessV1SolutionsFdBatchesV1ClassificationsResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsFdBatchesV1Classifications", + methodName: "V1SolutionsFdBatchesV1ClassificationsAsync", + pathTemplate: "\"/solutions/fd/batches/v1/classifications\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsFdBatchesV1Classifications", + methodName: "V1SolutionsFdBatchesV1ClassificationsAsync", + pathTemplate: "\"/solutions/fd/batches/v1/classifications\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __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); + ProcessV1SolutionsFdBatchesV1ClassificationsResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? 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::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.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::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsFdBatchesV1ClassificationsResults.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsFdBatchesV1ClassificationsResults.g.cs new file mode 100644 index 00000000..1b07b038 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsFdBatchesV1ClassificationsResults.g.cs @@ -0,0 +1,457 @@ + +#nullable enable + +namespace AI21 +{ + public partial class Ai21Client + { + + + private static readonly global::AI21.EndPointSecurityRequirement s_V1SolutionsFdBatchesV1ClassificationsResultsSecurityRequirement0 = + new global::AI21.EndPointSecurityRequirement + { + Authorizations = new global::AI21.EndPointAuthorizationRequirement[] + { new global::AI21.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::AI21.EndPointSecurityRequirement[] s_V1SolutionsFdBatchesV1ClassificationsResultsSecurityRequirements = + new global::AI21.EndPointSecurityRequirement[] + { s_V1SolutionsFdBatchesV1ClassificationsResultsSecurityRequirement0, + }; + partial void PrepareV1SolutionsFdBatchesV1ClassificationsResultsArguments( + global::System.Net.Http.HttpClient httpClient, + ref string batchId); + partial void PrepareV1SolutionsFdBatchesV1ClassificationsResultsRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string batchId); + partial void ProcessV1SolutionsFdBatchesV1ClassificationsResultsResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessV1SolutionsFdBatchesV1ClassificationsResultsResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Fnac Batch Classifications Results + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task V1SolutionsFdBatchesV1ClassificationsResultsAsync( + string batchId, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await V1SolutionsFdBatchesV1ClassificationsResultsAsResponseAsync( + batchId: batchId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Fnac Batch Classifications Results + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> V1SolutionsFdBatchesV1ClassificationsResultsAsResponseAsync( + string batchId, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareV1SolutionsFdBatchesV1ClassificationsResultsArguments( + httpClient: HttpClient, + batchId: ref batchId); + + + var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_V1SolutionsFdBatchesV1ClassificationsResultsSecurityRequirements, + operationName: "V1SolutionsFdBatchesV1ClassificationsResultsAsync"); + + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: $"/solutions/fd/batches/v1/classifications/{batchId}/results", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.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); + } + } + global::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareV1SolutionsFdBatchesV1ClassificationsResultsRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + batchId: batchId!); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsFdBatchesV1ClassificationsResults", + methodName: "V1SolutionsFdBatchesV1ClassificationsResultsAsync", + pathTemplate: "$\"/solutions/fd/batches/v1/classifications/{batchId}/results\"", + 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::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsFdBatchesV1ClassificationsResults", + methodName: "V1SolutionsFdBatchesV1ClassificationsResultsAsync", + pathTemplate: "$\"/solutions/fd/batches/v1/classifications/{batchId}/results\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsFdBatchesV1ClassificationsResults", + methodName: "V1SolutionsFdBatchesV1ClassificationsResultsAsync", + pathTemplate: "$\"/solutions/fd/batches/v1/classifications/{batchId}/results\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessV1SolutionsFdBatchesV1ClassificationsResultsResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsFdBatchesV1ClassificationsResults", + methodName: "V1SolutionsFdBatchesV1ClassificationsResultsAsync", + pathTemplate: "$\"/solutions/fd/batches/v1/classifications/{batchId}/results\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsFdBatchesV1ClassificationsResults", + methodName: "V1SolutionsFdBatchesV1ClassificationsResultsAsync", + pathTemplate: "$\"/solutions/fd/batches/v1/classifications/{batchId}/results\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __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::AI21.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessV1SolutionsFdBatchesV1ClassificationsResultsResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? 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::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.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::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsFdBatchesV1ClassificationsStatus.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsFdBatchesV1ClassificationsStatus.g.cs new file mode 100644 index 00000000..b06f04e1 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsFdBatchesV1ClassificationsStatus.g.cs @@ -0,0 +1,457 @@ + +#nullable enable + +namespace AI21 +{ + public partial class Ai21Client + { + + + private static readonly global::AI21.EndPointSecurityRequirement s_V1SolutionsFdBatchesV1ClassificationsStatusSecurityRequirement0 = + new global::AI21.EndPointSecurityRequirement + { + Authorizations = new global::AI21.EndPointAuthorizationRequirement[] + { new global::AI21.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::AI21.EndPointSecurityRequirement[] s_V1SolutionsFdBatchesV1ClassificationsStatusSecurityRequirements = + new global::AI21.EndPointSecurityRequirement[] + { s_V1SolutionsFdBatchesV1ClassificationsStatusSecurityRequirement0, + }; + partial void PrepareV1SolutionsFdBatchesV1ClassificationsStatusArguments( + global::System.Net.Http.HttpClient httpClient, + ref string batchId); + partial void PrepareV1SolutionsFdBatchesV1ClassificationsStatusRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string batchId); + partial void ProcessV1SolutionsFdBatchesV1ClassificationsStatusResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessV1SolutionsFdBatchesV1ClassificationsStatusResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Fnac Batch Classifications 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 V1SolutionsFdBatchesV1ClassificationsStatusAsync( + string batchId, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await V1SolutionsFdBatchesV1ClassificationsStatusAsResponseAsync( + batchId: batchId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Fnac Batch Classifications 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> V1SolutionsFdBatchesV1ClassificationsStatusAsResponseAsync( + string batchId, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareV1SolutionsFdBatchesV1ClassificationsStatusArguments( + httpClient: HttpClient, + batchId: ref batchId); + + + var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_V1SolutionsFdBatchesV1ClassificationsStatusSecurityRequirements, + operationName: "V1SolutionsFdBatchesV1ClassificationsStatusAsync"); + + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: $"/solutions/fd/batches/v1/classifications/{batchId}/status", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.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); + } + } + global::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareV1SolutionsFdBatchesV1ClassificationsStatusRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + batchId: batchId!); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsFdBatchesV1ClassificationsStatus", + methodName: "V1SolutionsFdBatchesV1ClassificationsStatusAsync", + pathTemplate: "$\"/solutions/fd/batches/v1/classifications/{batchId}/status\"", + 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::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsFdBatchesV1ClassificationsStatus", + methodName: "V1SolutionsFdBatchesV1ClassificationsStatusAsync", + pathTemplate: "$\"/solutions/fd/batches/v1/classifications/{batchId}/status\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsFdBatchesV1ClassificationsStatus", + methodName: "V1SolutionsFdBatchesV1ClassificationsStatusAsync", + pathTemplate: "$\"/solutions/fd/batches/v1/classifications/{batchId}/status\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessV1SolutionsFdBatchesV1ClassificationsStatusResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsFdBatchesV1ClassificationsStatus", + methodName: "V1SolutionsFdBatchesV1ClassificationsStatusAsync", + pathTemplate: "$\"/solutions/fd/batches/v1/classifications/{batchId}/status\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsFdBatchesV1ClassificationsStatus", + methodName: "V1SolutionsFdBatchesV1ClassificationsStatusAsync", + pathTemplate: "$\"/solutions/fd/batches/v1/classifications/{batchId}/status\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __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::AI21.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessV1SolutionsFdBatchesV1ClassificationsStatusResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? 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::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.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::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsFdBatchesV1Descriptions.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsFdBatchesV1Descriptions.g.cs new file mode 100644 index 00000000..102fa6ef --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsFdBatchesV1Descriptions.g.cs @@ -0,0 +1,411 @@ + +#nullable enable + +namespace AI21 +{ + public partial class Ai21Client + { + + + private static readonly global::AI21.EndPointSecurityRequirement s_V1SolutionsFdBatchesV1DescriptionsSecurityRequirement0 = + new global::AI21.EndPointSecurityRequirement + { + Authorizations = new global::AI21.EndPointAuthorizationRequirement[] + { new global::AI21.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::AI21.EndPointSecurityRequirement[] s_V1SolutionsFdBatchesV1DescriptionsSecurityRequirements = + new global::AI21.EndPointSecurityRequirement[] + { s_V1SolutionsFdBatchesV1DescriptionsSecurityRequirement0, + }; + partial void PrepareV1SolutionsFdBatchesV1DescriptionsArguments( + global::System.Net.Http.HttpClient httpClient); + partial void PrepareV1SolutionsFdBatchesV1DescriptionsRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage); + partial void ProcessV1SolutionsFdBatchesV1DescriptionsResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessV1SolutionsFdBatchesV1DescriptionsResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Fnac Batch Descriptions + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task V1SolutionsFdBatchesV1DescriptionsAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await V1SolutionsFdBatchesV1DescriptionsAsResponseAsync( + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Fnac Batch Descriptions + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> V1SolutionsFdBatchesV1DescriptionsAsResponseAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareV1SolutionsFdBatchesV1DescriptionsArguments( + httpClient: HttpClient); + + + var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_V1SolutionsFdBatchesV1DescriptionsSecurityRequirements, + operationName: "V1SolutionsFdBatchesV1DescriptionsAsync"); + + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: "/solutions/fd/batches/v1/descriptions", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.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); + } + } + global::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareV1SolutionsFdBatchesV1DescriptionsRequest( + 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::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsFdBatchesV1Descriptions", + methodName: "V1SolutionsFdBatchesV1DescriptionsAsync", + pathTemplate: "\"/solutions/fd/batches/v1/descriptions\"", + 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::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsFdBatchesV1Descriptions", + methodName: "V1SolutionsFdBatchesV1DescriptionsAsync", + pathTemplate: "\"/solutions/fd/batches/v1/descriptions\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsFdBatchesV1Descriptions", + methodName: "V1SolutionsFdBatchesV1DescriptionsAsync", + pathTemplate: "\"/solutions/fd/batches/v1/descriptions\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessV1SolutionsFdBatchesV1DescriptionsResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsFdBatchesV1Descriptions", + methodName: "V1SolutionsFdBatchesV1DescriptionsAsync", + pathTemplate: "\"/solutions/fd/batches/v1/descriptions\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsFdBatchesV1Descriptions", + methodName: "V1SolutionsFdBatchesV1DescriptionsAsync", + pathTemplate: "\"/solutions/fd/batches/v1/descriptions\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __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); + ProcessV1SolutionsFdBatchesV1DescriptionsResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? 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::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.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::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsFdBatchesV1DescriptionsResults.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsFdBatchesV1DescriptionsResults.g.cs new file mode 100644 index 00000000..224e7ea8 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsFdBatchesV1DescriptionsResults.g.cs @@ -0,0 +1,457 @@ + +#nullable enable + +namespace AI21 +{ + public partial class Ai21Client + { + + + private static readonly global::AI21.EndPointSecurityRequirement s_V1SolutionsFdBatchesV1DescriptionsResultsSecurityRequirement0 = + new global::AI21.EndPointSecurityRequirement + { + Authorizations = new global::AI21.EndPointAuthorizationRequirement[] + { new global::AI21.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::AI21.EndPointSecurityRequirement[] s_V1SolutionsFdBatchesV1DescriptionsResultsSecurityRequirements = + new global::AI21.EndPointSecurityRequirement[] + { s_V1SolutionsFdBatchesV1DescriptionsResultsSecurityRequirement0, + }; + partial void PrepareV1SolutionsFdBatchesV1DescriptionsResultsArguments( + global::System.Net.Http.HttpClient httpClient, + ref string batchId); + partial void PrepareV1SolutionsFdBatchesV1DescriptionsResultsRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string batchId); + partial void ProcessV1SolutionsFdBatchesV1DescriptionsResultsResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessV1SolutionsFdBatchesV1DescriptionsResultsResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Fnac Batch Descriptions Results + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task V1SolutionsFdBatchesV1DescriptionsResultsAsync( + string batchId, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await V1SolutionsFdBatchesV1DescriptionsResultsAsResponseAsync( + batchId: batchId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Fnac Batch Descriptions Results + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> V1SolutionsFdBatchesV1DescriptionsResultsAsResponseAsync( + string batchId, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareV1SolutionsFdBatchesV1DescriptionsResultsArguments( + httpClient: HttpClient, + batchId: ref batchId); + + + var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_V1SolutionsFdBatchesV1DescriptionsResultsSecurityRequirements, + operationName: "V1SolutionsFdBatchesV1DescriptionsResultsAsync"); + + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: $"/solutions/fd/batches/v1/descriptions/{batchId}/results", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.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); + } + } + global::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareV1SolutionsFdBatchesV1DescriptionsResultsRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + batchId: batchId!); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsFdBatchesV1DescriptionsResults", + methodName: "V1SolutionsFdBatchesV1DescriptionsResultsAsync", + pathTemplate: "$\"/solutions/fd/batches/v1/descriptions/{batchId}/results\"", + 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::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsFdBatchesV1DescriptionsResults", + methodName: "V1SolutionsFdBatchesV1DescriptionsResultsAsync", + pathTemplate: "$\"/solutions/fd/batches/v1/descriptions/{batchId}/results\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsFdBatchesV1DescriptionsResults", + methodName: "V1SolutionsFdBatchesV1DescriptionsResultsAsync", + pathTemplate: "$\"/solutions/fd/batches/v1/descriptions/{batchId}/results\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessV1SolutionsFdBatchesV1DescriptionsResultsResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsFdBatchesV1DescriptionsResults", + methodName: "V1SolutionsFdBatchesV1DescriptionsResultsAsync", + pathTemplate: "$\"/solutions/fd/batches/v1/descriptions/{batchId}/results\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsFdBatchesV1DescriptionsResults", + methodName: "V1SolutionsFdBatchesV1DescriptionsResultsAsync", + pathTemplate: "$\"/solutions/fd/batches/v1/descriptions/{batchId}/results\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __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::AI21.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessV1SolutionsFdBatchesV1DescriptionsResultsResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? 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::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.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::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsFdBatchesV1DescriptionsStatus.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsFdBatchesV1DescriptionsStatus.g.cs new file mode 100644 index 00000000..f75c519e --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsFdBatchesV1DescriptionsStatus.g.cs @@ -0,0 +1,457 @@ + +#nullable enable + +namespace AI21 +{ + public partial class Ai21Client + { + + + private static readonly global::AI21.EndPointSecurityRequirement s_V1SolutionsFdBatchesV1DescriptionsStatusSecurityRequirement0 = + new global::AI21.EndPointSecurityRequirement + { + Authorizations = new global::AI21.EndPointAuthorizationRequirement[] + { new global::AI21.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::AI21.EndPointSecurityRequirement[] s_V1SolutionsFdBatchesV1DescriptionsStatusSecurityRequirements = + new global::AI21.EndPointSecurityRequirement[] + { s_V1SolutionsFdBatchesV1DescriptionsStatusSecurityRequirement0, + }; + partial void PrepareV1SolutionsFdBatchesV1DescriptionsStatusArguments( + global::System.Net.Http.HttpClient httpClient, + ref string batchId); + partial void PrepareV1SolutionsFdBatchesV1DescriptionsStatusRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string batchId); + partial void ProcessV1SolutionsFdBatchesV1DescriptionsStatusResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessV1SolutionsFdBatchesV1DescriptionsStatusResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Fnac Batch Descriptions 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 V1SolutionsFdBatchesV1DescriptionsStatusAsync( + string batchId, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await V1SolutionsFdBatchesV1DescriptionsStatusAsResponseAsync( + batchId: batchId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Fnac Batch Descriptions 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> V1SolutionsFdBatchesV1DescriptionsStatusAsResponseAsync( + string batchId, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareV1SolutionsFdBatchesV1DescriptionsStatusArguments( + httpClient: HttpClient, + batchId: ref batchId); + + + var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_V1SolutionsFdBatchesV1DescriptionsStatusSecurityRequirements, + operationName: "V1SolutionsFdBatchesV1DescriptionsStatusAsync"); + + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: $"/solutions/fd/batches/v1/descriptions/{batchId}/status", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.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); + } + } + global::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareV1SolutionsFdBatchesV1DescriptionsStatusRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + batchId: batchId!); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsFdBatchesV1DescriptionsStatus", + methodName: "V1SolutionsFdBatchesV1DescriptionsStatusAsync", + pathTemplate: "$\"/solutions/fd/batches/v1/descriptions/{batchId}/status\"", + 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::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsFdBatchesV1DescriptionsStatus", + methodName: "V1SolutionsFdBatchesV1DescriptionsStatusAsync", + pathTemplate: "$\"/solutions/fd/batches/v1/descriptions/{batchId}/status\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsFdBatchesV1DescriptionsStatus", + methodName: "V1SolutionsFdBatchesV1DescriptionsStatusAsync", + pathTemplate: "$\"/solutions/fd/batches/v1/descriptions/{batchId}/status\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessV1SolutionsFdBatchesV1DescriptionsStatusResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsFdBatchesV1DescriptionsStatus", + methodName: "V1SolutionsFdBatchesV1DescriptionsStatusAsync", + pathTemplate: "$\"/solutions/fd/batches/v1/descriptions/{batchId}/status\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsFdBatchesV1DescriptionsStatus", + methodName: "V1SolutionsFdBatchesV1DescriptionsStatusAsync", + pathTemplate: "$\"/solutions/fd/batches/v1/descriptions/{batchId}/status\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __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::AI21.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessV1SolutionsFdBatchesV1DescriptionsStatusResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? 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::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.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::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsFdPreviewBatchesV1Classifications.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsFdPreviewBatchesV1Classifications.g.cs new file mode 100644 index 00000000..605b1531 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsFdPreviewBatchesV1Classifications.g.cs @@ -0,0 +1,411 @@ + +#nullable enable + +namespace AI21 +{ + public partial class Ai21Client + { + + + private static readonly global::AI21.EndPointSecurityRequirement s_V1SolutionsFdPreviewBatchesV1ClassificationsSecurityRequirement0 = + new global::AI21.EndPointSecurityRequirement + { + Authorizations = new global::AI21.EndPointAuthorizationRequirement[] + { new global::AI21.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::AI21.EndPointSecurityRequirement[] s_V1SolutionsFdPreviewBatchesV1ClassificationsSecurityRequirements = + new global::AI21.EndPointSecurityRequirement[] + { s_V1SolutionsFdPreviewBatchesV1ClassificationsSecurityRequirement0, + }; + partial void PrepareV1SolutionsFdPreviewBatchesV1ClassificationsArguments( + global::System.Net.Http.HttpClient httpClient); + partial void PrepareV1SolutionsFdPreviewBatchesV1ClassificationsRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage); + partial void ProcessV1SolutionsFdPreviewBatchesV1ClassificationsResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessV1SolutionsFdPreviewBatchesV1ClassificationsResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Fnac Batch Classifications Prefix Preview + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task V1SolutionsFdPreviewBatchesV1ClassificationsAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await V1SolutionsFdPreviewBatchesV1ClassificationsAsResponseAsync( + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Fnac Batch Classifications Prefix Preview + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> V1SolutionsFdPreviewBatchesV1ClassificationsAsResponseAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareV1SolutionsFdPreviewBatchesV1ClassificationsArguments( + httpClient: HttpClient); + + + var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_V1SolutionsFdPreviewBatchesV1ClassificationsSecurityRequirements, + operationName: "V1SolutionsFdPreviewBatchesV1ClassificationsAsync"); + + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: "/solutions-preview/fd/batches/v1/classifications", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.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); + } + } + global::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareV1SolutionsFdPreviewBatchesV1ClassificationsRequest( + 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::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsFdPreviewBatchesV1Classifications", + methodName: "V1SolutionsFdPreviewBatchesV1ClassificationsAsync", + pathTemplate: "\"/solutions-preview/fd/batches/v1/classifications\"", + 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::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsFdPreviewBatchesV1Classifications", + methodName: "V1SolutionsFdPreviewBatchesV1ClassificationsAsync", + pathTemplate: "\"/solutions-preview/fd/batches/v1/classifications\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsFdPreviewBatchesV1Classifications", + methodName: "V1SolutionsFdPreviewBatchesV1ClassificationsAsync", + pathTemplate: "\"/solutions-preview/fd/batches/v1/classifications\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessV1SolutionsFdPreviewBatchesV1ClassificationsResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsFdPreviewBatchesV1Classifications", + methodName: "V1SolutionsFdPreviewBatchesV1ClassificationsAsync", + pathTemplate: "\"/solutions-preview/fd/batches/v1/classifications\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsFdPreviewBatchesV1Classifications", + methodName: "V1SolutionsFdPreviewBatchesV1ClassificationsAsync", + pathTemplate: "\"/solutions-preview/fd/batches/v1/classifications\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __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); + ProcessV1SolutionsFdPreviewBatchesV1ClassificationsResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? 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::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.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::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsFdPreviewBatchesV1ClassificationsResults.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsFdPreviewBatchesV1ClassificationsResults.g.cs new file mode 100644 index 00000000..cd550cd8 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsFdPreviewBatchesV1ClassificationsResults.g.cs @@ -0,0 +1,457 @@ + +#nullable enable + +namespace AI21 +{ + public partial class Ai21Client + { + + + private static readonly global::AI21.EndPointSecurityRequirement s_V1SolutionsFdPreviewBatchesV1ClassificationsResultsSecurityRequirement0 = + new global::AI21.EndPointSecurityRequirement + { + Authorizations = new global::AI21.EndPointAuthorizationRequirement[] + { new global::AI21.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::AI21.EndPointSecurityRequirement[] s_V1SolutionsFdPreviewBatchesV1ClassificationsResultsSecurityRequirements = + new global::AI21.EndPointSecurityRequirement[] + { s_V1SolutionsFdPreviewBatchesV1ClassificationsResultsSecurityRequirement0, + }; + partial void PrepareV1SolutionsFdPreviewBatchesV1ClassificationsResultsArguments( + global::System.Net.Http.HttpClient httpClient, + ref string batchId); + partial void PrepareV1SolutionsFdPreviewBatchesV1ClassificationsResultsRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string batchId); + partial void ProcessV1SolutionsFdPreviewBatchesV1ClassificationsResultsResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessV1SolutionsFdPreviewBatchesV1ClassificationsResultsResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Fnac Batch Classifications Results Prefix Preview + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task V1SolutionsFdPreviewBatchesV1ClassificationsResultsAsync( + string batchId, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await V1SolutionsFdPreviewBatchesV1ClassificationsResultsAsResponseAsync( + batchId: batchId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Fnac Batch Classifications Results Prefix Preview + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> V1SolutionsFdPreviewBatchesV1ClassificationsResultsAsResponseAsync( + string batchId, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareV1SolutionsFdPreviewBatchesV1ClassificationsResultsArguments( + httpClient: HttpClient, + batchId: ref batchId); + + + var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_V1SolutionsFdPreviewBatchesV1ClassificationsResultsSecurityRequirements, + operationName: "V1SolutionsFdPreviewBatchesV1ClassificationsResultsAsync"); + + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: $"/solutions-preview/fd/batches/v1/classifications/{batchId}/results", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.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); + } + } + global::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareV1SolutionsFdPreviewBatchesV1ClassificationsResultsRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + batchId: batchId!); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsFdPreviewBatchesV1ClassificationsResults", + methodName: "V1SolutionsFdPreviewBatchesV1ClassificationsResultsAsync", + pathTemplate: "$\"/solutions-preview/fd/batches/v1/classifications/{batchId}/results\"", + 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::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsFdPreviewBatchesV1ClassificationsResults", + methodName: "V1SolutionsFdPreviewBatchesV1ClassificationsResultsAsync", + pathTemplate: "$\"/solutions-preview/fd/batches/v1/classifications/{batchId}/results\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsFdPreviewBatchesV1ClassificationsResults", + methodName: "V1SolutionsFdPreviewBatchesV1ClassificationsResultsAsync", + pathTemplate: "$\"/solutions-preview/fd/batches/v1/classifications/{batchId}/results\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessV1SolutionsFdPreviewBatchesV1ClassificationsResultsResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsFdPreviewBatchesV1ClassificationsResults", + methodName: "V1SolutionsFdPreviewBatchesV1ClassificationsResultsAsync", + pathTemplate: "$\"/solutions-preview/fd/batches/v1/classifications/{batchId}/results\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsFdPreviewBatchesV1ClassificationsResults", + methodName: "V1SolutionsFdPreviewBatchesV1ClassificationsResultsAsync", + pathTemplate: "$\"/solutions-preview/fd/batches/v1/classifications/{batchId}/results\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __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::AI21.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessV1SolutionsFdPreviewBatchesV1ClassificationsResultsResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? 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::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.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::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsFdPreviewBatchesV1ClassificationsStatus.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsFdPreviewBatchesV1ClassificationsStatus.g.cs new file mode 100644 index 00000000..c95ba6d7 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsFdPreviewBatchesV1ClassificationsStatus.g.cs @@ -0,0 +1,457 @@ + +#nullable enable + +namespace AI21 +{ + public partial class Ai21Client + { + + + private static readonly global::AI21.EndPointSecurityRequirement s_V1SolutionsFdPreviewBatchesV1ClassificationsStatusSecurityRequirement0 = + new global::AI21.EndPointSecurityRequirement + { + Authorizations = new global::AI21.EndPointAuthorizationRequirement[] + { new global::AI21.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::AI21.EndPointSecurityRequirement[] s_V1SolutionsFdPreviewBatchesV1ClassificationsStatusSecurityRequirements = + new global::AI21.EndPointSecurityRequirement[] + { s_V1SolutionsFdPreviewBatchesV1ClassificationsStatusSecurityRequirement0, + }; + partial void PrepareV1SolutionsFdPreviewBatchesV1ClassificationsStatusArguments( + global::System.Net.Http.HttpClient httpClient, + ref string batchId); + partial void PrepareV1SolutionsFdPreviewBatchesV1ClassificationsStatusRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string batchId); + partial void ProcessV1SolutionsFdPreviewBatchesV1ClassificationsStatusResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessV1SolutionsFdPreviewBatchesV1ClassificationsStatusResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Fnac Batch Classifications Status Prefix Preview + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task V1SolutionsFdPreviewBatchesV1ClassificationsStatusAsync( + string batchId, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await V1SolutionsFdPreviewBatchesV1ClassificationsStatusAsResponseAsync( + batchId: batchId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Fnac Batch Classifications Status Prefix Preview + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> V1SolutionsFdPreviewBatchesV1ClassificationsStatusAsResponseAsync( + string batchId, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareV1SolutionsFdPreviewBatchesV1ClassificationsStatusArguments( + httpClient: HttpClient, + batchId: ref batchId); + + + var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_V1SolutionsFdPreviewBatchesV1ClassificationsStatusSecurityRequirements, + operationName: "V1SolutionsFdPreviewBatchesV1ClassificationsStatusAsync"); + + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: $"/solutions-preview/fd/batches/v1/classifications/{batchId}/status", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.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); + } + } + global::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareV1SolutionsFdPreviewBatchesV1ClassificationsStatusRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + batchId: batchId!); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsFdPreviewBatchesV1ClassificationsStatus", + methodName: "V1SolutionsFdPreviewBatchesV1ClassificationsStatusAsync", + pathTemplate: "$\"/solutions-preview/fd/batches/v1/classifications/{batchId}/status\"", + 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::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsFdPreviewBatchesV1ClassificationsStatus", + methodName: "V1SolutionsFdPreviewBatchesV1ClassificationsStatusAsync", + pathTemplate: "$\"/solutions-preview/fd/batches/v1/classifications/{batchId}/status\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsFdPreviewBatchesV1ClassificationsStatus", + methodName: "V1SolutionsFdPreviewBatchesV1ClassificationsStatusAsync", + pathTemplate: "$\"/solutions-preview/fd/batches/v1/classifications/{batchId}/status\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessV1SolutionsFdPreviewBatchesV1ClassificationsStatusResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsFdPreviewBatchesV1ClassificationsStatus", + methodName: "V1SolutionsFdPreviewBatchesV1ClassificationsStatusAsync", + pathTemplate: "$\"/solutions-preview/fd/batches/v1/classifications/{batchId}/status\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsFdPreviewBatchesV1ClassificationsStatus", + methodName: "V1SolutionsFdPreviewBatchesV1ClassificationsStatusAsync", + pathTemplate: "$\"/solutions-preview/fd/batches/v1/classifications/{batchId}/status\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __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::AI21.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessV1SolutionsFdPreviewBatchesV1ClassificationsStatusResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? 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::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.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::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsFdPreviewBatchesV1Descriptions.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsFdPreviewBatchesV1Descriptions.g.cs new file mode 100644 index 00000000..665c9f2f --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsFdPreviewBatchesV1Descriptions.g.cs @@ -0,0 +1,411 @@ + +#nullable enable + +namespace AI21 +{ + public partial class Ai21Client + { + + + private static readonly global::AI21.EndPointSecurityRequirement s_V1SolutionsFdPreviewBatchesV1DescriptionsSecurityRequirement0 = + new global::AI21.EndPointSecurityRequirement + { + Authorizations = new global::AI21.EndPointAuthorizationRequirement[] + { new global::AI21.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::AI21.EndPointSecurityRequirement[] s_V1SolutionsFdPreviewBatchesV1DescriptionsSecurityRequirements = + new global::AI21.EndPointSecurityRequirement[] + { s_V1SolutionsFdPreviewBatchesV1DescriptionsSecurityRequirement0, + }; + partial void PrepareV1SolutionsFdPreviewBatchesV1DescriptionsArguments( + global::System.Net.Http.HttpClient httpClient); + partial void PrepareV1SolutionsFdPreviewBatchesV1DescriptionsRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage); + partial void ProcessV1SolutionsFdPreviewBatchesV1DescriptionsResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessV1SolutionsFdPreviewBatchesV1DescriptionsResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Fnac Batch Descriptions Prefix Preview + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task V1SolutionsFdPreviewBatchesV1DescriptionsAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await V1SolutionsFdPreviewBatchesV1DescriptionsAsResponseAsync( + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Fnac Batch Descriptions Prefix Preview + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> V1SolutionsFdPreviewBatchesV1DescriptionsAsResponseAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareV1SolutionsFdPreviewBatchesV1DescriptionsArguments( + httpClient: HttpClient); + + + var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_V1SolutionsFdPreviewBatchesV1DescriptionsSecurityRequirements, + operationName: "V1SolutionsFdPreviewBatchesV1DescriptionsAsync"); + + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: "/solutions-preview/fd/batches/v1/descriptions", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.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); + } + } + global::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareV1SolutionsFdPreviewBatchesV1DescriptionsRequest( + 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::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsFdPreviewBatchesV1Descriptions", + methodName: "V1SolutionsFdPreviewBatchesV1DescriptionsAsync", + pathTemplate: "\"/solutions-preview/fd/batches/v1/descriptions\"", + 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::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsFdPreviewBatchesV1Descriptions", + methodName: "V1SolutionsFdPreviewBatchesV1DescriptionsAsync", + pathTemplate: "\"/solutions-preview/fd/batches/v1/descriptions\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsFdPreviewBatchesV1Descriptions", + methodName: "V1SolutionsFdPreviewBatchesV1DescriptionsAsync", + pathTemplate: "\"/solutions-preview/fd/batches/v1/descriptions\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessV1SolutionsFdPreviewBatchesV1DescriptionsResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsFdPreviewBatchesV1Descriptions", + methodName: "V1SolutionsFdPreviewBatchesV1DescriptionsAsync", + pathTemplate: "\"/solutions-preview/fd/batches/v1/descriptions\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsFdPreviewBatchesV1Descriptions", + methodName: "V1SolutionsFdPreviewBatchesV1DescriptionsAsync", + pathTemplate: "\"/solutions-preview/fd/batches/v1/descriptions\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __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); + ProcessV1SolutionsFdPreviewBatchesV1DescriptionsResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? 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::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.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::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsFdPreviewBatchesV1DescriptionsResults.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsFdPreviewBatchesV1DescriptionsResults.g.cs new file mode 100644 index 00000000..c87697b2 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsFdPreviewBatchesV1DescriptionsResults.g.cs @@ -0,0 +1,457 @@ + +#nullable enable + +namespace AI21 +{ + public partial class Ai21Client + { + + + private static readonly global::AI21.EndPointSecurityRequirement s_V1SolutionsFdPreviewBatchesV1DescriptionsResultsSecurityRequirement0 = + new global::AI21.EndPointSecurityRequirement + { + Authorizations = new global::AI21.EndPointAuthorizationRequirement[] + { new global::AI21.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::AI21.EndPointSecurityRequirement[] s_V1SolutionsFdPreviewBatchesV1DescriptionsResultsSecurityRequirements = + new global::AI21.EndPointSecurityRequirement[] + { s_V1SolutionsFdPreviewBatchesV1DescriptionsResultsSecurityRequirement0, + }; + partial void PrepareV1SolutionsFdPreviewBatchesV1DescriptionsResultsArguments( + global::System.Net.Http.HttpClient httpClient, + ref string batchId); + partial void PrepareV1SolutionsFdPreviewBatchesV1DescriptionsResultsRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string batchId); + partial void ProcessV1SolutionsFdPreviewBatchesV1DescriptionsResultsResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessV1SolutionsFdPreviewBatchesV1DescriptionsResultsResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Fnac Batch Descriptions Results Prefix Preview + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task V1SolutionsFdPreviewBatchesV1DescriptionsResultsAsync( + string batchId, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await V1SolutionsFdPreviewBatchesV1DescriptionsResultsAsResponseAsync( + batchId: batchId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Fnac Batch Descriptions Results Prefix Preview + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> V1SolutionsFdPreviewBatchesV1DescriptionsResultsAsResponseAsync( + string batchId, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareV1SolutionsFdPreviewBatchesV1DescriptionsResultsArguments( + httpClient: HttpClient, + batchId: ref batchId); + + + var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_V1SolutionsFdPreviewBatchesV1DescriptionsResultsSecurityRequirements, + operationName: "V1SolutionsFdPreviewBatchesV1DescriptionsResultsAsync"); + + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: $"/solutions-preview/fd/batches/v1/descriptions/{batchId}/results", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.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); + } + } + global::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareV1SolutionsFdPreviewBatchesV1DescriptionsResultsRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + batchId: batchId!); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsFdPreviewBatchesV1DescriptionsResults", + methodName: "V1SolutionsFdPreviewBatchesV1DescriptionsResultsAsync", + pathTemplate: "$\"/solutions-preview/fd/batches/v1/descriptions/{batchId}/results\"", + 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::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsFdPreviewBatchesV1DescriptionsResults", + methodName: "V1SolutionsFdPreviewBatchesV1DescriptionsResultsAsync", + pathTemplate: "$\"/solutions-preview/fd/batches/v1/descriptions/{batchId}/results\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsFdPreviewBatchesV1DescriptionsResults", + methodName: "V1SolutionsFdPreviewBatchesV1DescriptionsResultsAsync", + pathTemplate: "$\"/solutions-preview/fd/batches/v1/descriptions/{batchId}/results\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessV1SolutionsFdPreviewBatchesV1DescriptionsResultsResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsFdPreviewBatchesV1DescriptionsResults", + methodName: "V1SolutionsFdPreviewBatchesV1DescriptionsResultsAsync", + pathTemplate: "$\"/solutions-preview/fd/batches/v1/descriptions/{batchId}/results\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsFdPreviewBatchesV1DescriptionsResults", + methodName: "V1SolutionsFdPreviewBatchesV1DescriptionsResultsAsync", + pathTemplate: "$\"/solutions-preview/fd/batches/v1/descriptions/{batchId}/results\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __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::AI21.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessV1SolutionsFdPreviewBatchesV1DescriptionsResultsResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? 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::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.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::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsFdPreviewBatchesV1DescriptionsStatus.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsFdPreviewBatchesV1DescriptionsStatus.g.cs new file mode 100644 index 00000000..6ff19d4d --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsFdPreviewBatchesV1DescriptionsStatus.g.cs @@ -0,0 +1,457 @@ + +#nullable enable + +namespace AI21 +{ + public partial class Ai21Client + { + + + private static readonly global::AI21.EndPointSecurityRequirement s_V1SolutionsFdPreviewBatchesV1DescriptionsStatusSecurityRequirement0 = + new global::AI21.EndPointSecurityRequirement + { + Authorizations = new global::AI21.EndPointAuthorizationRequirement[] + { new global::AI21.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::AI21.EndPointSecurityRequirement[] s_V1SolutionsFdPreviewBatchesV1DescriptionsStatusSecurityRequirements = + new global::AI21.EndPointSecurityRequirement[] + { s_V1SolutionsFdPreviewBatchesV1DescriptionsStatusSecurityRequirement0, + }; + partial void PrepareV1SolutionsFdPreviewBatchesV1DescriptionsStatusArguments( + global::System.Net.Http.HttpClient httpClient, + ref string batchId); + partial void PrepareV1SolutionsFdPreviewBatchesV1DescriptionsStatusRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string batchId); + partial void ProcessV1SolutionsFdPreviewBatchesV1DescriptionsStatusResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessV1SolutionsFdPreviewBatchesV1DescriptionsStatusResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Fnac Batch Descriptions Status Prefix Preview + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task V1SolutionsFdPreviewBatchesV1DescriptionsStatusAsync( + string batchId, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await V1SolutionsFdPreviewBatchesV1DescriptionsStatusAsResponseAsync( + batchId: batchId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Fnac Batch Descriptions Status Prefix Preview + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> V1SolutionsFdPreviewBatchesV1DescriptionsStatusAsResponseAsync( + string batchId, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareV1SolutionsFdPreviewBatchesV1DescriptionsStatusArguments( + httpClient: HttpClient, + batchId: ref batchId); + + + var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_V1SolutionsFdPreviewBatchesV1DescriptionsStatusSecurityRequirements, + operationName: "V1SolutionsFdPreviewBatchesV1DescriptionsStatusAsync"); + + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: $"/solutions-preview/fd/batches/v1/descriptions/{batchId}/status", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.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); + } + } + global::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareV1SolutionsFdPreviewBatchesV1DescriptionsStatusRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + batchId: batchId!); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsFdPreviewBatchesV1DescriptionsStatus", + methodName: "V1SolutionsFdPreviewBatchesV1DescriptionsStatusAsync", + pathTemplate: "$\"/solutions-preview/fd/batches/v1/descriptions/{batchId}/status\"", + 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::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsFdPreviewBatchesV1DescriptionsStatus", + methodName: "V1SolutionsFdPreviewBatchesV1DescriptionsStatusAsync", + pathTemplate: "$\"/solutions-preview/fd/batches/v1/descriptions/{batchId}/status\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsFdPreviewBatchesV1DescriptionsStatus", + methodName: "V1SolutionsFdPreviewBatchesV1DescriptionsStatusAsync", + pathTemplate: "$\"/solutions-preview/fd/batches/v1/descriptions/{batchId}/status\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessV1SolutionsFdPreviewBatchesV1DescriptionsStatusResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsFdPreviewBatchesV1DescriptionsStatus", + methodName: "V1SolutionsFdPreviewBatchesV1DescriptionsStatusAsync", + pathTemplate: "$\"/solutions-preview/fd/batches/v1/descriptions/{batchId}/status\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsFdPreviewBatchesV1DescriptionsStatus", + methodName: "V1SolutionsFdPreviewBatchesV1DescriptionsStatusAsync", + pathTemplate: "$\"/solutions-preview/fd/batches/v1/descriptions/{batchId}/status\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __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::AI21.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessV1SolutionsFdPreviewBatchesV1DescriptionsStatusResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? 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::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.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::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsFnacAftersalesBatchPredict.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsFnacAftersalesBatchPredict.g.cs new file mode 100644 index 00000000..e815617c --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsFnacAftersalesBatchPredict.g.cs @@ -0,0 +1,411 @@ + +#nullable enable + +namespace AI21 +{ + public partial class Ai21Client + { + + + private static readonly global::AI21.EndPointSecurityRequirement s_V1SolutionsFnacAftersalesBatchPredictSecurityRequirement0 = + new global::AI21.EndPointSecurityRequirement + { + Authorizations = new global::AI21.EndPointAuthorizationRequirement[] + { new global::AI21.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::AI21.EndPointSecurityRequirement[] s_V1SolutionsFnacAftersalesBatchPredictSecurityRequirements = + new global::AI21.EndPointSecurityRequirement[] + { s_V1SolutionsFnacAftersalesBatchPredictSecurityRequirement0, + }; + partial void PrepareV1SolutionsFnacAftersalesBatchPredictArguments( + global::System.Net.Http.HttpClient httpClient); + partial void PrepareV1SolutionsFnacAftersalesBatchPredictRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage); + partial void ProcessV1SolutionsFnacAftersalesBatchPredictResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessV1SolutionsFnacAftersalesBatchPredictResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Fnac Aftersales Batch Predict + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task V1SolutionsFnacAftersalesBatchPredictAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await V1SolutionsFnacAftersalesBatchPredictAsResponseAsync( + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Fnac Aftersales Batch Predict + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> V1SolutionsFnacAftersalesBatchPredictAsResponseAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareV1SolutionsFnacAftersalesBatchPredictArguments( + httpClient: HttpClient); + + + var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_V1SolutionsFnacAftersalesBatchPredictSecurityRequirements, + operationName: "V1SolutionsFnacAftersalesBatchPredictAsync"); + + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: "/solutions/fd_aftersales/parts-classification/batch", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.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); + } + } + global::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareV1SolutionsFnacAftersalesBatchPredictRequest( + 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::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsFnacAftersalesBatchPredict", + methodName: "V1SolutionsFnacAftersalesBatchPredictAsync", + pathTemplate: "\"/solutions/fd_aftersales/parts-classification/batch\"", + 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::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsFnacAftersalesBatchPredict", + methodName: "V1SolutionsFnacAftersalesBatchPredictAsync", + pathTemplate: "\"/solutions/fd_aftersales/parts-classification/batch\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsFnacAftersalesBatchPredict", + methodName: "V1SolutionsFnacAftersalesBatchPredictAsync", + pathTemplate: "\"/solutions/fd_aftersales/parts-classification/batch\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessV1SolutionsFnacAftersalesBatchPredictResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsFnacAftersalesBatchPredict", + methodName: "V1SolutionsFnacAftersalesBatchPredictAsync", + pathTemplate: "\"/solutions/fd_aftersales/parts-classification/batch\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsFnacAftersalesBatchPredict", + methodName: "V1SolutionsFnacAftersalesBatchPredictAsync", + pathTemplate: "\"/solutions/fd_aftersales/parts-classification/batch\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __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); + ProcessV1SolutionsFnacAftersalesBatchPredictResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? 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::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.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::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsFnacAftersalesBatchPredictStatus.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsFnacAftersalesBatchPredictStatus.g.cs new file mode 100644 index 00000000..457263d1 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsFnacAftersalesBatchPredictStatus.g.cs @@ -0,0 +1,457 @@ + +#nullable enable + +namespace AI21 +{ + public partial class Ai21Client + { + + + private static readonly global::AI21.EndPointSecurityRequirement s_V1SolutionsFnacAftersalesBatchPredictStatusSecurityRequirement0 = + new global::AI21.EndPointSecurityRequirement + { + Authorizations = new global::AI21.EndPointAuthorizationRequirement[] + { new global::AI21.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::AI21.EndPointSecurityRequirement[] s_V1SolutionsFnacAftersalesBatchPredictStatusSecurityRequirements = + new global::AI21.EndPointSecurityRequirement[] + { s_V1SolutionsFnacAftersalesBatchPredictStatusSecurityRequirement0, + }; + partial void PrepareV1SolutionsFnacAftersalesBatchPredictStatusArguments( + global::System.Net.Http.HttpClient httpClient, + ref string batchId); + partial void PrepareV1SolutionsFnacAftersalesBatchPredictStatusRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string batchId); + partial void ProcessV1SolutionsFnacAftersalesBatchPredictStatusResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessV1SolutionsFnacAftersalesBatchPredictStatusResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Fnac Aftersales Batch Predict 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 V1SolutionsFnacAftersalesBatchPredictStatusAsync( + string batchId, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await V1SolutionsFnacAftersalesBatchPredictStatusAsResponseAsync( + batchId: batchId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Fnac Aftersales Batch Predict 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> V1SolutionsFnacAftersalesBatchPredictStatusAsResponseAsync( + string batchId, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareV1SolutionsFnacAftersalesBatchPredictStatusArguments( + httpClient: HttpClient, + batchId: ref batchId); + + + var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_V1SolutionsFnacAftersalesBatchPredictStatusSecurityRequirements, + operationName: "V1SolutionsFnacAftersalesBatchPredictStatusAsync"); + + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: $"/solutions/fd_aftersales/parts-classification/batch/{batchId}/status", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.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::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareV1SolutionsFnacAftersalesBatchPredictStatusRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + batchId: batchId!); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsFnacAftersalesBatchPredictStatus", + methodName: "V1SolutionsFnacAftersalesBatchPredictStatusAsync", + pathTemplate: "$\"/solutions/fd_aftersales/parts-classification/batch/{batchId}/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::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsFnacAftersalesBatchPredictStatus", + methodName: "V1SolutionsFnacAftersalesBatchPredictStatusAsync", + pathTemplate: "$\"/solutions/fd_aftersales/parts-classification/batch/{batchId}/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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsFnacAftersalesBatchPredictStatus", + methodName: "V1SolutionsFnacAftersalesBatchPredictStatusAsync", + pathTemplate: "$\"/solutions/fd_aftersales/parts-classification/batch/{batchId}/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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessV1SolutionsFnacAftersalesBatchPredictStatusResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsFnacAftersalesBatchPredictStatus", + methodName: "V1SolutionsFnacAftersalesBatchPredictStatusAsync", + pathTemplate: "$\"/solutions/fd_aftersales/parts-classification/batch/{batchId}/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::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsFnacAftersalesBatchPredictStatus", + methodName: "V1SolutionsFnacAftersalesBatchPredictStatusAsync", + pathTemplate: "$\"/solutions/fd_aftersales/parts-classification/batch/{batchId}/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::AI21.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessV1SolutionsFnacAftersalesBatchPredictStatusResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? 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::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.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::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsFnacAftersalesPreviewBatchPredict.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsFnacAftersalesPreviewBatchPredict.g.cs new file mode 100644 index 00000000..0a40a221 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsFnacAftersalesPreviewBatchPredict.g.cs @@ -0,0 +1,411 @@ + +#nullable enable + +namespace AI21 +{ + public partial class Ai21Client + { + + + private static readonly global::AI21.EndPointSecurityRequirement s_V1SolutionsFnacAftersalesPreviewBatchPredictSecurityRequirement0 = + new global::AI21.EndPointSecurityRequirement + { + Authorizations = new global::AI21.EndPointAuthorizationRequirement[] + { new global::AI21.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::AI21.EndPointSecurityRequirement[] s_V1SolutionsFnacAftersalesPreviewBatchPredictSecurityRequirements = + new global::AI21.EndPointSecurityRequirement[] + { s_V1SolutionsFnacAftersalesPreviewBatchPredictSecurityRequirement0, + }; + partial void PrepareV1SolutionsFnacAftersalesPreviewBatchPredictArguments( + global::System.Net.Http.HttpClient httpClient); + partial void PrepareV1SolutionsFnacAftersalesPreviewBatchPredictRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage); + partial void ProcessV1SolutionsFnacAftersalesPreviewBatchPredictResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessV1SolutionsFnacAftersalesPreviewBatchPredictResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Fnac Aftersales Batch Predict Prefix Preview + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task V1SolutionsFnacAftersalesPreviewBatchPredictAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await V1SolutionsFnacAftersalesPreviewBatchPredictAsResponseAsync( + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Fnac Aftersales Batch Predict Prefix Preview + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> V1SolutionsFnacAftersalesPreviewBatchPredictAsResponseAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareV1SolutionsFnacAftersalesPreviewBatchPredictArguments( + httpClient: HttpClient); + + + var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_V1SolutionsFnacAftersalesPreviewBatchPredictSecurityRequirements, + operationName: "V1SolutionsFnacAftersalesPreviewBatchPredictAsync"); + + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: "/solutions-preview/fd_aftersales/parts-classification/batch", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.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); + } + } + global::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareV1SolutionsFnacAftersalesPreviewBatchPredictRequest( + 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::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsFnacAftersalesPreviewBatchPredict", + methodName: "V1SolutionsFnacAftersalesPreviewBatchPredictAsync", + pathTemplate: "\"/solutions-preview/fd_aftersales/parts-classification/batch\"", + 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::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsFnacAftersalesPreviewBatchPredict", + methodName: "V1SolutionsFnacAftersalesPreviewBatchPredictAsync", + pathTemplate: "\"/solutions-preview/fd_aftersales/parts-classification/batch\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsFnacAftersalesPreviewBatchPredict", + methodName: "V1SolutionsFnacAftersalesPreviewBatchPredictAsync", + pathTemplate: "\"/solutions-preview/fd_aftersales/parts-classification/batch\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessV1SolutionsFnacAftersalesPreviewBatchPredictResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsFnacAftersalesPreviewBatchPredict", + methodName: "V1SolutionsFnacAftersalesPreviewBatchPredictAsync", + pathTemplate: "\"/solutions-preview/fd_aftersales/parts-classification/batch\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsFnacAftersalesPreviewBatchPredict", + methodName: "V1SolutionsFnacAftersalesPreviewBatchPredictAsync", + pathTemplate: "\"/solutions-preview/fd_aftersales/parts-classification/batch\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __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); + ProcessV1SolutionsFnacAftersalesPreviewBatchPredictResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? 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::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.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::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsFnacAftersalesPreviewBatchPredictStatus.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsFnacAftersalesPreviewBatchPredictStatus.g.cs new file mode 100644 index 00000000..fb54eaaf --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsFnacAftersalesPreviewBatchPredictStatus.g.cs @@ -0,0 +1,457 @@ + +#nullable enable + +namespace AI21 +{ + public partial class Ai21Client + { + + + private static readonly global::AI21.EndPointSecurityRequirement s_V1SolutionsFnacAftersalesPreviewBatchPredictStatusSecurityRequirement0 = + new global::AI21.EndPointSecurityRequirement + { + Authorizations = new global::AI21.EndPointAuthorizationRequirement[] + { new global::AI21.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::AI21.EndPointSecurityRequirement[] s_V1SolutionsFnacAftersalesPreviewBatchPredictStatusSecurityRequirements = + new global::AI21.EndPointSecurityRequirement[] + { s_V1SolutionsFnacAftersalesPreviewBatchPredictStatusSecurityRequirement0, + }; + partial void PrepareV1SolutionsFnacAftersalesPreviewBatchPredictStatusArguments( + global::System.Net.Http.HttpClient httpClient, + ref string batchId); + partial void PrepareV1SolutionsFnacAftersalesPreviewBatchPredictStatusRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string batchId); + partial void ProcessV1SolutionsFnacAftersalesPreviewBatchPredictStatusResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessV1SolutionsFnacAftersalesPreviewBatchPredictStatusResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Fnac Aftersales Batch Predict Status Prefix Preview + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task V1SolutionsFnacAftersalesPreviewBatchPredictStatusAsync( + string batchId, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await V1SolutionsFnacAftersalesPreviewBatchPredictStatusAsResponseAsync( + batchId: batchId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Fnac Aftersales Batch Predict Status Prefix Preview + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> V1SolutionsFnacAftersalesPreviewBatchPredictStatusAsResponseAsync( + string batchId, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareV1SolutionsFnacAftersalesPreviewBatchPredictStatusArguments( + httpClient: HttpClient, + batchId: ref batchId); + + + var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_V1SolutionsFnacAftersalesPreviewBatchPredictStatusSecurityRequirements, + operationName: "V1SolutionsFnacAftersalesPreviewBatchPredictStatusAsync"); + + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: $"/solutions-preview/fd_aftersales/parts-classification/batch/{batchId}/status", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.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::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareV1SolutionsFnacAftersalesPreviewBatchPredictStatusRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + batchId: batchId!); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsFnacAftersalesPreviewBatchPredictStatus", + methodName: "V1SolutionsFnacAftersalesPreviewBatchPredictStatusAsync", + pathTemplate: "$\"/solutions-preview/fd_aftersales/parts-classification/batch/{batchId}/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::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsFnacAftersalesPreviewBatchPredictStatus", + methodName: "V1SolutionsFnacAftersalesPreviewBatchPredictStatusAsync", + pathTemplate: "$\"/solutions-preview/fd_aftersales/parts-classification/batch/{batchId}/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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsFnacAftersalesPreviewBatchPredictStatus", + methodName: "V1SolutionsFnacAftersalesPreviewBatchPredictStatusAsync", + pathTemplate: "$\"/solutions-preview/fd_aftersales/parts-classification/batch/{batchId}/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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessV1SolutionsFnacAftersalesPreviewBatchPredictStatusResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsFnacAftersalesPreviewBatchPredictStatus", + methodName: "V1SolutionsFnacAftersalesPreviewBatchPredictStatusAsync", + pathTemplate: "$\"/solutions-preview/fd_aftersales/parts-classification/batch/{batchId}/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::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsFnacAftersalesPreviewBatchPredictStatus", + methodName: "V1SolutionsFnacAftersalesPreviewBatchPredictStatusAsync", + pathTemplate: "$\"/solutions-preview/fd_aftersales/parts-classification/batch/{batchId}/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::AI21.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessV1SolutionsFnacAftersalesPreviewBatchPredictStatusResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? 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::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.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::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsFnacPreviewV1Classifications.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsFnacPreviewV1Classifications.g.cs new file mode 100644 index 00000000..e9a94be7 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsFnacPreviewV1Classifications.g.cs @@ -0,0 +1,411 @@ + +#nullable enable + +namespace AI21 +{ + public partial class Ai21Client + { + + + private static readonly global::AI21.EndPointSecurityRequirement s_V1SolutionsFnacPreviewV1ClassificationsSecurityRequirement0 = + new global::AI21.EndPointSecurityRequirement + { + Authorizations = new global::AI21.EndPointAuthorizationRequirement[] + { new global::AI21.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::AI21.EndPointSecurityRequirement[] s_V1SolutionsFnacPreviewV1ClassificationsSecurityRequirements = + new global::AI21.EndPointSecurityRequirement[] + { s_V1SolutionsFnacPreviewV1ClassificationsSecurityRequirement0, + }; + partial void PrepareV1SolutionsFnacPreviewV1ClassificationsArguments( + global::System.Net.Http.HttpClient httpClient); + partial void PrepareV1SolutionsFnacPreviewV1ClassificationsRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage); + partial void ProcessV1SolutionsFnacPreviewV1ClassificationsResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessV1SolutionsFnacPreviewV1ClassificationsResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Fnac V1 Classifications Prefix Preview + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task V1SolutionsFnacPreviewV1ClassificationsAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await V1SolutionsFnacPreviewV1ClassificationsAsResponseAsync( + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Fnac V1 Classifications Prefix Preview + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> V1SolutionsFnacPreviewV1ClassificationsAsResponseAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareV1SolutionsFnacPreviewV1ClassificationsArguments( + httpClient: HttpClient); + + + var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_V1SolutionsFnacPreviewV1ClassificationsSecurityRequirements, + operationName: "V1SolutionsFnacPreviewV1ClassificationsAsync"); + + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: "/solutions-preview/fnac/v1/classifications", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.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); + } + } + global::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareV1SolutionsFnacPreviewV1ClassificationsRequest( + 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::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsFnacPreviewV1Classifications", + methodName: "V1SolutionsFnacPreviewV1ClassificationsAsync", + pathTemplate: "\"/solutions-preview/fnac/v1/classifications\"", + 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::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsFnacPreviewV1Classifications", + methodName: "V1SolutionsFnacPreviewV1ClassificationsAsync", + pathTemplate: "\"/solutions-preview/fnac/v1/classifications\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsFnacPreviewV1Classifications", + methodName: "V1SolutionsFnacPreviewV1ClassificationsAsync", + pathTemplate: "\"/solutions-preview/fnac/v1/classifications\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessV1SolutionsFnacPreviewV1ClassificationsResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsFnacPreviewV1Classifications", + methodName: "V1SolutionsFnacPreviewV1ClassificationsAsync", + pathTemplate: "\"/solutions-preview/fnac/v1/classifications\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsFnacPreviewV1Classifications", + methodName: "V1SolutionsFnacPreviewV1ClassificationsAsync", + pathTemplate: "\"/solutions-preview/fnac/v1/classifications\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __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); + ProcessV1SolutionsFnacPreviewV1ClassificationsResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? 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::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.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::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsFnacPreviewV1DeprecatedClassifications.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsFnacPreviewV1DeprecatedClassifications.g.cs new file mode 100644 index 00000000..1b966a1d --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsFnacPreviewV1DeprecatedClassifications.g.cs @@ -0,0 +1,411 @@ + +#nullable enable + +namespace AI21 +{ + public partial class Ai21Client + { + + + private static readonly global::AI21.EndPointSecurityRequirement s_V1SolutionsFnacPreviewV1DeprecatedClassificationsSecurityRequirement0 = + new global::AI21.EndPointSecurityRequirement + { + Authorizations = new global::AI21.EndPointAuthorizationRequirement[] + { new global::AI21.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::AI21.EndPointSecurityRequirement[] s_V1SolutionsFnacPreviewV1DeprecatedClassificationsSecurityRequirements = + new global::AI21.EndPointSecurityRequirement[] + { s_V1SolutionsFnacPreviewV1DeprecatedClassificationsSecurityRequirement0, + }; + partial void PrepareV1SolutionsFnacPreviewV1DeprecatedClassificationsArguments( + global::System.Net.Http.HttpClient httpClient); + partial void PrepareV1SolutionsFnacPreviewV1DeprecatedClassificationsRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage); + partial void ProcessV1SolutionsFnacPreviewV1DeprecatedClassificationsResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessV1SolutionsFnacPreviewV1DeprecatedClassificationsResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Fnac V1 Deprecated Classifications Prefix Preview + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task V1SolutionsFnacPreviewV1DeprecatedClassificationsAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await V1SolutionsFnacPreviewV1DeprecatedClassificationsAsResponseAsync( + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Fnac V1 Deprecated Classifications Prefix Preview + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> V1SolutionsFnacPreviewV1DeprecatedClassificationsAsResponseAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareV1SolutionsFnacPreviewV1DeprecatedClassificationsArguments( + httpClient: HttpClient); + + + var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_V1SolutionsFnacPreviewV1DeprecatedClassificationsSecurityRequirements, + operationName: "V1SolutionsFnacPreviewV1DeprecatedClassificationsAsync"); + + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: "/solutions-preview/fnac/v1-deprecated/classifications", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.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); + } + } + global::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareV1SolutionsFnacPreviewV1DeprecatedClassificationsRequest( + 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::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsFnacPreviewV1DeprecatedClassifications", + methodName: "V1SolutionsFnacPreviewV1DeprecatedClassificationsAsync", + pathTemplate: "\"/solutions-preview/fnac/v1-deprecated/classifications\"", + 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::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsFnacPreviewV1DeprecatedClassifications", + methodName: "V1SolutionsFnacPreviewV1DeprecatedClassificationsAsync", + pathTemplate: "\"/solutions-preview/fnac/v1-deprecated/classifications\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsFnacPreviewV1DeprecatedClassifications", + methodName: "V1SolutionsFnacPreviewV1DeprecatedClassificationsAsync", + pathTemplate: "\"/solutions-preview/fnac/v1-deprecated/classifications\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessV1SolutionsFnacPreviewV1DeprecatedClassificationsResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsFnacPreviewV1DeprecatedClassifications", + methodName: "V1SolutionsFnacPreviewV1DeprecatedClassificationsAsync", + pathTemplate: "\"/solutions-preview/fnac/v1-deprecated/classifications\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsFnacPreviewV1DeprecatedClassifications", + methodName: "V1SolutionsFnacPreviewV1DeprecatedClassificationsAsync", + pathTemplate: "\"/solutions-preview/fnac/v1-deprecated/classifications\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __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); + ProcessV1SolutionsFnacPreviewV1DeprecatedClassificationsResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? 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::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.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::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsFnacPreviewV1DeprecatedDescriptions.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsFnacPreviewV1DeprecatedDescriptions.g.cs new file mode 100644 index 00000000..90dcee62 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsFnacPreviewV1DeprecatedDescriptions.g.cs @@ -0,0 +1,411 @@ + +#nullable enable + +namespace AI21 +{ + public partial class Ai21Client + { + + + private static readonly global::AI21.EndPointSecurityRequirement s_V1SolutionsFnacPreviewV1DeprecatedDescriptionsSecurityRequirement0 = + new global::AI21.EndPointSecurityRequirement + { + Authorizations = new global::AI21.EndPointAuthorizationRequirement[] + { new global::AI21.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::AI21.EndPointSecurityRequirement[] s_V1SolutionsFnacPreviewV1DeprecatedDescriptionsSecurityRequirements = + new global::AI21.EndPointSecurityRequirement[] + { s_V1SolutionsFnacPreviewV1DeprecatedDescriptionsSecurityRequirement0, + }; + partial void PrepareV1SolutionsFnacPreviewV1DeprecatedDescriptionsArguments( + global::System.Net.Http.HttpClient httpClient); + partial void PrepareV1SolutionsFnacPreviewV1DeprecatedDescriptionsRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage); + partial void ProcessV1SolutionsFnacPreviewV1DeprecatedDescriptionsResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessV1SolutionsFnacPreviewV1DeprecatedDescriptionsResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Fnac V1 Deprecated Descriptions Prefix Preview + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task V1SolutionsFnacPreviewV1DeprecatedDescriptionsAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await V1SolutionsFnacPreviewV1DeprecatedDescriptionsAsResponseAsync( + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Fnac V1 Deprecated Descriptions Prefix Preview + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> V1SolutionsFnacPreviewV1DeprecatedDescriptionsAsResponseAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareV1SolutionsFnacPreviewV1DeprecatedDescriptionsArguments( + httpClient: HttpClient); + + + var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_V1SolutionsFnacPreviewV1DeprecatedDescriptionsSecurityRequirements, + operationName: "V1SolutionsFnacPreviewV1DeprecatedDescriptionsAsync"); + + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: "/solutions-preview/fnac/v1-deprecated/descriptions", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.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); + } + } + global::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareV1SolutionsFnacPreviewV1DeprecatedDescriptionsRequest( + 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::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsFnacPreviewV1DeprecatedDescriptions", + methodName: "V1SolutionsFnacPreviewV1DeprecatedDescriptionsAsync", + pathTemplate: "\"/solutions-preview/fnac/v1-deprecated/descriptions\"", + 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::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsFnacPreviewV1DeprecatedDescriptions", + methodName: "V1SolutionsFnacPreviewV1DeprecatedDescriptionsAsync", + pathTemplate: "\"/solutions-preview/fnac/v1-deprecated/descriptions\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsFnacPreviewV1DeprecatedDescriptions", + methodName: "V1SolutionsFnacPreviewV1DeprecatedDescriptionsAsync", + pathTemplate: "\"/solutions-preview/fnac/v1-deprecated/descriptions\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessV1SolutionsFnacPreviewV1DeprecatedDescriptionsResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsFnacPreviewV1DeprecatedDescriptions", + methodName: "V1SolutionsFnacPreviewV1DeprecatedDescriptionsAsync", + pathTemplate: "\"/solutions-preview/fnac/v1-deprecated/descriptions\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsFnacPreviewV1DeprecatedDescriptions", + methodName: "V1SolutionsFnacPreviewV1DeprecatedDescriptionsAsync", + pathTemplate: "\"/solutions-preview/fnac/v1-deprecated/descriptions\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __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); + ProcessV1SolutionsFnacPreviewV1DeprecatedDescriptionsResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? 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::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.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::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsFnacPreviewV1Descriptions.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsFnacPreviewV1Descriptions.g.cs new file mode 100644 index 00000000..1b92ae35 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsFnacPreviewV1Descriptions.g.cs @@ -0,0 +1,411 @@ + +#nullable enable + +namespace AI21 +{ + public partial class Ai21Client + { + + + private static readonly global::AI21.EndPointSecurityRequirement s_V1SolutionsFnacPreviewV1DescriptionsSecurityRequirement0 = + new global::AI21.EndPointSecurityRequirement + { + Authorizations = new global::AI21.EndPointAuthorizationRequirement[] + { new global::AI21.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::AI21.EndPointSecurityRequirement[] s_V1SolutionsFnacPreviewV1DescriptionsSecurityRequirements = + new global::AI21.EndPointSecurityRequirement[] + { s_V1SolutionsFnacPreviewV1DescriptionsSecurityRequirement0, + }; + partial void PrepareV1SolutionsFnacPreviewV1DescriptionsArguments( + global::System.Net.Http.HttpClient httpClient); + partial void PrepareV1SolutionsFnacPreviewV1DescriptionsRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage); + partial void ProcessV1SolutionsFnacPreviewV1DescriptionsResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessV1SolutionsFnacPreviewV1DescriptionsResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Fnac V1 Descriptions Prefix Preview + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task V1SolutionsFnacPreviewV1DescriptionsAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await V1SolutionsFnacPreviewV1DescriptionsAsResponseAsync( + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Fnac V1 Descriptions Prefix Preview + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> V1SolutionsFnacPreviewV1DescriptionsAsResponseAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareV1SolutionsFnacPreviewV1DescriptionsArguments( + httpClient: HttpClient); + + + var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_V1SolutionsFnacPreviewV1DescriptionsSecurityRequirements, + operationName: "V1SolutionsFnacPreviewV1DescriptionsAsync"); + + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: "/solutions-preview/fnac/v1/descriptions", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.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); + } + } + global::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareV1SolutionsFnacPreviewV1DescriptionsRequest( + 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::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsFnacPreviewV1Descriptions", + methodName: "V1SolutionsFnacPreviewV1DescriptionsAsync", + pathTemplate: "\"/solutions-preview/fnac/v1/descriptions\"", + 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::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsFnacPreviewV1Descriptions", + methodName: "V1SolutionsFnacPreviewV1DescriptionsAsync", + pathTemplate: "\"/solutions-preview/fnac/v1/descriptions\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsFnacPreviewV1Descriptions", + methodName: "V1SolutionsFnacPreviewV1DescriptionsAsync", + pathTemplate: "\"/solutions-preview/fnac/v1/descriptions\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessV1SolutionsFnacPreviewV1DescriptionsResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsFnacPreviewV1Descriptions", + methodName: "V1SolutionsFnacPreviewV1DescriptionsAsync", + pathTemplate: "\"/solutions-preview/fnac/v1/descriptions\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsFnacPreviewV1Descriptions", + methodName: "V1SolutionsFnacPreviewV1DescriptionsAsync", + pathTemplate: "\"/solutions-preview/fnac/v1/descriptions\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __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); + ProcessV1SolutionsFnacPreviewV1DescriptionsResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? 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::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.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::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsFnacV1Classifications.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsFnacV1Classifications.g.cs new file mode 100644 index 00000000..e1275d81 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsFnacV1Classifications.g.cs @@ -0,0 +1,411 @@ + +#nullable enable + +namespace AI21 +{ + public partial class Ai21Client + { + + + private static readonly global::AI21.EndPointSecurityRequirement s_V1SolutionsFnacV1ClassificationsSecurityRequirement0 = + new global::AI21.EndPointSecurityRequirement + { + Authorizations = new global::AI21.EndPointAuthorizationRequirement[] + { new global::AI21.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::AI21.EndPointSecurityRequirement[] s_V1SolutionsFnacV1ClassificationsSecurityRequirements = + new global::AI21.EndPointSecurityRequirement[] + { s_V1SolutionsFnacV1ClassificationsSecurityRequirement0, + }; + partial void PrepareV1SolutionsFnacV1ClassificationsArguments( + global::System.Net.Http.HttpClient httpClient); + partial void PrepareV1SolutionsFnacV1ClassificationsRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage); + partial void ProcessV1SolutionsFnacV1ClassificationsResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessV1SolutionsFnacV1ClassificationsResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Fnac V1 Classifications + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task V1SolutionsFnacV1ClassificationsAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await V1SolutionsFnacV1ClassificationsAsResponseAsync( + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Fnac V1 Classifications + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> V1SolutionsFnacV1ClassificationsAsResponseAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareV1SolutionsFnacV1ClassificationsArguments( + httpClient: HttpClient); + + + var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_V1SolutionsFnacV1ClassificationsSecurityRequirements, + operationName: "V1SolutionsFnacV1ClassificationsAsync"); + + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: "/solutions/fnac/v1/classifications", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.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); + } + } + global::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareV1SolutionsFnacV1ClassificationsRequest( + 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::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsFnacV1Classifications", + methodName: "V1SolutionsFnacV1ClassificationsAsync", + pathTemplate: "\"/solutions/fnac/v1/classifications\"", + 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::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsFnacV1Classifications", + methodName: "V1SolutionsFnacV1ClassificationsAsync", + pathTemplate: "\"/solutions/fnac/v1/classifications\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsFnacV1Classifications", + methodName: "V1SolutionsFnacV1ClassificationsAsync", + pathTemplate: "\"/solutions/fnac/v1/classifications\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessV1SolutionsFnacV1ClassificationsResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsFnacV1Classifications", + methodName: "V1SolutionsFnacV1ClassificationsAsync", + pathTemplate: "\"/solutions/fnac/v1/classifications\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsFnacV1Classifications", + methodName: "V1SolutionsFnacV1ClassificationsAsync", + pathTemplate: "\"/solutions/fnac/v1/classifications\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __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); + ProcessV1SolutionsFnacV1ClassificationsResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? 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::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.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::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsFnacV1DeprecatedClassifications.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsFnacV1DeprecatedClassifications.g.cs new file mode 100644 index 00000000..93172a24 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsFnacV1DeprecatedClassifications.g.cs @@ -0,0 +1,411 @@ + +#nullable enable + +namespace AI21 +{ + public partial class Ai21Client + { + + + private static readonly global::AI21.EndPointSecurityRequirement s_V1SolutionsFnacV1DeprecatedClassificationsSecurityRequirement0 = + new global::AI21.EndPointSecurityRequirement + { + Authorizations = new global::AI21.EndPointAuthorizationRequirement[] + { new global::AI21.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::AI21.EndPointSecurityRequirement[] s_V1SolutionsFnacV1DeprecatedClassificationsSecurityRequirements = + new global::AI21.EndPointSecurityRequirement[] + { s_V1SolutionsFnacV1DeprecatedClassificationsSecurityRequirement0, + }; + partial void PrepareV1SolutionsFnacV1DeprecatedClassificationsArguments( + global::System.Net.Http.HttpClient httpClient); + partial void PrepareV1SolutionsFnacV1DeprecatedClassificationsRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage); + partial void ProcessV1SolutionsFnacV1DeprecatedClassificationsResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessV1SolutionsFnacV1DeprecatedClassificationsResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Fnac V1 Deprecated Classifications + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task V1SolutionsFnacV1DeprecatedClassificationsAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await V1SolutionsFnacV1DeprecatedClassificationsAsResponseAsync( + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Fnac V1 Deprecated Classifications + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> V1SolutionsFnacV1DeprecatedClassificationsAsResponseAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareV1SolutionsFnacV1DeprecatedClassificationsArguments( + httpClient: HttpClient); + + + var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_V1SolutionsFnacV1DeprecatedClassificationsSecurityRequirements, + operationName: "V1SolutionsFnacV1DeprecatedClassificationsAsync"); + + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: "/solutions/fnac/v1-deprecated/classifications", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.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); + } + } + global::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareV1SolutionsFnacV1DeprecatedClassificationsRequest( + 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::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsFnacV1DeprecatedClassifications", + methodName: "V1SolutionsFnacV1DeprecatedClassificationsAsync", + pathTemplate: "\"/solutions/fnac/v1-deprecated/classifications\"", + 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::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsFnacV1DeprecatedClassifications", + methodName: "V1SolutionsFnacV1DeprecatedClassificationsAsync", + pathTemplate: "\"/solutions/fnac/v1-deprecated/classifications\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsFnacV1DeprecatedClassifications", + methodName: "V1SolutionsFnacV1DeprecatedClassificationsAsync", + pathTemplate: "\"/solutions/fnac/v1-deprecated/classifications\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessV1SolutionsFnacV1DeprecatedClassificationsResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsFnacV1DeprecatedClassifications", + methodName: "V1SolutionsFnacV1DeprecatedClassificationsAsync", + pathTemplate: "\"/solutions/fnac/v1-deprecated/classifications\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsFnacV1DeprecatedClassifications", + methodName: "V1SolutionsFnacV1DeprecatedClassificationsAsync", + pathTemplate: "\"/solutions/fnac/v1-deprecated/classifications\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __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); + ProcessV1SolutionsFnacV1DeprecatedClassificationsResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? 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::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.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::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsFnacV1DeprecatedDescriptions.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsFnacV1DeprecatedDescriptions.g.cs new file mode 100644 index 00000000..5bfbf990 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsFnacV1DeprecatedDescriptions.g.cs @@ -0,0 +1,411 @@ + +#nullable enable + +namespace AI21 +{ + public partial class Ai21Client + { + + + private static readonly global::AI21.EndPointSecurityRequirement s_V1SolutionsFnacV1DeprecatedDescriptionsSecurityRequirement0 = + new global::AI21.EndPointSecurityRequirement + { + Authorizations = new global::AI21.EndPointAuthorizationRequirement[] + { new global::AI21.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::AI21.EndPointSecurityRequirement[] s_V1SolutionsFnacV1DeprecatedDescriptionsSecurityRequirements = + new global::AI21.EndPointSecurityRequirement[] + { s_V1SolutionsFnacV1DeprecatedDescriptionsSecurityRequirement0, + }; + partial void PrepareV1SolutionsFnacV1DeprecatedDescriptionsArguments( + global::System.Net.Http.HttpClient httpClient); + partial void PrepareV1SolutionsFnacV1DeprecatedDescriptionsRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage); + partial void ProcessV1SolutionsFnacV1DeprecatedDescriptionsResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessV1SolutionsFnacV1DeprecatedDescriptionsResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Fnac V1 Deprecated Descriptions + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task V1SolutionsFnacV1DeprecatedDescriptionsAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await V1SolutionsFnacV1DeprecatedDescriptionsAsResponseAsync( + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Fnac V1 Deprecated Descriptions + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> V1SolutionsFnacV1DeprecatedDescriptionsAsResponseAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareV1SolutionsFnacV1DeprecatedDescriptionsArguments( + httpClient: HttpClient); + + + var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_V1SolutionsFnacV1DeprecatedDescriptionsSecurityRequirements, + operationName: "V1SolutionsFnacV1DeprecatedDescriptionsAsync"); + + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: "/solutions/fnac/v1-deprecated/descriptions", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.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); + } + } + global::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareV1SolutionsFnacV1DeprecatedDescriptionsRequest( + 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::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsFnacV1DeprecatedDescriptions", + methodName: "V1SolutionsFnacV1DeprecatedDescriptionsAsync", + pathTemplate: "\"/solutions/fnac/v1-deprecated/descriptions\"", + 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::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsFnacV1DeprecatedDescriptions", + methodName: "V1SolutionsFnacV1DeprecatedDescriptionsAsync", + pathTemplate: "\"/solutions/fnac/v1-deprecated/descriptions\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsFnacV1DeprecatedDescriptions", + methodName: "V1SolutionsFnacV1DeprecatedDescriptionsAsync", + pathTemplate: "\"/solutions/fnac/v1-deprecated/descriptions\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessV1SolutionsFnacV1DeprecatedDescriptionsResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsFnacV1DeprecatedDescriptions", + methodName: "V1SolutionsFnacV1DeprecatedDescriptionsAsync", + pathTemplate: "\"/solutions/fnac/v1-deprecated/descriptions\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsFnacV1DeprecatedDescriptions", + methodName: "V1SolutionsFnacV1DeprecatedDescriptionsAsync", + pathTemplate: "\"/solutions/fnac/v1-deprecated/descriptions\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __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); + ProcessV1SolutionsFnacV1DeprecatedDescriptionsResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? 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::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.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::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsFnacV1Descriptions.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsFnacV1Descriptions.g.cs new file mode 100644 index 00000000..1928d186 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsFnacV1Descriptions.g.cs @@ -0,0 +1,411 @@ + +#nullable enable + +namespace AI21 +{ + public partial class Ai21Client + { + + + private static readonly global::AI21.EndPointSecurityRequirement s_V1SolutionsFnacV1DescriptionsSecurityRequirement0 = + new global::AI21.EndPointSecurityRequirement + { + Authorizations = new global::AI21.EndPointAuthorizationRequirement[] + { new global::AI21.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::AI21.EndPointSecurityRequirement[] s_V1SolutionsFnacV1DescriptionsSecurityRequirements = + new global::AI21.EndPointSecurityRequirement[] + { s_V1SolutionsFnacV1DescriptionsSecurityRequirement0, + }; + partial void PrepareV1SolutionsFnacV1DescriptionsArguments( + global::System.Net.Http.HttpClient httpClient); + partial void PrepareV1SolutionsFnacV1DescriptionsRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage); + partial void ProcessV1SolutionsFnacV1DescriptionsResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessV1SolutionsFnacV1DescriptionsResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Fnac V1 Descriptions + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task V1SolutionsFnacV1DescriptionsAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await V1SolutionsFnacV1DescriptionsAsResponseAsync( + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Fnac V1 Descriptions + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> V1SolutionsFnacV1DescriptionsAsResponseAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareV1SolutionsFnacV1DescriptionsArguments( + httpClient: HttpClient); + + + var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_V1SolutionsFnacV1DescriptionsSecurityRequirements, + operationName: "V1SolutionsFnacV1DescriptionsAsync"); + + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: "/solutions/fnac/v1/descriptions", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.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); + } + } + global::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareV1SolutionsFnacV1DescriptionsRequest( + 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::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsFnacV1Descriptions", + methodName: "V1SolutionsFnacV1DescriptionsAsync", + pathTemplate: "\"/solutions/fnac/v1/descriptions\"", + 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::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsFnacV1Descriptions", + methodName: "V1SolutionsFnacV1DescriptionsAsync", + pathTemplate: "\"/solutions/fnac/v1/descriptions\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsFnacV1Descriptions", + methodName: "V1SolutionsFnacV1DescriptionsAsync", + pathTemplate: "\"/solutions/fnac/v1/descriptions\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessV1SolutionsFnacV1DescriptionsResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsFnacV1Descriptions", + methodName: "V1SolutionsFnacV1DescriptionsAsync", + pathTemplate: "\"/solutions/fnac/v1/descriptions\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsFnacV1Descriptions", + methodName: "V1SolutionsFnacV1DescriptionsAsync", + pathTemplate: "\"/solutions/fnac/v1/descriptions\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __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); + ProcessV1SolutionsFnacV1DescriptionsResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? 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::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.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::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsTlvMunicipalityConvrag.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsTlvMunicipalityConvrag.g.cs new file mode 100644 index 00000000..67d32783 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsTlvMunicipalityConvrag.g.cs @@ -0,0 +1,411 @@ + +#nullable enable + +namespace AI21 +{ + public partial class Ai21Client + { + + + private static readonly global::AI21.EndPointSecurityRequirement s_V1SolutionsTlvMunicipalityConvragSecurityRequirement0 = + new global::AI21.EndPointSecurityRequirement + { + Authorizations = new global::AI21.EndPointAuthorizationRequirement[] + { new global::AI21.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::AI21.EndPointSecurityRequirement[] s_V1SolutionsTlvMunicipalityConvragSecurityRequirements = + new global::AI21.EndPointSecurityRequirement[] + { s_V1SolutionsTlvMunicipalityConvragSecurityRequirement0, + }; + partial void PrepareV1SolutionsTlvMunicipalityConvragArguments( + global::System.Net.Http.HttpClient httpClient); + partial void PrepareV1SolutionsTlvMunicipalityConvragRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage); + partial void ProcessV1SolutionsTlvMunicipalityConvragResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessV1SolutionsTlvMunicipalityConvragResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Tlv Convrag + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task V1SolutionsTlvMunicipalityConvragAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await V1SolutionsTlvMunicipalityConvragAsResponseAsync( + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Tlv Convrag + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> V1SolutionsTlvMunicipalityConvragAsResponseAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareV1SolutionsTlvMunicipalityConvragArguments( + httpClient: HttpClient); + + + var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_V1SolutionsTlvMunicipalityConvragSecurityRequirements, + operationName: "V1SolutionsTlvMunicipalityConvragAsync"); + + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: "/solutions/tlv_municipality/convrag", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.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); + } + } + global::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareV1SolutionsTlvMunicipalityConvragRequest( + 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::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsTlvMunicipalityConvrag", + methodName: "V1SolutionsTlvMunicipalityConvragAsync", + pathTemplate: "\"/solutions/tlv_municipality/convrag\"", + 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::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsTlvMunicipalityConvrag", + methodName: "V1SolutionsTlvMunicipalityConvragAsync", + pathTemplate: "\"/solutions/tlv_municipality/convrag\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsTlvMunicipalityConvrag", + methodName: "V1SolutionsTlvMunicipalityConvragAsync", + pathTemplate: "\"/solutions/tlv_municipality/convrag\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessV1SolutionsTlvMunicipalityConvragResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsTlvMunicipalityConvrag", + methodName: "V1SolutionsTlvMunicipalityConvragAsync", + pathTemplate: "\"/solutions/tlv_municipality/convrag\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsTlvMunicipalityConvrag", + methodName: "V1SolutionsTlvMunicipalityConvragAsync", + pathTemplate: "\"/solutions/tlv_municipality/convrag\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __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); + ProcessV1SolutionsTlvMunicipalityConvragResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? 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::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.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::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsTlvMunicipalityPreviewConvrag.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsTlvMunicipalityPreviewConvrag.g.cs new file mode 100644 index 00000000..1117c5e3 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Ai21Client.V1SolutionsTlvMunicipalityPreviewConvrag.g.cs @@ -0,0 +1,411 @@ + +#nullable enable + +namespace AI21 +{ + public partial class Ai21Client + { + + + private static readonly global::AI21.EndPointSecurityRequirement s_V1SolutionsTlvMunicipalityPreviewConvragSecurityRequirement0 = + new global::AI21.EndPointSecurityRequirement + { + Authorizations = new global::AI21.EndPointAuthorizationRequirement[] + { new global::AI21.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::AI21.EndPointSecurityRequirement[] s_V1SolutionsTlvMunicipalityPreviewConvragSecurityRequirements = + new global::AI21.EndPointSecurityRequirement[] + { s_V1SolutionsTlvMunicipalityPreviewConvragSecurityRequirement0, + }; + partial void PrepareV1SolutionsTlvMunicipalityPreviewConvragArguments( + global::System.Net.Http.HttpClient httpClient); + partial void PrepareV1SolutionsTlvMunicipalityPreviewConvragRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage); + partial void ProcessV1SolutionsTlvMunicipalityPreviewConvragResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessV1SolutionsTlvMunicipalityPreviewConvragResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Tlv Convrag Prefix Preview + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task V1SolutionsTlvMunicipalityPreviewConvragAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await V1SolutionsTlvMunicipalityPreviewConvragAsResponseAsync( + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Tlv Convrag Prefix Preview + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> V1SolutionsTlvMunicipalityPreviewConvragAsResponseAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareV1SolutionsTlvMunicipalityPreviewConvragArguments( + httpClient: HttpClient); + + + var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_V1SolutionsTlvMunicipalityPreviewConvragSecurityRequirements, + operationName: "V1SolutionsTlvMunicipalityPreviewConvragAsync"); + + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: "/solutions-preview/tlv_municipality/convrag", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.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); + } + } + global::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareV1SolutionsTlvMunicipalityPreviewConvragRequest( + 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::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsTlvMunicipalityPreviewConvrag", + methodName: "V1SolutionsTlvMunicipalityPreviewConvragAsync", + pathTemplate: "\"/solutions-preview/tlv_municipality/convrag\"", + 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::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsTlvMunicipalityPreviewConvrag", + methodName: "V1SolutionsTlvMunicipalityPreviewConvragAsync", + pathTemplate: "\"/solutions-preview/tlv_municipality/convrag\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsTlvMunicipalityPreviewConvrag", + methodName: "V1SolutionsTlvMunicipalityPreviewConvragAsync", + pathTemplate: "\"/solutions-preview/tlv_municipality/convrag\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessV1SolutionsTlvMunicipalityPreviewConvragResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsTlvMunicipalityPreviewConvrag", + methodName: "V1SolutionsTlvMunicipalityPreviewConvragAsync", + pathTemplate: "\"/solutions-preview/tlv_municipality/convrag\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SolutionsTlvMunicipalityPreviewConvrag", + methodName: "V1SolutionsTlvMunicipalityPreviewConvragAsync", + pathTemplate: "\"/solutions-preview/tlv_municipality/convrag\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __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); + ProcessV1SolutionsTlvMunicipalityPreviewConvragResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? 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::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.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::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.V1StudioApiGenerationRequirements.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.V1StudioApiGenerationRequirements.g.cs index 97aeeef9..41b8c674 100644 --- a/src/libs/AI21/Generated/AI21.Ai21Client.V1StudioApiGenerationRequirements.g.cs +++ b/src/libs/AI21/Generated/AI21.Ai21Client.V1StudioApiGenerationRequirements.g.cs @@ -14,6 +14,7 @@ public partial class Ai21Client { new global::AI21.EndPointAuthorizationRequirement { Type = "Http", + SchemeId = "HttpBearer", Location = "Header", Name = "Bearer", FriendlyName = "Bearer", @@ -44,11 +45,35 @@ partial void ProcessV1StudioApiGenerationRequirementsResponseContent( /// Generate Requirements /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// public async global::System.Threading.Tasks.Task V1StudioApiGenerationRequirementsAsync( global::AI21.RequirementsGenerationRequest request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await V1StudioApiGenerationRequirementsAsResponseAsync( + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Generate Requirements + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> V1StudioApiGenerationRequirementsAsResponseAsync( + + global::AI21.RequirementsGenerationRequest request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) { request = request ?? throw new global::System.ArgumentNullException(nameof(request)); @@ -65,22 +90,44 @@ partial void ProcessV1StudioApiGenerationRequirementsResponseContent( securityRequirements: s_V1StudioApiGenerationRequirementsSecurityRequirements, operationName: "V1StudioApiGenerationRequirementsAsync"); - var __pathBuilder = new global::AI21.PathBuilder( - path: "/studio/v1/generation/requirements", - 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)); + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: "/studio/v1/generation/requirements", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.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; + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; #endif foreach (var __authorization in __authorizations) { if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2") + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") { __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( scheme: __authorization.Name, @@ -90,165 +137,347 @@ partial void ProcessV1StudioApiGenerationRequirementsResponseContent( __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); - PrepareV1StudioApiGenerationRequirementsRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - request: request); + 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::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareV1StudioApiGenerationRequirementsRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + request: request); - ProcessResponse( - client: HttpClient, - response: __response); - ProcessV1StudioApiGenerationRequirementsResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Validation Error - if ((int)__response.StatusCode == 422) + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::AI21.HTTPValidationError? __value_422 = null; - try + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) { - if (ReadResponseAsString) + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1StudioApiGenerationRequirements", + methodName: "V1StudioApiGenerationRequirementsAsync", + pathTemplate: "\"/studio/v1/generation/requirements\"", + 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 { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); } - else + catch (global::System.Net.Http.HttpRequestException __exception) { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1StudioApiGenerationRequirements", + methodName: "V1StudioApiGenerationRequirementsAsync", + pathTemplate: "\"/studio/v1/generation/requirements\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1StudioApiGenerationRequirements", + methodName: "V1StudioApiGenerationRequirementsAsync", + pathTemplate: "\"/studio/v1/generation/requirements\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; } + + break; } - catch (global::System.Exception __ex) + + if (__response == null) { - __exception_422 = __ex; + throw new global::System.InvalidOperationException("No response received."); } - throw new global::AI21.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) + using (__response) { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - ProcessResponseContent( + ProcessResponse( client: HttpClient, - response: __response, - content: ref __content); - ProcessV1StudioApiGenerationRequirementsResponseContent( + response: __response); + ProcessV1StudioApiGenerationRequirementsResponse( httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) { - __response.EnsureSuccessStatusCode(); - - return - global::AI21.RequirementsGenerationResponse.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1StudioApiGenerationRequirements", + methodName: "V1StudioApiGenerationRequirementsAsync", + pathTemplate: "\"/studio/v1/generation/requirements\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } - catch (global::System.Exception __ex) + else { - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1StudioApiGenerationRequirements", + methodName: "V1StudioApiGenerationRequirementsAsync", + pathTemplate: "\"/studio/v1/generation/requirements\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - using var __content = await __response.Content.ReadAsStreamAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::AI21.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - return - await global::AI21.RequirementsGenerationResponse.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) - { - } + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessV1StudioApiGenerationRequirementsResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::AI21.RequirementsGenerationResponse.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => 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::AI21.RequirementsGenerationResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; } } + finally + { + __httpRequest?.Dispose(); + } } /// /// Generate Requirements /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// public async global::System.Threading.Tasks.Task V1StudioApiGenerationRequirementsAsync( string query, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) { var __request = new global::AI21.RequirementsGenerationRequest @@ -258,6 +487,7 @@ partial void ProcessV1StudioApiGenerationRequirementsResponseContent( return await V1StudioApiGenerationRequirementsAsync( request: __request, + requestOptions: requestOptions, cancellationToken: cancellationToken).ConfigureAwait(false); } } diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.V1StudioApiGenerationThreadName.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.V1StudioApiGenerationThreadName.g.cs deleted file mode 100644 index 7ca9b988..00000000 --- a/src/libs/AI21/Generated/AI21.Ai21Client.V1StudioApiGenerationThreadName.g.cs +++ /dev/null @@ -1,264 +0,0 @@ - -#nullable enable - -namespace AI21 -{ - public partial class Ai21Client - { - - - private static readonly global::AI21.EndPointSecurityRequirement s_V1StudioApiGenerationThreadNameSecurityRequirement0 = - new global::AI21.EndPointSecurityRequirement - { - Authorizations = new global::AI21.EndPointAuthorizationRequirement[] - { new global::AI21.EndPointAuthorizationRequirement - { - Type = "Http", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::AI21.EndPointSecurityRequirement[] s_V1StudioApiGenerationThreadNameSecurityRequirements = - new global::AI21.EndPointSecurityRequirement[] - { s_V1StudioApiGenerationThreadNameSecurityRequirement0, - }; - partial void PrepareV1StudioApiGenerationThreadNameArguments( - global::System.Net.Http.HttpClient httpClient, - global::AI21.ThreadNameGenerationRequest request); - partial void PrepareV1StudioApiGenerationThreadNameRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - global::AI21.ThreadNameGenerationRequest request); - partial void ProcessV1StudioApiGenerationThreadNameResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessV1StudioApiGenerationThreadNameResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Generate Thread Name - /// - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task V1StudioApiGenerationThreadNameAsync( - - global::AI21.ThreadNameGenerationRequest request, - global::System.Threading.CancellationToken cancellationToken = default) - { - request = request ?? throw new global::System.ArgumentNullException(nameof(request)); - - PrepareArguments( - client: HttpClient); - PrepareV1StudioApiGenerationThreadNameArguments( - httpClient: HttpClient, - request: request); - - - var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_V1StudioApiGenerationThreadNameSecurityRequirements, - operationName: "V1StudioApiGenerationThreadNameAsync"); - - var __pathBuilder = new global::AI21.PathBuilder( - path: "/studio/v1/generation/thread-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); - } - } - 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); - PrepareV1StudioApiGenerationThreadNameRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - 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); - ProcessV1StudioApiGenerationThreadNameResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Validation Error - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::AI21.HTTPValidationError? __value_422 = null; - try - { - if (ReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - throw new global::AI21.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) - { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessV1StudioApiGenerationThreadNameResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return - global::AI21.ThreadNameGenerationResponse.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - } - catch (global::System.Exception __ex) - { - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __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::AI21.ThreadNameGenerationResponse.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::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - } - /// - /// Generate Thread Name - /// - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task V1StudioApiGenerationThreadNameAsync( - string query, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __request = new global::AI21.ThreadNameGenerationRequest - { - Query = query, - }; - - return await V1StudioApiGenerationThreadNameAsync( - request: __request, - cancellationToken: cancellationToken).ConfigureAwait(false); - } - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.V1ValidatePlan.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.V1ValidatePlan.g.cs index 894e60ab..06bc2a98 100644 --- a/src/libs/AI21/Generated/AI21.Ai21Client.V1ValidatePlan.g.cs +++ b/src/libs/AI21/Generated/AI21.Ai21Client.V1ValidatePlan.g.cs @@ -14,6 +14,7 @@ public partial class Ai21Client { new global::AI21.EndPointAuthorizationRequirement { Type = "Http", + SchemeId = "HttpBearer", Location = "Header", Name = "Bearer", FriendlyName = "Bearer", @@ -47,12 +48,39 @@ partial void ProcessV1ValidatePlanResponseContent( /// /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// public async global::System.Threading.Tasks.Task V1ValidatePlanAsync( string assistantId, global::AI21.CreatePlanPayload request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await V1ValidatePlanAsResponseAsync( + assistantId: assistantId, + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Validate Plan + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> V1ValidatePlanAsResponseAsync( + string assistantId, + + global::AI21.CreatePlanPayload request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) { request = request ?? throw new global::System.ArgumentNullException(nameof(request)); @@ -70,22 +98,44 @@ partial void ProcessV1ValidatePlanResponseContent( securityRequirements: s_V1ValidatePlanSecurityRequirements, operationName: "V1ValidatePlanAsync"); - var __pathBuilder = new global::AI21.PathBuilder( - path: $"/studio/v1/assistants/{assistantId}/validate_plan", - 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)); + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: $"/studio/v1/assistants/{assistantId}/validate_plan", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.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; + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; #endif foreach (var __authorization in __authorizations) { if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2") + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") { __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( scheme: __authorization.Name, @@ -95,157 +145,337 @@ partial void ProcessV1ValidatePlanResponseContent( __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); - PrepareV1ValidatePlanRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - assistantId: assistantId, - request: request); + 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::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareV1ValidatePlanRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + assistantId: assistantId!, + request: request); - ProcessResponse( - client: HttpClient, - response: __response); - ProcessV1ValidatePlanResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Validation Error - if ((int)__response.StatusCode == 422) + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::AI21.HTTPValidationError? __value_422 = null; - try + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) { - if (ReadResponseAsString) + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1ValidatePlan", + methodName: "V1ValidatePlanAsync", + pathTemplate: "$\"/studio/v1/assistants/{assistantId}/validate_plan\"", + 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 { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); } - else + catch (global::System.Net.Http.HttpRequestException __exception) { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1ValidatePlan", + methodName: "V1ValidatePlanAsync", + pathTemplate: "$\"/studio/v1/assistants/{assistantId}/validate_plan\"", + 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; + } - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1ValidatePlan", + methodName: "V1ValidatePlanAsync", + pathTemplate: "$\"/studio/v1/assistants/{assistantId}/validate_plan\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; } - catch (global::System.Exception __ex) + + if (__response == null) { - __exception_422 = __ex; + throw new global::System.InvalidOperationException("No response received."); } - throw new global::AI21.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) + using (__response) { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( + ProcessResponse( client: HttpClient, - response: __response, - content: ref __content); - ProcessV1ValidatePlanResponseContent( + response: __response); + ProcessV1ValidatePlanResponse( httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) { - __response.EnsureSuccessStatusCode(); - - return - global::AI21.ValidationResult.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1ValidatePlan", + methodName: "V1ValidatePlanAsync", + pathTemplate: "$\"/studio/v1/assistants/{assistantId}/validate_plan\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } - catch (global::System.Exception __ex) + else { - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1ValidatePlan", + methodName: "V1ValidatePlanAsync", + pathTemplate: "$\"/studio/v1/assistants/{assistantId}/validate_plan\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - using var __content = await __response.Content.ReadAsStreamAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::AI21.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - return - await global::AI21.ValidationResult.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) - { - } + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessV1ValidatePlanResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::AI21.ValidationResult.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => 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::AI21.ValidationResult.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; } } + finally + { + __httpRequest?.Dispose(); + } } /// /// Validate Plan @@ -253,12 +483,14 @@ partial void ProcessV1ValidatePlanResponseContent( /// /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// public async global::System.Threading.Tasks.Task V1ValidatePlanAsync( string assistantId, string code, global::System.Collections.Generic.IList? schemas = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) { var __request = new global::AI21.CreatePlanPayload @@ -270,6 +502,7 @@ partial void ProcessV1ValidatePlanResponseContent( return await V1ValidatePlanAsync( assistantId: assistantId, request: __request, + requestOptions: requestOptions, cancellationToken: cancellationToken).ConfigureAwait(false); } } diff --git a/src/libs/AI21/Generated/AI21.Ai21Client.VidaaActionItemsPreviewSolutionsPreviewVidaaActionItemsPost.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.VidaaActionItemsPreviewSolutionsPreviewVidaaActionItemsPost.g.cs deleted file mode 100644 index 7049a351..00000000 --- a/src/libs/AI21/Generated/AI21.Ai21Client.VidaaActionItemsPreviewSolutionsPreviewVidaaActionItemsPost.g.cs +++ /dev/null @@ -1,188 +0,0 @@ - -#nullable enable - -namespace AI21 -{ - public partial class Ai21Client - { - - - private static readonly global::AI21.EndPointSecurityRequirement s_VidaaActionItemsPreviewSolutionsPreviewVidaaActionItemsPostSecurityRequirement0 = - new global::AI21.EndPointSecurityRequirement - { - Authorizations = new global::AI21.EndPointAuthorizationRequirement[] - { new global::AI21.EndPointAuthorizationRequirement - { - Type = "Http", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::AI21.EndPointSecurityRequirement[] s_VidaaActionItemsPreviewSolutionsPreviewVidaaActionItemsPostSecurityRequirements = - new global::AI21.EndPointSecurityRequirement[] - { s_VidaaActionItemsPreviewSolutionsPreviewVidaaActionItemsPostSecurityRequirement0, - }; - partial void PrepareVidaaActionItemsPreviewSolutionsPreviewVidaaActionItemsPostArguments( - global::System.Net.Http.HttpClient httpClient); - partial void PrepareVidaaActionItemsPreviewSolutionsPreviewVidaaActionItemsPostRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage); - partial void ProcessVidaaActionItemsPreviewSolutionsPreviewVidaaActionItemsPostResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessVidaaActionItemsPreviewSolutionsPreviewVidaaActionItemsPostResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Vidaa Action Items Preview - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task VidaaActionItemsPreviewSolutionsPreviewVidaaActionItemsPostAsync( - global::System.Threading.CancellationToken cancellationToken = default) - { - PrepareArguments( - client: HttpClient); - PrepareVidaaActionItemsPreviewSolutionsPreviewVidaaActionItemsPostArguments( - httpClient: HttpClient); - - - var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_VidaaActionItemsPreviewSolutionsPreviewVidaaActionItemsPostSecurityRequirements, - operationName: "VidaaActionItemsPreviewSolutionsPreviewVidaaActionItemsPostAsync"); - - var __pathBuilder = new global::AI21.PathBuilder( - path: "/solutions-preview/vidaa/action-items", - 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); - } - } - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareVidaaActionItemsPreviewSolutionsPreviewVidaaActionItemsPostRequest( - 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); - ProcessVidaaActionItemsPreviewSolutionsPreviewVidaaActionItemsPostResponse( - 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); - ProcessVidaaActionItemsPreviewSolutionsPreviewVidaaActionItemsPostResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return __content; - } - catch (global::System.Exception __ex) - { - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __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::AI21.ApiException( - message: __content ?? __response.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/AI21/Generated/AI21.Ai21Client.VidaaActionItemsSolutionsVidaaActionItemsPost.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.VidaaActionItemsSolutionsVidaaActionItemsPost.g.cs deleted file mode 100644 index a723f3a0..00000000 --- a/src/libs/AI21/Generated/AI21.Ai21Client.VidaaActionItemsSolutionsVidaaActionItemsPost.g.cs +++ /dev/null @@ -1,188 +0,0 @@ - -#nullable enable - -namespace AI21 -{ - public partial class Ai21Client - { - - - private static readonly global::AI21.EndPointSecurityRequirement s_VidaaActionItemsSolutionsVidaaActionItemsPostSecurityRequirement0 = - new global::AI21.EndPointSecurityRequirement - { - Authorizations = new global::AI21.EndPointAuthorizationRequirement[] - { new global::AI21.EndPointAuthorizationRequirement - { - Type = "Http", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::AI21.EndPointSecurityRequirement[] s_VidaaActionItemsSolutionsVidaaActionItemsPostSecurityRequirements = - new global::AI21.EndPointSecurityRequirement[] - { s_VidaaActionItemsSolutionsVidaaActionItemsPostSecurityRequirement0, - }; - partial void PrepareVidaaActionItemsSolutionsVidaaActionItemsPostArguments( - global::System.Net.Http.HttpClient httpClient); - partial void PrepareVidaaActionItemsSolutionsVidaaActionItemsPostRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage); - partial void ProcessVidaaActionItemsSolutionsVidaaActionItemsPostResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessVidaaActionItemsSolutionsVidaaActionItemsPostResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Vidaa Action Items - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task VidaaActionItemsSolutionsVidaaActionItemsPostAsync( - global::System.Threading.CancellationToken cancellationToken = default) - { - PrepareArguments( - client: HttpClient); - PrepareVidaaActionItemsSolutionsVidaaActionItemsPostArguments( - httpClient: HttpClient); - - - var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_VidaaActionItemsSolutionsVidaaActionItemsPostSecurityRequirements, - operationName: "VidaaActionItemsSolutionsVidaaActionItemsPostAsync"); - - var __pathBuilder = new global::AI21.PathBuilder( - path: "/solutions/vidaa/action-items", - 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); - } - } - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareVidaaActionItemsSolutionsVidaaActionItemsPostRequest( - 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); - ProcessVidaaActionItemsSolutionsVidaaActionItemsPostResponse( - 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); - ProcessVidaaActionItemsSolutionsVidaaActionItemsPostResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return __content; - } - catch (global::System.Exception __ex) - { - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __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::AI21.ApiException( - message: __content ?? __response.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/AI21/Generated/AI21.Ai21Client.VidaaFeedItemsPreviewSolutionsPreviewVidaaFeedItemsGet.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.VidaaFeedItemsPreviewSolutionsPreviewVidaaFeedItemsGet.g.cs deleted file mode 100644 index 15212b15..00000000 --- a/src/libs/AI21/Generated/AI21.Ai21Client.VidaaFeedItemsPreviewSolutionsPreviewVidaaFeedItemsGet.g.cs +++ /dev/null @@ -1,188 +0,0 @@ - -#nullable enable - -namespace AI21 -{ - public partial class Ai21Client - { - - - private static readonly global::AI21.EndPointSecurityRequirement s_VidaaFeedItemsPreviewSolutionsPreviewVidaaFeedItemsGetSecurityRequirement0 = - new global::AI21.EndPointSecurityRequirement - { - Authorizations = new global::AI21.EndPointAuthorizationRequirement[] - { new global::AI21.EndPointAuthorizationRequirement - { - Type = "Http", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::AI21.EndPointSecurityRequirement[] s_VidaaFeedItemsPreviewSolutionsPreviewVidaaFeedItemsGetSecurityRequirements = - new global::AI21.EndPointSecurityRequirement[] - { s_VidaaFeedItemsPreviewSolutionsPreviewVidaaFeedItemsGetSecurityRequirement0, - }; - partial void PrepareVidaaFeedItemsPreviewSolutionsPreviewVidaaFeedItemsGetArguments( - global::System.Net.Http.HttpClient httpClient); - partial void PrepareVidaaFeedItemsPreviewSolutionsPreviewVidaaFeedItemsGetRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage); - partial void ProcessVidaaFeedItemsPreviewSolutionsPreviewVidaaFeedItemsGetResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessVidaaFeedItemsPreviewSolutionsPreviewVidaaFeedItemsGetResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Vidaa Feed Items Preview - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task VidaaFeedItemsPreviewSolutionsPreviewVidaaFeedItemsGetAsync( - global::System.Threading.CancellationToken cancellationToken = default) - { - PrepareArguments( - client: HttpClient); - PrepareVidaaFeedItemsPreviewSolutionsPreviewVidaaFeedItemsGetArguments( - httpClient: HttpClient); - - - var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_VidaaFeedItemsPreviewSolutionsPreviewVidaaFeedItemsGetSecurityRequirements, - operationName: "VidaaFeedItemsPreviewSolutionsPreviewVidaaFeedItemsGetAsync"); - - var __pathBuilder = new global::AI21.PathBuilder( - path: "/solutions-preview/vidaa/feed-items", - 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); - PrepareVidaaFeedItemsPreviewSolutionsPreviewVidaaFeedItemsGetRequest( - 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); - ProcessVidaaFeedItemsPreviewSolutionsPreviewVidaaFeedItemsGetResponse( - 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); - ProcessVidaaFeedItemsPreviewSolutionsPreviewVidaaFeedItemsGetResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return __content; - } - catch (global::System.Exception __ex) - { - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __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::AI21.ApiException( - message: __content ?? __response.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/AI21/Generated/AI21.Ai21Client.VidaaFeedItemsSolutionsVidaaFeedItemsGet.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.VidaaFeedItemsSolutionsVidaaFeedItemsGet.g.cs deleted file mode 100644 index 55c3b7ef..00000000 --- a/src/libs/AI21/Generated/AI21.Ai21Client.VidaaFeedItemsSolutionsVidaaFeedItemsGet.g.cs +++ /dev/null @@ -1,188 +0,0 @@ - -#nullable enable - -namespace AI21 -{ - public partial class Ai21Client - { - - - private static readonly global::AI21.EndPointSecurityRequirement s_VidaaFeedItemsSolutionsVidaaFeedItemsGetSecurityRequirement0 = - new global::AI21.EndPointSecurityRequirement - { - Authorizations = new global::AI21.EndPointAuthorizationRequirement[] - { new global::AI21.EndPointAuthorizationRequirement - { - Type = "Http", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::AI21.EndPointSecurityRequirement[] s_VidaaFeedItemsSolutionsVidaaFeedItemsGetSecurityRequirements = - new global::AI21.EndPointSecurityRequirement[] - { s_VidaaFeedItemsSolutionsVidaaFeedItemsGetSecurityRequirement0, - }; - partial void PrepareVidaaFeedItemsSolutionsVidaaFeedItemsGetArguments( - global::System.Net.Http.HttpClient httpClient); - partial void PrepareVidaaFeedItemsSolutionsVidaaFeedItemsGetRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage); - partial void ProcessVidaaFeedItemsSolutionsVidaaFeedItemsGetResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessVidaaFeedItemsSolutionsVidaaFeedItemsGetResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Vidaa Feed Items - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task VidaaFeedItemsSolutionsVidaaFeedItemsGetAsync( - global::System.Threading.CancellationToken cancellationToken = default) - { - PrepareArguments( - client: HttpClient); - PrepareVidaaFeedItemsSolutionsVidaaFeedItemsGetArguments( - httpClient: HttpClient); - - - var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_VidaaFeedItemsSolutionsVidaaFeedItemsGetSecurityRequirements, - operationName: "VidaaFeedItemsSolutionsVidaaFeedItemsGetAsync"); - - var __pathBuilder = new global::AI21.PathBuilder( - path: "/solutions/vidaa/feed-items", - 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); - PrepareVidaaFeedItemsSolutionsVidaaFeedItemsGetRequest( - 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); - ProcessVidaaFeedItemsSolutionsVidaaFeedItemsGetResponse( - 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); - ProcessVidaaFeedItemsSolutionsVidaaFeedItemsGetResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return __content; - } - catch (global::System.Exception __ex) - { - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __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::AI21.ApiException( - message: __content ?? __response.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/AI21/Generated/AI21.Ai21Client.VidaaMessagesPreviewSolutionsPreviewVidaaApiMessagesPost.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.VidaaMessagesPreviewSolutionsPreviewVidaaApiMessagesPost.g.cs deleted file mode 100644 index 1771d614..00000000 --- a/src/libs/AI21/Generated/AI21.Ai21Client.VidaaMessagesPreviewSolutionsPreviewVidaaApiMessagesPost.g.cs +++ /dev/null @@ -1,188 +0,0 @@ - -#nullable enable - -namespace AI21 -{ - public partial class Ai21Client - { - - - private static readonly global::AI21.EndPointSecurityRequirement s_VidaaMessagesPreviewSolutionsPreviewVidaaApiMessagesPostSecurityRequirement0 = - new global::AI21.EndPointSecurityRequirement - { - Authorizations = new global::AI21.EndPointAuthorizationRequirement[] - { new global::AI21.EndPointAuthorizationRequirement - { - Type = "Http", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::AI21.EndPointSecurityRequirement[] s_VidaaMessagesPreviewSolutionsPreviewVidaaApiMessagesPostSecurityRequirements = - new global::AI21.EndPointSecurityRequirement[] - { s_VidaaMessagesPreviewSolutionsPreviewVidaaApiMessagesPostSecurityRequirement0, - }; - partial void PrepareVidaaMessagesPreviewSolutionsPreviewVidaaApiMessagesPostArguments( - global::System.Net.Http.HttpClient httpClient); - partial void PrepareVidaaMessagesPreviewSolutionsPreviewVidaaApiMessagesPostRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage); - partial void ProcessVidaaMessagesPreviewSolutionsPreviewVidaaApiMessagesPostResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessVidaaMessagesPreviewSolutionsPreviewVidaaApiMessagesPostResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Vidaa Messages Preview - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task VidaaMessagesPreviewSolutionsPreviewVidaaApiMessagesPostAsync( - global::System.Threading.CancellationToken cancellationToken = default) - { - PrepareArguments( - client: HttpClient); - PrepareVidaaMessagesPreviewSolutionsPreviewVidaaApiMessagesPostArguments( - httpClient: HttpClient); - - - var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_VidaaMessagesPreviewSolutionsPreviewVidaaApiMessagesPostSecurityRequirements, - operationName: "VidaaMessagesPreviewSolutionsPreviewVidaaApiMessagesPostAsync"); - - var __pathBuilder = new global::AI21.PathBuilder( - path: "/solutions-preview/vidaa/api/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); - } - } - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareVidaaMessagesPreviewSolutionsPreviewVidaaApiMessagesPostRequest( - 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); - ProcessVidaaMessagesPreviewSolutionsPreviewVidaaApiMessagesPostResponse( - 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); - ProcessVidaaMessagesPreviewSolutionsPreviewVidaaApiMessagesPostResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return __content; - } - catch (global::System.Exception __ex) - { - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __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::AI21.ApiException( - message: __content ?? __response.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/AI21/Generated/AI21.Ai21Client.VidaaMessagesSolutionsVidaaApiMessagesPost.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.VidaaMessagesSolutionsVidaaApiMessagesPost.g.cs deleted file mode 100644 index 60752b5d..00000000 --- a/src/libs/AI21/Generated/AI21.Ai21Client.VidaaMessagesSolutionsVidaaApiMessagesPost.g.cs +++ /dev/null @@ -1,188 +0,0 @@ - -#nullable enable - -namespace AI21 -{ - public partial class Ai21Client - { - - - private static readonly global::AI21.EndPointSecurityRequirement s_VidaaMessagesSolutionsVidaaApiMessagesPostSecurityRequirement0 = - new global::AI21.EndPointSecurityRequirement - { - Authorizations = new global::AI21.EndPointAuthorizationRequirement[] - { new global::AI21.EndPointAuthorizationRequirement - { - Type = "Http", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::AI21.EndPointSecurityRequirement[] s_VidaaMessagesSolutionsVidaaApiMessagesPostSecurityRequirements = - new global::AI21.EndPointSecurityRequirement[] - { s_VidaaMessagesSolutionsVidaaApiMessagesPostSecurityRequirement0, - }; - partial void PrepareVidaaMessagesSolutionsVidaaApiMessagesPostArguments( - global::System.Net.Http.HttpClient httpClient); - partial void PrepareVidaaMessagesSolutionsVidaaApiMessagesPostRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage); - partial void ProcessVidaaMessagesSolutionsVidaaApiMessagesPostResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessVidaaMessagesSolutionsVidaaApiMessagesPostResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Vidaa Messages - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task VidaaMessagesSolutionsVidaaApiMessagesPostAsync( - global::System.Threading.CancellationToken cancellationToken = default) - { - PrepareArguments( - client: HttpClient); - PrepareVidaaMessagesSolutionsVidaaApiMessagesPostArguments( - httpClient: HttpClient); - - - var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_VidaaMessagesSolutionsVidaaApiMessagesPostSecurityRequirements, - operationName: "VidaaMessagesSolutionsVidaaApiMessagesPostAsync"); - - var __pathBuilder = new global::AI21.PathBuilder( - path: "/solutions/vidaa/api/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); - } - } - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareVidaaMessagesSolutionsVidaaApiMessagesPostRequest( - 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); - ProcessVidaaMessagesSolutionsVidaaApiMessagesPostResponse( - 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); - ProcessVidaaMessagesSolutionsVidaaApiMessagesPostResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return __content; - } - catch (global::System.Exception __ex) - { - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __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::AI21.ApiException( - message: __content ?? __response.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/AI21/Generated/AI21.Ai21Client.VidaaSchedulerStatsPreviewSolutionsPreviewVidaaSchedulerStatsGet.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.VidaaSchedulerStatsPreviewSolutionsPreviewVidaaSchedulerStatsGet.g.cs deleted file mode 100644 index 7f7cec77..00000000 --- a/src/libs/AI21/Generated/AI21.Ai21Client.VidaaSchedulerStatsPreviewSolutionsPreviewVidaaSchedulerStatsGet.g.cs +++ /dev/null @@ -1,188 +0,0 @@ - -#nullable enable - -namespace AI21 -{ - public partial class Ai21Client - { - - - private static readonly global::AI21.EndPointSecurityRequirement s_VidaaSchedulerStatsPreviewSolutionsPreviewVidaaSchedulerStatsGetSecurityRequirement0 = - new global::AI21.EndPointSecurityRequirement - { - Authorizations = new global::AI21.EndPointAuthorizationRequirement[] - { new global::AI21.EndPointAuthorizationRequirement - { - Type = "Http", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::AI21.EndPointSecurityRequirement[] s_VidaaSchedulerStatsPreviewSolutionsPreviewVidaaSchedulerStatsGetSecurityRequirements = - new global::AI21.EndPointSecurityRequirement[] - { s_VidaaSchedulerStatsPreviewSolutionsPreviewVidaaSchedulerStatsGetSecurityRequirement0, - }; - partial void PrepareVidaaSchedulerStatsPreviewSolutionsPreviewVidaaSchedulerStatsGetArguments( - global::System.Net.Http.HttpClient httpClient); - partial void PrepareVidaaSchedulerStatsPreviewSolutionsPreviewVidaaSchedulerStatsGetRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage); - partial void ProcessVidaaSchedulerStatsPreviewSolutionsPreviewVidaaSchedulerStatsGetResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessVidaaSchedulerStatsPreviewSolutionsPreviewVidaaSchedulerStatsGetResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Vidaa Scheduler Stats Preview - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task VidaaSchedulerStatsPreviewSolutionsPreviewVidaaSchedulerStatsGetAsync( - global::System.Threading.CancellationToken cancellationToken = default) - { - PrepareArguments( - client: HttpClient); - PrepareVidaaSchedulerStatsPreviewSolutionsPreviewVidaaSchedulerStatsGetArguments( - httpClient: HttpClient); - - - var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_VidaaSchedulerStatsPreviewSolutionsPreviewVidaaSchedulerStatsGetSecurityRequirements, - operationName: "VidaaSchedulerStatsPreviewSolutionsPreviewVidaaSchedulerStatsGetAsync"); - - var __pathBuilder = new global::AI21.PathBuilder( - path: "/solutions-preview/vidaa/scheduler-stats", - 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); - PrepareVidaaSchedulerStatsPreviewSolutionsPreviewVidaaSchedulerStatsGetRequest( - 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); - ProcessVidaaSchedulerStatsPreviewSolutionsPreviewVidaaSchedulerStatsGetResponse( - 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); - ProcessVidaaSchedulerStatsPreviewSolutionsPreviewVidaaSchedulerStatsGetResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return __content; - } - catch (global::System.Exception __ex) - { - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __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::AI21.ApiException( - message: __content ?? __response.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/AI21/Generated/AI21.Ai21Client.VidaaSchedulerStatsSolutionsVidaaSchedulerStatsGet.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.VidaaSchedulerStatsSolutionsVidaaSchedulerStatsGet.g.cs deleted file mode 100644 index 8b55bdf8..00000000 --- a/src/libs/AI21/Generated/AI21.Ai21Client.VidaaSchedulerStatsSolutionsVidaaSchedulerStatsGet.g.cs +++ /dev/null @@ -1,188 +0,0 @@ - -#nullable enable - -namespace AI21 -{ - public partial class Ai21Client - { - - - private static readonly global::AI21.EndPointSecurityRequirement s_VidaaSchedulerStatsSolutionsVidaaSchedulerStatsGetSecurityRequirement0 = - new global::AI21.EndPointSecurityRequirement - { - Authorizations = new global::AI21.EndPointAuthorizationRequirement[] - { new global::AI21.EndPointAuthorizationRequirement - { - Type = "Http", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::AI21.EndPointSecurityRequirement[] s_VidaaSchedulerStatsSolutionsVidaaSchedulerStatsGetSecurityRequirements = - new global::AI21.EndPointSecurityRequirement[] - { s_VidaaSchedulerStatsSolutionsVidaaSchedulerStatsGetSecurityRequirement0, - }; - partial void PrepareVidaaSchedulerStatsSolutionsVidaaSchedulerStatsGetArguments( - global::System.Net.Http.HttpClient httpClient); - partial void PrepareVidaaSchedulerStatsSolutionsVidaaSchedulerStatsGetRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage); - partial void ProcessVidaaSchedulerStatsSolutionsVidaaSchedulerStatsGetResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessVidaaSchedulerStatsSolutionsVidaaSchedulerStatsGetResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Vidaa Scheduler Stats - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task VidaaSchedulerStatsSolutionsVidaaSchedulerStatsGetAsync( - global::System.Threading.CancellationToken cancellationToken = default) - { - PrepareArguments( - client: HttpClient); - PrepareVidaaSchedulerStatsSolutionsVidaaSchedulerStatsGetArguments( - httpClient: HttpClient); - - - var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_VidaaSchedulerStatsSolutionsVidaaSchedulerStatsGetSecurityRequirements, - operationName: "VidaaSchedulerStatsSolutionsVidaaSchedulerStatsGetAsync"); - - var __pathBuilder = new global::AI21.PathBuilder( - path: "/solutions/vidaa/scheduler-stats", - 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); - PrepareVidaaSchedulerStatsSolutionsVidaaSchedulerStatsGetRequest( - 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); - ProcessVidaaSchedulerStatsSolutionsVidaaSchedulerStatsGetResponse( - 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); - ProcessVidaaSchedulerStatsSolutionsVidaaSchedulerStatsGetResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return __content; - } - catch (global::System.Exception __ex) - { - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __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::AI21.ApiException( - message: __content ?? __response.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/AI21/Generated/AI21.Ai21Client.VidaaSourcesPreviewSolutionsPreviewVidaaSourcesGet.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.VidaaSourcesPreviewSolutionsPreviewVidaaSourcesGet.g.cs deleted file mode 100644 index f67ec947..00000000 --- a/src/libs/AI21/Generated/AI21.Ai21Client.VidaaSourcesPreviewSolutionsPreviewVidaaSourcesGet.g.cs +++ /dev/null @@ -1,188 +0,0 @@ - -#nullable enable - -namespace AI21 -{ - public partial class Ai21Client - { - - - private static readonly global::AI21.EndPointSecurityRequirement s_VidaaSourcesPreviewSolutionsPreviewVidaaSourcesGetSecurityRequirement0 = - new global::AI21.EndPointSecurityRequirement - { - Authorizations = new global::AI21.EndPointAuthorizationRequirement[] - { new global::AI21.EndPointAuthorizationRequirement - { - Type = "Http", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::AI21.EndPointSecurityRequirement[] s_VidaaSourcesPreviewSolutionsPreviewVidaaSourcesGetSecurityRequirements = - new global::AI21.EndPointSecurityRequirement[] - { s_VidaaSourcesPreviewSolutionsPreviewVidaaSourcesGetSecurityRequirement0, - }; - partial void PrepareVidaaSourcesPreviewSolutionsPreviewVidaaSourcesGetArguments( - global::System.Net.Http.HttpClient httpClient); - partial void PrepareVidaaSourcesPreviewSolutionsPreviewVidaaSourcesGetRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage); - partial void ProcessVidaaSourcesPreviewSolutionsPreviewVidaaSourcesGetResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessVidaaSourcesPreviewSolutionsPreviewVidaaSourcesGetResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Vidaa Sources Preview - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task VidaaSourcesPreviewSolutionsPreviewVidaaSourcesGetAsync( - global::System.Threading.CancellationToken cancellationToken = default) - { - PrepareArguments( - client: HttpClient); - PrepareVidaaSourcesPreviewSolutionsPreviewVidaaSourcesGetArguments( - httpClient: HttpClient); - - - var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_VidaaSourcesPreviewSolutionsPreviewVidaaSourcesGetSecurityRequirements, - operationName: "VidaaSourcesPreviewSolutionsPreviewVidaaSourcesGetAsync"); - - var __pathBuilder = new global::AI21.PathBuilder( - path: "/solutions-preview/vidaa/sources", - 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); - PrepareVidaaSourcesPreviewSolutionsPreviewVidaaSourcesGetRequest( - 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); - ProcessVidaaSourcesPreviewSolutionsPreviewVidaaSourcesGetResponse( - 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); - ProcessVidaaSourcesPreviewSolutionsPreviewVidaaSourcesGetResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return __content; - } - catch (global::System.Exception __ex) - { - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __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::AI21.ApiException( - message: __content ?? __response.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/AI21/Generated/AI21.Ai21Client.VidaaSourcesSolutionsVidaaSourcesGet.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.VidaaSourcesSolutionsVidaaSourcesGet.g.cs deleted file mode 100644 index 18184c2a..00000000 --- a/src/libs/AI21/Generated/AI21.Ai21Client.VidaaSourcesSolutionsVidaaSourcesGet.g.cs +++ /dev/null @@ -1,188 +0,0 @@ - -#nullable enable - -namespace AI21 -{ - public partial class Ai21Client - { - - - private static readonly global::AI21.EndPointSecurityRequirement s_VidaaSourcesSolutionsVidaaSourcesGetSecurityRequirement0 = - new global::AI21.EndPointSecurityRequirement - { - Authorizations = new global::AI21.EndPointAuthorizationRequirement[] - { new global::AI21.EndPointAuthorizationRequirement - { - Type = "Http", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::AI21.EndPointSecurityRequirement[] s_VidaaSourcesSolutionsVidaaSourcesGetSecurityRequirements = - new global::AI21.EndPointSecurityRequirement[] - { s_VidaaSourcesSolutionsVidaaSourcesGetSecurityRequirement0, - }; - partial void PrepareVidaaSourcesSolutionsVidaaSourcesGetArguments( - global::System.Net.Http.HttpClient httpClient); - partial void PrepareVidaaSourcesSolutionsVidaaSourcesGetRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage); - partial void ProcessVidaaSourcesSolutionsVidaaSourcesGetResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessVidaaSourcesSolutionsVidaaSourcesGetResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Vidaa Sources - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task VidaaSourcesSolutionsVidaaSourcesGetAsync( - global::System.Threading.CancellationToken cancellationToken = default) - { - PrepareArguments( - client: HttpClient); - PrepareVidaaSourcesSolutionsVidaaSourcesGetArguments( - httpClient: HttpClient); - - - var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_VidaaSourcesSolutionsVidaaSourcesGetSecurityRequirements, - operationName: "VidaaSourcesSolutionsVidaaSourcesGetAsync"); - - var __pathBuilder = new global::AI21.PathBuilder( - path: "/solutions/vidaa/sources", - 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); - PrepareVidaaSourcesSolutionsVidaaSourcesGetRequest( - 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); - ProcessVidaaSourcesSolutionsVidaaSourcesGetResponse( - 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); - ProcessVidaaSourcesSolutionsVidaaSourcesGetResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return __content; - } - catch (global::System.Exception __ex) - { - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __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::AI21.ApiException( - message: __content ?? __response.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/AI21/Generated/AI21.Ai21Client.VidaaSubscribePreviewSolutionsPreviewVidaaSubscribePost.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.VidaaSubscribePreviewSolutionsPreviewVidaaSubscribePost.g.cs deleted file mode 100644 index df9ccbc9..00000000 --- a/src/libs/AI21/Generated/AI21.Ai21Client.VidaaSubscribePreviewSolutionsPreviewVidaaSubscribePost.g.cs +++ /dev/null @@ -1,188 +0,0 @@ - -#nullable enable - -namespace AI21 -{ - public partial class Ai21Client - { - - - private static readonly global::AI21.EndPointSecurityRequirement s_VidaaSubscribePreviewSolutionsPreviewVidaaSubscribePostSecurityRequirement0 = - new global::AI21.EndPointSecurityRequirement - { - Authorizations = new global::AI21.EndPointAuthorizationRequirement[] - { new global::AI21.EndPointAuthorizationRequirement - { - Type = "Http", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::AI21.EndPointSecurityRequirement[] s_VidaaSubscribePreviewSolutionsPreviewVidaaSubscribePostSecurityRequirements = - new global::AI21.EndPointSecurityRequirement[] - { s_VidaaSubscribePreviewSolutionsPreviewVidaaSubscribePostSecurityRequirement0, - }; - partial void PrepareVidaaSubscribePreviewSolutionsPreviewVidaaSubscribePostArguments( - global::System.Net.Http.HttpClient httpClient); - partial void PrepareVidaaSubscribePreviewSolutionsPreviewVidaaSubscribePostRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage); - partial void ProcessVidaaSubscribePreviewSolutionsPreviewVidaaSubscribePostResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessVidaaSubscribePreviewSolutionsPreviewVidaaSubscribePostResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Vidaa Subscribe Preview - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task VidaaSubscribePreviewSolutionsPreviewVidaaSubscribePostAsync( - global::System.Threading.CancellationToken cancellationToken = default) - { - PrepareArguments( - client: HttpClient); - PrepareVidaaSubscribePreviewSolutionsPreviewVidaaSubscribePostArguments( - httpClient: HttpClient); - - - var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_VidaaSubscribePreviewSolutionsPreviewVidaaSubscribePostSecurityRequirements, - operationName: "VidaaSubscribePreviewSolutionsPreviewVidaaSubscribePostAsync"); - - var __pathBuilder = new global::AI21.PathBuilder( - path: "/solutions-preview/vidaa/subscribe", - 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); - } - } - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareVidaaSubscribePreviewSolutionsPreviewVidaaSubscribePostRequest( - 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); - ProcessVidaaSubscribePreviewSolutionsPreviewVidaaSubscribePostResponse( - 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); - ProcessVidaaSubscribePreviewSolutionsPreviewVidaaSubscribePostResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return __content; - } - catch (global::System.Exception __ex) - { - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __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::AI21.ApiException( - message: __content ?? __response.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/AI21/Generated/AI21.Ai21Client.VidaaSubscribeSolutionsVidaaSubscribePost.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.VidaaSubscribeSolutionsVidaaSubscribePost.g.cs deleted file mode 100644 index 029afee1..00000000 --- a/src/libs/AI21/Generated/AI21.Ai21Client.VidaaSubscribeSolutionsVidaaSubscribePost.g.cs +++ /dev/null @@ -1,188 +0,0 @@ - -#nullable enable - -namespace AI21 -{ - public partial class Ai21Client - { - - - private static readonly global::AI21.EndPointSecurityRequirement s_VidaaSubscribeSolutionsVidaaSubscribePostSecurityRequirement0 = - new global::AI21.EndPointSecurityRequirement - { - Authorizations = new global::AI21.EndPointAuthorizationRequirement[] - { new global::AI21.EndPointAuthorizationRequirement - { - Type = "Http", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::AI21.EndPointSecurityRequirement[] s_VidaaSubscribeSolutionsVidaaSubscribePostSecurityRequirements = - new global::AI21.EndPointSecurityRequirement[] - { s_VidaaSubscribeSolutionsVidaaSubscribePostSecurityRequirement0, - }; - partial void PrepareVidaaSubscribeSolutionsVidaaSubscribePostArguments( - global::System.Net.Http.HttpClient httpClient); - partial void PrepareVidaaSubscribeSolutionsVidaaSubscribePostRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage); - partial void ProcessVidaaSubscribeSolutionsVidaaSubscribePostResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessVidaaSubscribeSolutionsVidaaSubscribePostResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Vidaa Subscribe - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task VidaaSubscribeSolutionsVidaaSubscribePostAsync( - global::System.Threading.CancellationToken cancellationToken = default) - { - PrepareArguments( - client: HttpClient); - PrepareVidaaSubscribeSolutionsVidaaSubscribePostArguments( - httpClient: HttpClient); - - - var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_VidaaSubscribeSolutionsVidaaSubscribePostSecurityRequirements, - operationName: "VidaaSubscribeSolutionsVidaaSubscribePostAsync"); - - var __pathBuilder = new global::AI21.PathBuilder( - path: "/solutions/vidaa/subscribe", - 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); - } - } - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareVidaaSubscribeSolutionsVidaaSubscribePostRequest( - 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); - ProcessVidaaSubscribeSolutionsVidaaSubscribePostResponse( - 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); - ProcessVidaaSubscribeSolutionsVidaaSubscribePostResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return __content; - } - catch (global::System.Exception __ex) - { - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __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::AI21.ApiException( - message: __content ?? __response.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/AI21/Generated/AI21.Ai21Client.VidaaSubscriptionsPreviewSolutionsPreviewVidaaSubscriptionsGet.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.VidaaSubscriptionsPreviewSolutionsPreviewVidaaSubscriptionsGet.g.cs deleted file mode 100644 index 2f7b2213..00000000 --- a/src/libs/AI21/Generated/AI21.Ai21Client.VidaaSubscriptionsPreviewSolutionsPreviewVidaaSubscriptionsGet.g.cs +++ /dev/null @@ -1,188 +0,0 @@ - -#nullable enable - -namespace AI21 -{ - public partial class Ai21Client - { - - - private static readonly global::AI21.EndPointSecurityRequirement s_VidaaSubscriptionsPreviewSolutionsPreviewVidaaSubscriptionsGetSecurityRequirement0 = - new global::AI21.EndPointSecurityRequirement - { - Authorizations = new global::AI21.EndPointAuthorizationRequirement[] - { new global::AI21.EndPointAuthorizationRequirement - { - Type = "Http", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::AI21.EndPointSecurityRequirement[] s_VidaaSubscriptionsPreviewSolutionsPreviewVidaaSubscriptionsGetSecurityRequirements = - new global::AI21.EndPointSecurityRequirement[] - { s_VidaaSubscriptionsPreviewSolutionsPreviewVidaaSubscriptionsGetSecurityRequirement0, - }; - partial void PrepareVidaaSubscriptionsPreviewSolutionsPreviewVidaaSubscriptionsGetArguments( - global::System.Net.Http.HttpClient httpClient); - partial void PrepareVidaaSubscriptionsPreviewSolutionsPreviewVidaaSubscriptionsGetRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage); - partial void ProcessVidaaSubscriptionsPreviewSolutionsPreviewVidaaSubscriptionsGetResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessVidaaSubscriptionsPreviewSolutionsPreviewVidaaSubscriptionsGetResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Vidaa Subscriptions Preview - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task VidaaSubscriptionsPreviewSolutionsPreviewVidaaSubscriptionsGetAsync( - global::System.Threading.CancellationToken cancellationToken = default) - { - PrepareArguments( - client: HttpClient); - PrepareVidaaSubscriptionsPreviewSolutionsPreviewVidaaSubscriptionsGetArguments( - httpClient: HttpClient); - - - var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_VidaaSubscriptionsPreviewSolutionsPreviewVidaaSubscriptionsGetSecurityRequirements, - operationName: "VidaaSubscriptionsPreviewSolutionsPreviewVidaaSubscriptionsGetAsync"); - - var __pathBuilder = new global::AI21.PathBuilder( - path: "/solutions-preview/vidaa/subscriptions", - 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); - PrepareVidaaSubscriptionsPreviewSolutionsPreviewVidaaSubscriptionsGetRequest( - 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); - ProcessVidaaSubscriptionsPreviewSolutionsPreviewVidaaSubscriptionsGetResponse( - 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); - ProcessVidaaSubscriptionsPreviewSolutionsPreviewVidaaSubscriptionsGetResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return __content; - } - catch (global::System.Exception __ex) - { - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __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::AI21.ApiException( - message: __content ?? __response.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/AI21/Generated/AI21.Ai21Client.VidaaSubscriptionsSolutionsVidaaSubscriptionsGet.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.VidaaSubscriptionsSolutionsVidaaSubscriptionsGet.g.cs deleted file mode 100644 index da69ec9b..00000000 --- a/src/libs/AI21/Generated/AI21.Ai21Client.VidaaSubscriptionsSolutionsVidaaSubscriptionsGet.g.cs +++ /dev/null @@ -1,188 +0,0 @@ - -#nullable enable - -namespace AI21 -{ - public partial class Ai21Client - { - - - private static readonly global::AI21.EndPointSecurityRequirement s_VidaaSubscriptionsSolutionsVidaaSubscriptionsGetSecurityRequirement0 = - new global::AI21.EndPointSecurityRequirement - { - Authorizations = new global::AI21.EndPointAuthorizationRequirement[] - { new global::AI21.EndPointAuthorizationRequirement - { - Type = "Http", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::AI21.EndPointSecurityRequirement[] s_VidaaSubscriptionsSolutionsVidaaSubscriptionsGetSecurityRequirements = - new global::AI21.EndPointSecurityRequirement[] - { s_VidaaSubscriptionsSolutionsVidaaSubscriptionsGetSecurityRequirement0, - }; - partial void PrepareVidaaSubscriptionsSolutionsVidaaSubscriptionsGetArguments( - global::System.Net.Http.HttpClient httpClient); - partial void PrepareVidaaSubscriptionsSolutionsVidaaSubscriptionsGetRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage); - partial void ProcessVidaaSubscriptionsSolutionsVidaaSubscriptionsGetResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessVidaaSubscriptionsSolutionsVidaaSubscriptionsGetResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Vidaa Subscriptions - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task VidaaSubscriptionsSolutionsVidaaSubscriptionsGetAsync( - global::System.Threading.CancellationToken cancellationToken = default) - { - PrepareArguments( - client: HttpClient); - PrepareVidaaSubscriptionsSolutionsVidaaSubscriptionsGetArguments( - httpClient: HttpClient); - - - var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_VidaaSubscriptionsSolutionsVidaaSubscriptionsGetSecurityRequirements, - operationName: "VidaaSubscriptionsSolutionsVidaaSubscriptionsGetAsync"); - - var __pathBuilder = new global::AI21.PathBuilder( - path: "/solutions/vidaa/subscriptions", - 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); - PrepareVidaaSubscriptionsSolutionsVidaaSubscriptionsGetRequest( - 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); - ProcessVidaaSubscriptionsSolutionsVidaaSubscriptionsGetResponse( - 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); - ProcessVidaaSubscriptionsSolutionsVidaaSubscriptionsGetResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return __content; - } - catch (global::System.Exception __ex) - { - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __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::AI21.ApiException( - message: __content ?? __response.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/AI21/Generated/AI21.Ai21Client.VidaaSummarizePreviewSolutionsPreviewVidaaSummarizePost.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.VidaaSummarizePreviewSolutionsPreviewVidaaSummarizePost.g.cs deleted file mode 100644 index 48c82fce..00000000 --- a/src/libs/AI21/Generated/AI21.Ai21Client.VidaaSummarizePreviewSolutionsPreviewVidaaSummarizePost.g.cs +++ /dev/null @@ -1,188 +0,0 @@ - -#nullable enable - -namespace AI21 -{ - public partial class Ai21Client - { - - - private static readonly global::AI21.EndPointSecurityRequirement s_VidaaSummarizePreviewSolutionsPreviewVidaaSummarizePostSecurityRequirement0 = - new global::AI21.EndPointSecurityRequirement - { - Authorizations = new global::AI21.EndPointAuthorizationRequirement[] - { new global::AI21.EndPointAuthorizationRequirement - { - Type = "Http", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::AI21.EndPointSecurityRequirement[] s_VidaaSummarizePreviewSolutionsPreviewVidaaSummarizePostSecurityRequirements = - new global::AI21.EndPointSecurityRequirement[] - { s_VidaaSummarizePreviewSolutionsPreviewVidaaSummarizePostSecurityRequirement0, - }; - partial void PrepareVidaaSummarizePreviewSolutionsPreviewVidaaSummarizePostArguments( - global::System.Net.Http.HttpClient httpClient); - partial void PrepareVidaaSummarizePreviewSolutionsPreviewVidaaSummarizePostRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage); - partial void ProcessVidaaSummarizePreviewSolutionsPreviewVidaaSummarizePostResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessVidaaSummarizePreviewSolutionsPreviewVidaaSummarizePostResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Vidaa Summarize Preview - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task VidaaSummarizePreviewSolutionsPreviewVidaaSummarizePostAsync( - global::System.Threading.CancellationToken cancellationToken = default) - { - PrepareArguments( - client: HttpClient); - PrepareVidaaSummarizePreviewSolutionsPreviewVidaaSummarizePostArguments( - httpClient: HttpClient); - - - var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_VidaaSummarizePreviewSolutionsPreviewVidaaSummarizePostSecurityRequirements, - operationName: "VidaaSummarizePreviewSolutionsPreviewVidaaSummarizePostAsync"); - - var __pathBuilder = new global::AI21.PathBuilder( - path: "/solutions-preview/vidaa/summarize", - 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); - } - } - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareVidaaSummarizePreviewSolutionsPreviewVidaaSummarizePostRequest( - 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); - ProcessVidaaSummarizePreviewSolutionsPreviewVidaaSummarizePostResponse( - 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); - ProcessVidaaSummarizePreviewSolutionsPreviewVidaaSummarizePostResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return __content; - } - catch (global::System.Exception __ex) - { - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __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::AI21.ApiException( - message: __content ?? __response.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/AI21/Generated/AI21.Ai21Client.VidaaSummarizeSolutionsVidaaSummarizePost.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.VidaaSummarizeSolutionsVidaaSummarizePost.g.cs deleted file mode 100644 index b438aab7..00000000 --- a/src/libs/AI21/Generated/AI21.Ai21Client.VidaaSummarizeSolutionsVidaaSummarizePost.g.cs +++ /dev/null @@ -1,188 +0,0 @@ - -#nullable enable - -namespace AI21 -{ - public partial class Ai21Client - { - - - private static readonly global::AI21.EndPointSecurityRequirement s_VidaaSummarizeSolutionsVidaaSummarizePostSecurityRequirement0 = - new global::AI21.EndPointSecurityRequirement - { - Authorizations = new global::AI21.EndPointAuthorizationRequirement[] - { new global::AI21.EndPointAuthorizationRequirement - { - Type = "Http", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::AI21.EndPointSecurityRequirement[] s_VidaaSummarizeSolutionsVidaaSummarizePostSecurityRequirements = - new global::AI21.EndPointSecurityRequirement[] - { s_VidaaSummarizeSolutionsVidaaSummarizePostSecurityRequirement0, - }; - partial void PrepareVidaaSummarizeSolutionsVidaaSummarizePostArguments( - global::System.Net.Http.HttpClient httpClient); - partial void PrepareVidaaSummarizeSolutionsVidaaSummarizePostRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage); - partial void ProcessVidaaSummarizeSolutionsVidaaSummarizePostResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessVidaaSummarizeSolutionsVidaaSummarizePostResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Vidaa Summarize - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task VidaaSummarizeSolutionsVidaaSummarizePostAsync( - global::System.Threading.CancellationToken cancellationToken = default) - { - PrepareArguments( - client: HttpClient); - PrepareVidaaSummarizeSolutionsVidaaSummarizePostArguments( - httpClient: HttpClient); - - - var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_VidaaSummarizeSolutionsVidaaSummarizePostSecurityRequirements, - operationName: "VidaaSummarizeSolutionsVidaaSummarizePostAsync"); - - var __pathBuilder = new global::AI21.PathBuilder( - path: "/solutions/vidaa/summarize", - 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); - } - } - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareVidaaSummarizeSolutionsVidaaSummarizePostRequest( - 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); - ProcessVidaaSummarizeSolutionsVidaaSummarizePostResponse( - 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); - ProcessVidaaSummarizeSolutionsVidaaSummarizePostResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return __content; - } - catch (global::System.Exception __ex) - { - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __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::AI21.ApiException( - message: __content ?? __response.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/AI21/Generated/AI21.Ai21Client.VidaaTriggerPollPreviewSolutionsPreviewVidaaTriggerPollPost.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.VidaaTriggerPollPreviewSolutionsPreviewVidaaTriggerPollPost.g.cs deleted file mode 100644 index 46830b63..00000000 --- a/src/libs/AI21/Generated/AI21.Ai21Client.VidaaTriggerPollPreviewSolutionsPreviewVidaaTriggerPollPost.g.cs +++ /dev/null @@ -1,188 +0,0 @@ - -#nullable enable - -namespace AI21 -{ - public partial class Ai21Client - { - - - private static readonly global::AI21.EndPointSecurityRequirement s_VidaaTriggerPollPreviewSolutionsPreviewVidaaTriggerPollPostSecurityRequirement0 = - new global::AI21.EndPointSecurityRequirement - { - Authorizations = new global::AI21.EndPointAuthorizationRequirement[] - { new global::AI21.EndPointAuthorizationRequirement - { - Type = "Http", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::AI21.EndPointSecurityRequirement[] s_VidaaTriggerPollPreviewSolutionsPreviewVidaaTriggerPollPostSecurityRequirements = - new global::AI21.EndPointSecurityRequirement[] - { s_VidaaTriggerPollPreviewSolutionsPreviewVidaaTriggerPollPostSecurityRequirement0, - }; - partial void PrepareVidaaTriggerPollPreviewSolutionsPreviewVidaaTriggerPollPostArguments( - global::System.Net.Http.HttpClient httpClient); - partial void PrepareVidaaTriggerPollPreviewSolutionsPreviewVidaaTriggerPollPostRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage); - partial void ProcessVidaaTriggerPollPreviewSolutionsPreviewVidaaTriggerPollPostResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessVidaaTriggerPollPreviewSolutionsPreviewVidaaTriggerPollPostResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Vidaa Trigger Poll Preview - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task VidaaTriggerPollPreviewSolutionsPreviewVidaaTriggerPollPostAsync( - global::System.Threading.CancellationToken cancellationToken = default) - { - PrepareArguments( - client: HttpClient); - PrepareVidaaTriggerPollPreviewSolutionsPreviewVidaaTriggerPollPostArguments( - httpClient: HttpClient); - - - var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_VidaaTriggerPollPreviewSolutionsPreviewVidaaTriggerPollPostSecurityRequirements, - operationName: "VidaaTriggerPollPreviewSolutionsPreviewVidaaTriggerPollPostAsync"); - - var __pathBuilder = new global::AI21.PathBuilder( - path: "/solutions-preview/vidaa/trigger-poll", - 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); - } - } - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareVidaaTriggerPollPreviewSolutionsPreviewVidaaTriggerPollPostRequest( - 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); - ProcessVidaaTriggerPollPreviewSolutionsPreviewVidaaTriggerPollPostResponse( - 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); - ProcessVidaaTriggerPollPreviewSolutionsPreviewVidaaTriggerPollPostResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return __content; - } - catch (global::System.Exception __ex) - { - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __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::AI21.ApiException( - message: __content ?? __response.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/AI21/Generated/AI21.Ai21Client.VidaaTriggerPollSolutionsVidaaTriggerPollPost.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.VidaaTriggerPollSolutionsVidaaTriggerPollPost.g.cs deleted file mode 100644 index d5530a31..00000000 --- a/src/libs/AI21/Generated/AI21.Ai21Client.VidaaTriggerPollSolutionsVidaaTriggerPollPost.g.cs +++ /dev/null @@ -1,188 +0,0 @@ - -#nullable enable - -namespace AI21 -{ - public partial class Ai21Client - { - - - private static readonly global::AI21.EndPointSecurityRequirement s_VidaaTriggerPollSolutionsVidaaTriggerPollPostSecurityRequirement0 = - new global::AI21.EndPointSecurityRequirement - { - Authorizations = new global::AI21.EndPointAuthorizationRequirement[] - { new global::AI21.EndPointAuthorizationRequirement - { - Type = "Http", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::AI21.EndPointSecurityRequirement[] s_VidaaTriggerPollSolutionsVidaaTriggerPollPostSecurityRequirements = - new global::AI21.EndPointSecurityRequirement[] - { s_VidaaTriggerPollSolutionsVidaaTriggerPollPostSecurityRequirement0, - }; - partial void PrepareVidaaTriggerPollSolutionsVidaaTriggerPollPostArguments( - global::System.Net.Http.HttpClient httpClient); - partial void PrepareVidaaTriggerPollSolutionsVidaaTriggerPollPostRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage); - partial void ProcessVidaaTriggerPollSolutionsVidaaTriggerPollPostResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessVidaaTriggerPollSolutionsVidaaTriggerPollPostResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Vidaa Trigger Poll - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task VidaaTriggerPollSolutionsVidaaTriggerPollPostAsync( - global::System.Threading.CancellationToken cancellationToken = default) - { - PrepareArguments( - client: HttpClient); - PrepareVidaaTriggerPollSolutionsVidaaTriggerPollPostArguments( - httpClient: HttpClient); - - - var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_VidaaTriggerPollSolutionsVidaaTriggerPollPostSecurityRequirements, - operationName: "VidaaTriggerPollSolutionsVidaaTriggerPollPostAsync"); - - var __pathBuilder = new global::AI21.PathBuilder( - path: "/solutions/vidaa/trigger-poll", - 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); - } - } - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareVidaaTriggerPollSolutionsVidaaTriggerPollPostRequest( - 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); - ProcessVidaaTriggerPollSolutionsVidaaTriggerPollPostResponse( - 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); - ProcessVidaaTriggerPollSolutionsVidaaTriggerPollPostResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return __content; - } - catch (global::System.Exception __ex) - { - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __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::AI21.ApiException( - message: __content ?? __response.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/AI21/Generated/AI21.Ai21Client.VidaaUnsubscribePreviewSolutionsPreviewVidaaUnsubscribePost.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.VidaaUnsubscribePreviewSolutionsPreviewVidaaUnsubscribePost.g.cs deleted file mode 100644 index 36570ebb..00000000 --- a/src/libs/AI21/Generated/AI21.Ai21Client.VidaaUnsubscribePreviewSolutionsPreviewVidaaUnsubscribePost.g.cs +++ /dev/null @@ -1,188 +0,0 @@ - -#nullable enable - -namespace AI21 -{ - public partial class Ai21Client - { - - - private static readonly global::AI21.EndPointSecurityRequirement s_VidaaUnsubscribePreviewSolutionsPreviewVidaaUnsubscribePostSecurityRequirement0 = - new global::AI21.EndPointSecurityRequirement - { - Authorizations = new global::AI21.EndPointAuthorizationRequirement[] - { new global::AI21.EndPointAuthorizationRequirement - { - Type = "Http", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::AI21.EndPointSecurityRequirement[] s_VidaaUnsubscribePreviewSolutionsPreviewVidaaUnsubscribePostSecurityRequirements = - new global::AI21.EndPointSecurityRequirement[] - { s_VidaaUnsubscribePreviewSolutionsPreviewVidaaUnsubscribePostSecurityRequirement0, - }; - partial void PrepareVidaaUnsubscribePreviewSolutionsPreviewVidaaUnsubscribePostArguments( - global::System.Net.Http.HttpClient httpClient); - partial void PrepareVidaaUnsubscribePreviewSolutionsPreviewVidaaUnsubscribePostRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage); - partial void ProcessVidaaUnsubscribePreviewSolutionsPreviewVidaaUnsubscribePostResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessVidaaUnsubscribePreviewSolutionsPreviewVidaaUnsubscribePostResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Vidaa Unsubscribe Preview - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task VidaaUnsubscribePreviewSolutionsPreviewVidaaUnsubscribePostAsync( - global::System.Threading.CancellationToken cancellationToken = default) - { - PrepareArguments( - client: HttpClient); - PrepareVidaaUnsubscribePreviewSolutionsPreviewVidaaUnsubscribePostArguments( - httpClient: HttpClient); - - - var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_VidaaUnsubscribePreviewSolutionsPreviewVidaaUnsubscribePostSecurityRequirements, - operationName: "VidaaUnsubscribePreviewSolutionsPreviewVidaaUnsubscribePostAsync"); - - var __pathBuilder = new global::AI21.PathBuilder( - path: "/solutions-preview/vidaa/unsubscribe", - 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); - } - } - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareVidaaUnsubscribePreviewSolutionsPreviewVidaaUnsubscribePostRequest( - 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); - ProcessVidaaUnsubscribePreviewSolutionsPreviewVidaaUnsubscribePostResponse( - 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); - ProcessVidaaUnsubscribePreviewSolutionsPreviewVidaaUnsubscribePostResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return __content; - } - catch (global::System.Exception __ex) - { - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __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::AI21.ApiException( - message: __content ?? __response.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/AI21/Generated/AI21.Ai21Client.VidaaUnsubscribeSolutionsVidaaUnsubscribePost.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.VidaaUnsubscribeSolutionsVidaaUnsubscribePost.g.cs deleted file mode 100644 index dca5c131..00000000 --- a/src/libs/AI21/Generated/AI21.Ai21Client.VidaaUnsubscribeSolutionsVidaaUnsubscribePost.g.cs +++ /dev/null @@ -1,188 +0,0 @@ - -#nullable enable - -namespace AI21 -{ - public partial class Ai21Client - { - - - private static readonly global::AI21.EndPointSecurityRequirement s_VidaaUnsubscribeSolutionsVidaaUnsubscribePostSecurityRequirement0 = - new global::AI21.EndPointSecurityRequirement - { - Authorizations = new global::AI21.EndPointAuthorizationRequirement[] - { new global::AI21.EndPointAuthorizationRequirement - { - Type = "Http", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::AI21.EndPointSecurityRequirement[] s_VidaaUnsubscribeSolutionsVidaaUnsubscribePostSecurityRequirements = - new global::AI21.EndPointSecurityRequirement[] - { s_VidaaUnsubscribeSolutionsVidaaUnsubscribePostSecurityRequirement0, - }; - partial void PrepareVidaaUnsubscribeSolutionsVidaaUnsubscribePostArguments( - global::System.Net.Http.HttpClient httpClient); - partial void PrepareVidaaUnsubscribeSolutionsVidaaUnsubscribePostRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage); - partial void ProcessVidaaUnsubscribeSolutionsVidaaUnsubscribePostResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessVidaaUnsubscribeSolutionsVidaaUnsubscribePostResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Vidaa Unsubscribe - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task VidaaUnsubscribeSolutionsVidaaUnsubscribePostAsync( - global::System.Threading.CancellationToken cancellationToken = default) - { - PrepareArguments( - client: HttpClient); - PrepareVidaaUnsubscribeSolutionsVidaaUnsubscribePostArguments( - httpClient: HttpClient); - - - var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_VidaaUnsubscribeSolutionsVidaaUnsubscribePostSecurityRequirements, - operationName: "VidaaUnsubscribeSolutionsVidaaUnsubscribePostAsync"); - - var __pathBuilder = new global::AI21.PathBuilder( - path: "/solutions/vidaa/unsubscribe", - 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); - } - } - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareVidaaUnsubscribeSolutionsVidaaUnsubscribePostRequest( - 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); - ProcessVidaaUnsubscribeSolutionsVidaaUnsubscribePostResponse( - 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); - ProcessVidaaUnsubscribeSolutionsVidaaUnsubscribePostResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return __content; - } - catch (global::System.Exception __ex) - { - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __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::AI21.ApiException( - message: __content ?? __response.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/AI21/Generated/AI21.Ai21Client.WppFeedbackPrefixPreviewSolutionsPreviewWppFeedbackPost.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.WppFeedbackPrefixPreviewSolutionsPreviewWppFeedbackPost.g.cs deleted file mode 100644 index 9ff63eb2..00000000 --- a/src/libs/AI21/Generated/AI21.Ai21Client.WppFeedbackPrefixPreviewSolutionsPreviewWppFeedbackPost.g.cs +++ /dev/null @@ -1,188 +0,0 @@ - -#nullable enable - -namespace AI21 -{ - public partial class Ai21Client - { - - - private static readonly global::AI21.EndPointSecurityRequirement s_WppFeedbackPrefixPreviewSolutionsPreviewWppFeedbackPostSecurityRequirement0 = - new global::AI21.EndPointSecurityRequirement - { - Authorizations = new global::AI21.EndPointAuthorizationRequirement[] - { new global::AI21.EndPointAuthorizationRequirement - { - Type = "Http", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::AI21.EndPointSecurityRequirement[] s_WppFeedbackPrefixPreviewSolutionsPreviewWppFeedbackPostSecurityRequirements = - new global::AI21.EndPointSecurityRequirement[] - { s_WppFeedbackPrefixPreviewSolutionsPreviewWppFeedbackPostSecurityRequirement0, - }; - partial void PrepareWppFeedbackPrefixPreviewSolutionsPreviewWppFeedbackPostArguments( - global::System.Net.Http.HttpClient httpClient); - partial void PrepareWppFeedbackPrefixPreviewSolutionsPreviewWppFeedbackPostRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage); - partial void ProcessWppFeedbackPrefixPreviewSolutionsPreviewWppFeedbackPostResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessWppFeedbackPrefixPreviewSolutionsPreviewWppFeedbackPostResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Wpp Feedback Prefix Preview - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task WppFeedbackPrefixPreviewSolutionsPreviewWppFeedbackPostAsync( - global::System.Threading.CancellationToken cancellationToken = default) - { - PrepareArguments( - client: HttpClient); - PrepareWppFeedbackPrefixPreviewSolutionsPreviewWppFeedbackPostArguments( - httpClient: HttpClient); - - - var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_WppFeedbackPrefixPreviewSolutionsPreviewWppFeedbackPostSecurityRequirements, - operationName: "WppFeedbackPrefixPreviewSolutionsPreviewWppFeedbackPostAsync"); - - var __pathBuilder = new global::AI21.PathBuilder( - path: "/solutions-preview/wpp/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); - } - } - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareWppFeedbackPrefixPreviewSolutionsPreviewWppFeedbackPostRequest( - 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); - ProcessWppFeedbackPrefixPreviewSolutionsPreviewWppFeedbackPostResponse( - 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); - ProcessWppFeedbackPrefixPreviewSolutionsPreviewWppFeedbackPostResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return __content; - } - catch (global::System.Exception __ex) - { - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __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::AI21.ApiException( - message: __content ?? __response.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/AI21/Generated/AI21.Ai21Client.WppFeedbackSolutionsWppFeedbackPost.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.WppFeedbackSolutionsWppFeedbackPost.g.cs deleted file mode 100644 index cb9b5c89..00000000 --- a/src/libs/AI21/Generated/AI21.Ai21Client.WppFeedbackSolutionsWppFeedbackPost.g.cs +++ /dev/null @@ -1,188 +0,0 @@ - -#nullable enable - -namespace AI21 -{ - public partial class Ai21Client - { - - - private static readonly global::AI21.EndPointSecurityRequirement s_WppFeedbackSolutionsWppFeedbackPostSecurityRequirement0 = - new global::AI21.EndPointSecurityRequirement - { - Authorizations = new global::AI21.EndPointAuthorizationRequirement[] - { new global::AI21.EndPointAuthorizationRequirement - { - Type = "Http", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::AI21.EndPointSecurityRequirement[] s_WppFeedbackSolutionsWppFeedbackPostSecurityRequirements = - new global::AI21.EndPointSecurityRequirement[] - { s_WppFeedbackSolutionsWppFeedbackPostSecurityRequirement0, - }; - partial void PrepareWppFeedbackSolutionsWppFeedbackPostArguments( - global::System.Net.Http.HttpClient httpClient); - partial void PrepareWppFeedbackSolutionsWppFeedbackPostRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage); - partial void ProcessWppFeedbackSolutionsWppFeedbackPostResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessWppFeedbackSolutionsWppFeedbackPostResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Wpp Feedback - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task WppFeedbackSolutionsWppFeedbackPostAsync( - global::System.Threading.CancellationToken cancellationToken = default) - { - PrepareArguments( - client: HttpClient); - PrepareWppFeedbackSolutionsWppFeedbackPostArguments( - httpClient: HttpClient); - - - var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_WppFeedbackSolutionsWppFeedbackPostSecurityRequirements, - operationName: "WppFeedbackSolutionsWppFeedbackPostAsync"); - - var __pathBuilder = new global::AI21.PathBuilder( - path: "/solutions/wpp/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); - } - } - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareWppFeedbackSolutionsWppFeedbackPostRequest( - 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); - ProcessWppFeedbackSolutionsWppFeedbackPostResponse( - 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); - ProcessWppFeedbackSolutionsWppFeedbackPostResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return __content; - } - catch (global::System.Exception __ex) - { - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __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::AI21.ApiException( - message: __content ?? __response.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/AI21/Generated/AI21.Ai21Client.WppQueryPrefixPreviewSolutionsPreviewWppQueryPost.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.WppQueryPrefixPreviewSolutionsPreviewWppQueryPost.g.cs deleted file mode 100644 index c2c92951..00000000 --- a/src/libs/AI21/Generated/AI21.Ai21Client.WppQueryPrefixPreviewSolutionsPreviewWppQueryPost.g.cs +++ /dev/null @@ -1,188 +0,0 @@ - -#nullable enable - -namespace AI21 -{ - public partial class Ai21Client - { - - - private static readonly global::AI21.EndPointSecurityRequirement s_WppQueryPrefixPreviewSolutionsPreviewWppQueryPostSecurityRequirement0 = - new global::AI21.EndPointSecurityRequirement - { - Authorizations = new global::AI21.EndPointAuthorizationRequirement[] - { new global::AI21.EndPointAuthorizationRequirement - { - Type = "Http", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::AI21.EndPointSecurityRequirement[] s_WppQueryPrefixPreviewSolutionsPreviewWppQueryPostSecurityRequirements = - new global::AI21.EndPointSecurityRequirement[] - { s_WppQueryPrefixPreviewSolutionsPreviewWppQueryPostSecurityRequirement0, - }; - partial void PrepareWppQueryPrefixPreviewSolutionsPreviewWppQueryPostArguments( - global::System.Net.Http.HttpClient httpClient); - partial void PrepareWppQueryPrefixPreviewSolutionsPreviewWppQueryPostRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage); - partial void ProcessWppQueryPrefixPreviewSolutionsPreviewWppQueryPostResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessWppQueryPrefixPreviewSolutionsPreviewWppQueryPostResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Wpp Query Prefix Preview - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task WppQueryPrefixPreviewSolutionsPreviewWppQueryPostAsync( - global::System.Threading.CancellationToken cancellationToken = default) - { - PrepareArguments( - client: HttpClient); - PrepareWppQueryPrefixPreviewSolutionsPreviewWppQueryPostArguments( - httpClient: HttpClient); - - - var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_WppQueryPrefixPreviewSolutionsPreviewWppQueryPostSecurityRequirements, - operationName: "WppQueryPrefixPreviewSolutionsPreviewWppQueryPostAsync"); - - var __pathBuilder = new global::AI21.PathBuilder( - path: "/solutions-preview/wpp/query", - 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); - } - } - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareWppQueryPrefixPreviewSolutionsPreviewWppQueryPostRequest( - 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); - ProcessWppQueryPrefixPreviewSolutionsPreviewWppQueryPostResponse( - 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); - ProcessWppQueryPrefixPreviewSolutionsPreviewWppQueryPostResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return __content; - } - catch (global::System.Exception __ex) - { - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __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::AI21.ApiException( - message: __content ?? __response.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/AI21/Generated/AI21.Ai21Client.WppQuerySolutionsWppQueryPost.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.WppQuerySolutionsWppQueryPost.g.cs deleted file mode 100644 index 4fdd5c9a..00000000 --- a/src/libs/AI21/Generated/AI21.Ai21Client.WppQuerySolutionsWppQueryPost.g.cs +++ /dev/null @@ -1,188 +0,0 @@ - -#nullable enable - -namespace AI21 -{ - public partial class Ai21Client - { - - - private static readonly global::AI21.EndPointSecurityRequirement s_WppQuerySolutionsWppQueryPostSecurityRequirement0 = - new global::AI21.EndPointSecurityRequirement - { - Authorizations = new global::AI21.EndPointAuthorizationRequirement[] - { new global::AI21.EndPointAuthorizationRequirement - { - Type = "Http", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::AI21.EndPointSecurityRequirement[] s_WppQuerySolutionsWppQueryPostSecurityRequirements = - new global::AI21.EndPointSecurityRequirement[] - { s_WppQuerySolutionsWppQueryPostSecurityRequirement0, - }; - partial void PrepareWppQuerySolutionsWppQueryPostArguments( - global::System.Net.Http.HttpClient httpClient); - partial void PrepareWppQuerySolutionsWppQueryPostRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage); - partial void ProcessWppQuerySolutionsWppQueryPostResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessWppQuerySolutionsWppQueryPostResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Wpp Query - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task WppQuerySolutionsWppQueryPostAsync( - global::System.Threading.CancellationToken cancellationToken = default) - { - PrepareArguments( - client: HttpClient); - PrepareWppQuerySolutionsWppQueryPostArguments( - httpClient: HttpClient); - - - var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_WppQuerySolutionsWppQueryPostSecurityRequirements, - operationName: "WppQuerySolutionsWppQueryPostAsync"); - - var __pathBuilder = new global::AI21.PathBuilder( - path: "/solutions/wpp/query", - 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); - } - } - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareWppQuerySolutionsWppQueryPostRequest( - 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); - ProcessWppQuerySolutionsWppQueryPostResponse( - 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); - ProcessWppQuerySolutionsWppQueryPostResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return __content; - } - catch (global::System.Exception __ex) - { - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __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::AI21.ApiException( - message: __content ?? __response.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/AI21/Generated/AI21.Ai21Client.g.cs b/src/libs/AI21/Generated/AI21.Ai21Client.g.cs index ec021f0f..4b478987 100644 --- a/src/libs/AI21/Generated/AI21.Ai21Client.g.cs +++ b/src/libs/AI21/Generated/AI21.Ai21Client.g.cs @@ -31,6 +31,9 @@ public sealed partial class Ai21Client : global::AI21.IAi21Client, global::Syste #if DEBUG = true; #endif + + /// + public global::AI21.AutoSDKClientOptions Options { get; } /// /// /// @@ -40,7 +43,7 @@ public sealed partial class Ai21Client : global::AI21.IAi21Client, global::Syste /// /// /// - public JambaCompleteClient JambaComplete => new JambaCompleteClient(HttpClient, authorizations: Authorizations) + public JambaCompleteClient JambaComplete => new JambaCompleteClient(HttpClient, baseUri: null, authorizations: Authorizations, options: Options) { ReadResponseAsString = ReadResponseAsString, JsonSerializerContext = JsonSerializerContext, @@ -49,7 +52,7 @@ public sealed partial class Ai21Client : global::AI21.IAi21Client, global::Syste /// /// /// - public LibraryManagementClient LibraryManagement => new LibraryManagementClient(HttpClient, authorizations: Authorizations) + public LibraryManagementClient LibraryManagement => new LibraryManagementClient(HttpClient, baseUri: null, authorizations: Authorizations, options: Options) { ReadResponseAsString = ReadResponseAsString, JsonSerializerContext = JsonSerializerContext, @@ -58,7 +61,7 @@ public sealed partial class Ai21Client : global::AI21.IAi21Client, global::Syste /// /// /// - public RagEngineClient RagEngine => new RagEngineClient(HttpClient, authorizations: Authorizations) + public RagEngineClient RagEngine => new RagEngineClient(HttpClient, baseUri: null, authorizations: Authorizations, options: Options) { ReadResponseAsString = ReadResponseAsString, JsonSerializerContext = JsonSerializerContext, @@ -67,7 +70,7 @@ public sealed partial class Ai21Client : global::AI21.IAi21Client, global::Syste /// /// /// - public SecretsClient Secrets => new SecretsClient(HttpClient, authorizations: Authorizations) + public SecretsClient Secrets => new SecretsClient(HttpClient, baseUri: null, authorizations: Authorizations, options: Options) { ReadResponseAsString = ReadResponseAsString, JsonSerializerContext = JsonSerializerContext, @@ -76,7 +79,7 @@ public sealed partial class Ai21Client : global::AI21.IAi21Client, global::Syste /// /// /// - public WebsiteConnectorClient WebsiteConnector => new WebsiteConnectorClient(HttpClient, authorizations: Authorizations) + public WebsiteConnectorClient WebsiteConnector => new WebsiteConnectorClient(HttpClient, baseUri: null, authorizations: Authorizations, options: Options) { ReadResponseAsString = ReadResponseAsString, JsonSerializerContext = JsonSerializerContext, @@ -95,11 +98,58 @@ public Ai21Client( 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 Ai21Client 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 Ai21Client( + global::System.Net.Http.HttpClient? httpClient, + global::System.Collections.Generic.List? authorizations, + global::AI21.AutoSDKClientOptions? options, + bool disposeHttpClient = true) : this( + httpClient, + baseUri: null, + authorizations, + options, + disposeHttpClient: disposeHttpClient) + { + } + + /// + /// Creates a new instance of the Ai21Client. + /// 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 Ai21Client( + global::System.Net.Http.HttpClient? httpClient, + global::System.Uri? baseUri, + global::System.Collections.Generic.List? authorizations, + global::AI21.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::AI21.AutoSDKClientOptions(); _disposeHttpClient = disposeHttpClient; Initialized(HttpClient); diff --git a/src/libs/AI21/Generated/AI21.AnyOf.2.Json.g.cs b/src/libs/AI21/Generated/AI21.AnyOf.2.Json.g.cs index bcec7ec0..1598ef2f 100644 --- a/src/libs/AI21/Generated/AI21.AnyOf.2.Json.g.cs +++ b/src/libs/AI21/Generated/AI21.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::AI21.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::AI21.AnyOf?; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::AI21.AnyOf? FromJson( + string json) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize>( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::AI21.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::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync?>( jsonStream, jsonSerializerOptions); diff --git a/src/libs/AI21/Generated/AI21.AnyOf.2.g.cs b/src/libs/AI21/Generated/AI21.AnyOf.2.g.cs index 7fa57a7d..efdc8e91 100644 --- a/src/libs/AI21/Generated/AI21.AnyOf.2.g.cs +++ b/src/libs/AI21/Generated/AI21.AnyOf.2.g.cs @@ -25,6 +25,26 @@ namespace AI21 #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 AI21 [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/AI21/Generated/AI21.AnyOf.4.Json.g.cs b/src/libs/AI21/Generated/AI21.AnyOf.4.Json.g.cs index e633b036..f06634f9 100644 --- a/src/libs/AI21/Generated/AI21.AnyOf.4.Json.g.cs +++ b/src/libs/AI21/Generated/AI21.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::AI21.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::AI21.AnyOf?; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::AI21.AnyOf? FromJson( + string json) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize>( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::AI21.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::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync?>( jsonStream, jsonSerializerOptions); diff --git a/src/libs/AI21/Generated/AI21.AnyOf.4.g.cs b/src/libs/AI21/Generated/AI21.AnyOf.4.g.cs index 7b32c0fa..e225d3be 100644 --- a/src/libs/AI21/Generated/AI21.AnyOf.4.g.cs +++ b/src/libs/AI21/Generated/AI21.AnyOf.4.g.cs @@ -25,6 +25,26 @@ namespace AI21 #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 AI21 #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 AI21 #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 AI21 [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/AI21/Generated/AI21.AutoSDKHttpResponse.g.cs b/src/libs/AI21/Generated/AI21.AutoSDKHttpResponse.g.cs new file mode 100644 index 00000000..57eb4e71 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.AutoSDKHttpResponse.g.cs @@ -0,0 +1,121 @@ + +#nullable enable + +namespace AI21 +{ + /// + /// 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/AI21/Generated/AI21.Exceptions.g.cs b/src/libs/AI21/Generated/AI21.Exceptions.g.cs index c7e2755a..a1ba2e0c 100644 --- a/src/libs/AI21/Generated/AI21.Exceptions.g.cs +++ b/src/libs/AI21/Generated/AI21.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::AI21.ApiException Create( + global::System.Net.HttpStatusCode statusCode, + string message, + global::System.Exception? innerException = null, + global::System.Collections.Generic.IDictionary>? responseHeaders = null) + { + return new global::AI21.ApiException(message, innerException, statusCode); + } + + /// + /// Convenience overload that constructs an with response body and headers populated. + /// + public static global::AI21.ApiException Create( + global::System.Net.HttpStatusCode statusCode, + string message, + global::System.Exception? innerException, + string? responseBody, + global::System.Collections.Generic.Dictionary>? responseHeaders) + { + var exception = global::AI21.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::AI21.ApiException Create( + global::System.Net.HttpStatusCode statusCode, + string message, + global::System.Exception? innerException = null, + global::System.Collections.Generic.IDictionary>? responseHeaders = null) + { + return new global::AI21.ApiException(message, innerException, statusCode); + } + + /// + /// Convenience overload that constructs an with response body, object, and headers populated. + /// + public static global::AI21.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::AI21.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/AI21/Generated/AI21.IAi21Client.AnalyticsAgentsGatewayAnalyticsV1AgentsGet.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.AnalyticsAgentsGatewayAnalyticsV1AgentsGet.g.cs new file mode 100644 index 00000000..d2df7df7 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.IAi21Client.AnalyticsAgentsGatewayAnalyticsV1AgentsGet.g.cs @@ -0,0 +1,26 @@ +#nullable enable + +namespace AI21 +{ + public partial interface IAi21Client + { + /// + /// Analytics Agents + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task AnalyticsAgentsGatewayAnalyticsV1AgentsGetAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Analytics Agents + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> AnalyticsAgentsGatewayAnalyticsV1AgentsGetAsResponseAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.AnalyticsAgentsTokenwiseAnalyticsV1AgentsGet.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.AnalyticsAgentsTokenwiseAnalyticsV1AgentsGet.g.cs new file mode 100644 index 00000000..a9d02d04 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.IAi21Client.AnalyticsAgentsTokenwiseAnalyticsV1AgentsGet.g.cs @@ -0,0 +1,26 @@ +#nullable enable + +namespace AI21 +{ + public partial interface IAi21Client + { + /// + /// Analytics Agents + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task AnalyticsAgentsTokenwiseAnalyticsV1AgentsGetAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Analytics Agents + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> AnalyticsAgentsTokenwiseAnalyticsV1AgentsGetAsResponseAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.AnalyticsContextBashGatewayAnalyticsV1ContextBashGet.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.AnalyticsContextBashGatewayAnalyticsV1ContextBashGet.g.cs new file mode 100644 index 00000000..39dfa892 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.IAi21Client.AnalyticsContextBashGatewayAnalyticsV1ContextBashGet.g.cs @@ -0,0 +1,26 @@ +#nullable enable + +namespace AI21 +{ + public partial interface IAi21Client + { + /// + /// Analytics Context Bash + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task AnalyticsContextBashGatewayAnalyticsV1ContextBashGetAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Analytics Context Bash + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> AnalyticsContextBashGatewayAnalyticsV1ContextBashGetAsResponseAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.AnalyticsContextBashTokenwiseAnalyticsV1ContextBashGet.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.AnalyticsContextBashTokenwiseAnalyticsV1ContextBashGet.g.cs new file mode 100644 index 00000000..6d0f98b3 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.IAi21Client.AnalyticsContextBashTokenwiseAnalyticsV1ContextBashGet.g.cs @@ -0,0 +1,26 @@ +#nullable enable + +namespace AI21 +{ + public partial interface IAi21Client + { + /// + /// Analytics Context Bash + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task AnalyticsContextBashTokenwiseAnalyticsV1ContextBashGetAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Analytics Context Bash + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> AnalyticsContextBashTokenwiseAnalyticsV1ContextBashGetAsResponseAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.AnalyticsContextBlocksGatewayAnalyticsV1ContextBlocksGet.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.AnalyticsContextBlocksGatewayAnalyticsV1ContextBlocksGet.g.cs new file mode 100644 index 00000000..672a1ef2 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.IAi21Client.AnalyticsContextBlocksGatewayAnalyticsV1ContextBlocksGet.g.cs @@ -0,0 +1,26 @@ +#nullable enable + +namespace AI21 +{ + public partial interface IAi21Client + { + /// + /// Analytics Context Blocks + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task AnalyticsContextBlocksGatewayAnalyticsV1ContextBlocksGetAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Analytics Context Blocks + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> AnalyticsContextBlocksGatewayAnalyticsV1ContextBlocksGetAsResponseAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.AnalyticsContextBlocksTokenwiseAnalyticsV1ContextBlocksGet.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.AnalyticsContextBlocksTokenwiseAnalyticsV1ContextBlocksGet.g.cs new file mode 100644 index 00000000..03ac13cd --- /dev/null +++ b/src/libs/AI21/Generated/AI21.IAi21Client.AnalyticsContextBlocksTokenwiseAnalyticsV1ContextBlocksGet.g.cs @@ -0,0 +1,26 @@ +#nullable enable + +namespace AI21 +{ + public partial interface IAi21Client + { + /// + /// Analytics Context Blocks + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task AnalyticsContextBlocksTokenwiseAnalyticsV1ContextBlocksGetAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Analytics Context Blocks + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> AnalyticsContextBlocksTokenwiseAnalyticsV1ContextBlocksGetAsResponseAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.AnalyticsContextPrefixGatewayAnalyticsV1ContextPrefixGet.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.AnalyticsContextPrefixGatewayAnalyticsV1ContextPrefixGet.g.cs new file mode 100644 index 00000000..a03cbb1b --- /dev/null +++ b/src/libs/AI21/Generated/AI21.IAi21Client.AnalyticsContextPrefixGatewayAnalyticsV1ContextPrefixGet.g.cs @@ -0,0 +1,26 @@ +#nullable enable + +namespace AI21 +{ + public partial interface IAi21Client + { + /// + /// Analytics Context Prefix + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task AnalyticsContextPrefixGatewayAnalyticsV1ContextPrefixGetAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Analytics Context Prefix + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> AnalyticsContextPrefixGatewayAnalyticsV1ContextPrefixGetAsResponseAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.AnalyticsContextPrefixTokenwiseAnalyticsV1ContextPrefixGet.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.AnalyticsContextPrefixTokenwiseAnalyticsV1ContextPrefixGet.g.cs new file mode 100644 index 00000000..eeea0e8d --- /dev/null +++ b/src/libs/AI21/Generated/AI21.IAi21Client.AnalyticsContextPrefixTokenwiseAnalyticsV1ContextPrefixGet.g.cs @@ -0,0 +1,26 @@ +#nullable enable + +namespace AI21 +{ + public partial interface IAi21Client + { + /// + /// Analytics Context Prefix + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task AnalyticsContextPrefixTokenwiseAnalyticsV1ContextPrefixGetAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Analytics Context Prefix + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> AnalyticsContextPrefixTokenwiseAnalyticsV1ContextPrefixGetAsResponseAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.AnalyticsContextToolsGatewayAnalyticsV1ContextToolsGet.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.AnalyticsContextToolsGatewayAnalyticsV1ContextToolsGet.g.cs new file mode 100644 index 00000000..c56cd888 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.IAi21Client.AnalyticsContextToolsGatewayAnalyticsV1ContextToolsGet.g.cs @@ -0,0 +1,26 @@ +#nullable enable + +namespace AI21 +{ + public partial interface IAi21Client + { + /// + /// Analytics Context Tools + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task AnalyticsContextToolsGatewayAnalyticsV1ContextToolsGetAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Analytics Context Tools + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> AnalyticsContextToolsGatewayAnalyticsV1ContextToolsGetAsResponseAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.AnalyticsContextToolsTokenwiseAnalyticsV1ContextToolsGet.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.AnalyticsContextToolsTokenwiseAnalyticsV1ContextToolsGet.g.cs new file mode 100644 index 00000000..daa3c33a --- /dev/null +++ b/src/libs/AI21/Generated/AI21.IAi21Client.AnalyticsContextToolsTokenwiseAnalyticsV1ContextToolsGet.g.cs @@ -0,0 +1,26 @@ +#nullable enable + +namespace AI21 +{ + public partial interface IAi21Client + { + /// + /// Analytics Context Tools + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task AnalyticsContextToolsTokenwiseAnalyticsV1ContextToolsGetAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Analytics Context Tools + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> AnalyticsContextToolsTokenwiseAnalyticsV1ContextToolsGetAsResponseAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.AnalyticsErrorsGatewayAnalyticsV1ErrorsGet.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.AnalyticsErrorsGatewayAnalyticsV1ErrorsGet.g.cs new file mode 100644 index 00000000..f8784ca2 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.IAi21Client.AnalyticsErrorsGatewayAnalyticsV1ErrorsGet.g.cs @@ -0,0 +1,26 @@ +#nullable enable + +namespace AI21 +{ + public partial interface IAi21Client + { + /// + /// Analytics Errors + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task AnalyticsErrorsGatewayAnalyticsV1ErrorsGetAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Analytics Errors + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> AnalyticsErrorsGatewayAnalyticsV1ErrorsGetAsResponseAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.AnalyticsErrorsTokenwiseAnalyticsV1ErrorsGet.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.AnalyticsErrorsTokenwiseAnalyticsV1ErrorsGet.g.cs new file mode 100644 index 00000000..3ad9f455 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.IAi21Client.AnalyticsErrorsTokenwiseAnalyticsV1ErrorsGet.g.cs @@ -0,0 +1,26 @@ +#nullable enable + +namespace AI21 +{ + public partial interface IAi21Client + { + /// + /// Analytics Errors + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task AnalyticsErrorsTokenwiseAnalyticsV1ErrorsGetAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Analytics Errors + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> AnalyticsErrorsTokenwiseAnalyticsV1ErrorsGetAsResponseAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.AnalyticsFiltersGatewayAnalyticsV1FiltersGet.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.AnalyticsFiltersGatewayAnalyticsV1FiltersGet.g.cs new file mode 100644 index 00000000..ca601025 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.IAi21Client.AnalyticsFiltersGatewayAnalyticsV1FiltersGet.g.cs @@ -0,0 +1,26 @@ +#nullable enable + +namespace AI21 +{ + public partial interface IAi21Client + { + /// + /// Analytics Filters + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task AnalyticsFiltersGatewayAnalyticsV1FiltersGetAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Analytics Filters + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> AnalyticsFiltersGatewayAnalyticsV1FiltersGetAsResponseAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.AnalyticsFiltersTokenwiseAnalyticsV1FiltersGet.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.AnalyticsFiltersTokenwiseAnalyticsV1FiltersGet.g.cs new file mode 100644 index 00000000..e6e85281 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.IAi21Client.AnalyticsFiltersTokenwiseAnalyticsV1FiltersGet.g.cs @@ -0,0 +1,26 @@ +#nullable enable + +namespace AI21 +{ + public partial interface IAi21Client + { + /// + /// Analytics Filters + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task AnalyticsFiltersTokenwiseAnalyticsV1FiltersGetAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Analytics Filters + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> AnalyticsFiltersTokenwiseAnalyticsV1FiltersGetAsResponseAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.AnalyticsSessionDetailGatewayAnalyticsV1SessionsSessionIdGet.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.AnalyticsSessionDetailGatewayAnalyticsV1SessionsSessionIdGet.g.cs new file mode 100644 index 00000000..52459a16 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.IAi21Client.AnalyticsSessionDetailGatewayAnalyticsV1SessionsSessionIdGet.g.cs @@ -0,0 +1,30 @@ +#nullable enable + +namespace AI21 +{ + public partial interface IAi21Client + { + /// + /// Analytics Session Detail + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task AnalyticsSessionDetailGatewayAnalyticsV1SessionsSessionIdGetAsync( + string sessionId, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Analytics Session Detail + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> AnalyticsSessionDetailGatewayAnalyticsV1SessionsSessionIdGetAsResponseAsync( + string sessionId, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.AnalyticsSessionDetailTokenwiseAnalyticsV1SessionsSessionIdGet.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.AnalyticsSessionDetailTokenwiseAnalyticsV1SessionsSessionIdGet.g.cs new file mode 100644 index 00000000..aa16935d --- /dev/null +++ b/src/libs/AI21/Generated/AI21.IAi21Client.AnalyticsSessionDetailTokenwiseAnalyticsV1SessionsSessionIdGet.g.cs @@ -0,0 +1,30 @@ +#nullable enable + +namespace AI21 +{ + public partial interface IAi21Client + { + /// + /// Analytics Session Detail + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task AnalyticsSessionDetailTokenwiseAnalyticsV1SessionsSessionIdGetAsync( + string sessionId, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Analytics Session Detail + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> AnalyticsSessionDetailTokenwiseAnalyticsV1SessionsSessionIdGetAsResponseAsync( + string sessionId, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.AnalyticsSessionsGatewayAnalyticsV1SessionsGet.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.AnalyticsSessionsGatewayAnalyticsV1SessionsGet.g.cs new file mode 100644 index 00000000..0cbd242b --- /dev/null +++ b/src/libs/AI21/Generated/AI21.IAi21Client.AnalyticsSessionsGatewayAnalyticsV1SessionsGet.g.cs @@ -0,0 +1,26 @@ +#nullable enable + +namespace AI21 +{ + public partial interface IAi21Client + { + /// + /// Analytics Sessions + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task AnalyticsSessionsGatewayAnalyticsV1SessionsGetAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Analytics Sessions + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> AnalyticsSessionsGatewayAnalyticsV1SessionsGetAsResponseAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.AnalyticsSessionsTokenwiseAnalyticsV1SessionsGet.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.AnalyticsSessionsTokenwiseAnalyticsV1SessionsGet.g.cs new file mode 100644 index 00000000..1e2c84ba --- /dev/null +++ b/src/libs/AI21/Generated/AI21.IAi21Client.AnalyticsSessionsTokenwiseAnalyticsV1SessionsGet.g.cs @@ -0,0 +1,26 @@ +#nullable enable + +namespace AI21 +{ + public partial interface IAi21Client + { + /// + /// Analytics Sessions + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task AnalyticsSessionsTokenwiseAnalyticsV1SessionsGetAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Analytics Sessions + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> AnalyticsSessionsTokenwiseAnalyticsV1SessionsGetAsResponseAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.AnalyticsSummaryGatewayAnalyticsV1SummaryGet.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.AnalyticsSummaryGatewayAnalyticsV1SummaryGet.g.cs new file mode 100644 index 00000000..87fe9e90 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.IAi21Client.AnalyticsSummaryGatewayAnalyticsV1SummaryGet.g.cs @@ -0,0 +1,26 @@ +#nullable enable + +namespace AI21 +{ + public partial interface IAi21Client + { + /// + /// Analytics Summary + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task AnalyticsSummaryGatewayAnalyticsV1SummaryGetAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Analytics Summary + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> AnalyticsSummaryGatewayAnalyticsV1SummaryGetAsResponseAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.AnalyticsSummaryTokenwiseAnalyticsV1SummaryGet.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.AnalyticsSummaryTokenwiseAnalyticsV1SummaryGet.g.cs new file mode 100644 index 00000000..f126a157 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.IAi21Client.AnalyticsSummaryTokenwiseAnalyticsV1SummaryGet.g.cs @@ -0,0 +1,26 @@ +#nullable enable + +namespace AI21 +{ + public partial interface IAi21Client + { + /// + /// Analytics Summary + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task AnalyticsSummaryTokenwiseAnalyticsV1SummaryGetAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Analytics Summary + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> AnalyticsSummaryTokenwiseAnalyticsV1SummaryGetAsResponseAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.AnalyticsTransformersGatewayAnalyticsV1TransformersGet.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.AnalyticsTransformersGatewayAnalyticsV1TransformersGet.g.cs new file mode 100644 index 00000000..9153a2a3 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.IAi21Client.AnalyticsTransformersGatewayAnalyticsV1TransformersGet.g.cs @@ -0,0 +1,26 @@ +#nullable enable + +namespace AI21 +{ + public partial interface IAi21Client + { + /// + /// Analytics Transformers + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task AnalyticsTransformersGatewayAnalyticsV1TransformersGetAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Analytics Transformers + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> AnalyticsTransformersGatewayAnalyticsV1TransformersGetAsResponseAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.AnalyticsTransformersTokenwiseAnalyticsV1TransformersGet.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.AnalyticsTransformersTokenwiseAnalyticsV1TransformersGet.g.cs new file mode 100644 index 00000000..72f05582 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.IAi21Client.AnalyticsTransformersTokenwiseAnalyticsV1TransformersGet.g.cs @@ -0,0 +1,26 @@ +#nullable enable + +namespace AI21 +{ + public partial interface IAi21Client + { + /// + /// Analytics Transformers + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task AnalyticsTransformersTokenwiseAnalyticsV1TransformersGetAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Analytics Transformers + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> AnalyticsTransformersTokenwiseAnalyticsV1TransformersGetAsResponseAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.AnalyticsTrendsGatewayAnalyticsV1TrendsGet.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.AnalyticsTrendsGatewayAnalyticsV1TrendsGet.g.cs new file mode 100644 index 00000000..321c6c68 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.IAi21Client.AnalyticsTrendsGatewayAnalyticsV1TrendsGet.g.cs @@ -0,0 +1,26 @@ +#nullable enable + +namespace AI21 +{ + public partial interface IAi21Client + { + /// + /// Analytics Trends + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task AnalyticsTrendsGatewayAnalyticsV1TrendsGetAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Analytics Trends + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> AnalyticsTrendsGatewayAnalyticsV1TrendsGetAsResponseAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.AnalyticsTrendsTokenwiseAnalyticsV1TrendsGet.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.AnalyticsTrendsTokenwiseAnalyticsV1TrendsGet.g.cs new file mode 100644 index 00000000..2bf86515 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.IAi21Client.AnalyticsTrendsTokenwiseAnalyticsV1TrendsGet.g.cs @@ -0,0 +1,26 @@ +#nullable enable + +namespace AI21 +{ + public partial interface IAi21Client + { + /// + /// Analytics Trends + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task AnalyticsTrendsTokenwiseAnalyticsV1TrendsGetAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Analytics Trends + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> AnalyticsTrendsTokenwiseAnalyticsV1TrendsGetAsResponseAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.CanIframeStudioV1DemosScraperCanIframeGet.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.CanIframeStudioV1DemosScraperCanIframeGet.g.cs index 50652c2b..bbd55e4c 100644 --- a/src/libs/AI21/Generated/AI21.IAi21Client.CanIframeStudioV1DemosScraperCanIframeGet.g.cs +++ b/src/libs/AI21/Generated/AI21.IAi21Client.CanIframeStudioV1DemosScraperCanIframeGet.g.cs @@ -8,10 +8,23 @@ public partial interface IAi21Client /// Can Iframe /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// global::System.Threading.Tasks.Task CanIframeStudioV1DemosScraperCanIframeGetAsync( string url, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Can Iframe + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> CanIframeStudioV1DemosScraperCanIframeGetAsResponseAsync( + string url, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.ClarotyProductLookupSolutionsClarotyProductLookupPost.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.ClarotyProductLookupSolutionsClarotyProductLookupPost.g.cs deleted file mode 100644 index 975cbeb0..00000000 --- a/src/libs/AI21/Generated/AI21.IAi21Client.ClarotyProductLookupSolutionsClarotyProductLookupPost.g.cs +++ /dev/null @@ -1,15 +0,0 @@ -#nullable enable - -namespace AI21 -{ - public partial interface IAi21Client - { - /// - /// Claroty Product Lookup - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task ClarotyProductLookupSolutionsClarotyProductLookupPostAsync( - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.ClarotyScrapeUrlSolutionsClarotyScrapeUrlPost.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.ClarotyScrapeUrlSolutionsClarotyScrapeUrlPost.g.cs deleted file mode 100644 index 7a009de4..00000000 --- a/src/libs/AI21/Generated/AI21.IAi21Client.ClarotyScrapeUrlSolutionsClarotyScrapeUrlPost.g.cs +++ /dev/null @@ -1,15 +0,0 @@ -#nullable enable - -namespace AI21 -{ - public partial interface IAi21Client - { - /// - /// Claroty Scrape Url - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task ClarotyScrapeUrlSolutionsClarotyScrapeUrlPostAsync( - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.ClarotySuggestVendorModelSolutionsClarotySuggestVendorModelPost.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.ClarotySuggestVendorModelSolutionsClarotySuggestVendorModelPost.g.cs deleted file mode 100644 index b99eab2c..00000000 --- a/src/libs/AI21/Generated/AI21.IAi21Client.ClarotySuggestVendorModelSolutionsClarotySuggestVendorModelPost.g.cs +++ /dev/null @@ -1,15 +0,0 @@ -#nullable enable - -namespace AI21 -{ - public partial interface IAi21Client - { - /// - /// Claroty Suggest Vendor Model - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task ClarotySuggestVendorModelSolutionsClarotySuggestVendorModelPostAsync( - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.CompareTextStudioV1DemosDocumentModifierCompareTextPost.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.CompareTextStudioV1DemosDocumentModifierCompareTextPost.g.cs index ff47f20c..830229b4 100644 --- a/src/libs/AI21/Generated/AI21.IAi21Client.CompareTextStudioV1DemosDocumentModifierCompareTextPost.g.cs +++ b/src/libs/AI21/Generated/AI21.IAi21Client.CompareTextStudioV1DemosDocumentModifierCompareTextPost.g.cs @@ -9,11 +9,26 @@ public partial interface IAi21Client /// Compare text in a document file against a reference text. /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// global::System.Threading.Tasks.Task CompareTextStudioV1DemosDocumentModifierCompareTextPostAsync( global::AI21.CompareTextRequest request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Compare Text
+ /// Compare text in a document file against a reference text. + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> CompareTextStudioV1DemosDocumentModifierCompareTextPostAsResponseAsync( + + global::AI21.CompareTextRequest request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); /// /// Compare Text
@@ -21,11 +36,13 @@ public partial interface IAi21Client ///
/// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// global::System.Threading.Tasks.Task CompareTextStudioV1DemosDocumentModifierCompareTextPostAsync( string originalText, string modifiedText, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.ConvertDocumentFileStudioV1ChatFilesConvertPost.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.ConvertDocumentFileStudioV1ChatFilesConvertPost.g.cs index 37351a7d..35d0e57d 100644 --- a/src/libs/AI21/Generated/AI21.IAi21Client.ConvertDocumentFileStudioV1ChatFilesConvertPost.g.cs +++ b/src/libs/AI21/Generated/AI21.IAi21Client.ConvertDocumentFileStudioV1ChatFilesConvertPost.g.cs @@ -8,20 +8,71 @@ public partial interface IAi21Client /// Convert Document 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 ConvertDocumentFileStudioV1ChatFilesConvertPostAsync( global::AI21.BodyConvertDocumentFileStudioV1ChatFilesConvertPost request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Convert Document 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> ConvertDocumentFileStudioV1ChatFilesConvertPostAsResponseAsync( + + global::AI21.BodyConvertDocumentFileStudioV1ChatFilesConvertPost request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); /// /// Convert Document 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 ConvertDocumentFileStudioV1ChatFilesConvertPostAsync( global::System.Collections.Generic.IList files, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + + /// + /// Convert Document File + /// + /// + /// 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 ConvertDocumentFileStudioV1ChatFilesConvertPostAsync( + global::System.Collections.Generic.IReadOnlyList files, + global::System.Collections.Generic.IReadOnlyList? filesFileNames = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Convert Document File + /// + /// + /// 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> ConvertDocumentFileStudioV1ChatFilesConvertPostAsResponseAsync( + global::System.Collections.Generic.IReadOnlyList files, + global::System.Collections.Generic.IReadOnlyList? filesFileNames = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.CreateAgentGatewaySettingsAgentsPost.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.CreateAgentGatewaySettingsAgentsPost.g.cs new file mode 100644 index 00000000..f19b233c --- /dev/null +++ b/src/libs/AI21/Generated/AI21.IAi21Client.CreateAgentGatewaySettingsAgentsPost.g.cs @@ -0,0 +1,57 @@ +#nullable enable + +namespace AI21 +{ + public partial interface IAi21Client + { + /// + /// Create Agent + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task CreateAgentGatewaySettingsAgentsPostAsync( + + global::AI21.AgentCreate request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Create Agent + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> CreateAgentGatewaySettingsAgentsPostAsResponseAsync( + + global::AI21.AgentCreate request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Create Agent + /// + /// + /// + /// Default Value: other + /// + /// + /// + /// + /// + /// 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 CreateAgentGatewaySettingsAgentsPostAsync( + string agentId, + string? kind = default, + string? name = default, + string? description = default, + string? configId = default, + bool? enabled = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.CreateAgentTokenwiseSettingsAgentsPost.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.CreateAgentTokenwiseSettingsAgentsPost.g.cs new file mode 100644 index 00000000..e5ae6cb0 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.IAi21Client.CreateAgentTokenwiseSettingsAgentsPost.g.cs @@ -0,0 +1,57 @@ +#nullable enable + +namespace AI21 +{ + public partial interface IAi21Client + { + /// + /// Create Agent + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task CreateAgentTokenwiseSettingsAgentsPostAsync( + + global::AI21.AgentCreate request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Create Agent + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> CreateAgentTokenwiseSettingsAgentsPostAsResponseAsync( + + global::AI21.AgentCreate request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Create Agent + /// + /// + /// + /// Default Value: other + /// + /// + /// + /// + /// + /// 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 CreateAgentTokenwiseSettingsAgentsPostAsync( + string agentId, + string? kind = default, + string? name = default, + string? description = default, + string? configId = default, + bool? enabled = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.CreateConfigGatewaySettingsConfigsPost.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.CreateConfigGatewaySettingsConfigsPost.g.cs new file mode 100644 index 00000000..7bde2684 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.IAi21Client.CreateConfigGatewaySettingsConfigsPost.g.cs @@ -0,0 +1,53 @@ +#nullable enable + +namespace AI21 +{ + public partial interface IAi21Client + { + /// + /// Create 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 CreateConfigGatewaySettingsConfigsPostAsync( + + global::AI21.ConfigProfileCreate request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Create 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> CreateConfigGatewaySettingsConfigsPostAsResponseAsync( + + global::AI21.ConfigProfileCreate request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Create Config + /// + /// + /// + /// + /// + /// + /// 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 CreateConfigGatewaySettingsConfigsPostAsync( + string configId, + string? name = default, + string? description = default, + object? overrides = default, + bool? enabled = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.CreateConfigTokenwiseSettingsConfigsPost.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.CreateConfigTokenwiseSettingsConfigsPost.g.cs new file mode 100644 index 00000000..f3c546c4 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.IAi21Client.CreateConfigTokenwiseSettingsConfigsPost.g.cs @@ -0,0 +1,53 @@ +#nullable enable + +namespace AI21 +{ + public partial interface IAi21Client + { + /// + /// Create 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 CreateConfigTokenwiseSettingsConfigsPostAsync( + + global::AI21.ConfigProfileCreate request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Create 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> CreateConfigTokenwiseSettingsConfigsPostAsResponseAsync( + + global::AI21.ConfigProfileCreate request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Create Config + /// + /// + /// + /// + /// + /// + /// 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 CreateConfigTokenwiseSettingsConfigsPostAsync( + string configId, + string? name = default, + string? description = default, + object? overrides = default, + bool? enabled = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.CreateDemoStudioV1DemosPost.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.CreateDemoStudioV1DemosPost.g.cs index ad0682af..1e5ef3af 100644 --- a/src/libs/AI21/Generated/AI21.IAi21Client.CreateDemoStudioV1DemosPost.g.cs +++ b/src/libs/AI21/Generated/AI21.IAi21Client.CreateDemoStudioV1DemosPost.g.cs @@ -9,11 +9,26 @@ public partial interface IAi21Client /// Create a new demo. /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// global::System.Threading.Tasks.Task CreateDemoStudioV1DemosPostAsync( global::AI21.DemoCreate request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Create Demo
+ /// Create a new demo. + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> CreateDemoStudioV1DemosPostAsResponseAsync( + + global::AI21.DemoCreate request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); /// /// Create Demo
@@ -34,6 +49,7 @@ public partial interface IAi21Client /// /// Name of the UI component /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// global::System.Threading.Tasks.Task CreateDemoStudioV1DemosPostAsync( @@ -42,6 +58,7 @@ public partial interface IAi21Client global::AI21.DemoStatus status, string uiComponentName, object? config = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.CreateMcpStorageStudioV1McpStoragePost.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.CreateMcpStorageStudioV1McpStoragePost.g.cs index 4e8cbe93..4a4bb883 100644 --- a/src/libs/AI21/Generated/AI21.IAi21Client.CreateMcpStorageStudioV1McpStoragePost.g.cs +++ b/src/libs/AI21/Generated/AI21.IAi21Client.CreateMcpStorageStudioV1McpStoragePost.g.cs @@ -8,11 +8,25 @@ public partial interface IAi21Client /// Create Mcp Storage ///
/// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// global::System.Threading.Tasks.Task CreateMcpStorageStudioV1McpStoragePostAsync( global::AI21.CreateMCPStorageRequest request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Create Mcp Storage + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> CreateMcpStorageStudioV1McpStoragePostAsResponseAsync( + + global::AI21.CreateMCPStorageRequest request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); /// /// Create Mcp Storage @@ -26,6 +40,7 @@ public partial interface IAi21Client /// /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// global::System.Threading.Tasks.Task CreateMcpStorageStudioV1McpStoragePostAsync( @@ -36,6 +51,7 @@ public partial interface IAi21Client string? authHeaderName = default, string? authValue = default, global::System.Collections.Generic.IList? allowedTools = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.CreateOrganizationSchemaStudioV1StructuredRagOrganizationsOrganizationIdSchemasPost.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.CreateOrganizationSchemaStudioV1StructuredRagOrganizationsOrganizationIdSchemasPost.g.cs index 3bb1ef61..f2bc8256 100644 --- a/src/libs/AI21/Generated/AI21.IAi21Client.CreateOrganizationSchemaStudioV1StructuredRagOrganizationsOrganizationIdSchemasPost.g.cs +++ b/src/libs/AI21/Generated/AI21.IAi21Client.CreateOrganizationSchemaStudioV1StructuredRagOrganizationsOrganizationIdSchemasPost.g.cs @@ -9,12 +9,28 @@ public partial interface IAi21Client /// /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// global::System.Threading.Tasks.Task CreateOrganizationSchemaStudioV1StructuredRagOrganizationsOrganizationIdSchemasPostAsync( string organizationId, global::AI21.CreateOrganizationSchemaRequest request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Create Organization 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> CreateOrganizationSchemaStudioV1StructuredRagOrganizationsOrganizationIdSchemasPostAsResponseAsync( + string organizationId, + + global::AI21.CreateOrganizationSchemaRequest request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); /// /// Create Organization Schema @@ -25,6 +41,7 @@ public partial interface IAi21Client /// /// 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 CreateOrganizationSchemaStudioV1StructuredRagOrganizationsOrganizationIdSchemasPostAsync( @@ -32,6 +49,7 @@ public partial interface IAi21Client string schemaName, object schemaObject, bool? runClassification = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.DeleteAgentGatewaySettingsAgentsAgentIdDelete.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.DeleteAgentGatewaySettingsAgentsAgentIdDelete.g.cs new file mode 100644 index 00000000..df9d30df --- /dev/null +++ b/src/libs/AI21/Generated/AI21.IAi21Client.DeleteAgentGatewaySettingsAgentsAgentIdDelete.g.cs @@ -0,0 +1,30 @@ +#nullable enable + +namespace AI21 +{ + public partial interface IAi21Client + { + /// + /// Delete Agent + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task DeleteAgentGatewaySettingsAgentsAgentIdDeleteAsync( + string agentId, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Delete Agent + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task DeleteAgentGatewaySettingsAgentsAgentIdDeleteAsResponseAsync( + string agentId, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.DeleteAgentTokenwiseSettingsAgentsAgentIdDelete.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.DeleteAgentTokenwiseSettingsAgentsAgentIdDelete.g.cs new file mode 100644 index 00000000..f3dbb50b --- /dev/null +++ b/src/libs/AI21/Generated/AI21.IAi21Client.DeleteAgentTokenwiseSettingsAgentsAgentIdDelete.g.cs @@ -0,0 +1,30 @@ +#nullable enable + +namespace AI21 +{ + public partial interface IAi21Client + { + /// + /// Delete Agent + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task DeleteAgentTokenwiseSettingsAgentsAgentIdDeleteAsync( + string agentId, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Delete Agent + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task DeleteAgentTokenwiseSettingsAgentsAgentIdDeleteAsResponseAsync( + string agentId, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.DeleteConfigGatewaySettingsConfigsConfigIdDelete.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.DeleteConfigGatewaySettingsConfigsConfigIdDelete.g.cs new file mode 100644 index 00000000..9846b221 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.IAi21Client.DeleteConfigGatewaySettingsConfigsConfigIdDelete.g.cs @@ -0,0 +1,30 @@ +#nullable enable + +namespace AI21 +{ + public partial interface IAi21Client + { + /// + /// Delete 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 DeleteConfigGatewaySettingsConfigsConfigIdDeleteAsync( + string configId, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Delete 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 DeleteConfigGatewaySettingsConfigsConfigIdDeleteAsResponseAsync( + string configId, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.DeleteConfigTokenwiseSettingsConfigsConfigIdDelete.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.DeleteConfigTokenwiseSettingsConfigsConfigIdDelete.g.cs new file mode 100644 index 00000000..55d0c2bd --- /dev/null +++ b/src/libs/AI21/Generated/AI21.IAi21Client.DeleteConfigTokenwiseSettingsConfigsConfigIdDelete.g.cs @@ -0,0 +1,30 @@ +#nullable enable + +namespace AI21 +{ + public partial interface IAi21Client + { + /// + /// Delete 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 DeleteConfigTokenwiseSettingsConfigsConfigIdDeleteAsync( + string configId, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Delete 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 DeleteConfigTokenwiseSettingsConfigsConfigIdDeleteAsResponseAsync( + string configId, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.DeleteDemoStudioV1DemosDemoIdDelete.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.DeleteDemoStudioV1DemosDemoIdDelete.g.cs index 8cf8d99e..7232ab38 100644 --- a/src/libs/AI21/Generated/AI21.IAi21Client.DeleteDemoStudioV1DemosDemoIdDelete.g.cs +++ b/src/libs/AI21/Generated/AI21.IAi21Client.DeleteDemoStudioV1DemosDemoIdDelete.g.cs @@ -9,10 +9,24 @@ public partial interface IAi21Client /// Delete a demo. /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// global::System.Threading.Tasks.Task DeleteDemoStudioV1DemosDemoIdDeleteAsync( string demoId, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Delete Demo
+ /// Delete a demo. + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> DeleteDemoStudioV1DemosDemoIdDeleteAsResponseAsync( + string demoId, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.DeleteMcpStorageStudioV1McpStorageMcpIdDelete.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.DeleteMcpStorageStudioV1McpStorageMcpIdDelete.g.cs index 0525d836..9c872dd7 100644 --- a/src/libs/AI21/Generated/AI21.IAi21Client.DeleteMcpStorageStudioV1McpStorageMcpIdDelete.g.cs +++ b/src/libs/AI21/Generated/AI21.IAi21Client.DeleteMcpStorageStudioV1McpStorageMcpIdDelete.g.cs @@ -8,10 +8,23 @@ public partial interface IAi21Client /// Delete Mcp Storage /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// global::System.Threading.Tasks.Task DeleteMcpStorageStudioV1McpStorageMcpIdDeleteAsync( string mcpId, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Delete Mcp Storage + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> DeleteMcpStorageStudioV1McpStorageMcpIdDeleteAsResponseAsync( + string mcpId, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.DeleteOrganizationSchemaStudioV1StructuredRagOrganizationsOrganizationIdSchemasSchemaNameDelete.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.DeleteOrganizationSchemaStudioV1StructuredRagOrganizationsOrganizationIdSchemasSchemaNameDelete.g.cs index 06e10d84..ee80b7ff 100644 --- a/src/libs/AI21/Generated/AI21.IAi21Client.DeleteOrganizationSchemaStudioV1StructuredRagOrganizationsOrganizationIdSchemasSchemaNameDelete.g.cs +++ b/src/libs/AI21/Generated/AI21.IAi21Client.DeleteOrganizationSchemaStudioV1StructuredRagOrganizationsOrganizationIdSchemasSchemaNameDelete.g.cs @@ -9,11 +9,26 @@ public partial interface IAi21Client /// /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// global::System.Threading.Tasks.Task DeleteOrganizationSchemaStudioV1StructuredRagOrganizationsOrganizationIdSchemasSchemaNameDeleteAsync( string organizationId, string schemaName, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Delete Organization 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> DeleteOrganizationSchemaStudioV1StructuredRagOrganizationsOrganizationIdSchemasSchemaNameDeleteAsResponseAsync( + string organizationId, + string schemaName, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.DeleteWebsiteConnectorStudioV1ConnectorsWebsiteConnectorIdDelete.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.DeleteWebsiteConnectorStudioV1ConnectorsWebsiteConnectorIdDelete.g.cs deleted file mode 100644 index 8bee4408..00000000 --- a/src/libs/AI21/Generated/AI21.IAi21Client.DeleteWebsiteConnectorStudioV1ConnectorsWebsiteConnectorIdDelete.g.cs +++ /dev/null @@ -1,17 +0,0 @@ -#nullable enable - -namespace AI21 -{ - public partial interface IAi21Client - { - /// - /// Delete Website Connector - /// - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task DeleteWebsiteConnectorStudioV1ConnectorsWebsiteConnectorIdDeleteAsync( - string connectorId, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.DeleteWorkspaceModelEndpointStudioV1SettingsModelsNameDelete.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.DeleteWorkspaceModelEndpointStudioV1SettingsModelsNameDelete.g.cs deleted file mode 100644 index d6739e97..00000000 --- a/src/libs/AI21/Generated/AI21.IAi21Client.DeleteWorkspaceModelEndpointStudioV1SettingsModelsNameDelete.g.cs +++ /dev/null @@ -1,17 +0,0 @@ -#nullable enable - -namespace AI21 -{ - public partial interface IAi21Client - { - /// - /// Delete Workspace Model Endpoint - /// - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task DeleteWorkspaceModelEndpointStudioV1SettingsModelsNameDeleteAsync( - string name, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.DetectSchemaStudioV1StructuredRagOrganizationsOrganizationIdSchemaDetectionPost.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.DetectSchemaStudioV1StructuredRagOrganizationsOrganizationIdSchemaDetectionPost.g.cs index af7a764c..daf698cd 100644 --- a/src/libs/AI21/Generated/AI21.IAi21Client.DetectSchemaStudioV1StructuredRagOrganizationsOrganizationIdSchemaDetectionPost.g.cs +++ b/src/libs/AI21/Generated/AI21.IAi21Client.DetectSchemaStudioV1StructuredRagOrganizationsOrganizationIdSchemaDetectionPost.g.cs @@ -9,12 +9,28 @@ public partial interface IAi21Client /// /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// global::System.Threading.Tasks.Task DetectSchemaStudioV1StructuredRagOrganizationsOrganizationIdSchemaDetectionPostAsync( string organizationId, global::AI21.DetectSchemaRequest request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Detect 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> DetectSchemaStudioV1StructuredRagOrganizationsOrganizationIdSchemaDetectionPostAsResponseAsync( + string organizationId, + + global::AI21.DetectSchemaRequest request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); /// /// Detect Schema @@ -22,12 +38,14 @@ public partial interface IAi21Client /// /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// global::System.Threading.Tasks.Task DetectSchemaStudioV1StructuredRagOrganizationsOrganizationIdSchemaDetectionPostAsync( string organizationId, global::System.Collections.Generic.IList documents, global::System.Collections.Generic.IList? queries = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.DownloadModifiedDocumentStudioV1DemosDocumentModifierDownloadPost.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.DownloadModifiedDocumentStudioV1DemosDocumentModifierDownloadPost.g.cs index ec056a93..c54a5aa8 100644 --- a/src/libs/AI21/Generated/AI21.IAi21Client.DownloadModifiedDocumentStudioV1DemosDocumentModifierDownloadPost.g.cs +++ b/src/libs/AI21/Generated/AI21.IAi21Client.DownloadModifiedDocumentStudioV1DemosDocumentModifierDownloadPost.g.cs @@ -9,11 +9,26 @@ public partial interface IAi21Client /// Download a modified document. /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// global::System.Threading.Tasks.Task DownloadModifiedDocumentStudioV1DemosDocumentModifierDownloadPostAsync( global::AI21.DownloadModifiedDocumentRequest request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Download Modified Document
+ /// Download a modified document. + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> DownloadModifiedDocumentStudioV1DemosDocumentModifierDownloadPostAsResponseAsync( + + global::AI21.DownloadModifiedDocumentRequest request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); /// /// Download Modified Document
@@ -21,11 +36,13 @@ public partial interface IAi21Client ///
/// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// global::System.Threading.Tasks.Task DownloadModifiedDocumentStudioV1DemosDocumentModifierDownloadPostAsync( string content, string filename, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.FnacAftersalesBatchPredictPrefixPreviewSolutionsPreviewFdAftersalesPartsClassificationBatchPost.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.FnacAftersalesBatchPredictPrefixPreviewSolutionsPreviewFdAftersalesPartsClassificationBatchPost.g.cs deleted file mode 100644 index 5f04022d..00000000 --- a/src/libs/AI21/Generated/AI21.IAi21Client.FnacAftersalesBatchPredictPrefixPreviewSolutionsPreviewFdAftersalesPartsClassificationBatchPost.g.cs +++ /dev/null @@ -1,15 +0,0 @@ -#nullable enable - -namespace AI21 -{ - public partial interface IAi21Client - { - /// - /// Fnac Aftersales Batch Predict Prefix Preview - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task FnacAftersalesBatchPredictPrefixPreviewSolutionsPreviewFdAftersalesPartsClassificationBatchPostAsync( - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.FnacAftersalesBatchPredictSolutionsFdAftersalesPartsClassificationBatchPost.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.FnacAftersalesBatchPredictSolutionsFdAftersalesPartsClassificationBatchPost.g.cs deleted file mode 100644 index 4bc21ddc..00000000 --- a/src/libs/AI21/Generated/AI21.IAi21Client.FnacAftersalesBatchPredictSolutionsFdAftersalesPartsClassificationBatchPost.g.cs +++ /dev/null @@ -1,15 +0,0 @@ -#nullable enable - -namespace AI21 -{ - public partial interface IAi21Client - { - /// - /// Fnac Aftersales Batch Predict - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task FnacAftersalesBatchPredictSolutionsFdAftersalesPartsClassificationBatchPostAsync( - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.FnacAftersalesBatchPredictStatusPrefixPreviewSolutionsPreviewFdAftersalesPartsClassificationBatchBatchIdStatusGet.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.FnacAftersalesBatchPredictStatusPrefixPreviewSolutionsPreviewFdAftersalesPartsClassificationBatchBatchIdStatusGet.g.cs deleted file mode 100644 index f86b0e94..00000000 --- a/src/libs/AI21/Generated/AI21.IAi21Client.FnacAftersalesBatchPredictStatusPrefixPreviewSolutionsPreviewFdAftersalesPartsClassificationBatchBatchIdStatusGet.g.cs +++ /dev/null @@ -1,17 +0,0 @@ -#nullable enable - -namespace AI21 -{ - public partial interface IAi21Client - { - /// - /// Fnac Aftersales Batch Predict Status Prefix Preview - /// - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task FnacAftersalesBatchPredictStatusPrefixPreviewSolutionsPreviewFdAftersalesPartsClassificationBatchBatchIdStatusGetAsync( - string batchId, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.FnacAftersalesBatchPredictStatusSolutionsFdAftersalesPartsClassificationBatchBatchIdStatusGet.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.FnacAftersalesBatchPredictStatusSolutionsFdAftersalesPartsClassificationBatchBatchIdStatusGet.g.cs deleted file mode 100644 index 536d7e54..00000000 --- a/src/libs/AI21/Generated/AI21.IAi21Client.FnacAftersalesBatchPredictStatusSolutionsFdAftersalesPartsClassificationBatchBatchIdStatusGet.g.cs +++ /dev/null @@ -1,17 +0,0 @@ -#nullable enable - -namespace AI21 -{ - public partial interface IAi21Client - { - /// - /// Fnac Aftersales Batch Predict Status - /// - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task FnacAftersalesBatchPredictStatusSolutionsFdAftersalesPartsClassificationBatchBatchIdStatusGetAsync( - string batchId, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.FnacBatchClassificationsPrefixPreviewSolutionsPreviewFdBatchesV1ClassificationsPost.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.FnacBatchClassificationsPrefixPreviewSolutionsPreviewFdBatchesV1ClassificationsPost.g.cs deleted file mode 100644 index 1c74289d..00000000 --- a/src/libs/AI21/Generated/AI21.IAi21Client.FnacBatchClassificationsPrefixPreviewSolutionsPreviewFdBatchesV1ClassificationsPost.g.cs +++ /dev/null @@ -1,15 +0,0 @@ -#nullable enable - -namespace AI21 -{ - public partial interface IAi21Client - { - /// - /// Fnac Batch Classifications Prefix Preview - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task FnacBatchClassificationsPrefixPreviewSolutionsPreviewFdBatchesV1ClassificationsPostAsync( - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.FnacBatchClassificationsResultsPrefixPreviewSolutionsPreviewFdBatchesV1ClassificationsBatchIdResultsPost.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.FnacBatchClassificationsResultsPrefixPreviewSolutionsPreviewFdBatchesV1ClassificationsBatchIdResultsPost.g.cs deleted file mode 100644 index 23b18f54..00000000 --- a/src/libs/AI21/Generated/AI21.IAi21Client.FnacBatchClassificationsResultsPrefixPreviewSolutionsPreviewFdBatchesV1ClassificationsBatchIdResultsPost.g.cs +++ /dev/null @@ -1,17 +0,0 @@ -#nullable enable - -namespace AI21 -{ - public partial interface IAi21Client - { - /// - /// Fnac Batch Classifications Results Prefix Preview - /// - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task FnacBatchClassificationsResultsPrefixPreviewSolutionsPreviewFdBatchesV1ClassificationsBatchIdResultsPostAsync( - string batchId, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.FnacBatchClassificationsResultsSolutionsFdBatchesV1ClassificationsBatchIdResultsPost.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.FnacBatchClassificationsResultsSolutionsFdBatchesV1ClassificationsBatchIdResultsPost.g.cs deleted file mode 100644 index cd7e80e2..00000000 --- a/src/libs/AI21/Generated/AI21.IAi21Client.FnacBatchClassificationsResultsSolutionsFdBatchesV1ClassificationsBatchIdResultsPost.g.cs +++ /dev/null @@ -1,17 +0,0 @@ -#nullable enable - -namespace AI21 -{ - public partial interface IAi21Client - { - /// - /// Fnac Batch Classifications Results - /// - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task FnacBatchClassificationsResultsSolutionsFdBatchesV1ClassificationsBatchIdResultsPostAsync( - string batchId, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.FnacBatchClassificationsSolutionsFdBatchesV1ClassificationsPost.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.FnacBatchClassificationsSolutionsFdBatchesV1ClassificationsPost.g.cs deleted file mode 100644 index 7b9f6ce2..00000000 --- a/src/libs/AI21/Generated/AI21.IAi21Client.FnacBatchClassificationsSolutionsFdBatchesV1ClassificationsPost.g.cs +++ /dev/null @@ -1,15 +0,0 @@ -#nullable enable - -namespace AI21 -{ - public partial interface IAi21Client - { - /// - /// Fnac Batch Classifications - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task FnacBatchClassificationsSolutionsFdBatchesV1ClassificationsPostAsync( - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.FnacBatchClassificationsStatusPrefixPreviewSolutionsPreviewFdBatchesV1ClassificationsBatchIdStatusPost.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.FnacBatchClassificationsStatusPrefixPreviewSolutionsPreviewFdBatchesV1ClassificationsBatchIdStatusPost.g.cs deleted file mode 100644 index acdafbea..00000000 --- a/src/libs/AI21/Generated/AI21.IAi21Client.FnacBatchClassificationsStatusPrefixPreviewSolutionsPreviewFdBatchesV1ClassificationsBatchIdStatusPost.g.cs +++ /dev/null @@ -1,17 +0,0 @@ -#nullable enable - -namespace AI21 -{ - public partial interface IAi21Client - { - /// - /// Fnac Batch Classifications Status Prefix Preview - /// - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task FnacBatchClassificationsStatusPrefixPreviewSolutionsPreviewFdBatchesV1ClassificationsBatchIdStatusPostAsync( - string batchId, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.FnacBatchClassificationsStatusSolutionsFdBatchesV1ClassificationsBatchIdStatusPost.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.FnacBatchClassificationsStatusSolutionsFdBatchesV1ClassificationsBatchIdStatusPost.g.cs deleted file mode 100644 index a12a801f..00000000 --- a/src/libs/AI21/Generated/AI21.IAi21Client.FnacBatchClassificationsStatusSolutionsFdBatchesV1ClassificationsBatchIdStatusPost.g.cs +++ /dev/null @@ -1,17 +0,0 @@ -#nullable enable - -namespace AI21 -{ - public partial interface IAi21Client - { - /// - /// Fnac Batch Classifications Status - /// - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task FnacBatchClassificationsStatusSolutionsFdBatchesV1ClassificationsBatchIdStatusPostAsync( - string batchId, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.FnacBatchDescriptionsPrefixPreviewSolutionsPreviewFdBatchesV1DescriptionsPost.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.FnacBatchDescriptionsPrefixPreviewSolutionsPreviewFdBatchesV1DescriptionsPost.g.cs deleted file mode 100644 index 531fddac..00000000 --- a/src/libs/AI21/Generated/AI21.IAi21Client.FnacBatchDescriptionsPrefixPreviewSolutionsPreviewFdBatchesV1DescriptionsPost.g.cs +++ /dev/null @@ -1,15 +0,0 @@ -#nullable enable - -namespace AI21 -{ - public partial interface IAi21Client - { - /// - /// Fnac Batch Descriptions Prefix Preview - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task FnacBatchDescriptionsPrefixPreviewSolutionsPreviewFdBatchesV1DescriptionsPostAsync( - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.FnacBatchDescriptionsResultsPrefixPreviewSolutionsPreviewFdBatchesV1DescriptionsBatchIdResultsPost.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.FnacBatchDescriptionsResultsPrefixPreviewSolutionsPreviewFdBatchesV1DescriptionsBatchIdResultsPost.g.cs deleted file mode 100644 index 86d04b82..00000000 --- a/src/libs/AI21/Generated/AI21.IAi21Client.FnacBatchDescriptionsResultsPrefixPreviewSolutionsPreviewFdBatchesV1DescriptionsBatchIdResultsPost.g.cs +++ /dev/null @@ -1,17 +0,0 @@ -#nullable enable - -namespace AI21 -{ - public partial interface IAi21Client - { - /// - /// Fnac Batch Descriptions Results Prefix Preview - /// - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task FnacBatchDescriptionsResultsPrefixPreviewSolutionsPreviewFdBatchesV1DescriptionsBatchIdResultsPostAsync( - string batchId, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.FnacBatchDescriptionsResultsSolutionsFdBatchesV1DescriptionsBatchIdResultsPost.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.FnacBatchDescriptionsResultsSolutionsFdBatchesV1DescriptionsBatchIdResultsPost.g.cs deleted file mode 100644 index 0db37f9e..00000000 --- a/src/libs/AI21/Generated/AI21.IAi21Client.FnacBatchDescriptionsResultsSolutionsFdBatchesV1DescriptionsBatchIdResultsPost.g.cs +++ /dev/null @@ -1,17 +0,0 @@ -#nullable enable - -namespace AI21 -{ - public partial interface IAi21Client - { - /// - /// Fnac Batch Descriptions Results - /// - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task FnacBatchDescriptionsResultsSolutionsFdBatchesV1DescriptionsBatchIdResultsPostAsync( - string batchId, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.FnacBatchDescriptionsSolutionsFdBatchesV1DescriptionsPost.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.FnacBatchDescriptionsSolutionsFdBatchesV1DescriptionsPost.g.cs deleted file mode 100644 index 5d44832d..00000000 --- a/src/libs/AI21/Generated/AI21.IAi21Client.FnacBatchDescriptionsSolutionsFdBatchesV1DescriptionsPost.g.cs +++ /dev/null @@ -1,15 +0,0 @@ -#nullable enable - -namespace AI21 -{ - public partial interface IAi21Client - { - /// - /// Fnac Batch Descriptions - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task FnacBatchDescriptionsSolutionsFdBatchesV1DescriptionsPostAsync( - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.FnacBatchDescriptionsStatusPrefixPreviewSolutionsPreviewFdBatchesV1DescriptionsBatchIdStatusPost.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.FnacBatchDescriptionsStatusPrefixPreviewSolutionsPreviewFdBatchesV1DescriptionsBatchIdStatusPost.g.cs deleted file mode 100644 index e7d370d1..00000000 --- a/src/libs/AI21/Generated/AI21.IAi21Client.FnacBatchDescriptionsStatusPrefixPreviewSolutionsPreviewFdBatchesV1DescriptionsBatchIdStatusPost.g.cs +++ /dev/null @@ -1,17 +0,0 @@ -#nullable enable - -namespace AI21 -{ - public partial interface IAi21Client - { - /// - /// Fnac Batch Descriptions Status Prefix Preview - /// - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task FnacBatchDescriptionsStatusPrefixPreviewSolutionsPreviewFdBatchesV1DescriptionsBatchIdStatusPostAsync( - string batchId, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.FnacBatchDescriptionsStatusSolutionsFdBatchesV1DescriptionsBatchIdStatusPost.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.FnacBatchDescriptionsStatusSolutionsFdBatchesV1DescriptionsBatchIdStatusPost.g.cs deleted file mode 100644 index 45a2c87f..00000000 --- a/src/libs/AI21/Generated/AI21.IAi21Client.FnacBatchDescriptionsStatusSolutionsFdBatchesV1DescriptionsBatchIdStatusPost.g.cs +++ /dev/null @@ -1,17 +0,0 @@ -#nullable enable - -namespace AI21 -{ - public partial interface IAi21Client - { - /// - /// Fnac Batch Descriptions Status - /// - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task FnacBatchDescriptionsStatusSolutionsFdBatchesV1DescriptionsBatchIdStatusPostAsync( - string batchId, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.FnacV1ClassificationsPrefixPreviewSolutionsPreviewFnacV1ClassificationsPost.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.FnacV1ClassificationsPrefixPreviewSolutionsPreviewFnacV1ClassificationsPost.g.cs deleted file mode 100644 index c272a2e6..00000000 --- a/src/libs/AI21/Generated/AI21.IAi21Client.FnacV1ClassificationsPrefixPreviewSolutionsPreviewFnacV1ClassificationsPost.g.cs +++ /dev/null @@ -1,15 +0,0 @@ -#nullable enable - -namespace AI21 -{ - public partial interface IAi21Client - { - /// - /// Fnac V1 Classifications Prefix Preview - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task FnacV1ClassificationsPrefixPreviewSolutionsPreviewFnacV1ClassificationsPostAsync( - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.FnacV1ClassificationsSolutionsFnacV1ClassificationsPost.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.FnacV1ClassificationsSolutionsFnacV1ClassificationsPost.g.cs deleted file mode 100644 index 946994c3..00000000 --- a/src/libs/AI21/Generated/AI21.IAi21Client.FnacV1ClassificationsSolutionsFnacV1ClassificationsPost.g.cs +++ /dev/null @@ -1,15 +0,0 @@ -#nullable enable - -namespace AI21 -{ - public partial interface IAi21Client - { - /// - /// Fnac V1 Classifications - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task FnacV1ClassificationsSolutionsFnacV1ClassificationsPostAsync( - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.FnacV1DeprecatedClassificationsPrefixPreviewSolutionsPreviewFnacV1DeprecatedClassificationsPost.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.FnacV1DeprecatedClassificationsPrefixPreviewSolutionsPreviewFnacV1DeprecatedClassificationsPost.g.cs deleted file mode 100644 index 3e822f5d..00000000 --- a/src/libs/AI21/Generated/AI21.IAi21Client.FnacV1DeprecatedClassificationsPrefixPreviewSolutionsPreviewFnacV1DeprecatedClassificationsPost.g.cs +++ /dev/null @@ -1,15 +0,0 @@ -#nullable enable - -namespace AI21 -{ - public partial interface IAi21Client - { - /// - /// Fnac V1 Deprecated Classifications Prefix Preview - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task FnacV1DeprecatedClassificationsPrefixPreviewSolutionsPreviewFnacV1DeprecatedClassificationsPostAsync( - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.FnacV1DeprecatedClassificationsSolutionsFnacV1DeprecatedClassificationsPost.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.FnacV1DeprecatedClassificationsSolutionsFnacV1DeprecatedClassificationsPost.g.cs deleted file mode 100644 index 639b822d..00000000 --- a/src/libs/AI21/Generated/AI21.IAi21Client.FnacV1DeprecatedClassificationsSolutionsFnacV1DeprecatedClassificationsPost.g.cs +++ /dev/null @@ -1,15 +0,0 @@ -#nullable enable - -namespace AI21 -{ - public partial interface IAi21Client - { - /// - /// Fnac V1 Deprecated Classifications - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task FnacV1DeprecatedClassificationsSolutionsFnacV1DeprecatedClassificationsPostAsync( - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.FnacV1DeprecatedDescriptionsPrefixPreviewSolutionsPreviewFnacV1DeprecatedDescriptionsPost.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.FnacV1DeprecatedDescriptionsPrefixPreviewSolutionsPreviewFnacV1DeprecatedDescriptionsPost.g.cs deleted file mode 100644 index 2a8f991e..00000000 --- a/src/libs/AI21/Generated/AI21.IAi21Client.FnacV1DeprecatedDescriptionsPrefixPreviewSolutionsPreviewFnacV1DeprecatedDescriptionsPost.g.cs +++ /dev/null @@ -1,15 +0,0 @@ -#nullable enable - -namespace AI21 -{ - public partial interface IAi21Client - { - /// - /// Fnac V1 Deprecated Descriptions Prefix Preview - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task FnacV1DeprecatedDescriptionsPrefixPreviewSolutionsPreviewFnacV1DeprecatedDescriptionsPostAsync( - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.FnacV1DeprecatedDescriptionsSolutionsFnacV1DeprecatedDescriptionsPost.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.FnacV1DeprecatedDescriptionsSolutionsFnacV1DeprecatedDescriptionsPost.g.cs deleted file mode 100644 index 42595781..00000000 --- a/src/libs/AI21/Generated/AI21.IAi21Client.FnacV1DeprecatedDescriptionsSolutionsFnacV1DeprecatedDescriptionsPost.g.cs +++ /dev/null @@ -1,15 +0,0 @@ -#nullable enable - -namespace AI21 -{ - public partial interface IAi21Client - { - /// - /// Fnac V1 Deprecated Descriptions - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task FnacV1DeprecatedDescriptionsSolutionsFnacV1DeprecatedDescriptionsPostAsync( - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.FnacV1DescriptionsPrefixPreviewSolutionsPreviewFnacV1DescriptionsPost.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.FnacV1DescriptionsPrefixPreviewSolutionsPreviewFnacV1DescriptionsPost.g.cs deleted file mode 100644 index 11342276..00000000 --- a/src/libs/AI21/Generated/AI21.IAi21Client.FnacV1DescriptionsPrefixPreviewSolutionsPreviewFnacV1DescriptionsPost.g.cs +++ /dev/null @@ -1,15 +0,0 @@ -#nullable enable - -namespace AI21 -{ - public partial interface IAi21Client - { - /// - /// Fnac V1 Descriptions Prefix Preview - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task FnacV1DescriptionsPrefixPreviewSolutionsPreviewFnacV1DescriptionsPostAsync( - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.FnacV1DescriptionsSolutionsFnacV1DescriptionsPost.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.FnacV1DescriptionsSolutionsFnacV1DescriptionsPost.g.cs deleted file mode 100644 index b7b9ea4f..00000000 --- a/src/libs/AI21/Generated/AI21.IAi21Client.FnacV1DescriptionsSolutionsFnacV1DescriptionsPost.g.cs +++ /dev/null @@ -1,15 +0,0 @@ -#nullable enable - -namespace AI21 -{ - public partial interface IAi21Client - { - /// - /// Fnac V1 Descriptions - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task FnacV1DescriptionsSolutionsFnacV1DescriptionsPostAsync( - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.ForwardParagonWebhookStudioV1ConnectorsParagonWebhookPost.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.ForwardParagonWebhookStudioV1ConnectorsParagonWebhookPost.g.cs deleted file mode 100644 index e0869120..00000000 --- a/src/libs/AI21/Generated/AI21.IAi21Client.ForwardParagonWebhookStudioV1ConnectorsParagonWebhookPost.g.cs +++ /dev/null @@ -1,15 +0,0 @@ -#nullable enable - -namespace AI21 -{ - public partial interface IAi21Client - { - /// - /// Forward Paragon Webhook - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task ForwardParagonWebhookStudioV1ConnectorsParagonWebhookPostAsync( - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.GenerateOrgTokenStudioV1ConnectorsConnectedUsersEntityIdTokensPost.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.GenerateOrgTokenStudioV1ConnectorsConnectedUsersEntityIdTokensPost.g.cs deleted file mode 100644 index 835cc765..00000000 --- a/src/libs/AI21/Generated/AI21.IAi21Client.GenerateOrgTokenStudioV1ConnectorsConnectedUsersEntityIdTokensPost.g.cs +++ /dev/null @@ -1,17 +0,0 @@ -#nullable enable - -namespace AI21 -{ - public partial interface IAi21Client - { - /// - /// Generate Org Token - /// - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task GenerateOrgTokenStudioV1ConnectorsConnectedUsersEntityIdTokensPostAsync( - string entityId, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.GenerateResponsePdfStudioV1DemosRfiGenerateResponsePdfPost.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.GenerateResponsePdfStudioV1DemosRfiGenerateResponsePdfPost.g.cs index d56c4b50..b7b25a1f 100644 --- a/src/libs/AI21/Generated/AI21.IAi21Client.GenerateResponsePdfStudioV1DemosRfiGenerateResponsePdfPost.g.cs +++ b/src/libs/AI21/Generated/AI21.IAi21Client.GenerateResponsePdfStudioV1DemosRfiGenerateResponsePdfPost.g.cs @@ -8,11 +8,25 @@ public partial interface IAi21Client /// Combine section answers ➜ styled PDF for download /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// global::System.Threading.Tasks.Task GenerateResponsePdfStudioV1DemosRfiGenerateResponsePdfPostAsync( global::AI21.MarkdownRequest request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Combine section answers ➜ styled PDF for download + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> GenerateResponsePdfStudioV1DemosRfiGenerateResponsePdfPostAsResponseAsync( + + global::AI21.MarkdownRequest request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); /// /// Combine section answers ➜ styled PDF for download @@ -20,10 +34,12 @@ public partial interface IAi21Client /// /// All section answers concatenated /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// global::System.Threading.Tasks.Task GenerateResponsePdfStudioV1DemosRfiGenerateResponsePdfPostAsync( string text, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.GetAgentGatewaySettingsAgentsAgentIdGet.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.GetAgentGatewaySettingsAgentsAgentIdGet.g.cs new file mode 100644 index 00000000..20774161 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.IAi21Client.GetAgentGatewaySettingsAgentsAgentIdGet.g.cs @@ -0,0 +1,30 @@ +#nullable enable + +namespace AI21 +{ + public partial interface IAi21Client + { + /// + /// Get Agent + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task GetAgentGatewaySettingsAgentsAgentIdGetAsync( + string agentId, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Get Agent + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> GetAgentGatewaySettingsAgentsAgentIdGetAsResponseAsync( + string agentId, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.GetAgentOptimizationsGatewaySettingsAgentsAgentIdOptimizationsGet.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.GetAgentOptimizationsGatewaySettingsAgentsAgentIdOptimizationsGet.g.cs new file mode 100644 index 00000000..f0c56783 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.IAi21Client.GetAgentOptimizationsGatewaySettingsAgentsAgentIdOptimizationsGet.g.cs @@ -0,0 +1,30 @@ +#nullable enable + +namespace AI21 +{ + public partial interface IAi21Client + { + /// + /// Get Agent Optimizations + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> GetAgentOptimizationsGatewaySettingsAgentsAgentIdOptimizationsGetAsync( + string agentId, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Get Agent Optimizations + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task>> GetAgentOptimizationsGatewaySettingsAgentsAgentIdOptimizationsGetAsResponseAsync( + string agentId, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.GetAgentOptimizationsTokenwiseSettingsAgentsAgentIdOptimizationsGet.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.GetAgentOptimizationsTokenwiseSettingsAgentsAgentIdOptimizationsGet.g.cs new file mode 100644 index 00000000..0e9c46f0 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.IAi21Client.GetAgentOptimizationsTokenwiseSettingsAgentsAgentIdOptimizationsGet.g.cs @@ -0,0 +1,30 @@ +#nullable enable + +namespace AI21 +{ + public partial interface IAi21Client + { + /// + /// Get Agent Optimizations + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> GetAgentOptimizationsTokenwiseSettingsAgentsAgentIdOptimizationsGetAsync( + string agentId, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Get Agent Optimizations + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task>> GetAgentOptimizationsTokenwiseSettingsAgentsAgentIdOptimizationsGetAsResponseAsync( + string agentId, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.GetAgentTokenwiseSettingsAgentsAgentIdGet.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.GetAgentTokenwiseSettingsAgentsAgentIdGet.g.cs new file mode 100644 index 00000000..51990189 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.IAi21Client.GetAgentTokenwiseSettingsAgentsAgentIdGet.g.cs @@ -0,0 +1,30 @@ +#nullable enable + +namespace AI21 +{ + public partial interface IAi21Client + { + /// + /// Get Agent + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task GetAgentTokenwiseSettingsAgentsAgentIdGetAsync( + string agentId, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Get Agent + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> GetAgentTokenwiseSettingsAgentsAgentIdGetAsResponseAsync( + string agentId, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.GetAssistantsByMcpStudioV1McpStorageMcpIdAssistantsGet.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.GetAssistantsByMcpStudioV1McpStorageMcpIdAssistantsGet.g.cs index cdd8d803..954f9fce 100644 --- a/src/libs/AI21/Generated/AI21.IAi21Client.GetAssistantsByMcpStudioV1McpStorageMcpIdAssistantsGet.g.cs +++ b/src/libs/AI21/Generated/AI21.IAi21Client.GetAssistantsByMcpStudioV1McpStorageMcpIdAssistantsGet.g.cs @@ -8,10 +8,23 @@ public partial interface IAi21Client /// Get Assistants By Mcp /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// global::System.Threading.Tasks.Task GetAssistantsByMcpStudioV1McpStorageMcpIdAssistantsGetAsync( string mcpId, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Get Assistants By Mcp + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> GetAssistantsByMcpStudioV1McpStorageMcpIdAssistantsGetAsResponseAsync( + string mcpId, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.GetAvailableModelsEndpointStudioV1SettingsModelsAvailableGet.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.GetAvailableModelsEndpointStudioV1SettingsModelsAvailableGet.g.cs index 8ce5781f..1b5513e2 100644 --- a/src/libs/AI21/Generated/AI21.IAi21Client.GetAvailableModelsEndpointStudioV1SettingsModelsAvailableGet.g.cs +++ b/src/libs/AI21/Generated/AI21.IAi21Client.GetAvailableModelsEndpointStudioV1SettingsModelsAvailableGet.g.cs @@ -7,9 +7,20 @@ public partial interface IAi21Client /// /// Get Available Models Endpoint /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// global::System.Threading.Tasks.Task GetAvailableModelsEndpointStudioV1SettingsModelsAvailableGetAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Get Available Models Endpoint + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> GetAvailableModelsEndpointStudioV1SettingsModelsAvailableGetAsResponseAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.GetConfigGatewaySettingsConfigsConfigIdGet.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.GetConfigGatewaySettingsConfigsConfigIdGet.g.cs new file mode 100644 index 00000000..94abd154 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.IAi21Client.GetConfigGatewaySettingsConfigsConfigIdGet.g.cs @@ -0,0 +1,30 @@ +#nullable enable + +namespace AI21 +{ + public partial interface IAi21Client + { + /// + /// 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 GetConfigGatewaySettingsConfigsConfigIdGetAsync( + string configId, + global::AI21.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> GetConfigGatewaySettingsConfigsConfigIdGetAsResponseAsync( + string configId, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.GetConfigSchemaGatewaySettingsConfigsSchemaGet.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.GetConfigSchemaGatewaySettingsConfigsSchemaGet.g.cs new file mode 100644 index 00000000..145e80f4 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.IAi21Client.GetConfigSchemaGatewaySettingsConfigsSchemaGet.g.cs @@ -0,0 +1,26 @@ +#nullable enable + +namespace AI21 +{ + public partial interface IAi21Client + { + /// + /// Get Config 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 GetConfigSchemaGatewaySettingsConfigsSchemaGetAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Get Config 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> GetConfigSchemaGatewaySettingsConfigsSchemaGetAsResponseAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.GetConfigSchemaTokenwiseSettingsConfigsSchemaGet.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.GetConfigSchemaTokenwiseSettingsConfigsSchemaGet.g.cs new file mode 100644 index 00000000..3cfdf200 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.IAi21Client.GetConfigSchemaTokenwiseSettingsConfigsSchemaGet.g.cs @@ -0,0 +1,26 @@ +#nullable enable + +namespace AI21 +{ + public partial interface IAi21Client + { + /// + /// Get Config 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 GetConfigSchemaTokenwiseSettingsConfigsSchemaGetAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Get Config 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> GetConfigSchemaTokenwiseSettingsConfigsSchemaGetAsResponseAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.GetConfigTokenwiseSettingsConfigsConfigIdGet.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.GetConfigTokenwiseSettingsConfigsConfigIdGet.g.cs new file mode 100644 index 00000000..aba379e1 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.IAi21Client.GetConfigTokenwiseSettingsConfigsConfigIdGet.g.cs @@ -0,0 +1,30 @@ +#nullable enable + +namespace AI21 +{ + public partial interface IAi21Client + { + /// + /// 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 GetConfigTokenwiseSettingsConfigsConfigIdGetAsync( + string configId, + global::AI21.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> GetConfigTokenwiseSettingsConfigsConfigIdGetAsResponseAsync( + string configId, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.GetConnectorConnectionStatusStudioV1ConnectorsConnectedUsersEntityIdDataSourcesDataSourceConnectionStatusGet.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.GetConnectorConnectionStatusStudioV1ConnectorsConnectedUsersEntityIdDataSourcesDataSourceConnectionStatusGet.g.cs deleted file mode 100644 index 4f5c7c33..00000000 --- a/src/libs/AI21/Generated/AI21.IAi21Client.GetConnectorConnectionStatusStudioV1ConnectorsConnectedUsersEntityIdDataSourcesDataSourceConnectionStatusGet.g.cs +++ /dev/null @@ -1,21 +0,0 @@ -#nullable enable - -namespace AI21 -{ - public partial interface IAi21Client - { - /// - /// Get Connector Connection Status - /// - /// - /// - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task GetConnectorConnectionStatusStudioV1ConnectorsConnectedUsersEntityIdDataSourcesDataSourceConnectionStatusGetAsync( - string entityId, - string dataSource, - string paragonToken, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.GetDataSourceStatusStudioV1ConnectorsConnectedUsersEntityIdDataSourcesDataSourceStatusGet.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.GetDataSourceStatusStudioV1ConnectorsConnectedUsersEntityIdDataSourcesDataSourceStatusGet.g.cs deleted file mode 100644 index d44822d5..00000000 --- a/src/libs/AI21/Generated/AI21.IAi21Client.GetDataSourceStatusStudioV1ConnectorsConnectedUsersEntityIdDataSourcesDataSourceStatusGet.g.cs +++ /dev/null @@ -1,21 +0,0 @@ -#nullable enable - -namespace AI21 -{ - public partial interface IAi21Client - { - /// - /// Get Data Source Status - /// - /// - /// - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task GetDataSourceStatusStudioV1ConnectorsConnectedUsersEntityIdDataSourcesDataSourceStatusGetAsync( - string entityId, - string dataSource, - string paragonToken, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.GetDemoStudioV1DemosDemoIdGet.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.GetDemoStudioV1DemosDemoIdGet.g.cs index ae0d862f..c71b54a9 100644 --- a/src/libs/AI21/Generated/AI21.IAi21Client.GetDemoStudioV1DemosDemoIdGet.g.cs +++ b/src/libs/AI21/Generated/AI21.IAi21Client.GetDemoStudioV1DemosDemoIdGet.g.cs @@ -9,10 +9,24 @@ public partial interface IAi21Client /// Get a specific demo by 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 GetDemoStudioV1DemosDemoIdGetAsync( string demoId, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Get Demo
+ /// Get a specific demo by 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> GetDemoStudioV1DemosDemoIdGetAsResponseAsync( + string demoId, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.GetFileUrlStudioV1DemosScraperFileUrlFileIdGet.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.GetFileUrlStudioV1DemosScraperFileUrlFileIdGet.g.cs index 646df227..23f84f2c 100644 --- a/src/libs/AI21/Generated/AI21.IAi21Client.GetFileUrlStudioV1DemosScraperFileUrlFileIdGet.g.cs +++ b/src/libs/AI21/Generated/AI21.IAi21Client.GetFileUrlStudioV1DemosScraperFileUrlFileIdGet.g.cs @@ -9,11 +9,26 @@ public partial interface IAi21Client /// /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// global::System.Threading.Tasks.Task GetFileUrlStudioV1DemosScraperFileUrlFileIdGetAsync( string fileId, string? apiKey = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Get File Url + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> GetFileUrlStudioV1DemosScraperFileUrlFileIdGetAsResponseAsync( + string fileId, + string? apiKey = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.GetMcpStorageStudioV1McpStorageMcpIdGet.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.GetMcpStorageStudioV1McpStorageMcpIdGet.g.cs index d3a4aa66..bc3d2a90 100644 --- a/src/libs/AI21/Generated/AI21.IAi21Client.GetMcpStorageStudioV1McpStorageMcpIdGet.g.cs +++ b/src/libs/AI21/Generated/AI21.IAi21Client.GetMcpStorageStudioV1McpStorageMcpIdGet.g.cs @@ -8,10 +8,23 @@ public partial interface IAi21Client /// Get Mcp Storage /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// global::System.Threading.Tasks.Task GetMcpStorageStudioV1McpStorageMcpIdGetAsync( string mcpId, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Get Mcp Storage + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> GetMcpStorageStudioV1McpStorageMcpIdGetAsResponseAsync( + string mcpId, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.GetOrgDataSourcesInfoStudioV1ConnectorsConnectedUsersEntityIdDataSourcesGet.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.GetOrgDataSourcesInfoStudioV1ConnectorsConnectedUsersEntityIdDataSourcesGet.g.cs deleted file mode 100644 index 9dfb67b2..00000000 --- a/src/libs/AI21/Generated/AI21.IAi21Client.GetOrgDataSourcesInfoStudioV1ConnectorsConnectedUsersEntityIdDataSourcesGet.g.cs +++ /dev/null @@ -1,17 +0,0 @@ -#nullable enable - -namespace AI21 -{ - public partial interface IAi21Client - { - /// - /// Get Org Data Sources Info - /// - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task GetOrgDataSourcesInfoStudioV1ConnectorsConnectedUsersEntityIdDataSourcesGetAsync( - string entityId, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.GetOrganizationSchemasStudioV1StructuredRagOrganizationsOrganizationIdSchemasGet.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.GetOrganizationSchemasStudioV1StructuredRagOrganizationsOrganizationIdSchemasGet.g.cs index bc4f583d..fc479244 100644 --- a/src/libs/AI21/Generated/AI21.IAi21Client.GetOrganizationSchemasStudioV1StructuredRagOrganizationsOrganizationIdSchemasGet.g.cs +++ b/src/libs/AI21/Generated/AI21.IAi21Client.GetOrganizationSchemasStudioV1StructuredRagOrganizationsOrganizationIdSchemasGet.g.cs @@ -8,10 +8,23 @@ public partial interface IAi21Client /// Get Organization Schemas /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// global::System.Threading.Tasks.Task GetOrganizationSchemasStudioV1StructuredRagOrganizationsOrganizationIdSchemasGetAsync( string organizationId, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Get Organization Schemas + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> GetOrganizationSchemasStudioV1StructuredRagOrganizationsOrganizationIdSchemasGetAsResponseAsync( + string organizationId, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.GetOutputExplanationStudioV1ExecutionsExecutionIdExplanationsOutputGet.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.GetOutputExplanationStudioV1ExecutionsExecutionIdExplanationsOutputGet.g.cs deleted file mode 100644 index c7b56ec9..00000000 --- a/src/libs/AI21/Generated/AI21.IAi21Client.GetOutputExplanationStudioV1ExecutionsExecutionIdExplanationsOutputGet.g.cs +++ /dev/null @@ -1,23 +0,0 @@ -#nullable enable - -namespace AI21 -{ - public partial interface IAi21Client - { - /// - /// Get Output Explanation
- /// Get output explanation for an execution (cached or generated).
- /// Set force_regenerate=True to regenerate even if cached. - ///
- /// - /// - /// Default Value: false - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task GetOutputExplanationStudioV1ExecutionsExecutionIdExplanationsOutputGetAsync( - string executionId, - bool? forceRegenerate = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.GetParsedFileStudioV1DemosDocumentModifierGetParsedFileGet.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.GetParsedFileStudioV1DemosDocumentModifierGetParsedFileGet.g.cs index 37acbd30..412ac982 100644 --- a/src/libs/AI21/Generated/AI21.IAi21Client.GetParsedFileStudioV1DemosDocumentModifierGetParsedFileGet.g.cs +++ b/src/libs/AI21/Generated/AI21.IAi21Client.GetParsedFileStudioV1DemosDocumentModifierGetParsedFileGet.g.cs @@ -9,10 +9,24 @@ public partial interface IAi21Client /// Get the parsed file from the document modifier. /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// global::System.Threading.Tasks.Task GetParsedFileStudioV1DemosDocumentModifierGetParsedFileGetAsync( string fileName, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Get Parsed File
+ /// Get the parsed file from the document modifier. + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> GetParsedFileStudioV1DemosDocumentModifierGetParsedFileGetAsResponseAsync( + string fileName, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.GetStepExplanationsStudioV1ExecutionsExecutionIdExplanationsStepsGet.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.GetStepExplanationsStudioV1ExecutionsExecutionIdExplanationsStepsGet.g.cs deleted file mode 100644 index f52036da..00000000 --- a/src/libs/AI21/Generated/AI21.IAi21Client.GetStepExplanationsStudioV1ExecutionsExecutionIdExplanationsStepsGet.g.cs +++ /dev/null @@ -1,23 +0,0 @@ -#nullable enable - -namespace AI21 -{ - public partial interface IAi21Client - { - /// - /// Get Step Explanations
- /// Get step explanations for an execution (cached or generated).
- /// Set force_regenerate=True to regenerate even if cached. - ///
- /// - /// - /// Default Value: false - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task GetStepExplanationsStudioV1ExecutionsExecutionIdExplanationsStepsGetAsync( - string executionId, - bool? forceRegenerate = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.GetVectorStoreStudioV1DemosRegulationsVectorStoreVectorStoreIdGet.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.GetVectorStoreStudioV1DemosRegulationsVectorStoreVectorStoreIdGet.g.cs index 0e336147..4d527b46 100644 --- a/src/libs/AI21/Generated/AI21.IAi21Client.GetVectorStoreStudioV1DemosRegulationsVectorStoreVectorStoreIdGet.g.cs +++ b/src/libs/AI21/Generated/AI21.IAi21Client.GetVectorStoreStudioV1DemosRegulationsVectorStoreVectorStoreIdGet.g.cs @@ -9,10 +9,24 @@ public partial interface IAi21Client /// Get a vector store by 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 GetVectorStoreStudioV1DemosRegulationsVectorStoreVectorStoreIdGetAsync( string vectorStoreId, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Get Vector Store
+ /// Get a vector store by 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> GetVectorStoreStudioV1DemosRegulationsVectorStoreVectorStoreIdGetAsResponseAsync( + string vectorStoreId, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.GetWebsiteConnectorByIdStudioV1ConnectorsWebsiteConnectorIdGet.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.GetWebsiteConnectorByIdStudioV1ConnectorsWebsiteConnectorIdGet.g.cs deleted file mode 100644 index 54aca650..00000000 --- a/src/libs/AI21/Generated/AI21.IAi21Client.GetWebsiteConnectorByIdStudioV1ConnectorsWebsiteConnectorIdGet.g.cs +++ /dev/null @@ -1,17 +0,0 @@ -#nullable enable - -namespace AI21 -{ - public partial interface IAi21Client - { - /// - /// Get Website Connector By Id - /// - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task GetWebsiteConnectorByIdStudioV1ConnectorsWebsiteConnectorIdGetAsync( - string connectorId, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.GetWebsiteConnectorStudioV1ConnectorsWebsiteGet.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.GetWebsiteConnectorStudioV1ConnectorsWebsiteGet.g.cs deleted file mode 100644 index 62bee7f5..00000000 --- a/src/libs/AI21/Generated/AI21.IAi21Client.GetWebsiteConnectorStudioV1ConnectorsWebsiteGet.g.cs +++ /dev/null @@ -1,15 +0,0 @@ -#nullable enable - -namespace AI21 -{ - public partial interface IAi21Client - { - /// - /// Get Website Connector - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task GetWebsiteConnectorStudioV1ConnectorsWebsiteGetAsync( - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.GetWorkspaceModelSecretEndpointStudioV1SettingsModelsNameSecretsGet.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.GetWorkspaceModelSecretEndpointStudioV1SettingsModelsNameSecretsGet.g.cs index cfd7d425..d13bca1f 100644 --- a/src/libs/AI21/Generated/AI21.IAi21Client.GetWorkspaceModelSecretEndpointStudioV1SettingsModelsNameSecretsGet.g.cs +++ b/src/libs/AI21/Generated/AI21.IAi21Client.GetWorkspaceModelSecretEndpointStudioV1SettingsModelsNameSecretsGet.g.cs @@ -8,10 +8,23 @@ public partial interface IAi21Client /// Get Workspace Model Secret Endpoint /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// global::System.Threading.Tasks.Task GetWorkspaceModelSecretEndpointStudioV1SettingsModelsNameSecretsGetAsync( string name, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Get Workspace Model Secret Endpoint + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> GetWorkspaceModelSecretEndpointStudioV1SettingsModelsNameSecretsGetAsResponseAsync( + string name, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.GetWorkspaceModelsByOrganizationEndpointStudioV1SettingsModelsGet.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.GetWorkspaceModelsByOrganizationEndpointStudioV1SettingsModelsGet.g.cs index 35524629..a0a4a026 100644 --- a/src/libs/AI21/Generated/AI21.IAi21Client.GetWorkspaceModelsByOrganizationEndpointStudioV1SettingsModelsGet.g.cs +++ b/src/libs/AI21/Generated/AI21.IAi21Client.GetWorkspaceModelsByOrganizationEndpointStudioV1SettingsModelsGet.g.cs @@ -7,9 +7,20 @@ public partial interface IAi21Client /// /// Get Workspace Models By Organization Endpoint /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// global::System.Threading.Tasks.Task GetWorkspaceModelsByOrganizationEndpointStudioV1SettingsModelsGetAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Get Workspace Models By Organization Endpoint + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> GetWorkspaceModelsByOrganizationEndpointStudioV1SettingsModelsGetAsResponseAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.JambaExecuteStudioV1DemosDocumentModifierJambaExecutePost.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.JambaExecuteStudioV1DemosDocumentModifierJambaExecutePost.g.cs index 803212b8..339eb2cf 100644 --- a/src/libs/AI21/Generated/AI21.IAi21Client.JambaExecuteStudioV1DemosDocumentModifierJambaExecutePost.g.cs +++ b/src/libs/AI21/Generated/AI21.IAi21Client.JambaExecuteStudioV1DemosDocumentModifierJambaExecutePost.g.cs @@ -9,11 +9,26 @@ public partial interface IAi21Client /// Execute a Jamba request. /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// global::System.Threading.Tasks.Task JambaExecuteStudioV1DemosDocumentModifierJambaExecutePostAsync( global::AI21.JambaExecuteRequest request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Jamba Execute
+ /// Execute a Jamba request. + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> JambaExecuteStudioV1DemosDocumentModifierJambaExecutePostAsResponseAsync( + + global::AI21.JambaExecuteRequest request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); /// /// Jamba Execute
@@ -23,6 +38,7 @@ public partial interface IAi21Client /// /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// global::System.Threading.Tasks.Task JambaExecuteStudioV1DemosDocumentModifierJambaExecutePostAsync( @@ -30,6 +46,7 @@ public partial interface IAi21Client string task, string prompt, string? apiKey = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.KirshDocumentUploadProcessPrefixPreviewSolutionsPreviewKirshDocumentUploadProcessPost.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.KirshDocumentUploadProcessPrefixPreviewSolutionsPreviewKirshDocumentUploadProcessPost.g.cs deleted file mode 100644 index c5f7346d..00000000 --- a/src/libs/AI21/Generated/AI21.IAi21Client.KirshDocumentUploadProcessPrefixPreviewSolutionsPreviewKirshDocumentUploadProcessPost.g.cs +++ /dev/null @@ -1,15 +0,0 @@ -#nullable enable - -namespace AI21 -{ - public partial interface IAi21Client - { - /// - /// Kirsh Document Upload Process Prefix Preview - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task KirshDocumentUploadProcessPrefixPreviewSolutionsPreviewKirshDocumentUploadProcessPostAsync( - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.KirshDocumentUploadProcessSolutionsKirshDocumentUploadProcessPost.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.KirshDocumentUploadProcessSolutionsKirshDocumentUploadProcessPost.g.cs deleted file mode 100644 index 394244e0..00000000 --- a/src/libs/AI21/Generated/AI21.IAi21Client.KirshDocumentUploadProcessSolutionsKirshDocumentUploadProcessPost.g.cs +++ /dev/null @@ -1,15 +0,0 @@ -#nullable enable - -namespace AI21 -{ - public partial interface IAi21Client - { - /// - /// Kirsh Document Upload Process - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task KirshDocumentUploadProcessSolutionsKirshDocumentUploadProcessPostAsync( - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.KirshEmailAssistantPrefixPreviewSolutionsPreviewKirshEmailAssistantPost.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.KirshEmailAssistantPrefixPreviewSolutionsPreviewKirshEmailAssistantPost.g.cs deleted file mode 100644 index 6e516348..00000000 --- a/src/libs/AI21/Generated/AI21.IAi21Client.KirshEmailAssistantPrefixPreviewSolutionsPreviewKirshEmailAssistantPost.g.cs +++ /dev/null @@ -1,15 +0,0 @@ -#nullable enable - -namespace AI21 -{ - public partial interface IAi21Client - { - /// - /// Kirsh Email Assistant Prefix Preview - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task KirshEmailAssistantPrefixPreviewSolutionsPreviewKirshEmailAssistantPostAsync( - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.KirshEmailAssistantSolutionsKirshEmailAssistantPost.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.KirshEmailAssistantSolutionsKirshEmailAssistantPost.g.cs deleted file mode 100644 index 5c144142..00000000 --- a/src/libs/AI21/Generated/AI21.IAi21Client.KirshEmailAssistantSolutionsKirshEmailAssistantPost.g.cs +++ /dev/null @@ -1,15 +0,0 @@ -#nullable enable - -namespace AI21 -{ - public partial interface IAi21Client - { - /// - /// Kirsh Email Assistant - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task KirshEmailAssistantSolutionsKirshEmailAssistantPostAsync( - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.KirshFundingAndCategorizationCheckPrefixPreviewSolutionsPreviewKirshFundingAndCategorizationCheckPost.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.KirshFundingAndCategorizationCheckPrefixPreviewSolutionsPreviewKirshFundingAndCategorizationCheckPost.g.cs deleted file mode 100644 index 90e56218..00000000 --- a/src/libs/AI21/Generated/AI21.IAi21Client.KirshFundingAndCategorizationCheckPrefixPreviewSolutionsPreviewKirshFundingAndCategorizationCheckPost.g.cs +++ /dev/null @@ -1,15 +0,0 @@ -#nullable enable - -namespace AI21 -{ - public partial interface IAi21Client - { - /// - /// Kirsh Funding And Categorization Check Prefix Preview - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task KirshFundingAndCategorizationCheckPrefixPreviewSolutionsPreviewKirshFundingAndCategorizationCheckPostAsync( - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.KirshFundingAndCategorizationCheckSolutionsKirshFundingAndCategorizationCheckPost.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.KirshFundingAndCategorizationCheckSolutionsKirshFundingAndCategorizationCheckPost.g.cs deleted file mode 100644 index fe3ab6fe..00000000 --- a/src/libs/AI21/Generated/AI21.IAi21Client.KirshFundingAndCategorizationCheckSolutionsKirshFundingAndCategorizationCheckPost.g.cs +++ /dev/null @@ -1,15 +0,0 @@ -#nullable enable - -namespace AI21 -{ - public partial interface IAi21Client - { - /// - /// Kirsh Funding And Categorization Check - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task KirshFundingAndCategorizationCheckSolutionsKirshFundingAndCategorizationCheckPostAsync( - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.KirshGrantCompliancePrefixPreviewSolutionsPreviewKirshGrantCompliancePost.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.KirshGrantCompliancePrefixPreviewSolutionsPreviewKirshGrantCompliancePost.g.cs deleted file mode 100644 index c3f430ab..00000000 --- a/src/libs/AI21/Generated/AI21.IAi21Client.KirshGrantCompliancePrefixPreviewSolutionsPreviewKirshGrantCompliancePost.g.cs +++ /dev/null @@ -1,15 +0,0 @@ -#nullable enable - -namespace AI21 -{ - public partial interface IAi21Client - { - /// - /// Kirsh Grant Compliance Prefix Preview - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task KirshGrantCompliancePrefixPreviewSolutionsPreviewKirshGrantCompliancePostAsync( - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.KirshGrantComplianceSolutionsKirshGrantCompliancePost.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.KirshGrantComplianceSolutionsKirshGrantCompliancePost.g.cs deleted file mode 100644 index 1dab2ebd..00000000 --- a/src/libs/AI21/Generated/AI21.IAi21Client.KirshGrantComplianceSolutionsKirshGrantCompliancePost.g.cs +++ /dev/null @@ -1,15 +0,0 @@ -#nullable enable - -namespace AI21 -{ - public partial interface IAi21Client - { - /// - /// Kirsh Grant Compliance - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task KirshGrantComplianceSolutionsKirshGrantCompliancePostAsync( - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.KirshGrantMetadataPrefixPreviewSolutionsPreviewKirshGrantMetadataPost.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.KirshGrantMetadataPrefixPreviewSolutionsPreviewKirshGrantMetadataPost.g.cs deleted file mode 100644 index a2790cbd..00000000 --- a/src/libs/AI21/Generated/AI21.IAi21Client.KirshGrantMetadataPrefixPreviewSolutionsPreviewKirshGrantMetadataPost.g.cs +++ /dev/null @@ -1,15 +0,0 @@ -#nullable enable - -namespace AI21 -{ - public partial interface IAi21Client - { - /// - /// Kirsh Grant Metadata Prefix Preview - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task KirshGrantMetadataPrefixPreviewSolutionsPreviewKirshGrantMetadataPostAsync( - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.KirshGrantMetadataSolutionsKirshGrantMetadataPost.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.KirshGrantMetadataSolutionsKirshGrantMetadataPost.g.cs deleted file mode 100644 index 6557e8e7..00000000 --- a/src/libs/AI21/Generated/AI21.IAi21Client.KirshGrantMetadataSolutionsKirshGrantMetadataPost.g.cs +++ /dev/null @@ -1,15 +0,0 @@ -#nullable enable - -namespace AI21 -{ - public partial interface IAi21Client - { - /// - /// Kirsh Grant Metadata - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task KirshGrantMetadataSolutionsKirshGrantMetadataPostAsync( - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.KirshPublicInformationCheckPrefixPreviewSolutionsPreviewKirshPublicInformationCheckPost.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.KirshPublicInformationCheckPrefixPreviewSolutionsPreviewKirshPublicInformationCheckPost.g.cs deleted file mode 100644 index 8fa0e0a5..00000000 --- a/src/libs/AI21/Generated/AI21.IAi21Client.KirshPublicInformationCheckPrefixPreviewSolutionsPreviewKirshPublicInformationCheckPost.g.cs +++ /dev/null @@ -1,15 +0,0 @@ -#nullable enable - -namespace AI21 -{ - public partial interface IAi21Client - { - /// - /// Kirsh Public Information Check Prefix Preview - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task KirshPublicInformationCheckPrefixPreviewSolutionsPreviewKirshPublicInformationCheckPostAsync( - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.KirshPublicInformationCheckSolutionsKirshPublicInformationCheckPost.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.KirshPublicInformationCheckSolutionsKirshPublicInformationCheckPost.g.cs deleted file mode 100644 index 147906d2..00000000 --- a/src/libs/AI21/Generated/AI21.IAi21Client.KirshPublicInformationCheckSolutionsKirshPublicInformationCheckPost.g.cs +++ /dev/null @@ -1,15 +0,0 @@ -#nullable enable - -namespace AI21 -{ - public partial interface IAi21Client - { - /// - /// Kirsh Public Information Check - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task KirshPublicInformationCheckSolutionsKirshPublicInformationCheckPostAsync( - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.ListAgentsGatewaySettingsAgentsGet.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.ListAgentsGatewaySettingsAgentsGet.g.cs new file mode 100644 index 00000000..0cd8480d --- /dev/null +++ b/src/libs/AI21/Generated/AI21.IAi21Client.ListAgentsGatewaySettingsAgentsGet.g.cs @@ -0,0 +1,26 @@ +#nullable enable + +namespace AI21 +{ + public partial interface IAi21Client + { + /// + /// List Agents + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> ListAgentsGatewaySettingsAgentsGetAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// List Agents + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task>> ListAgentsGatewaySettingsAgentsGetAsResponseAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.ListAgentsTokenwiseSettingsAgentsGet.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.ListAgentsTokenwiseSettingsAgentsGet.g.cs new file mode 100644 index 00000000..3119e169 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.IAi21Client.ListAgentsTokenwiseSettingsAgentsGet.g.cs @@ -0,0 +1,26 @@ +#nullable enable + +namespace AI21 +{ + public partial interface IAi21Client + { + /// + /// List Agents + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> ListAgentsTokenwiseSettingsAgentsGetAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// List Agents + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task>> ListAgentsTokenwiseSettingsAgentsGetAsResponseAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.ListConfigsGatewaySettingsConfigsGet.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.ListConfigsGatewaySettingsConfigsGet.g.cs new file mode 100644 index 00000000..63419fcf --- /dev/null +++ b/src/libs/AI21/Generated/AI21.IAi21Client.ListConfigsGatewaySettingsConfigsGet.g.cs @@ -0,0 +1,26 @@ +#nullable enable + +namespace AI21 +{ + public partial interface IAi21Client + { + /// + /// List Configs + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> ListConfigsGatewaySettingsConfigsGetAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// List Configs + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task>> ListConfigsGatewaySettingsConfigsGetAsResponseAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.ListConfigsTokenwiseSettingsConfigsGet.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.ListConfigsTokenwiseSettingsConfigsGet.g.cs new file mode 100644 index 00000000..80a90e14 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.IAi21Client.ListConfigsTokenwiseSettingsConfigsGet.g.cs @@ -0,0 +1,26 @@ +#nullable enable + +namespace AI21 +{ + public partial interface IAi21Client + { + /// + /// List Configs + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> ListConfigsTokenwiseSettingsConfigsGetAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// List Configs + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task>> ListConfigsTokenwiseSettingsConfigsGetAsResponseAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.ListDemosStudioV1DemosGet.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.ListDemosStudioV1DemosGet.g.cs index 3e0c9c22..f6a7f8c1 100644 --- a/src/libs/AI21/Generated/AI21.IAi21Client.ListDemosStudioV1DemosGet.g.cs +++ b/src/libs/AI21/Generated/AI21.IAi21Client.ListDemosStudioV1DemosGet.g.cs @@ -8,9 +8,21 @@ public partial interface IAi21Client /// List Demos
/// List all available demos. ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// global::System.Threading.Tasks.Task> ListDemosStudioV1DemosGetAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// List Demos
+ /// List all available demos. + ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task>> ListDemosStudioV1DemosGetAsResponseAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.ListMcpStorageStudioV1McpStorageGet.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.ListMcpStorageStudioV1McpStorageGet.g.cs index 95b53926..800b4120 100644 --- a/src/libs/AI21/Generated/AI21.IAi21Client.ListMcpStorageStudioV1McpStorageGet.g.cs +++ b/src/libs/AI21/Generated/AI21.IAi21Client.ListMcpStorageStudioV1McpStorageGet.g.cs @@ -8,10 +8,23 @@ public partial interface IAi21Client /// List Mcp Storage /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// global::System.Threading.Tasks.Task ListMcpStorageStudioV1McpStorageGetAsync( global::System.Guid? workspaceId = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// List Mcp Storage + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> ListMcpStorageStudioV1McpStorageGetAsResponseAsync( + global::System.Guid? workspaceId = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.McpToolDiscoveryStudioV1McpDiscoverPost.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.McpToolDiscoveryStudioV1McpDiscoverPost.g.cs deleted file mode 100644 index 3ee3cc70..00000000 --- a/src/libs/AI21/Generated/AI21.IAi21Client.McpToolDiscoveryStudioV1McpDiscoverPost.g.cs +++ /dev/null @@ -1,31 +0,0 @@ -#nullable enable - -namespace AI21 -{ - public partial interface IAi21Client - { - /// - /// Mcp Tool Discovery - /// - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task McpToolDiscoveryStudioV1McpDiscoverPostAsync( - - global::AI21.MCPDefinition request, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Mcp Tool Discovery - /// - /// - /// - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task McpToolDiscoveryStudioV1McpDiscoverPostAsync( - string serverUrl, - string? serverLabel = default, - object? headers = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.ParsePdfStudioV1DemosDocumentModifierParsePdfPost.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.ParsePdfStudioV1DemosDocumentModifierParsePdfPost.g.cs index c064a385..34ac3bc2 100644 --- a/src/libs/AI21/Generated/AI21.IAi21Client.ParsePdfStudioV1DemosDocumentModifierParsePdfPost.g.cs +++ b/src/libs/AI21/Generated/AI21.IAi21Client.ParsePdfStudioV1DemosDocumentModifierParsePdfPost.g.cs @@ -9,11 +9,26 @@ public partial interface IAi21Client /// Parse a PDF file and return its contents. /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// global::System.Threading.Tasks.Task ParsePdfStudioV1DemosDocumentModifierParsePdfPostAsync( global::AI21.BodyParsePdfStudioV1DemosDocumentModifierParsePdfPost request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Parse Pdf
+ /// Parse a PDF file and return its contents. + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> ParsePdfStudioV1DemosDocumentModifierParsePdfPostAsResponseAsync( + + global::AI21.BodyParsePdfStudioV1DemosDocumentModifierParsePdfPost request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); /// /// Parse Pdf
@@ -21,11 +36,46 @@ public partial interface IAi21Client ///
/// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// global::System.Threading.Tasks.Task ParsePdfStudioV1DemosDocumentModifierParsePdfPostAsync( byte[] file, string filename, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + + /// + /// Parse Pdf
+ /// Parse a PDF file and return its contents. + ///
+ /// + /// The stream to send as the multipart 'file' 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 ParsePdfStudioV1DemosDocumentModifierParsePdfPostAsync( + global::System.IO.Stream file, + string filename, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Parse Pdf
+ /// Parse a PDF file and return its contents. + ///
+ /// + /// The stream to send as the multipart 'file' 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> ParsePdfStudioV1DemosDocumentModifierParsePdfPostAsResponseAsync( + global::System.IO.Stream file, + string filename, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.PostWebsiteConnectorStudioV1ConnectorsWebsitePost.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.PostWebsiteConnectorStudioV1ConnectorsWebsitePost.g.cs deleted file mode 100644 index 8c31ea67..00000000 --- a/src/libs/AI21/Generated/AI21.IAi21Client.PostWebsiteConnectorStudioV1ConnectorsWebsitePost.g.cs +++ /dev/null @@ -1,29 +0,0 @@ -#nullable enable - -namespace AI21 -{ - public partial interface IAi21Client - { - /// - /// Post Website Connector - /// - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task PostWebsiteConnectorStudioV1ConnectorsWebsitePostAsync( - - global::AI21.WebsiteConnectorPayload request, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Post Website Connector - /// - /// - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task PostWebsiteConnectorStudioV1ConnectorsWebsitePostAsync( - global::AI21.WebsiteConnectorPayloadType type, - global::AI21.AnyOf> value, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.ProcessRfiDocumentStudioV1DemosRfiProcessRfiPost.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.ProcessRfiDocumentStudioV1DemosRfiProcessRfiPost.g.cs index 98d4b17b..b4ad5b6f 100644 --- a/src/libs/AI21/Generated/AI21.IAi21Client.ProcessRfiDocumentStudioV1DemosRfiProcessRfiPost.g.cs +++ b/src/libs/AI21/Generated/AI21.IAi21Client.ProcessRfiDocumentStudioV1DemosRfiProcessRfiPost.g.cs @@ -8,11 +8,25 @@ public partial interface IAi21Client /// Process Rfi Document /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// global::System.Threading.Tasks.Task> ProcessRfiDocumentStudioV1DemosRfiProcessRfiPostAsync( global::AI21.BodyProcessRfiDocumentStudioV1DemosRfiProcessRfiPost request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Process Rfi Document + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task>> ProcessRfiDocumentStudioV1DemosRfiProcessRfiPostAsResponseAsync( + + global::AI21.BodyProcessRfiDocumentStudioV1DemosRfiProcessRfiPost request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); /// /// Process Rfi Document @@ -30,6 +44,7 @@ public partial interface IAi21Client /// /// Vector store ID to use for RFI processing /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// global::System.Threading.Tasks.Task> ProcessRfiDocumentStudioV1DemosRfiProcessRfiPostAsync( @@ -37,6 +52,60 @@ public partial interface IAi21Client string filename, string? budget = default, string? vectorStoreId = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + + /// + /// Process Rfi Document + /// + /// + /// RFI document file (PDF supported) + /// + /// + /// RFI document file (PDF supported) + /// + /// + /// Budget level: LOW, MEDIUM, or HIGH
+ /// Default Value: MEDIUM + /// + /// + /// Vector store ID to use for RFI processing + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> ProcessRfiDocumentStudioV1DemosRfiProcessRfiPostAsync( + global::System.IO.Stream file, + string filename, + string? budget = default, + string? vectorStoreId = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Process Rfi Document + /// + /// + /// RFI document file (PDF supported) + /// + /// + /// RFI document file (PDF supported) + /// + /// + /// Budget level: LOW, MEDIUM, or HIGH
+ /// Default Value: MEDIUM + /// + /// + /// Vector store ID to use for RFI processing + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task>> ProcessRfiDocumentStudioV1DemosRfiProcessRfiPostAsResponseAsync( + global::System.IO.Stream file, + string filename, + string? budget = default, + string? vectorStoreId = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.ProxyOffV1GatewayOffV1PathGet.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.ProxyOffV1GatewayOffV1PathGet.g.cs new file mode 100644 index 00000000..01fc8676 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.IAi21Client.ProxyOffV1GatewayOffV1PathGet.g.cs @@ -0,0 +1,36 @@ +#nullable enable + +namespace AI21 +{ + public partial interface IAi21Client + { + /// + /// Proxy Off V1
+ /// A/B off-arm — forces gateway transformers off for this request 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 ProxyOffV1GatewayOffV1PathGetAsync( + string path, + string? xAi21Key = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Proxy Off V1
+ /// A/B off-arm — forces gateway transformers off for this request 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> ProxyOffV1GatewayOffV1PathGetAsResponseAsync( + string path, + string? xAi21Key = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.ProxyOffV1GatewayOffV1PathGet2.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.ProxyOffV1GatewayOffV1PathGet2.g.cs new file mode 100644 index 00000000..55ac60e2 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.IAi21Client.ProxyOffV1GatewayOffV1PathGet2.g.cs @@ -0,0 +1,36 @@ +#nullable enable + +namespace AI21 +{ + public partial interface IAi21Client + { + /// + /// Proxy Off V1
+ /// A/B off-arm — forces gateway transformers off for this request 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 ProxyOffV1GatewayOffV1PathGet2Async( + string path, + string? xAi21Key = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Proxy Off V1
+ /// A/B off-arm — forces gateway transformers off for this request 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> ProxyOffV1GatewayOffV1PathGet2AsResponseAsync( + string path, + string? xAi21Key = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.ProxyOffV1GatewayOffV1PathGet3.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.ProxyOffV1GatewayOffV1PathGet3.g.cs new file mode 100644 index 00000000..87a84995 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.IAi21Client.ProxyOffV1GatewayOffV1PathGet3.g.cs @@ -0,0 +1,36 @@ +#nullable enable + +namespace AI21 +{ + public partial interface IAi21Client + { + /// + /// Proxy Off V1
+ /// A/B off-arm — forces gateway transformers off for this request 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 ProxyOffV1GatewayOffV1PathGet3Async( + string path, + string? xAi21Key = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Proxy Off V1
+ /// A/B off-arm — forces gateway transformers off for this request 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> ProxyOffV1GatewayOffV1PathGet3AsResponseAsync( + string path, + string? xAi21Key = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.ProxyOffV1GatewayOffV1PathGet4.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.ProxyOffV1GatewayOffV1PathGet4.g.cs new file mode 100644 index 00000000..595546fc --- /dev/null +++ b/src/libs/AI21/Generated/AI21.IAi21Client.ProxyOffV1GatewayOffV1PathGet4.g.cs @@ -0,0 +1,36 @@ +#nullable enable + +namespace AI21 +{ + public partial interface IAi21Client + { + /// + /// Proxy Off V1
+ /// A/B off-arm — forces gateway transformers off for this request 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 ProxyOffV1GatewayOffV1PathGet4Async( + string path, + string? xAi21Key = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Proxy Off V1
+ /// A/B off-arm — forces gateway transformers off for this request 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> ProxyOffV1GatewayOffV1PathGet4AsResponseAsync( + string path, + string? xAi21Key = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.ProxyOffV1GatewayOffV1PathGet5.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.ProxyOffV1GatewayOffV1PathGet5.g.cs new file mode 100644 index 00000000..55603743 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.IAi21Client.ProxyOffV1GatewayOffV1PathGet5.g.cs @@ -0,0 +1,36 @@ +#nullable enable + +namespace AI21 +{ + public partial interface IAi21Client + { + /// + /// Proxy Off V1
+ /// A/B off-arm — forces gateway transformers off for this request 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 ProxyOffV1GatewayOffV1PathGet5Async( + string path, + string? xAi21Key = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Proxy Off V1
+ /// A/B off-arm — forces gateway transformers off for this request 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> ProxyOffV1GatewayOffV1PathGet5AsResponseAsync( + string path, + string? xAi21Key = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.ProxyOffV1GatewayOffV1PathGet6.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.ProxyOffV1GatewayOffV1PathGet6.g.cs new file mode 100644 index 00000000..40c3b31b --- /dev/null +++ b/src/libs/AI21/Generated/AI21.IAi21Client.ProxyOffV1GatewayOffV1PathGet6.g.cs @@ -0,0 +1,36 @@ +#nullable enable + +namespace AI21 +{ + public partial interface IAi21Client + { + /// + /// Proxy Off V1
+ /// A/B off-arm — forces gateway transformers off for this request 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 ProxyOffV1GatewayOffV1PathGet6Async( + string path, + string? xAi21Key = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Proxy Off V1
+ /// A/B off-arm — forces gateway transformers off for this request 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> ProxyOffV1GatewayOffV1PathGet6AsResponseAsync( + string path, + string? xAi21Key = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.ProxyOffV1TokenwiseOffV1PathGet.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.ProxyOffV1TokenwiseOffV1PathGet.g.cs new file mode 100644 index 00000000..6c26c0e7 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.IAi21Client.ProxyOffV1TokenwiseOffV1PathGet.g.cs @@ -0,0 +1,36 @@ +#nullable enable + +namespace AI21 +{ + public partial interface IAi21Client + { + /// + /// Proxy Off V1
+ /// A/B off-arm — forces gateway transformers off for this request 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 ProxyOffV1TokenwiseOffV1PathGetAsync( + string path, + string? xAi21Key = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Proxy Off V1
+ /// A/B off-arm — forces gateway transformers off for this request 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> ProxyOffV1TokenwiseOffV1PathGetAsResponseAsync( + string path, + string? xAi21Key = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.ProxyOffV1TokenwiseOffV1PathGet2.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.ProxyOffV1TokenwiseOffV1PathGet2.g.cs new file mode 100644 index 00000000..559cf546 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.IAi21Client.ProxyOffV1TokenwiseOffV1PathGet2.g.cs @@ -0,0 +1,36 @@ +#nullable enable + +namespace AI21 +{ + public partial interface IAi21Client + { + /// + /// Proxy Off V1
+ /// A/B off-arm — forces gateway transformers off for this request 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 ProxyOffV1TokenwiseOffV1PathGet2Async( + string path, + string? xAi21Key = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Proxy Off V1
+ /// A/B off-arm — forces gateway transformers off for this request 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> ProxyOffV1TokenwiseOffV1PathGet2AsResponseAsync( + string path, + string? xAi21Key = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.ProxyOffV1TokenwiseOffV1PathGet3.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.ProxyOffV1TokenwiseOffV1PathGet3.g.cs new file mode 100644 index 00000000..05825871 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.IAi21Client.ProxyOffV1TokenwiseOffV1PathGet3.g.cs @@ -0,0 +1,36 @@ +#nullable enable + +namespace AI21 +{ + public partial interface IAi21Client + { + /// + /// Proxy Off V1
+ /// A/B off-arm — forces gateway transformers off for this request 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 ProxyOffV1TokenwiseOffV1PathGet3Async( + string path, + string? xAi21Key = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Proxy Off V1
+ /// A/B off-arm — forces gateway transformers off for this request 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> ProxyOffV1TokenwiseOffV1PathGet3AsResponseAsync( + string path, + string? xAi21Key = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.ProxyOffV1TokenwiseOffV1PathGet4.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.ProxyOffV1TokenwiseOffV1PathGet4.g.cs new file mode 100644 index 00000000..b7b73e50 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.IAi21Client.ProxyOffV1TokenwiseOffV1PathGet4.g.cs @@ -0,0 +1,36 @@ +#nullable enable + +namespace AI21 +{ + public partial interface IAi21Client + { + /// + /// Proxy Off V1
+ /// A/B off-arm — forces gateway transformers off for this request 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 ProxyOffV1TokenwiseOffV1PathGet4Async( + string path, + string? xAi21Key = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Proxy Off V1
+ /// A/B off-arm — forces gateway transformers off for this request 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> ProxyOffV1TokenwiseOffV1PathGet4AsResponseAsync( + string path, + string? xAi21Key = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.ProxyOffV1TokenwiseOffV1PathGet5.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.ProxyOffV1TokenwiseOffV1PathGet5.g.cs new file mode 100644 index 00000000..7fbf5c5c --- /dev/null +++ b/src/libs/AI21/Generated/AI21.IAi21Client.ProxyOffV1TokenwiseOffV1PathGet5.g.cs @@ -0,0 +1,36 @@ +#nullable enable + +namespace AI21 +{ + public partial interface IAi21Client + { + /// + /// Proxy Off V1
+ /// A/B off-arm — forces gateway transformers off for this request 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 ProxyOffV1TokenwiseOffV1PathGet5Async( + string path, + string? xAi21Key = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Proxy Off V1
+ /// A/B off-arm — forces gateway transformers off for this request 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> ProxyOffV1TokenwiseOffV1PathGet5AsResponseAsync( + string path, + string? xAi21Key = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.ProxyOffV1TokenwiseOffV1PathGet6.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.ProxyOffV1TokenwiseOffV1PathGet6.g.cs new file mode 100644 index 00000000..f32e6457 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.IAi21Client.ProxyOffV1TokenwiseOffV1PathGet6.g.cs @@ -0,0 +1,36 @@ +#nullable enable + +namespace AI21 +{ + public partial interface IAi21Client + { + /// + /// Proxy Off V1
+ /// A/B off-arm — forces gateway transformers off for this request 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 ProxyOffV1TokenwiseOffV1PathGet6Async( + string path, + string? xAi21Key = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Proxy Off V1
+ /// A/B off-arm — forces gateway transformers off for this request 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> ProxyOffV1TokenwiseOffV1PathGet6AsResponseAsync( + string path, + string? xAi21Key = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.ProxyOnV1GatewayOnV1PathGet.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.ProxyOnV1GatewayOnV1PathGet.g.cs new file mode 100644 index 00000000..c6db54ed --- /dev/null +++ b/src/libs/AI21/Generated/AI21.IAi21Client.ProxyOnV1GatewayOnV1PathGet.g.cs @@ -0,0 +1,36 @@ +#nullable enable + +namespace AI21 +{ + public partial interface IAi21Client + { + /// + /// Proxy On V1
+ /// A/B on-arm — forces gateway transformers on for this request 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 ProxyOnV1GatewayOnV1PathGetAsync( + string path, + string? xAi21Key = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Proxy On V1
+ /// A/B on-arm — forces gateway transformers on for this request 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> ProxyOnV1GatewayOnV1PathGetAsResponseAsync( + string path, + string? xAi21Key = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.ProxyOnV1GatewayOnV1PathGet2.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.ProxyOnV1GatewayOnV1PathGet2.g.cs new file mode 100644 index 00000000..0f694557 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.IAi21Client.ProxyOnV1GatewayOnV1PathGet2.g.cs @@ -0,0 +1,36 @@ +#nullable enable + +namespace AI21 +{ + public partial interface IAi21Client + { + /// + /// Proxy On V1
+ /// A/B on-arm — forces gateway transformers on for this request 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 ProxyOnV1GatewayOnV1PathGet2Async( + string path, + string? xAi21Key = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Proxy On V1
+ /// A/B on-arm — forces gateway transformers on for this request 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> ProxyOnV1GatewayOnV1PathGet2AsResponseAsync( + string path, + string? xAi21Key = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.ProxyOnV1GatewayOnV1PathGet3.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.ProxyOnV1GatewayOnV1PathGet3.g.cs new file mode 100644 index 00000000..01f567c4 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.IAi21Client.ProxyOnV1GatewayOnV1PathGet3.g.cs @@ -0,0 +1,36 @@ +#nullable enable + +namespace AI21 +{ + public partial interface IAi21Client + { + /// + /// Proxy On V1
+ /// A/B on-arm — forces gateway transformers on for this request 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 ProxyOnV1GatewayOnV1PathGet3Async( + string path, + string? xAi21Key = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Proxy On V1
+ /// A/B on-arm — forces gateway transformers on for this request 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> ProxyOnV1GatewayOnV1PathGet3AsResponseAsync( + string path, + string? xAi21Key = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.ProxyOnV1GatewayOnV1PathGet4.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.ProxyOnV1GatewayOnV1PathGet4.g.cs new file mode 100644 index 00000000..70ce860c --- /dev/null +++ b/src/libs/AI21/Generated/AI21.IAi21Client.ProxyOnV1GatewayOnV1PathGet4.g.cs @@ -0,0 +1,36 @@ +#nullable enable + +namespace AI21 +{ + public partial interface IAi21Client + { + /// + /// Proxy On V1
+ /// A/B on-arm — forces gateway transformers on for this request 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 ProxyOnV1GatewayOnV1PathGet4Async( + string path, + string? xAi21Key = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Proxy On V1
+ /// A/B on-arm — forces gateway transformers on for this request 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> ProxyOnV1GatewayOnV1PathGet4AsResponseAsync( + string path, + string? xAi21Key = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.ProxyOnV1GatewayOnV1PathGet5.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.ProxyOnV1GatewayOnV1PathGet5.g.cs new file mode 100644 index 00000000..77025a5e --- /dev/null +++ b/src/libs/AI21/Generated/AI21.IAi21Client.ProxyOnV1GatewayOnV1PathGet5.g.cs @@ -0,0 +1,36 @@ +#nullable enable + +namespace AI21 +{ + public partial interface IAi21Client + { + /// + /// Proxy On V1
+ /// A/B on-arm — forces gateway transformers on for this request 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 ProxyOnV1GatewayOnV1PathGet5Async( + string path, + string? xAi21Key = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Proxy On V1
+ /// A/B on-arm — forces gateway transformers on for this request 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> ProxyOnV1GatewayOnV1PathGet5AsResponseAsync( + string path, + string? xAi21Key = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.ProxyOnV1GatewayOnV1PathGet6.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.ProxyOnV1GatewayOnV1PathGet6.g.cs new file mode 100644 index 00000000..d952a9f4 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.IAi21Client.ProxyOnV1GatewayOnV1PathGet6.g.cs @@ -0,0 +1,36 @@ +#nullable enable + +namespace AI21 +{ + public partial interface IAi21Client + { + /// + /// Proxy On V1
+ /// A/B on-arm — forces gateway transformers on for this request 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 ProxyOnV1GatewayOnV1PathGet6Async( + string path, + string? xAi21Key = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Proxy On V1
+ /// A/B on-arm — forces gateway transformers on for this request 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> ProxyOnV1GatewayOnV1PathGet6AsResponseAsync( + string path, + string? xAi21Key = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.ProxyOnV1TokenwiseOnV1PathGet.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.ProxyOnV1TokenwiseOnV1PathGet.g.cs new file mode 100644 index 00000000..134dfc68 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.IAi21Client.ProxyOnV1TokenwiseOnV1PathGet.g.cs @@ -0,0 +1,36 @@ +#nullable enable + +namespace AI21 +{ + public partial interface IAi21Client + { + /// + /// Proxy On V1
+ /// A/B on-arm — forces gateway transformers on for this request 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 ProxyOnV1TokenwiseOnV1PathGetAsync( + string path, + string? xAi21Key = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Proxy On V1
+ /// A/B on-arm — forces gateway transformers on for this request 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> ProxyOnV1TokenwiseOnV1PathGetAsResponseAsync( + string path, + string? xAi21Key = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.ProxyOnV1TokenwiseOnV1PathGet2.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.ProxyOnV1TokenwiseOnV1PathGet2.g.cs new file mode 100644 index 00000000..a2926795 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.IAi21Client.ProxyOnV1TokenwiseOnV1PathGet2.g.cs @@ -0,0 +1,36 @@ +#nullable enable + +namespace AI21 +{ + public partial interface IAi21Client + { + /// + /// Proxy On V1
+ /// A/B on-arm — forces gateway transformers on for this request 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 ProxyOnV1TokenwiseOnV1PathGet2Async( + string path, + string? xAi21Key = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Proxy On V1
+ /// A/B on-arm — forces gateway transformers on for this request 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> ProxyOnV1TokenwiseOnV1PathGet2AsResponseAsync( + string path, + string? xAi21Key = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.ProxyOnV1TokenwiseOnV1PathGet3.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.ProxyOnV1TokenwiseOnV1PathGet3.g.cs new file mode 100644 index 00000000..0b2cb979 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.IAi21Client.ProxyOnV1TokenwiseOnV1PathGet3.g.cs @@ -0,0 +1,36 @@ +#nullable enable + +namespace AI21 +{ + public partial interface IAi21Client + { + /// + /// Proxy On V1
+ /// A/B on-arm — forces gateway transformers on for this request 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 ProxyOnV1TokenwiseOnV1PathGet3Async( + string path, + string? xAi21Key = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Proxy On V1
+ /// A/B on-arm — forces gateway transformers on for this request 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> ProxyOnV1TokenwiseOnV1PathGet3AsResponseAsync( + string path, + string? xAi21Key = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.ProxyOnV1TokenwiseOnV1PathGet4.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.ProxyOnV1TokenwiseOnV1PathGet4.g.cs new file mode 100644 index 00000000..b89e1dbe --- /dev/null +++ b/src/libs/AI21/Generated/AI21.IAi21Client.ProxyOnV1TokenwiseOnV1PathGet4.g.cs @@ -0,0 +1,36 @@ +#nullable enable + +namespace AI21 +{ + public partial interface IAi21Client + { + /// + /// Proxy On V1
+ /// A/B on-arm — forces gateway transformers on for this request 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 ProxyOnV1TokenwiseOnV1PathGet4Async( + string path, + string? xAi21Key = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Proxy On V1
+ /// A/B on-arm — forces gateway transformers on for this request 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> ProxyOnV1TokenwiseOnV1PathGet4AsResponseAsync( + string path, + string? xAi21Key = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.ProxyOnV1TokenwiseOnV1PathGet5.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.ProxyOnV1TokenwiseOnV1PathGet5.g.cs new file mode 100644 index 00000000..24a1b85a --- /dev/null +++ b/src/libs/AI21/Generated/AI21.IAi21Client.ProxyOnV1TokenwiseOnV1PathGet5.g.cs @@ -0,0 +1,36 @@ +#nullable enable + +namespace AI21 +{ + public partial interface IAi21Client + { + /// + /// Proxy On V1
+ /// A/B on-arm — forces gateway transformers on for this request 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 ProxyOnV1TokenwiseOnV1PathGet5Async( + string path, + string? xAi21Key = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Proxy On V1
+ /// A/B on-arm — forces gateway transformers on for this request 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> ProxyOnV1TokenwiseOnV1PathGet5AsResponseAsync( + string path, + string? xAi21Key = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.ProxyOnV1TokenwiseOnV1PathGet6.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.ProxyOnV1TokenwiseOnV1PathGet6.g.cs new file mode 100644 index 00000000..32199485 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.IAi21Client.ProxyOnV1TokenwiseOnV1PathGet6.g.cs @@ -0,0 +1,36 @@ +#nullable enable + +namespace AI21 +{ + public partial interface IAi21Client + { + /// + /// Proxy On V1
+ /// A/B on-arm — forces gateway transformers on for this request 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 ProxyOnV1TokenwiseOnV1PathGet6Async( + string path, + string? xAi21Key = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Proxy On V1
+ /// A/B on-arm — forces gateway transformers on for this request 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> ProxyOnV1TokenwiseOnV1PathGet6AsResponseAsync( + string path, + string? xAi21Key = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.ProxyV1GatewayV1PathGet.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.ProxyV1GatewayV1PathGet.g.cs new file mode 100644 index 00000000..7fb9ee4d --- /dev/null +++ b/src/libs/AI21/Generated/AI21.IAi21Client.ProxyV1GatewayV1PathGet.g.cs @@ -0,0 +1,40 @@ +#nullable enable + +namespace AI21 +{ + public partial interface IAi21Client + { + /// + /// Proxy V1
+ /// Catch-all for the Anthropic-compatible surface (``/v1/messages``, etc.).
+ /// Gated on a Tokenwise subscription (OPSS-55); the A/B ``/on`` and ``/off`` arms are
+ /// intentionally left ungated. + ///
+ /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task ProxyV1GatewayV1PathGetAsync( + string path, + string? xAi21Key = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Proxy V1
+ /// Catch-all for the Anthropic-compatible surface (``/v1/messages``, etc.).
+ /// Gated on a Tokenwise subscription (OPSS-55); the A/B ``/on`` and ``/off`` arms are
+ /// intentionally left ungated. + ///
+ /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> ProxyV1GatewayV1PathGetAsResponseAsync( + string path, + string? xAi21Key = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.ProxyV1GatewayV1PathGet2.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.ProxyV1GatewayV1PathGet2.g.cs new file mode 100644 index 00000000..09c0c993 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.IAi21Client.ProxyV1GatewayV1PathGet2.g.cs @@ -0,0 +1,40 @@ +#nullable enable + +namespace AI21 +{ + public partial interface IAi21Client + { + /// + /// Proxy V1
+ /// Catch-all for the Anthropic-compatible surface (``/v1/messages``, etc.).
+ /// Gated on a Tokenwise subscription (OPSS-55); the A/B ``/on`` and ``/off`` arms are
+ /// intentionally left ungated. + ///
+ /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task ProxyV1GatewayV1PathGet2Async( + string path, + string? xAi21Key = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Proxy V1
+ /// Catch-all for the Anthropic-compatible surface (``/v1/messages``, etc.).
+ /// Gated on a Tokenwise subscription (OPSS-55); the A/B ``/on`` and ``/off`` arms are
+ /// intentionally left ungated. + ///
+ /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> ProxyV1GatewayV1PathGet2AsResponseAsync( + string path, + string? xAi21Key = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.ProxyV1GatewayV1PathGet3.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.ProxyV1GatewayV1PathGet3.g.cs new file mode 100644 index 00000000..bfd18b02 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.IAi21Client.ProxyV1GatewayV1PathGet3.g.cs @@ -0,0 +1,40 @@ +#nullable enable + +namespace AI21 +{ + public partial interface IAi21Client + { + /// + /// Proxy V1
+ /// Catch-all for the Anthropic-compatible surface (``/v1/messages``, etc.).
+ /// Gated on a Tokenwise subscription (OPSS-55); the A/B ``/on`` and ``/off`` arms are
+ /// intentionally left ungated. + ///
+ /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task ProxyV1GatewayV1PathGet3Async( + string path, + string? xAi21Key = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Proxy V1
+ /// Catch-all for the Anthropic-compatible surface (``/v1/messages``, etc.).
+ /// Gated on a Tokenwise subscription (OPSS-55); the A/B ``/on`` and ``/off`` arms are
+ /// intentionally left ungated. + ///
+ /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> ProxyV1GatewayV1PathGet3AsResponseAsync( + string path, + string? xAi21Key = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.ProxyV1GatewayV1PathGet4.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.ProxyV1GatewayV1PathGet4.g.cs new file mode 100644 index 00000000..ba45b4bb --- /dev/null +++ b/src/libs/AI21/Generated/AI21.IAi21Client.ProxyV1GatewayV1PathGet4.g.cs @@ -0,0 +1,40 @@ +#nullable enable + +namespace AI21 +{ + public partial interface IAi21Client + { + /// + /// Proxy V1
+ /// Catch-all for the Anthropic-compatible surface (``/v1/messages``, etc.).
+ /// Gated on a Tokenwise subscription (OPSS-55); the A/B ``/on`` and ``/off`` arms are
+ /// intentionally left ungated. + ///
+ /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task ProxyV1GatewayV1PathGet4Async( + string path, + string? xAi21Key = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Proxy V1
+ /// Catch-all for the Anthropic-compatible surface (``/v1/messages``, etc.).
+ /// Gated on a Tokenwise subscription (OPSS-55); the A/B ``/on`` and ``/off`` arms are
+ /// intentionally left ungated. + ///
+ /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> ProxyV1GatewayV1PathGet4AsResponseAsync( + string path, + string? xAi21Key = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.ProxyV1GatewayV1PathGet5.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.ProxyV1GatewayV1PathGet5.g.cs new file mode 100644 index 00000000..0047dfa1 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.IAi21Client.ProxyV1GatewayV1PathGet5.g.cs @@ -0,0 +1,40 @@ +#nullable enable + +namespace AI21 +{ + public partial interface IAi21Client + { + /// + /// Proxy V1
+ /// Catch-all for the Anthropic-compatible surface (``/v1/messages``, etc.).
+ /// Gated on a Tokenwise subscription (OPSS-55); the A/B ``/on`` and ``/off`` arms are
+ /// intentionally left ungated. + ///
+ /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task ProxyV1GatewayV1PathGet5Async( + string path, + string? xAi21Key = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Proxy V1
+ /// Catch-all for the Anthropic-compatible surface (``/v1/messages``, etc.).
+ /// Gated on a Tokenwise subscription (OPSS-55); the A/B ``/on`` and ``/off`` arms are
+ /// intentionally left ungated. + ///
+ /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> ProxyV1GatewayV1PathGet5AsResponseAsync( + string path, + string? xAi21Key = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.ProxyV1GatewayV1PathGet6.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.ProxyV1GatewayV1PathGet6.g.cs new file mode 100644 index 00000000..cd1d6163 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.IAi21Client.ProxyV1GatewayV1PathGet6.g.cs @@ -0,0 +1,40 @@ +#nullable enable + +namespace AI21 +{ + public partial interface IAi21Client + { + /// + /// Proxy V1
+ /// Catch-all for the Anthropic-compatible surface (``/v1/messages``, etc.).
+ /// Gated on a Tokenwise subscription (OPSS-55); the A/B ``/on`` and ``/off`` arms are
+ /// intentionally left ungated. + ///
+ /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task ProxyV1GatewayV1PathGet6Async( + string path, + string? xAi21Key = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Proxy V1
+ /// Catch-all for the Anthropic-compatible surface (``/v1/messages``, etc.).
+ /// Gated on a Tokenwise subscription (OPSS-55); the A/B ``/on`` and ``/off`` arms are
+ /// intentionally left ungated. + ///
+ /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> ProxyV1GatewayV1PathGet6AsResponseAsync( + string path, + string? xAi21Key = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.ProxyV1TokenwiseV1PathGet.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.ProxyV1TokenwiseV1PathGet.g.cs new file mode 100644 index 00000000..49fb8f04 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.IAi21Client.ProxyV1TokenwiseV1PathGet.g.cs @@ -0,0 +1,40 @@ +#nullable enable + +namespace AI21 +{ + public partial interface IAi21Client + { + /// + /// Proxy V1
+ /// Catch-all for the Anthropic-compatible surface (``/v1/messages``, etc.).
+ /// Gated on a Tokenwise subscription (OPSS-55); the A/B ``/on`` and ``/off`` arms are
+ /// intentionally left ungated. + ///
+ /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task ProxyV1TokenwiseV1PathGetAsync( + string path, + string? xAi21Key = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Proxy V1
+ /// Catch-all for the Anthropic-compatible surface (``/v1/messages``, etc.).
+ /// Gated on a Tokenwise subscription (OPSS-55); the A/B ``/on`` and ``/off`` arms are
+ /// intentionally left ungated. + ///
+ /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> ProxyV1TokenwiseV1PathGetAsResponseAsync( + string path, + string? xAi21Key = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.ProxyV1TokenwiseV1PathGet2.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.ProxyV1TokenwiseV1PathGet2.g.cs new file mode 100644 index 00000000..3a2b6c97 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.IAi21Client.ProxyV1TokenwiseV1PathGet2.g.cs @@ -0,0 +1,40 @@ +#nullable enable + +namespace AI21 +{ + public partial interface IAi21Client + { + /// + /// Proxy V1
+ /// Catch-all for the Anthropic-compatible surface (``/v1/messages``, etc.).
+ /// Gated on a Tokenwise subscription (OPSS-55); the A/B ``/on`` and ``/off`` arms are
+ /// intentionally left ungated. + ///
+ /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task ProxyV1TokenwiseV1PathGet2Async( + string path, + string? xAi21Key = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Proxy V1
+ /// Catch-all for the Anthropic-compatible surface (``/v1/messages``, etc.).
+ /// Gated on a Tokenwise subscription (OPSS-55); the A/B ``/on`` and ``/off`` arms are
+ /// intentionally left ungated. + ///
+ /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> ProxyV1TokenwiseV1PathGet2AsResponseAsync( + string path, + string? xAi21Key = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.ProxyV1TokenwiseV1PathGet3.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.ProxyV1TokenwiseV1PathGet3.g.cs new file mode 100644 index 00000000..8f0b6401 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.IAi21Client.ProxyV1TokenwiseV1PathGet3.g.cs @@ -0,0 +1,40 @@ +#nullable enable + +namespace AI21 +{ + public partial interface IAi21Client + { + /// + /// Proxy V1
+ /// Catch-all for the Anthropic-compatible surface (``/v1/messages``, etc.).
+ /// Gated on a Tokenwise subscription (OPSS-55); the A/B ``/on`` and ``/off`` arms are
+ /// intentionally left ungated. + ///
+ /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task ProxyV1TokenwiseV1PathGet3Async( + string path, + string? xAi21Key = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Proxy V1
+ /// Catch-all for the Anthropic-compatible surface (``/v1/messages``, etc.).
+ /// Gated on a Tokenwise subscription (OPSS-55); the A/B ``/on`` and ``/off`` arms are
+ /// intentionally left ungated. + ///
+ /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> ProxyV1TokenwiseV1PathGet3AsResponseAsync( + string path, + string? xAi21Key = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.ProxyV1TokenwiseV1PathGet4.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.ProxyV1TokenwiseV1PathGet4.g.cs new file mode 100644 index 00000000..46380613 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.IAi21Client.ProxyV1TokenwiseV1PathGet4.g.cs @@ -0,0 +1,40 @@ +#nullable enable + +namespace AI21 +{ + public partial interface IAi21Client + { + /// + /// Proxy V1
+ /// Catch-all for the Anthropic-compatible surface (``/v1/messages``, etc.).
+ /// Gated on a Tokenwise subscription (OPSS-55); the A/B ``/on`` and ``/off`` arms are
+ /// intentionally left ungated. + ///
+ /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task ProxyV1TokenwiseV1PathGet4Async( + string path, + string? xAi21Key = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Proxy V1
+ /// Catch-all for the Anthropic-compatible surface (``/v1/messages``, etc.).
+ /// Gated on a Tokenwise subscription (OPSS-55); the A/B ``/on`` and ``/off`` arms are
+ /// intentionally left ungated. + ///
+ /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> ProxyV1TokenwiseV1PathGet4AsResponseAsync( + string path, + string? xAi21Key = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.ProxyV1TokenwiseV1PathGet5.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.ProxyV1TokenwiseV1PathGet5.g.cs new file mode 100644 index 00000000..af292371 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.IAi21Client.ProxyV1TokenwiseV1PathGet5.g.cs @@ -0,0 +1,40 @@ +#nullable enable + +namespace AI21 +{ + public partial interface IAi21Client + { + /// + /// Proxy V1
+ /// Catch-all for the Anthropic-compatible surface (``/v1/messages``, etc.).
+ /// Gated on a Tokenwise subscription (OPSS-55); the A/B ``/on`` and ``/off`` arms are
+ /// intentionally left ungated. + ///
+ /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task ProxyV1TokenwiseV1PathGet5Async( + string path, + string? xAi21Key = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Proxy V1
+ /// Catch-all for the Anthropic-compatible surface (``/v1/messages``, etc.).
+ /// Gated on a Tokenwise subscription (OPSS-55); the A/B ``/on`` and ``/off`` arms are
+ /// intentionally left ungated. + ///
+ /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> ProxyV1TokenwiseV1PathGet5AsResponseAsync( + string path, + string? xAi21Key = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.ProxyV1TokenwiseV1PathGet6.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.ProxyV1TokenwiseV1PathGet6.g.cs new file mode 100644 index 00000000..fcf91f3d --- /dev/null +++ b/src/libs/AI21/Generated/AI21.IAi21Client.ProxyV1TokenwiseV1PathGet6.g.cs @@ -0,0 +1,40 @@ +#nullable enable + +namespace AI21 +{ + public partial interface IAi21Client + { + /// + /// Proxy V1
+ /// Catch-all for the Anthropic-compatible surface (``/v1/messages``, etc.).
+ /// Gated on a Tokenwise subscription (OPSS-55); the A/B ``/on`` and ``/off`` arms are
+ /// intentionally left ungated. + ///
+ /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task ProxyV1TokenwiseV1PathGet6Async( + string path, + string? xAi21Key = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Proxy V1
+ /// Catch-all for the Anthropic-compatible surface (``/v1/messages``, etc.).
+ /// Gated on a Tokenwise subscription (OPSS-55); the A/B ``/on`` and ``/off`` arms are
+ /// intentionally left ungated. + ///
+ /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> ProxyV1TokenwiseV1PathGet6AsResponseAsync( + string path, + string? xAi21Key = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.RunSyncStudioV1ConnectorsConnectedUsersDataSourcesSyncsPost.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.RunSyncStudioV1ConnectorsConnectedUsersDataSourcesSyncsPost.g.cs deleted file mode 100644 index f886d061..00000000 --- a/src/libs/AI21/Generated/AI21.IAi21Client.RunSyncStudioV1ConnectorsConnectedUsersDataSourcesSyncsPost.g.cs +++ /dev/null @@ -1,37 +0,0 @@ -#nullable enable - -namespace AI21 -{ - public partial interface IAi21Client - { - /// - /// Run Sync - /// - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task RunSyncStudioV1ConnectorsConnectedUsersDataSourcesSyncsPostAsync( - - global::AI21.ConnectorsSyncParams request, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Run Sync - /// - /// - /// - /// - /// - /// - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task RunSyncStudioV1ConnectorsConnectedUsersDataSourcesSyncsPostAsync( - string token, - string dataSource, - string organizationId, - string pipeline, - object? configuration = default, - string? configurationName = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.RunWorkflowStudioV1ConnectorsConnectedUsersEntityIdDataSourcesDataSourceWorkflowsWorkflowNameRunPost.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.RunWorkflowStudioV1ConnectorsConnectedUsersEntityIdDataSourcesDataSourceWorkflowsWorkflowNameRunPost.g.cs deleted file mode 100644 index 69e30331..00000000 --- a/src/libs/AI21/Generated/AI21.IAi21Client.RunWorkflowStudioV1ConnectorsConnectedUsersEntityIdDataSourcesDataSourceWorkflowsWorkflowNameRunPost.g.cs +++ /dev/null @@ -1,21 +0,0 @@ -#nullable enable - -namespace AI21 -{ - public partial interface IAi21Client - { - /// - /// Run Workflow - /// - /// - /// - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task RunWorkflowStudioV1ConnectorsConnectedUsersEntityIdDataSourcesDataSourceWorkflowsWorkflowNameRunPostAsync( - string entityId, - string dataSource, - string workflowName, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.SyncWebsiteStudioV1ConnectorsWebsiteConnectorIdSyncPost.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.SyncWebsiteStudioV1ConnectorsWebsiteConnectorIdSyncPost.g.cs deleted file mode 100644 index d59c9e76..00000000 --- a/src/libs/AI21/Generated/AI21.IAi21Client.SyncWebsiteStudioV1ConnectorsWebsiteConnectorIdSyncPost.g.cs +++ /dev/null @@ -1,17 +0,0 @@ -#nullable enable - -namespace AI21 -{ - public partial interface IAi21Client - { - /// - /// Sync Website - /// - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task SyncWebsiteStudioV1ConnectorsWebsiteConnectorIdSyncPostAsync( - string connectorId, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.TlvConvragPrefixPreviewSolutionsPreviewTlvMunicipalityConvragPost.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.TlvConvragPrefixPreviewSolutionsPreviewTlvMunicipalityConvragPost.g.cs deleted file mode 100644 index 82a9ca18..00000000 --- a/src/libs/AI21/Generated/AI21.IAi21Client.TlvConvragPrefixPreviewSolutionsPreviewTlvMunicipalityConvragPost.g.cs +++ /dev/null @@ -1,15 +0,0 @@ -#nullable enable - -namespace AI21 -{ - public partial interface IAi21Client - { - /// - /// Tlv Convrag Prefix Preview - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task TlvConvragPrefixPreviewSolutionsPreviewTlvMunicipalityConvragPostAsync( - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.TlvConvragSolutionsTlvMunicipalityConvragPost.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.TlvConvragSolutionsTlvMunicipalityConvragPost.g.cs deleted file mode 100644 index 6ce2a45f..00000000 --- a/src/libs/AI21/Generated/AI21.IAi21Client.TlvConvragSolutionsTlvMunicipalityConvragPost.g.cs +++ /dev/null @@ -1,15 +0,0 @@ -#nullable enable - -namespace AI21 -{ - public partial interface IAi21Client - { - /// - /// Tlv Convrag - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task TlvConvragSolutionsTlvMunicipalityConvragPostAsync( - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.UpdateAgentGatewaySettingsAgentsAgentIdPut.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.UpdateAgentGatewaySettingsAgentsAgentIdPut.g.cs new file mode 100644 index 00000000..53f26cd8 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.IAi21Client.UpdateAgentGatewaySettingsAgentsAgentIdPut.g.cs @@ -0,0 +1,57 @@ +#nullable enable + +namespace AI21 +{ + public partial interface IAi21Client + { + /// + /// Update Agent + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task UpdateAgentGatewaySettingsAgentsAgentIdPutAsync( + string agentId, + + global::AI21.AgentUpdate request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Update Agent + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> UpdateAgentGatewaySettingsAgentsAgentIdPutAsResponseAsync( + string agentId, + + global::AI21.AgentUpdate request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Update Agent + /// + /// + /// + /// + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task UpdateAgentGatewaySettingsAgentsAgentIdPutAsync( + string agentId, + string? name = default, + string? kind = default, + string? description = default, + string? configId = default, + bool? enabled = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.UpdateAgentTokenwiseSettingsAgentsAgentIdPut.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.UpdateAgentTokenwiseSettingsAgentsAgentIdPut.g.cs new file mode 100644 index 00000000..52408c6c --- /dev/null +++ b/src/libs/AI21/Generated/AI21.IAi21Client.UpdateAgentTokenwiseSettingsAgentsAgentIdPut.g.cs @@ -0,0 +1,57 @@ +#nullable enable + +namespace AI21 +{ + public partial interface IAi21Client + { + /// + /// Update Agent + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task UpdateAgentTokenwiseSettingsAgentsAgentIdPutAsync( + string agentId, + + global::AI21.AgentUpdate request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Update Agent + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> UpdateAgentTokenwiseSettingsAgentsAgentIdPutAsResponseAsync( + string agentId, + + global::AI21.AgentUpdate request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Update Agent + /// + /// + /// + /// + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task UpdateAgentTokenwiseSettingsAgentsAgentIdPutAsync( + string agentId, + string? name = default, + string? kind = default, + string? description = default, + string? configId = default, + bool? enabled = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.UpdateConfigGatewaySettingsConfigsConfigIdPut.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.UpdateConfigGatewaySettingsConfigsConfigIdPut.g.cs new file mode 100644 index 00000000..515a7579 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.IAi21Client.UpdateConfigGatewaySettingsConfigsConfigIdPut.g.cs @@ -0,0 +1,55 @@ +#nullable enable + +namespace AI21 +{ + public partial interface IAi21Client + { + /// + /// Update 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 UpdateConfigGatewaySettingsConfigsConfigIdPutAsync( + string configId, + + global::AI21.ConfigProfileUpdate request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Update 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> UpdateConfigGatewaySettingsConfigsConfigIdPutAsResponseAsync( + string configId, + + global::AI21.ConfigProfileUpdate request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Update 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 UpdateConfigGatewaySettingsConfigsConfigIdPutAsync( + string configId, + string? name = default, + string? description = default, + object? overrides = default, + bool? enabled = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.UpdateConfigTokenwiseSettingsConfigsConfigIdPut.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.UpdateConfigTokenwiseSettingsConfigsConfigIdPut.g.cs new file mode 100644 index 00000000..55ef2af9 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.IAi21Client.UpdateConfigTokenwiseSettingsConfigsConfigIdPut.g.cs @@ -0,0 +1,55 @@ +#nullable enable + +namespace AI21 +{ + public partial interface IAi21Client + { + /// + /// Update 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 UpdateConfigTokenwiseSettingsConfigsConfigIdPutAsync( + string configId, + + global::AI21.ConfigProfileUpdate request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Update 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> UpdateConfigTokenwiseSettingsConfigsConfigIdPutAsResponseAsync( + string configId, + + global::AI21.ConfigProfileUpdate request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Update 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 UpdateConfigTokenwiseSettingsConfigsConfigIdPutAsync( + string configId, + string? name = default, + string? description = default, + object? overrides = default, + bool? enabled = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.UpdateDemoStudioV1DemosDemoIdPut.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.UpdateDemoStudioV1DemosDemoIdPut.g.cs index 5cdafc7a..97f54409 100644 --- a/src/libs/AI21/Generated/AI21.IAi21Client.UpdateDemoStudioV1DemosDemoIdPut.g.cs +++ b/src/libs/AI21/Generated/AI21.IAi21Client.UpdateDemoStudioV1DemosDemoIdPut.g.cs @@ -10,12 +10,29 @@ public partial interface IAi21Client ///
/// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// global::System.Threading.Tasks.Task UpdateDemoStudioV1DemosDemoIdPutAsync( string demoId, global::AI21.DemoUpdate request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Update Demo
+ /// Update an existing demo. + ///
+ /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> UpdateDemoStudioV1DemosDemoIdPutAsResponseAsync( + string demoId, + + global::AI21.DemoUpdate request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); /// /// Update Demo
@@ -37,6 +54,7 @@ public partial interface IAi21Client /// /// Name of the UI component /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// global::System.Threading.Tasks.Task UpdateDemoStudioV1DemosDemoIdPutAsync( @@ -46,6 +64,7 @@ public partial interface IAi21Client global::AI21.DemoStatus? status = default, object? config = default, string? uiComponentName = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.UpdateMcpStorageStudioV1McpStorageMcpIdPatch.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.UpdateMcpStorageStudioV1McpStorageMcpIdPatch.g.cs index e1c862ee..18196fee 100644 --- a/src/libs/AI21/Generated/AI21.IAi21Client.UpdateMcpStorageStudioV1McpStorageMcpIdPatch.g.cs +++ b/src/libs/AI21/Generated/AI21.IAi21Client.UpdateMcpStorageStudioV1McpStorageMcpIdPatch.g.cs @@ -9,23 +9,41 @@ public partial interface IAi21Client ///
/// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// global::System.Threading.Tasks.Task UpdateMcpStorageStudioV1McpStorageMcpIdPatchAsync( string mcpId, global::AI21.UpdateMCPStorageRequest request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Update Mcp Storage + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> UpdateMcpStorageStudioV1McpStorageMcpIdPatchAsResponseAsync( + string mcpId, + + global::AI21.UpdateMCPStorageRequest request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); /// /// Update Mcp Storage /// /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// global::System.Threading.Tasks.Task UpdateMcpStorageStudioV1McpStorageMcpIdPatchAsync( string mcpId, string serverLabel, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.UpdateWorkspaceModelEndpointStudioV1SettingsModelsNamePatch.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.UpdateWorkspaceModelEndpointStudioV1SettingsModelsNamePatch.g.cs index 3aafdbe1..de563ee7 100644 --- a/src/libs/AI21/Generated/AI21.IAi21Client.UpdateWorkspaceModelEndpointStudioV1SettingsModelsNamePatch.g.cs +++ b/src/libs/AI21/Generated/AI21.IAi21Client.UpdateWorkspaceModelEndpointStudioV1SettingsModelsNamePatch.g.cs @@ -9,12 +9,28 @@ public partial interface IAi21Client /// /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// global::System.Threading.Tasks.Task UpdateWorkspaceModelEndpointStudioV1SettingsModelsNamePatchAsync( string name, global::AI21.WorkspaceModelUpdate request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Update Workspace Model Endpoint + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> UpdateWorkspaceModelEndpointStudioV1SettingsModelsNamePatchAsResponseAsync( + string name, + + global::AI21.WorkspaceModelUpdate request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); /// /// Update Workspace Model Endpoint @@ -23,6 +39,7 @@ public partial interface IAi21Client /// /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// global::System.Threading.Tasks.Task UpdateWorkspaceModelEndpointStudioV1SettingsModelsNamePatchAsync( @@ -30,6 +47,7 @@ public partial interface IAi21Client string? requestName = default, string? modelType = default, string? secretId = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.UploadCheckComplianceStudioV1DemosRegulationsUploadCheckCompliancePost.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.UploadCheckComplianceStudioV1DemosRegulationsUploadCheckCompliancePost.g.cs index bd140f32..a247f580 100644 --- a/src/libs/AI21/Generated/AI21.IAi21Client.UploadCheckComplianceStudioV1DemosRegulationsUploadCheckCompliancePost.g.cs +++ b/src/libs/AI21/Generated/AI21.IAi21Client.UploadCheckComplianceStudioV1DemosRegulationsUploadCheckCompliancePost.g.cs @@ -9,11 +9,26 @@ public partial interface IAi21Client /// Check compliance of a document file against regulatory requirements. /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// global::System.Threading.Tasks.Task UploadCheckComplianceStudioV1DemosRegulationsUploadCheckCompliancePostAsync( global::AI21.BodyUploadCheckComplianceStudioV1DemosRegulationsUploadCheckCompliancePost request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Upload Check Compliance
+ /// Check compliance of a document file against regulatory requirements. + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> UploadCheckComplianceStudioV1DemosRegulationsUploadCheckCompliancePostAsResponseAsync( + + global::AI21.BodyUploadCheckComplianceStudioV1DemosRegulationsUploadCheckCompliancePost request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); /// /// Upload Check Compliance
@@ -27,6 +42,7 @@ public partial interface IAi21Client /// /// Vector store ID to use for RFI processing /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// global::System.Threading.Tasks.Task UploadCheckComplianceStudioV1DemosRegulationsUploadCheckCompliancePostAsync( @@ -34,6 +50,56 @@ public partial interface IAi21Client string filename, string? budget = default, string? vectorStoreId = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + + /// + /// Upload Check Compliance
+ /// Check compliance of a document file against regulatory requirements. + ///
+ /// + /// The stream to send as the multipart 'file' file part. + /// + /// + /// + /// Default Value: MEDIUM + /// + /// + /// Vector store ID to use for RFI processing + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task UploadCheckComplianceStudioV1DemosRegulationsUploadCheckCompliancePostAsync( + global::System.IO.Stream file, + string filename, + string? budget = default, + string? vectorStoreId = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Upload Check Compliance
+ /// Check compliance of a document file against regulatory requirements. + ///
+ /// + /// The stream to send as the multipart 'file' file part. + /// + /// + /// + /// Default Value: MEDIUM + /// + /// + /// Vector store ID to use for RFI processing + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> UploadCheckComplianceStudioV1DemosRegulationsUploadCheckCompliancePostAsResponseAsync( + global::System.IO.Stream file, + string filename, + string? budget = default, + string? vectorStoreId = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.V1CreateAssistant.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.V1CreateAssistant.g.cs index ae45b8a1..3f61194c 100644 --- a/src/libs/AI21/Generated/AI21.IAi21Client.V1CreateAssistant.g.cs +++ b/src/libs/AI21/Generated/AI21.IAi21Client.V1CreateAssistant.g.cs @@ -8,11 +8,25 @@ public partial interface IAi21Client /// Create Assistant ///
/// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// global::System.Threading.Tasks.Task V1CreateAssistantAsync( global::AI21.CreateAssistantRequest request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Create Assistant + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> V1CreateAssistantAsResponseAsync( + + global::AI21.CreateAssistantRequest request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); /// /// Create Assistant @@ -34,6 +48,7 @@ public partial interface IAi21Client /// /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// global::System.Threading.Tasks.Task V1CreateAssistantAsync( @@ -50,6 +65,7 @@ public partial interface IAi21Client string? systemPrompt = default, global::AI21.WorkflowConfig? workflowConfig = default, object? configOverrides = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.V1CreatePlan.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.V1CreatePlan.g.cs index 29f61af5..a491eb74 100644 --- a/src/libs/AI21/Generated/AI21.IAi21Client.V1CreatePlan.g.cs +++ b/src/libs/AI21/Generated/AI21.IAi21Client.V1CreatePlan.g.cs @@ -9,12 +9,28 @@ public partial interface IAi21Client /// /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// global::System.Threading.Tasks.Task V1CreatePlanAsync( string assistantId, global::AI21.CreatePlanPayload request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Create Plan + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> V1CreatePlanAsResponseAsync( + string assistantId, + + global::AI21.CreatePlanPayload request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); /// /// Create Plan @@ -22,12 +38,14 @@ public partial interface IAi21Client /// /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// global::System.Threading.Tasks.Task V1CreatePlanAsync( string assistantId, string code, global::System.Collections.Generic.IList? schemas = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.V1CreateRoute.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.V1CreateRoute.g.cs index fa64991b..fcc276eb 100644 --- a/src/libs/AI21/Generated/AI21.IAi21Client.V1CreateRoute.g.cs +++ b/src/libs/AI21/Generated/AI21.IAi21Client.V1CreateRoute.g.cs @@ -9,12 +9,28 @@ public partial interface IAi21Client /// /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// global::System.Threading.Tasks.Task V1CreateRouteAsync( string assistantId, global::AI21.CreateRoutePayload request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Create Route + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> V1CreateRouteAsResponseAsync( + string assistantId, + + global::AI21.CreateRoutePayload request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); /// /// Create Route @@ -24,6 +40,7 @@ public partial interface IAi21Client /// /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// global::System.Threading.Tasks.Task V1CreateRouteAsync( @@ -32,6 +49,7 @@ public partial interface IAi21Client string name, string description, global::System.Collections.Generic.IList examples, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.V1DeleteAssistant.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.V1DeleteAssistant.g.cs index 5d789ab5..ff1b3df0 100644 --- a/src/libs/AI21/Generated/AI21.IAi21Client.V1DeleteAssistant.g.cs +++ b/src/libs/AI21/Generated/AI21.IAi21Client.V1DeleteAssistant.g.cs @@ -8,10 +8,23 @@ public partial interface IAi21Client /// Delete Assistant /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// global::System.Threading.Tasks.Task V1DeleteAssistantAsync( string assistantId, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Delete Assistant + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> V1DeleteAssistantAsResponseAsync( + string assistantId, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.V1DeleteRoute.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.V1DeleteRoute.g.cs index 49bc6fee..38c87bc1 100644 --- a/src/libs/AI21/Generated/AI21.IAi21Client.V1DeleteRoute.g.cs +++ b/src/libs/AI21/Generated/AI21.IAi21Client.V1DeleteRoute.g.cs @@ -9,11 +9,26 @@ public partial interface IAi21Client /// /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// global::System.Threading.Tasks.Task V1DeleteRouteAsync( string routeId, string assistantId, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Delete Route + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> V1DeleteRouteAsResponseAsync( + string routeId, + string assistantId, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.V1GenerateAssistant.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.V1GenerateAssistant.g.cs index 4b67e94f..0570ed4f 100644 --- a/src/libs/AI21/Generated/AI21.IAi21Client.V1GenerateAssistant.g.cs +++ b/src/libs/AI21/Generated/AI21.IAi21Client.V1GenerateAssistant.g.cs @@ -8,22 +8,38 @@ public partial interface IAi21Client /// Generate Assistant /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// global::System.Threading.Tasks.Task V1GenerateAssistantAsync( global::AI21.GenerateAssistantRequest request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Generate Assistant + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> V1GenerateAssistantAsResponseAsync( + + global::AI21.GenerateAssistantRequest request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); /// /// Generate Assistant /// /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// global::System.Threading.Tasks.Task V1GenerateAssistantAsync( string prompt, string? avatar = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.V1GetAssistant.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.V1GetAssistant.g.cs index de766947..646e917a 100644 --- a/src/libs/AI21/Generated/AI21.IAi21Client.V1GetAssistant.g.cs +++ b/src/libs/AI21/Generated/AI21.IAi21Client.V1GetAssistant.g.cs @@ -8,10 +8,23 @@ public partial interface IAi21Client /// Get Assistant /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// global::System.Threading.Tasks.Task V1GetAssistantAsync( string assistantId, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Get Assistant + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> V1GetAssistantAsResponseAsync( + string assistantId, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.V1GetMaestroRun.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.V1GetMaestroRun.g.cs index 6a260913..d5c18902 100644 --- a/src/libs/AI21/Generated/AI21.IAi21Client.V1GetMaestroRun.g.cs +++ b/src/libs/AI21/Generated/AI21.IAi21Client.V1GetMaestroRun.g.cs @@ -8,10 +8,23 @@ public partial interface IAi21Client /// Get Maestro Run /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// global::System.Threading.Tasks.Task V1GetMaestroRunAsync( string executionId, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Get Maestro Run + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> V1GetMaestroRunAsResponseAsync( + string executionId, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.V1GetPlan.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.V1GetPlan.g.cs index 46c8653e..123ab059 100644 --- a/src/libs/AI21/Generated/AI21.IAi21Client.V1GetPlan.g.cs +++ b/src/libs/AI21/Generated/AI21.IAi21Client.V1GetPlan.g.cs @@ -9,11 +9,26 @@ public partial interface IAi21Client /// /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// global::System.Threading.Tasks.Task V1GetPlanAsync( string planId, string assistantId, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Get Plan + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> V1GetPlanAsResponseAsync( + string planId, + string assistantId, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.V1GetRoute.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.V1GetRoute.g.cs index a5cffa7c..bee097a5 100644 --- a/src/libs/AI21/Generated/AI21.IAi21Client.V1GetRoute.g.cs +++ b/src/libs/AI21/Generated/AI21.IAi21Client.V1GetRoute.g.cs @@ -9,11 +9,26 @@ public partial interface IAi21Client /// /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// global::System.Threading.Tasks.Task V1GetRouteAsync( string routeId, string assistantId, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Get Route + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> V1GetRouteAsResponseAsync( + string routeId, + string assistantId, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.V1ListAssistants.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.V1ListAssistants.g.cs index f10c0dab..e826a396 100644 --- a/src/libs/AI21/Generated/AI21.IAi21Client.V1ListAssistants.g.cs +++ b/src/libs/AI21/Generated/AI21.IAi21Client.V1ListAssistants.g.cs @@ -8,10 +8,23 @@ public partial interface IAi21Client /// Get Assistants /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// global::System.Threading.Tasks.Task V1ListAssistantsAsync( global::System.Collections.Generic.IList? workspaceIds = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Get Assistants + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> V1ListAssistantsAsResponseAsync( + global::System.Collections.Generic.IList? workspaceIds = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.V1ListModelsInfo.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.V1ListModelsInfo.g.cs index d7c3053a..4699b255 100644 --- a/src/libs/AI21/Generated/AI21.IAi21Client.V1ListModelsInfo.g.cs +++ b/src/libs/AI21/Generated/AI21.IAi21Client.V1ListModelsInfo.g.cs @@ -7,9 +7,20 @@ public partial interface IAi21Client /// /// Get 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 V1ListModelsInfoAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Get 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> V1ListModelsInfoAsResponseAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.V1ListPlans.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.V1ListPlans.g.cs index 8ce894db..3b069fc3 100644 --- a/src/libs/AI21/Generated/AI21.IAi21Client.V1ListPlans.g.cs +++ b/src/libs/AI21/Generated/AI21.IAi21Client.V1ListPlans.g.cs @@ -8,10 +8,23 @@ public partial interface IAi21Client /// List Plans /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// global::System.Threading.Tasks.Task V1ListPlansAsync( string assistantId, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// List Plans + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> V1ListPlansAsResponseAsync( + string assistantId, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.V1ListRoutes.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.V1ListRoutes.g.cs index eb2ad2ad..7a895697 100644 --- a/src/libs/AI21/Generated/AI21.IAi21Client.V1ListRoutes.g.cs +++ b/src/libs/AI21/Generated/AI21.IAi21Client.V1ListRoutes.g.cs @@ -9,11 +9,26 @@ public partial interface IAi21Client /// /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// global::System.Threading.Tasks.Task V1ListRoutesAsync( string assistantId, string? name = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Get Routes + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> V1ListRoutesAsResponseAsync( + string assistantId, + string? name = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.V1MaestroRun.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.V1MaestroRun.g.cs index fff0103a..22b1471f 100644 --- a/src/libs/AI21/Generated/AI21.IAi21Client.V1MaestroRun.g.cs +++ b/src/libs/AI21/Generated/AI21.IAi21Client.V1MaestroRun.g.cs @@ -8,11 +8,25 @@ public partial interface IAi21Client /// Create Maestro Run /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// global::System.Threading.Tasks.Task V1MaestroRunAsync( global::AI21.CreateMaestroRunsPayload request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Create Maestro Run + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> V1MaestroRunAsResponseAsync( + + global::AI21.CreateMaestroRunsPayload request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); /// /// Create Maestro Run @@ -51,6 +65,7 @@ public partial interface IAi21Client /// be 1. A streaming response is different than the non-streaming response.
/// 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 V1MaestroRunAsync( @@ -71,6 +86,7 @@ public partial interface IAi21Client global::AI21.CreateMaestroRunsPayloadResponseLanguage? responseLanguage = default, string? systemPrompt = default, bool? stream = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.V1ModifyAssistant.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.V1ModifyAssistant.g.cs index e2ad85a4..9f3f9b90 100644 --- a/src/libs/AI21/Generated/AI21.IAi21Client.V1ModifyAssistant.g.cs +++ b/src/libs/AI21/Generated/AI21.IAi21Client.V1ModifyAssistant.g.cs @@ -9,12 +9,28 @@ public partial interface IAi21Client ///
/// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// global::System.Threading.Tasks.Task V1ModifyAssistantAsync( string assistantId, global::AI21.ModifyAssistantRequest request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Modify Assistant + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> V1ModifyAssistantAsResponseAsync( + string assistantId, + + global::AI21.ModifyAssistantRequest request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); /// /// Modify Assistant @@ -42,6 +58,7 @@ public partial interface IAi21Client /// /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// global::System.Threading.Tasks.Task V1ModifyAssistantAsync( @@ -60,6 +77,7 @@ public partial interface IAi21Client string? systemPrompt = default, global::AI21.WorkflowConfig? workflowConfig = default, object? configOverrides = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.V1ModifyPlan.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.V1ModifyPlan.g.cs index d0991f91..13cba1d7 100644 --- a/src/libs/AI21/Generated/AI21.IAi21Client.V1ModifyPlan.g.cs +++ b/src/libs/AI21/Generated/AI21.IAi21Client.V1ModifyPlan.g.cs @@ -10,6 +10,7 @@ public partial interface IAi21Client /// /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// global::System.Threading.Tasks.Task V1ModifyPlanAsync( @@ -17,6 +18,23 @@ public partial interface IAi21Client string assistantId, global::AI21.CreatePlanPayload request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Modify Plan + /// + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> V1ModifyPlanAsResponseAsync( + string planId, + string assistantId, + + global::AI21.CreatePlanPayload request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); /// /// Modify Plan @@ -25,6 +43,7 @@ public partial interface IAi21Client /// /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// global::System.Threading.Tasks.Task V1ModifyPlanAsync( @@ -32,6 +51,7 @@ public partial interface IAi21Client string assistantId, string code, global::System.Collections.Generic.IList? schemas = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.V1ModifyRoute.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.V1ModifyRoute.g.cs index 336912ec..fd54930b 100644 --- a/src/libs/AI21/Generated/AI21.IAi21Client.V1ModifyRoute.g.cs +++ b/src/libs/AI21/Generated/AI21.IAi21Client.V1ModifyRoute.g.cs @@ -10,6 +10,7 @@ public partial interface IAi21Client /// /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// global::System.Threading.Tasks.Task V1ModifyRouteAsync( @@ -17,6 +18,23 @@ public partial interface IAi21Client string assistantId, global::AI21.UpdateRoutePayload request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Modify Route + /// + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> V1ModifyRouteAsResponseAsync( + string routeId, + string assistantId, + + global::AI21.UpdateRoutePayload request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); /// /// Modify Route @@ -25,6 +43,7 @@ public partial interface IAi21Client /// /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// global::System.Threading.Tasks.Task V1ModifyRouteAsync( @@ -32,6 +51,7 @@ public partial interface IAi21Client string assistantId, string description, global::System.Collections.Generic.IList? examples = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.V1RunAssistant.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.V1RunAssistant.g.cs index 13a53dcf..2374b8ed 100644 --- a/src/libs/AI21/Generated/AI21.IAi21Client.V1RunAssistant.g.cs +++ b/src/libs/AI21/Generated/AI21.IAi21Client.V1RunAssistant.g.cs @@ -9,12 +9,28 @@ public partial interface IAi21Client /// /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// global::System.Threading.Tasks.Task V1RunAssistantAsync( string assistantId, global::AI21.RunAssistantRequest request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Run Assistant + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> V1RunAssistantAsResponseAsync( + string assistantId, + + global::AI21.RunAssistantRequest request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); /// /// Run Assistant @@ -38,6 +54,7 @@ public partial interface IAi21Client /// Default Value: unset /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// global::System.Threading.Tasks.Task V1RunAssistantAsync( @@ -50,6 +67,7 @@ public partial interface IAi21Client bool? dynamicPlanningEnabled = default, global::AI21.RunAssistantRequestResponseLanguage? responseLanguage = default, string? systemPrompt = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsFdBatchesV1Classifications.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsFdBatchesV1Classifications.g.cs new file mode 100644 index 00000000..f7fe9275 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsFdBatchesV1Classifications.g.cs @@ -0,0 +1,26 @@ +#nullable enable + +namespace AI21 +{ + public partial interface IAi21Client + { + /// + /// Fnac Batch Classifications + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task V1SolutionsFdBatchesV1ClassificationsAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Fnac Batch Classifications + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> V1SolutionsFdBatchesV1ClassificationsAsResponseAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsFdBatchesV1ClassificationsResults.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsFdBatchesV1ClassificationsResults.g.cs new file mode 100644 index 00000000..20969497 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsFdBatchesV1ClassificationsResults.g.cs @@ -0,0 +1,30 @@ +#nullable enable + +namespace AI21 +{ + public partial interface IAi21Client + { + /// + /// Fnac Batch Classifications Results + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task V1SolutionsFdBatchesV1ClassificationsResultsAsync( + string batchId, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Fnac Batch Classifications Results + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> V1SolutionsFdBatchesV1ClassificationsResultsAsResponseAsync( + string batchId, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsFdBatchesV1ClassificationsStatus.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsFdBatchesV1ClassificationsStatus.g.cs new file mode 100644 index 00000000..b6900208 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsFdBatchesV1ClassificationsStatus.g.cs @@ -0,0 +1,30 @@ +#nullable enable + +namespace AI21 +{ + public partial interface IAi21Client + { + /// + /// Fnac Batch Classifications 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 V1SolutionsFdBatchesV1ClassificationsStatusAsync( + string batchId, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Fnac Batch Classifications 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> V1SolutionsFdBatchesV1ClassificationsStatusAsResponseAsync( + string batchId, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsFdBatchesV1Descriptions.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsFdBatchesV1Descriptions.g.cs new file mode 100644 index 00000000..c59b0075 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsFdBatchesV1Descriptions.g.cs @@ -0,0 +1,26 @@ +#nullable enable + +namespace AI21 +{ + public partial interface IAi21Client + { + /// + /// Fnac Batch Descriptions + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task V1SolutionsFdBatchesV1DescriptionsAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Fnac Batch Descriptions + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> V1SolutionsFdBatchesV1DescriptionsAsResponseAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsFdBatchesV1DescriptionsResults.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsFdBatchesV1DescriptionsResults.g.cs new file mode 100644 index 00000000..d548303e --- /dev/null +++ b/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsFdBatchesV1DescriptionsResults.g.cs @@ -0,0 +1,30 @@ +#nullable enable + +namespace AI21 +{ + public partial interface IAi21Client + { + /// + /// Fnac Batch Descriptions Results + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task V1SolutionsFdBatchesV1DescriptionsResultsAsync( + string batchId, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Fnac Batch Descriptions Results + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> V1SolutionsFdBatchesV1DescriptionsResultsAsResponseAsync( + string batchId, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsFdBatchesV1DescriptionsStatus.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsFdBatchesV1DescriptionsStatus.g.cs new file mode 100644 index 00000000..8bf6e04f --- /dev/null +++ b/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsFdBatchesV1DescriptionsStatus.g.cs @@ -0,0 +1,30 @@ +#nullable enable + +namespace AI21 +{ + public partial interface IAi21Client + { + /// + /// Fnac Batch Descriptions 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 V1SolutionsFdBatchesV1DescriptionsStatusAsync( + string batchId, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Fnac Batch Descriptions 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> V1SolutionsFdBatchesV1DescriptionsStatusAsResponseAsync( + string batchId, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsFdPreviewBatchesV1Classifications.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsFdPreviewBatchesV1Classifications.g.cs new file mode 100644 index 00000000..2f18bfe7 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsFdPreviewBatchesV1Classifications.g.cs @@ -0,0 +1,26 @@ +#nullable enable + +namespace AI21 +{ + public partial interface IAi21Client + { + /// + /// Fnac Batch Classifications Prefix Preview + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task V1SolutionsFdPreviewBatchesV1ClassificationsAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Fnac Batch Classifications Prefix Preview + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> V1SolutionsFdPreviewBatchesV1ClassificationsAsResponseAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsFdPreviewBatchesV1ClassificationsResults.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsFdPreviewBatchesV1ClassificationsResults.g.cs new file mode 100644 index 00000000..0151b139 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsFdPreviewBatchesV1ClassificationsResults.g.cs @@ -0,0 +1,30 @@ +#nullable enable + +namespace AI21 +{ + public partial interface IAi21Client + { + /// + /// Fnac Batch Classifications Results Prefix Preview + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task V1SolutionsFdPreviewBatchesV1ClassificationsResultsAsync( + string batchId, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Fnac Batch Classifications Results Prefix Preview + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> V1SolutionsFdPreviewBatchesV1ClassificationsResultsAsResponseAsync( + string batchId, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsFdPreviewBatchesV1ClassificationsStatus.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsFdPreviewBatchesV1ClassificationsStatus.g.cs new file mode 100644 index 00000000..2d06022a --- /dev/null +++ b/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsFdPreviewBatchesV1ClassificationsStatus.g.cs @@ -0,0 +1,30 @@ +#nullable enable + +namespace AI21 +{ + public partial interface IAi21Client + { + /// + /// Fnac Batch Classifications Status Prefix Preview + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task V1SolutionsFdPreviewBatchesV1ClassificationsStatusAsync( + string batchId, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Fnac Batch Classifications Status Prefix Preview + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> V1SolutionsFdPreviewBatchesV1ClassificationsStatusAsResponseAsync( + string batchId, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsFdPreviewBatchesV1Descriptions.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsFdPreviewBatchesV1Descriptions.g.cs new file mode 100644 index 00000000..14ed1aad --- /dev/null +++ b/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsFdPreviewBatchesV1Descriptions.g.cs @@ -0,0 +1,26 @@ +#nullable enable + +namespace AI21 +{ + public partial interface IAi21Client + { + /// + /// Fnac Batch Descriptions Prefix Preview + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task V1SolutionsFdPreviewBatchesV1DescriptionsAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Fnac Batch Descriptions Prefix Preview + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> V1SolutionsFdPreviewBatchesV1DescriptionsAsResponseAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsFdPreviewBatchesV1DescriptionsResults.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsFdPreviewBatchesV1DescriptionsResults.g.cs new file mode 100644 index 00000000..6e25a614 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsFdPreviewBatchesV1DescriptionsResults.g.cs @@ -0,0 +1,30 @@ +#nullable enable + +namespace AI21 +{ + public partial interface IAi21Client + { + /// + /// Fnac Batch Descriptions Results Prefix Preview + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task V1SolutionsFdPreviewBatchesV1DescriptionsResultsAsync( + string batchId, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Fnac Batch Descriptions Results Prefix Preview + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> V1SolutionsFdPreviewBatchesV1DescriptionsResultsAsResponseAsync( + string batchId, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsFdPreviewBatchesV1DescriptionsStatus.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsFdPreviewBatchesV1DescriptionsStatus.g.cs new file mode 100644 index 00000000..67cb3a3c --- /dev/null +++ b/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsFdPreviewBatchesV1DescriptionsStatus.g.cs @@ -0,0 +1,30 @@ +#nullable enable + +namespace AI21 +{ + public partial interface IAi21Client + { + /// + /// Fnac Batch Descriptions Status Prefix Preview + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task V1SolutionsFdPreviewBatchesV1DescriptionsStatusAsync( + string batchId, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Fnac Batch Descriptions Status Prefix Preview + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> V1SolutionsFdPreviewBatchesV1DescriptionsStatusAsResponseAsync( + string batchId, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsFnacAftersalesBatchPredict.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsFnacAftersalesBatchPredict.g.cs new file mode 100644 index 00000000..578ae4c0 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsFnacAftersalesBatchPredict.g.cs @@ -0,0 +1,26 @@ +#nullable enable + +namespace AI21 +{ + public partial interface IAi21Client + { + /// + /// Fnac Aftersales Batch Predict + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task V1SolutionsFnacAftersalesBatchPredictAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Fnac Aftersales Batch Predict + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> V1SolutionsFnacAftersalesBatchPredictAsResponseAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsFnacAftersalesBatchPredictStatus.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsFnacAftersalesBatchPredictStatus.g.cs new file mode 100644 index 00000000..f9ef48fd --- /dev/null +++ b/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsFnacAftersalesBatchPredictStatus.g.cs @@ -0,0 +1,30 @@ +#nullable enable + +namespace AI21 +{ + public partial interface IAi21Client + { + /// + /// Fnac Aftersales Batch Predict 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 V1SolutionsFnacAftersalesBatchPredictStatusAsync( + string batchId, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Fnac Aftersales Batch Predict 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> V1SolutionsFnacAftersalesBatchPredictStatusAsResponseAsync( + string batchId, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsFnacAftersalesPreviewBatchPredict.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsFnacAftersalesPreviewBatchPredict.g.cs new file mode 100644 index 00000000..fc9d210f --- /dev/null +++ b/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsFnacAftersalesPreviewBatchPredict.g.cs @@ -0,0 +1,26 @@ +#nullable enable + +namespace AI21 +{ + public partial interface IAi21Client + { + /// + /// Fnac Aftersales Batch Predict Prefix Preview + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task V1SolutionsFnacAftersalesPreviewBatchPredictAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Fnac Aftersales Batch Predict Prefix Preview + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> V1SolutionsFnacAftersalesPreviewBatchPredictAsResponseAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsFnacAftersalesPreviewBatchPredictStatus.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsFnacAftersalesPreviewBatchPredictStatus.g.cs new file mode 100644 index 00000000..fc894c3a --- /dev/null +++ b/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsFnacAftersalesPreviewBatchPredictStatus.g.cs @@ -0,0 +1,30 @@ +#nullable enable + +namespace AI21 +{ + public partial interface IAi21Client + { + /// + /// Fnac Aftersales Batch Predict Status Prefix Preview + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task V1SolutionsFnacAftersalesPreviewBatchPredictStatusAsync( + string batchId, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Fnac Aftersales Batch Predict Status Prefix Preview + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> V1SolutionsFnacAftersalesPreviewBatchPredictStatusAsResponseAsync( + string batchId, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsFnacPreviewV1Classifications.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsFnacPreviewV1Classifications.g.cs new file mode 100644 index 00000000..7b4127b3 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsFnacPreviewV1Classifications.g.cs @@ -0,0 +1,26 @@ +#nullable enable + +namespace AI21 +{ + public partial interface IAi21Client + { + /// + /// Fnac V1 Classifications Prefix Preview + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task V1SolutionsFnacPreviewV1ClassificationsAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Fnac V1 Classifications Prefix Preview + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> V1SolutionsFnacPreviewV1ClassificationsAsResponseAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsFnacPreviewV1DeprecatedClassifications.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsFnacPreviewV1DeprecatedClassifications.g.cs new file mode 100644 index 00000000..2542f9e2 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsFnacPreviewV1DeprecatedClassifications.g.cs @@ -0,0 +1,26 @@ +#nullable enable + +namespace AI21 +{ + public partial interface IAi21Client + { + /// + /// Fnac V1 Deprecated Classifications Prefix Preview + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task V1SolutionsFnacPreviewV1DeprecatedClassificationsAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Fnac V1 Deprecated Classifications Prefix Preview + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> V1SolutionsFnacPreviewV1DeprecatedClassificationsAsResponseAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsFnacPreviewV1DeprecatedDescriptions.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsFnacPreviewV1DeprecatedDescriptions.g.cs new file mode 100644 index 00000000..3efd9616 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsFnacPreviewV1DeprecatedDescriptions.g.cs @@ -0,0 +1,26 @@ +#nullable enable + +namespace AI21 +{ + public partial interface IAi21Client + { + /// + /// Fnac V1 Deprecated Descriptions Prefix Preview + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task V1SolutionsFnacPreviewV1DeprecatedDescriptionsAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Fnac V1 Deprecated Descriptions Prefix Preview + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> V1SolutionsFnacPreviewV1DeprecatedDescriptionsAsResponseAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsFnacPreviewV1Descriptions.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsFnacPreviewV1Descriptions.g.cs new file mode 100644 index 00000000..f0b2e140 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsFnacPreviewV1Descriptions.g.cs @@ -0,0 +1,26 @@ +#nullable enable + +namespace AI21 +{ + public partial interface IAi21Client + { + /// + /// Fnac V1 Descriptions Prefix Preview + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task V1SolutionsFnacPreviewV1DescriptionsAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Fnac V1 Descriptions Prefix Preview + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> V1SolutionsFnacPreviewV1DescriptionsAsResponseAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsFnacV1Classifications.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsFnacV1Classifications.g.cs new file mode 100644 index 00000000..6d8d6e2c --- /dev/null +++ b/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsFnacV1Classifications.g.cs @@ -0,0 +1,26 @@ +#nullable enable + +namespace AI21 +{ + public partial interface IAi21Client + { + /// + /// Fnac V1 Classifications + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task V1SolutionsFnacV1ClassificationsAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Fnac V1 Classifications + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> V1SolutionsFnacV1ClassificationsAsResponseAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsFnacV1DeprecatedClassifications.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsFnacV1DeprecatedClassifications.g.cs new file mode 100644 index 00000000..e773a2ae --- /dev/null +++ b/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsFnacV1DeprecatedClassifications.g.cs @@ -0,0 +1,26 @@ +#nullable enable + +namespace AI21 +{ + public partial interface IAi21Client + { + /// + /// Fnac V1 Deprecated Classifications + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task V1SolutionsFnacV1DeprecatedClassificationsAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Fnac V1 Deprecated Classifications + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> V1SolutionsFnacV1DeprecatedClassificationsAsResponseAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsFnacV1DeprecatedDescriptions.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsFnacV1DeprecatedDescriptions.g.cs new file mode 100644 index 00000000..cf7d8bac --- /dev/null +++ b/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsFnacV1DeprecatedDescriptions.g.cs @@ -0,0 +1,26 @@ +#nullable enable + +namespace AI21 +{ + public partial interface IAi21Client + { + /// + /// Fnac V1 Deprecated Descriptions + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task V1SolutionsFnacV1DeprecatedDescriptionsAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Fnac V1 Deprecated Descriptions + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> V1SolutionsFnacV1DeprecatedDescriptionsAsResponseAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsFnacV1Descriptions.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsFnacV1Descriptions.g.cs new file mode 100644 index 00000000..40aeb9d1 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsFnacV1Descriptions.g.cs @@ -0,0 +1,26 @@ +#nullable enable + +namespace AI21 +{ + public partial interface IAi21Client + { + /// + /// Fnac V1 Descriptions + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task V1SolutionsFnacV1DescriptionsAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Fnac V1 Descriptions + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> V1SolutionsFnacV1DescriptionsAsResponseAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsTlvMunicipalityConvrag.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsTlvMunicipalityConvrag.g.cs new file mode 100644 index 00000000..3e5fce5c --- /dev/null +++ b/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsTlvMunicipalityConvrag.g.cs @@ -0,0 +1,26 @@ +#nullable enable + +namespace AI21 +{ + public partial interface IAi21Client + { + /// + /// Tlv Convrag + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task V1SolutionsTlvMunicipalityConvragAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Tlv Convrag + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> V1SolutionsTlvMunicipalityConvragAsResponseAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsTlvMunicipalityPreviewConvrag.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsTlvMunicipalityPreviewConvrag.g.cs new file mode 100644 index 00000000..144f3d5d --- /dev/null +++ b/src/libs/AI21/Generated/AI21.IAi21Client.V1SolutionsTlvMunicipalityPreviewConvrag.g.cs @@ -0,0 +1,26 @@ +#nullable enable + +namespace AI21 +{ + public partial interface IAi21Client + { + /// + /// Tlv Convrag Prefix Preview + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task V1SolutionsTlvMunicipalityPreviewConvragAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Tlv Convrag Prefix Preview + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> V1SolutionsTlvMunicipalityPreviewConvragAsResponseAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.V1StudioApiGenerationRequirements.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.V1StudioApiGenerationRequirements.g.cs index 6d543240..e4bbabf5 100644 --- a/src/libs/AI21/Generated/AI21.IAi21Client.V1StudioApiGenerationRequirements.g.cs +++ b/src/libs/AI21/Generated/AI21.IAi21Client.V1StudioApiGenerationRequirements.g.cs @@ -8,20 +8,36 @@ public partial interface IAi21Client /// Generate Requirements /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// global::System.Threading.Tasks.Task V1StudioApiGenerationRequirementsAsync( global::AI21.RequirementsGenerationRequest request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Generate Requirements + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> V1StudioApiGenerationRequirementsAsResponseAsync( + + global::AI21.RequirementsGenerationRequest request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); /// /// Generate Requirements /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// global::System.Threading.Tasks.Task V1StudioApiGenerationRequirementsAsync( string query, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.V1StudioApiGenerationThreadName.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.V1StudioApiGenerationThreadName.g.cs deleted file mode 100644 index 230a9922..00000000 --- a/src/libs/AI21/Generated/AI21.IAi21Client.V1StudioApiGenerationThreadName.g.cs +++ /dev/null @@ -1,27 +0,0 @@ -#nullable enable - -namespace AI21 -{ - public partial interface IAi21Client - { - /// - /// Generate Thread Name - /// - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task V1StudioApiGenerationThreadNameAsync( - - global::AI21.ThreadNameGenerationRequest request, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Generate Thread Name - /// - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task V1StudioApiGenerationThreadNameAsync( - string query, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.V1ValidatePlan.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.V1ValidatePlan.g.cs index b92773ca..4dbd9429 100644 --- a/src/libs/AI21/Generated/AI21.IAi21Client.V1ValidatePlan.g.cs +++ b/src/libs/AI21/Generated/AI21.IAi21Client.V1ValidatePlan.g.cs @@ -9,12 +9,28 @@ public partial interface IAi21Client /// /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// global::System.Threading.Tasks.Task V1ValidatePlanAsync( string assistantId, global::AI21.CreatePlanPayload request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Validate Plan + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> V1ValidatePlanAsResponseAsync( + string assistantId, + + global::AI21.CreatePlanPayload request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); /// /// Validate Plan @@ -22,12 +38,14 @@ public partial interface IAi21Client /// /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// global::System.Threading.Tasks.Task V1ValidatePlanAsync( string assistantId, string code, global::System.Collections.Generic.IList? schemas = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.VidaaActionItemsPreviewSolutionsPreviewVidaaActionItemsPost.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.VidaaActionItemsPreviewSolutionsPreviewVidaaActionItemsPost.g.cs deleted file mode 100644 index af6c2bd5..00000000 --- a/src/libs/AI21/Generated/AI21.IAi21Client.VidaaActionItemsPreviewSolutionsPreviewVidaaActionItemsPost.g.cs +++ /dev/null @@ -1,15 +0,0 @@ -#nullable enable - -namespace AI21 -{ - public partial interface IAi21Client - { - /// - /// Vidaa Action Items Preview - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task VidaaActionItemsPreviewSolutionsPreviewVidaaActionItemsPostAsync( - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.VidaaActionItemsSolutionsVidaaActionItemsPost.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.VidaaActionItemsSolutionsVidaaActionItemsPost.g.cs deleted file mode 100644 index 7001790e..00000000 --- a/src/libs/AI21/Generated/AI21.IAi21Client.VidaaActionItemsSolutionsVidaaActionItemsPost.g.cs +++ /dev/null @@ -1,15 +0,0 @@ -#nullable enable - -namespace AI21 -{ - public partial interface IAi21Client - { - /// - /// Vidaa Action Items - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task VidaaActionItemsSolutionsVidaaActionItemsPostAsync( - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.VidaaFeedItemsPreviewSolutionsPreviewVidaaFeedItemsGet.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.VidaaFeedItemsPreviewSolutionsPreviewVidaaFeedItemsGet.g.cs deleted file mode 100644 index 11c3c89b..00000000 --- a/src/libs/AI21/Generated/AI21.IAi21Client.VidaaFeedItemsPreviewSolutionsPreviewVidaaFeedItemsGet.g.cs +++ /dev/null @@ -1,15 +0,0 @@ -#nullable enable - -namespace AI21 -{ - public partial interface IAi21Client - { - /// - /// Vidaa Feed Items Preview - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task VidaaFeedItemsPreviewSolutionsPreviewVidaaFeedItemsGetAsync( - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.VidaaFeedItemsSolutionsVidaaFeedItemsGet.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.VidaaFeedItemsSolutionsVidaaFeedItemsGet.g.cs deleted file mode 100644 index ef82e444..00000000 --- a/src/libs/AI21/Generated/AI21.IAi21Client.VidaaFeedItemsSolutionsVidaaFeedItemsGet.g.cs +++ /dev/null @@ -1,15 +0,0 @@ -#nullable enable - -namespace AI21 -{ - public partial interface IAi21Client - { - /// - /// Vidaa Feed Items - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task VidaaFeedItemsSolutionsVidaaFeedItemsGetAsync( - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.VidaaMessagesPreviewSolutionsPreviewVidaaApiMessagesPost.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.VidaaMessagesPreviewSolutionsPreviewVidaaApiMessagesPost.g.cs deleted file mode 100644 index 000866dc..00000000 --- a/src/libs/AI21/Generated/AI21.IAi21Client.VidaaMessagesPreviewSolutionsPreviewVidaaApiMessagesPost.g.cs +++ /dev/null @@ -1,15 +0,0 @@ -#nullable enable - -namespace AI21 -{ - public partial interface IAi21Client - { - /// - /// Vidaa Messages Preview - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task VidaaMessagesPreviewSolutionsPreviewVidaaApiMessagesPostAsync( - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.VidaaMessagesSolutionsVidaaApiMessagesPost.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.VidaaMessagesSolutionsVidaaApiMessagesPost.g.cs deleted file mode 100644 index eba58d33..00000000 --- a/src/libs/AI21/Generated/AI21.IAi21Client.VidaaMessagesSolutionsVidaaApiMessagesPost.g.cs +++ /dev/null @@ -1,15 +0,0 @@ -#nullable enable - -namespace AI21 -{ - public partial interface IAi21Client - { - /// - /// Vidaa Messages - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task VidaaMessagesSolutionsVidaaApiMessagesPostAsync( - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.VidaaSchedulerStatsPreviewSolutionsPreviewVidaaSchedulerStatsGet.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.VidaaSchedulerStatsPreviewSolutionsPreviewVidaaSchedulerStatsGet.g.cs deleted file mode 100644 index 4ce6d5ce..00000000 --- a/src/libs/AI21/Generated/AI21.IAi21Client.VidaaSchedulerStatsPreviewSolutionsPreviewVidaaSchedulerStatsGet.g.cs +++ /dev/null @@ -1,15 +0,0 @@ -#nullable enable - -namespace AI21 -{ - public partial interface IAi21Client - { - /// - /// Vidaa Scheduler Stats Preview - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task VidaaSchedulerStatsPreviewSolutionsPreviewVidaaSchedulerStatsGetAsync( - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.VidaaSchedulerStatsSolutionsVidaaSchedulerStatsGet.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.VidaaSchedulerStatsSolutionsVidaaSchedulerStatsGet.g.cs deleted file mode 100644 index 6e8265b0..00000000 --- a/src/libs/AI21/Generated/AI21.IAi21Client.VidaaSchedulerStatsSolutionsVidaaSchedulerStatsGet.g.cs +++ /dev/null @@ -1,15 +0,0 @@ -#nullable enable - -namespace AI21 -{ - public partial interface IAi21Client - { - /// - /// Vidaa Scheduler Stats - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task VidaaSchedulerStatsSolutionsVidaaSchedulerStatsGetAsync( - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.VidaaSourcesPreviewSolutionsPreviewVidaaSourcesGet.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.VidaaSourcesPreviewSolutionsPreviewVidaaSourcesGet.g.cs deleted file mode 100644 index 1fe458a2..00000000 --- a/src/libs/AI21/Generated/AI21.IAi21Client.VidaaSourcesPreviewSolutionsPreviewVidaaSourcesGet.g.cs +++ /dev/null @@ -1,15 +0,0 @@ -#nullable enable - -namespace AI21 -{ - public partial interface IAi21Client - { - /// - /// Vidaa Sources Preview - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task VidaaSourcesPreviewSolutionsPreviewVidaaSourcesGetAsync( - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.VidaaSourcesSolutionsVidaaSourcesGet.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.VidaaSourcesSolutionsVidaaSourcesGet.g.cs deleted file mode 100644 index cbfc2328..00000000 --- a/src/libs/AI21/Generated/AI21.IAi21Client.VidaaSourcesSolutionsVidaaSourcesGet.g.cs +++ /dev/null @@ -1,15 +0,0 @@ -#nullable enable - -namespace AI21 -{ - public partial interface IAi21Client - { - /// - /// Vidaa Sources - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task VidaaSourcesSolutionsVidaaSourcesGetAsync( - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.VidaaSubscribePreviewSolutionsPreviewVidaaSubscribePost.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.VidaaSubscribePreviewSolutionsPreviewVidaaSubscribePost.g.cs deleted file mode 100644 index 2f6b614a..00000000 --- a/src/libs/AI21/Generated/AI21.IAi21Client.VidaaSubscribePreviewSolutionsPreviewVidaaSubscribePost.g.cs +++ /dev/null @@ -1,15 +0,0 @@ -#nullable enable - -namespace AI21 -{ - public partial interface IAi21Client - { - /// - /// Vidaa Subscribe Preview - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task VidaaSubscribePreviewSolutionsPreviewVidaaSubscribePostAsync( - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.VidaaSubscribeSolutionsVidaaSubscribePost.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.VidaaSubscribeSolutionsVidaaSubscribePost.g.cs deleted file mode 100644 index e7b03f17..00000000 --- a/src/libs/AI21/Generated/AI21.IAi21Client.VidaaSubscribeSolutionsVidaaSubscribePost.g.cs +++ /dev/null @@ -1,15 +0,0 @@ -#nullable enable - -namespace AI21 -{ - public partial interface IAi21Client - { - /// - /// Vidaa Subscribe - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task VidaaSubscribeSolutionsVidaaSubscribePostAsync( - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.VidaaSubscriptionsPreviewSolutionsPreviewVidaaSubscriptionsGet.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.VidaaSubscriptionsPreviewSolutionsPreviewVidaaSubscriptionsGet.g.cs deleted file mode 100644 index eca05fea..00000000 --- a/src/libs/AI21/Generated/AI21.IAi21Client.VidaaSubscriptionsPreviewSolutionsPreviewVidaaSubscriptionsGet.g.cs +++ /dev/null @@ -1,15 +0,0 @@ -#nullable enable - -namespace AI21 -{ - public partial interface IAi21Client - { - /// - /// Vidaa Subscriptions Preview - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task VidaaSubscriptionsPreviewSolutionsPreviewVidaaSubscriptionsGetAsync( - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.VidaaSubscriptionsSolutionsVidaaSubscriptionsGet.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.VidaaSubscriptionsSolutionsVidaaSubscriptionsGet.g.cs deleted file mode 100644 index b15401d6..00000000 --- a/src/libs/AI21/Generated/AI21.IAi21Client.VidaaSubscriptionsSolutionsVidaaSubscriptionsGet.g.cs +++ /dev/null @@ -1,15 +0,0 @@ -#nullable enable - -namespace AI21 -{ - public partial interface IAi21Client - { - /// - /// Vidaa Subscriptions - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task VidaaSubscriptionsSolutionsVidaaSubscriptionsGetAsync( - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.VidaaSummarizePreviewSolutionsPreviewVidaaSummarizePost.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.VidaaSummarizePreviewSolutionsPreviewVidaaSummarizePost.g.cs deleted file mode 100644 index c9ae60f9..00000000 --- a/src/libs/AI21/Generated/AI21.IAi21Client.VidaaSummarizePreviewSolutionsPreviewVidaaSummarizePost.g.cs +++ /dev/null @@ -1,15 +0,0 @@ -#nullable enable - -namespace AI21 -{ - public partial interface IAi21Client - { - /// - /// Vidaa Summarize Preview - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task VidaaSummarizePreviewSolutionsPreviewVidaaSummarizePostAsync( - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.VidaaSummarizeSolutionsVidaaSummarizePost.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.VidaaSummarizeSolutionsVidaaSummarizePost.g.cs deleted file mode 100644 index 71909ad7..00000000 --- a/src/libs/AI21/Generated/AI21.IAi21Client.VidaaSummarizeSolutionsVidaaSummarizePost.g.cs +++ /dev/null @@ -1,15 +0,0 @@ -#nullable enable - -namespace AI21 -{ - public partial interface IAi21Client - { - /// - /// Vidaa Summarize - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task VidaaSummarizeSolutionsVidaaSummarizePostAsync( - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.VidaaTriggerPollPreviewSolutionsPreviewVidaaTriggerPollPost.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.VidaaTriggerPollPreviewSolutionsPreviewVidaaTriggerPollPost.g.cs deleted file mode 100644 index 07921c42..00000000 --- a/src/libs/AI21/Generated/AI21.IAi21Client.VidaaTriggerPollPreviewSolutionsPreviewVidaaTriggerPollPost.g.cs +++ /dev/null @@ -1,15 +0,0 @@ -#nullable enable - -namespace AI21 -{ - public partial interface IAi21Client - { - /// - /// Vidaa Trigger Poll Preview - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task VidaaTriggerPollPreviewSolutionsPreviewVidaaTriggerPollPostAsync( - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.VidaaTriggerPollSolutionsVidaaTriggerPollPost.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.VidaaTriggerPollSolutionsVidaaTriggerPollPost.g.cs deleted file mode 100644 index 393e0fa0..00000000 --- a/src/libs/AI21/Generated/AI21.IAi21Client.VidaaTriggerPollSolutionsVidaaTriggerPollPost.g.cs +++ /dev/null @@ -1,15 +0,0 @@ -#nullable enable - -namespace AI21 -{ - public partial interface IAi21Client - { - /// - /// Vidaa Trigger Poll - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task VidaaTriggerPollSolutionsVidaaTriggerPollPostAsync( - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.VidaaUnsubscribePreviewSolutionsPreviewVidaaUnsubscribePost.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.VidaaUnsubscribePreviewSolutionsPreviewVidaaUnsubscribePost.g.cs deleted file mode 100644 index 8a63bb2c..00000000 --- a/src/libs/AI21/Generated/AI21.IAi21Client.VidaaUnsubscribePreviewSolutionsPreviewVidaaUnsubscribePost.g.cs +++ /dev/null @@ -1,15 +0,0 @@ -#nullable enable - -namespace AI21 -{ - public partial interface IAi21Client - { - /// - /// Vidaa Unsubscribe Preview - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task VidaaUnsubscribePreviewSolutionsPreviewVidaaUnsubscribePostAsync( - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.VidaaUnsubscribeSolutionsVidaaUnsubscribePost.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.VidaaUnsubscribeSolutionsVidaaUnsubscribePost.g.cs deleted file mode 100644 index f51de598..00000000 --- a/src/libs/AI21/Generated/AI21.IAi21Client.VidaaUnsubscribeSolutionsVidaaUnsubscribePost.g.cs +++ /dev/null @@ -1,15 +0,0 @@ -#nullable enable - -namespace AI21 -{ - public partial interface IAi21Client - { - /// - /// Vidaa Unsubscribe - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task VidaaUnsubscribeSolutionsVidaaUnsubscribePostAsync( - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.WppFeedbackPrefixPreviewSolutionsPreviewWppFeedbackPost.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.WppFeedbackPrefixPreviewSolutionsPreviewWppFeedbackPost.g.cs deleted file mode 100644 index cddada7b..00000000 --- a/src/libs/AI21/Generated/AI21.IAi21Client.WppFeedbackPrefixPreviewSolutionsPreviewWppFeedbackPost.g.cs +++ /dev/null @@ -1,15 +0,0 @@ -#nullable enable - -namespace AI21 -{ - public partial interface IAi21Client - { - /// - /// Wpp Feedback Prefix Preview - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task WppFeedbackPrefixPreviewSolutionsPreviewWppFeedbackPostAsync( - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.WppFeedbackSolutionsWppFeedbackPost.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.WppFeedbackSolutionsWppFeedbackPost.g.cs deleted file mode 100644 index 3df5db88..00000000 --- a/src/libs/AI21/Generated/AI21.IAi21Client.WppFeedbackSolutionsWppFeedbackPost.g.cs +++ /dev/null @@ -1,15 +0,0 @@ -#nullable enable - -namespace AI21 -{ - public partial interface IAi21Client - { - /// - /// Wpp Feedback - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task WppFeedbackSolutionsWppFeedbackPostAsync( - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.WppQueryPrefixPreviewSolutionsPreviewWppQueryPost.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.WppQueryPrefixPreviewSolutionsPreviewWppQueryPost.g.cs deleted file mode 100644 index c79d4125..00000000 --- a/src/libs/AI21/Generated/AI21.IAi21Client.WppQueryPrefixPreviewSolutionsPreviewWppQueryPost.g.cs +++ /dev/null @@ -1,15 +0,0 @@ -#nullable enable - -namespace AI21 -{ - public partial interface IAi21Client - { - /// - /// Wpp Query Prefix Preview - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task WppQueryPrefixPreviewSolutionsPreviewWppQueryPostAsync( - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.WppQuerySolutionsWppQueryPost.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.WppQuerySolutionsWppQueryPost.g.cs deleted file mode 100644 index 4f400fb3..00000000 --- a/src/libs/AI21/Generated/AI21.IAi21Client.WppQuerySolutionsWppQueryPost.g.cs +++ /dev/null @@ -1,15 +0,0 @@ -#nullable enable - -namespace AI21 -{ - public partial interface IAi21Client - { - /// - /// Wpp Query - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task WppQuerySolutionsWppQueryPostAsync( - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Client.g.cs b/src/libs/AI21/Generated/AI21.IAi21Client.g.cs index 8ca6623f..71464623 100644 --- a/src/libs/AI21/Generated/AI21.IAi21Client.g.cs +++ b/src/libs/AI21/Generated/AI21.IAi21Client.g.cs @@ -33,6 +33,11 @@ public partial interface IAi21Client : 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::AI21.AutoSDKClientOptions Options { get; } + /// /// diff --git a/src/libs/AI21/Generated/AI21.IJambaCompleteClient.V1ChatComplete.g.cs b/src/libs/AI21/Generated/AI21.IJambaCompleteClient.V1ChatComplete.g.cs index c02f2719..e5b937b6 100644 --- a/src/libs/AI21/Generated/AI21.IJambaCompleteClient.V1ChatComplete.g.cs +++ b/src/libs/AI21/Generated/AI21.IJambaCompleteClient.V1ChatComplete.g.cs @@ -13,11 +13,30 @@ public partial interface IJambaCompleteClient /// token is generated, rather than waiting for the entire response. /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// global::System.Threading.Tasks.Task>> V1ChatCompleteAsync( global::AI21.ChatRequest request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Studio Chat Complete
+ /// This is the endpoint for the [Jamba Instruct model](https://docs.ai21.com/docs/jamba-models).
+ /// This is a foundation model that supports both single-turn (question answering,
+ /// text completion) and multi-turn (chat style) interactions.
+ /// You can optionally stream results if you want to get the response as each
+ /// token is generated, rather than waiting for the entire response. + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task>>> V1ChatCompleteAsResponseAsync( + + global::AI21.ChatRequest request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); /// /// Studio Chat Complete
@@ -86,6 +105,7 @@ public partial interface IJambaCompleteClient /// /// Default Value: {"type":"text"} /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// global::System.Threading.Tasks.Task>> V1ChatCompleteAsync( @@ -101,6 +121,7 @@ public partial interface IJambaCompleteClient global::AI21.MockResponseConfig? mockResponse = default, global::System.Collections.Generic.IList? documents = default, global::AI21.ResponseFormat? responseFormat = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IJambaCompleteClient.g.cs b/src/libs/AI21/Generated/AI21.IJambaCompleteClient.g.cs index 73d1a55e..bda028ae 100644 --- a/src/libs/AI21/Generated/AI21.IJambaCompleteClient.g.cs +++ b/src/libs/AI21/Generated/AI21.IJambaCompleteClient.g.cs @@ -32,6 +32,11 @@ public partial interface IJambaCompleteClient : 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::AI21.AutoSDKClientOptions Options { get; } + /// /// diff --git a/src/libs/AI21/Generated/AI21.ILibraryManagementClient.V1LibraryDelete.g.cs b/src/libs/AI21/Generated/AI21.ILibraryManagementClient.V1LibraryDelete.g.cs index f701b9e9..be0808b1 100644 --- a/src/libs/AI21/Generated/AI21.ILibraryManagementClient.V1LibraryDelete.g.cs +++ b/src/libs/AI21/Generated/AI21.ILibraryManagementClient.V1LibraryDelete.g.cs @@ -11,10 +11,26 @@ public partial interface ILibraryManagementClient /// Files in `PROCESSING` status cannot be deleted. Attempts to delete such files will result in a <span style="color:red">422</span> error. /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// global::System.Threading.Tasks.Task V1LibraryDeleteAsync( global::System.Guid fileId, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Delete File
+ /// Delete the specified file from the library.
+ /// **Restrictions**:
+ /// Files in `PROCESSING` status cannot be deleted. Attempts to delete such files will result in a <span style="color:red">422</span> error. + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> V1LibraryDeleteAsResponseAsync( + global::System.Guid fileId, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.ILibraryManagementClient.V1LibraryManagement.g.cs b/src/libs/AI21/Generated/AI21.ILibraryManagementClient.V1LibraryManagement.g.cs index e2a783a2..0b7f3eda 100644 --- a/src/libs/AI21/Generated/AI21.ILibraryManagementClient.V1LibraryManagement.g.cs +++ b/src/libs/AI21/Generated/AI21.ILibraryManagementClient.V1LibraryManagement.g.cs @@ -19,6 +19,7 @@ public partial interface ILibraryManagementClient /// Default Value: 500000 /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// global::System.Threading.Tasks.Task> V1LibraryManagementAsync( @@ -28,6 +29,34 @@ public partial interface ILibraryManagementClient global::System.Collections.Generic.IList? label = default, int? limit = default, int? offset = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Get Workspace Files
+ /// Get metadata about a specific file by file ID. The file ID is generated by
+ /// AI21 when you upload the file. + ///
+ /// + /// + /// + /// An enumeration. + /// + /// + /// + /// Default Value: 500000 + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task>> V1LibraryManagementAsResponseAsync( + string? name = default, + string? path = default, + global::AI21.FileStatus? status = default, + global::System.Collections.Generic.IList? label = default, + int? limit = default, + int? offset = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.ILibraryManagementClient.V1LibraryManagement2.g.cs b/src/libs/AI21/Generated/AI21.ILibraryManagementClient.V1LibraryManagement2.g.cs index 30757fea..443fd8e2 100644 --- a/src/libs/AI21/Generated/AI21.ILibraryManagementClient.V1LibraryManagement2.g.cs +++ b/src/libs/AI21/Generated/AI21.ILibraryManagementClient.V1LibraryManagement2.g.cs @@ -16,10 +16,31 @@ public partial interface ILibraryManagementClient /// "financial" AND status UPLOADED will be returned. /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// global::System.Threading.Tasks.Task V1LibraryManagement2Async( global::System.Guid fileId, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Get File By Id
+ /// Retrieve a list of documents in the user's library. Optionally specify a
+ /// filter to find only files with matching labels or paths. This method
+ /// returns only metadata about files; to download a file, call
+ /// `GET .../files/{file_id}/download`
+ /// When specifying qualifiers with your request, only files that match
+ /// _all_ qualifiers will be returns. So, for example, if you specify
+ /// `label='financial'` and `status='UPLOADED'`, only files with the label
+ /// "financial" AND status UPLOADED will be returned. + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> V1LibraryManagement2AsResponseAsync( + global::System.Guid fileId, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.ILibraryManagementClient.V1LibraryManagement3.g.cs b/src/libs/AI21/Generated/AI21.ILibraryManagementClient.V1LibraryManagement3.g.cs index 9f2a1c7a..ad860b5e 100644 --- a/src/libs/AI21/Generated/AI21.ILibraryManagementClient.V1LibraryManagement3.g.cs +++ b/src/libs/AI21/Generated/AI21.ILibraryManagementClient.V1LibraryManagement3.g.cs @@ -17,12 +17,36 @@ public partial interface ILibraryManagementClient /// /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// global::System.Threading.Tasks.Task V1LibraryManagement3Async( global::System.Guid fileId, global::AI21.FilesUpdateRequest request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Update File
+ /// Update the specified parameters of a specific document in the user's library.
+ /// This operation currently supports updating the publicUrl and labels parameters.
+ /// > **This operation overwrites the specified items with the new data you provide.**
+ /// > If you wish to add new labels to the labels list without removing the existing ones,
+ /// > you must submit a labels list that includes both the current and new labels.**
+ /// >
+ /// > For instance, if the current labels are "Label A" and "Label B", and you wish to
+ /// > add "New Label C" and "New Label D" to the list, you must specify `"labels": ["Label A", "Label B", "New Label C", "New Label D"]`. + ///
+ /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> V1LibraryManagement3AsResponseAsync( + global::System.Guid fileId, + + global::AI21.FilesUpdateRequest request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); /// /// Update File
@@ -45,12 +69,14 @@ public partial interface ILibraryManagementClient /// Any labels to associate with this file. Separate multiple labels with commas. If
/// provided, will overwrite all existing labels. /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// global::System.Threading.Tasks.Task V1LibraryManagement3Async( global::System.Guid fileId, string? publicUrl = default, global::System.Collections.Generic.IList? labels = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.ILibraryManagementClient.V1LibraryUpload.g.cs b/src/libs/AI21/Generated/AI21.ILibraryManagementClient.V1LibraryUpload.g.cs index 37d5eadc..e04b7654 100644 --- a/src/libs/AI21/Generated/AI21.ILibraryManagementClient.V1LibraryUpload.g.cs +++ b/src/libs/AI21/Generated/AI21.ILibraryManagementClient.V1LibraryUpload.g.cs @@ -14,11 +14,31 @@ public partial interface ILibraryManagementClient /// - **Supported file types:** PDF, DocX, HTML, TXT ///
/// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// global::System.Threading.Tasks.Task V1LibraryUploadAsync( global::AI21.BodyV1LibraryUpload request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Upload Workspace File
+ /// Upload files to use for [RAG Engine document searches](https://docs.ai21.com/docs/rag-engine-overview).
+ /// You can assign metadata to your files to limit searches to specific files by file metadata.
+ /// There is no bulk upload method; files must be loaded one at a time.
+ /// - **Max number of files:** No limit. The playground limits bulk uploads to 50 files per request.
+ /// - **Max library size:** 1 GB total size. No limit to individual file size.
+ /// - **Supported file types:** PDF, DocX, HTML, TXT + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> V1LibraryUploadAsResponseAsync( + + global::AI21.BodyV1LibraryUpload request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); /// /// Upload Workspace File
@@ -41,6 +61,7 @@ public partial interface ILibraryManagementClient /// /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// global::System.Threading.Tasks.Task V1LibraryUploadAsync( @@ -54,6 +75,86 @@ public partial interface ILibraryManagementClient global::System.Guid? batchId = default, string? dataSource = default, string? metadata = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + + /// + /// Upload Workspace File
+ /// Upload files to use for [RAG Engine document searches](https://docs.ai21.com/docs/rag-engine-overview).
+ /// You can assign metadata to your files to limit searches to specific files by file metadata.
+ /// There is no bulk upload method; files must be loaded one at a time.
+ /// - **Max number of files:** No limit. The playground limits bulk uploads to 50 files per request.
+ /// - **Max library size:** 1 GB total size. No limit to individual file size.
+ /// - **Supported file types:** PDF, DocX, HTML, TXT + ///
+ /// + /// The stream to send as the multipart 'file' file part. + /// + /// + /// + /// + /// + /// + /// + /// Default Value: immediate + /// + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task V1LibraryUploadAsync( + global::System.IO.Stream file, + string filename, + string? path = default, + global::System.Collections.Generic.IList? labels = default, + string? publicUrl = default, + string? customConfigs = default, + global::AI21.UploadMode? uploadMode = default, + global::System.Guid? batchId = default, + string? dataSource = default, + string? metadata = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Upload Workspace File
+ /// Upload files to use for [RAG Engine document searches](https://docs.ai21.com/docs/rag-engine-overview).
+ /// You can assign metadata to your files to limit searches to specific files by file metadata.
+ /// There is no bulk upload method; files must be loaded one at a time.
+ /// - **Max number of files:** No limit. The playground limits bulk uploads to 50 files per request.
+ /// - **Max library size:** 1 GB total size. No limit to individual file size.
+ /// - **Supported file types:** PDF, DocX, HTML, TXT + ///
+ /// + /// The stream to send as the multipart 'file' file part. + /// + /// + /// + /// + /// + /// + /// + /// Default Value: immediate + /// + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> V1LibraryUploadAsResponseAsync( + global::System.IO.Stream file, + string filename, + string? path = default, + global::System.Collections.Generic.IList? labels = default, + string? publicUrl = default, + string? customConfigs = default, + global::AI21.UploadMode? uploadMode = default, + global::System.Guid? batchId = default, + string? dataSource = default, + string? metadata = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.ILibraryManagementClient.g.cs b/src/libs/AI21/Generated/AI21.ILibraryManagementClient.g.cs index 12d429b5..34bf6de6 100644 --- a/src/libs/AI21/Generated/AI21.ILibraryManagementClient.g.cs +++ b/src/libs/AI21/Generated/AI21.ILibraryManagementClient.g.cs @@ -32,6 +32,11 @@ public partial interface ILibraryManagementClient : 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::AI21.AutoSDKClientOptions Options { get; } + /// /// diff --git a/src/libs/AI21/Generated/AI21.IRagEngineClient.V1LibraryManagement.g.cs b/src/libs/AI21/Generated/AI21.IRagEngineClient.V1LibraryManagement.g.cs index 7b721ea8..26a357c8 100644 --- a/src/libs/AI21/Generated/AI21.IRagEngineClient.V1LibraryManagement.g.cs +++ b/src/libs/AI21/Generated/AI21.IRagEngineClient.V1LibraryManagement.g.cs @@ -8,10 +8,23 @@ public partial interface IRagEngineClient /// Get Batch Ingestion 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 V1LibraryManagementAsync( global::System.Guid batchId, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Get Batch Ingestion 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> V1LibraryManagementAsResponseAsync( + global::System.Guid batchId, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IRagEngineClient.V1LibraryManagement2.g.cs b/src/libs/AI21/Generated/AI21.IRagEngineClient.V1LibraryManagement2.g.cs index a37a12c3..ec5592af 100644 --- a/src/libs/AI21/Generated/AI21.IRagEngineClient.V1LibraryManagement2.g.cs +++ b/src/libs/AI21/Generated/AI21.IRagEngineClient.V1LibraryManagement2.g.cs @@ -8,10 +8,23 @@ public partial interface IRagEngineClient /// Generate Documents Signed Url /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// global::System.Threading.Tasks.Task V1LibraryManagement2Async( global::System.Guid fileId, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Generate Documents Signed Url + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> V1LibraryManagement2AsResponseAsync( + global::System.Guid fileId, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IRagEngineClient.V1LibraryManagement3.g.cs b/src/libs/AI21/Generated/AI21.IRagEngineClient.V1LibraryManagement3.g.cs index 1d04ab46..cb271fa6 100644 --- a/src/libs/AI21/Generated/AI21.IRagEngineClient.V1LibraryManagement3.g.cs +++ b/src/libs/AI21/Generated/AI21.IRagEngineClient.V1LibraryManagement3.g.cs @@ -9,10 +9,24 @@ public partial interface IRagEngineClient /// Download parsed document with Content-Disposition header for immediate download. /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// global::System.Threading.Tasks.Task V1LibraryManagement3Async( global::System.Guid fileId, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Download Parsed Document
+ /// Download parsed document with Content-Disposition header for immediate download. + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> V1LibraryManagement3AsResponseAsync( + global::System.Guid fileId, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IRagEngineClient.V1LibrarySearch.g.cs b/src/libs/AI21/Generated/AI21.IRagEngineClient.V1LibrarySearch.g.cs deleted file mode 100644 index 8cc4dd80..00000000 --- a/src/libs/AI21/Generated/AI21.IRagEngineClient.V1LibrarySearch.g.cs +++ /dev/null @@ -1,53 +0,0 @@ -#nullable enable - -namespace AI21 -{ - public partial interface IRagEngineClient - { - /// - /// Search - /// - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task V1LibrarySearchAsync( - - global::AI21.LibrarySearchRequest request, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Search - /// - /// - /// - /// - /// - /// - /// - /// Default Value: AND - /// - /// - /// - /// Default Value: segments - /// - /// - /// Default Value: 1 - /// - /// - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task V1LibrarySearchAsync( - string query, - int? maxSegments = default, - string? path = default, - global::System.Collections.Generic.IList? labels = default, - global::AI21.QueryFilter? labelsFilter = default, - global::AI21.LibrarySearchRequestLabelsFilterMode? labelsFilterMode = default, - global::System.Collections.Generic.IList? fileIds = default, - global::AI21.RetrievalStrategy? retrievalStrategy = default, - int? maxNeighbors = default, - double? retrievalSimilarityThreshold = default, - double? hybridSearchAlpha = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IRagEngineClient.g.cs b/src/libs/AI21/Generated/AI21.IRagEngineClient.g.cs index bcec7a40..4bbac4af 100644 --- a/src/libs/AI21/Generated/AI21.IRagEngineClient.g.cs +++ b/src/libs/AI21/Generated/AI21.IRagEngineClient.g.cs @@ -32,6 +32,11 @@ public partial interface IRagEngineClient : 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::AI21.AutoSDKClientOptions Options { get; } + /// /// diff --git a/src/libs/AI21/Generated/AI21.ISecretsClient.V1SecretStorage.g.cs b/src/libs/AI21/Generated/AI21.ISecretsClient.V1SecretStorage.g.cs index 7972c8bb..ab6bd642 100644 --- a/src/libs/AI21/Generated/AI21.ISecretsClient.V1SecretStorage.g.cs +++ b/src/libs/AI21/Generated/AI21.ISecretsClient.V1SecretStorage.g.cs @@ -7,9 +7,20 @@ public partial interface ISecretsClient /// /// Get Secret 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 V1SecretStorageAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Get Secret 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> V1SecretStorageAsResponseAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.ISecretsClient.V1SecretStorage2.g.cs b/src/libs/AI21/Generated/AI21.ISecretsClient.V1SecretStorage2.g.cs index 81dddf19..0056dc09 100644 --- a/src/libs/AI21/Generated/AI21.ISecretsClient.V1SecretStorage2.g.cs +++ b/src/libs/AI21/Generated/AI21.ISecretsClient.V1SecretStorage2.g.cs @@ -8,22 +8,38 @@ public partial interface ISecretsClient /// Save Secret /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// global::System.Threading.Tasks.Task V1SecretStorage2Async( global::AI21.CreateSecretPayload request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Save Secret + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> V1SecretStorage2AsResponseAsync( + + global::AI21.CreateSecretPayload request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); /// /// Save Secret /// /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// global::System.Threading.Tasks.Task V1SecretStorage2Async( string secretName, string secretValue, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.ISecretsClient.V1SecretStorage3.g.cs b/src/libs/AI21/Generated/AI21.ISecretsClient.V1SecretStorage3.g.cs index 1613c0ed..a0cbac6c 100644 --- a/src/libs/AI21/Generated/AI21.ISecretsClient.V1SecretStorage3.g.cs +++ b/src/libs/AI21/Generated/AI21.ISecretsClient.V1SecretStorage3.g.cs @@ -8,10 +8,23 @@ public partial interface ISecretsClient /// Delete Secret /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// global::System.Threading.Tasks.Task V1SecretStorage3Async( string secretId, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Delete Secret + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> V1SecretStorage3AsResponseAsync( + string secretId, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.ISecretsClient.V1SecretStorage4.g.cs b/src/libs/AI21/Generated/AI21.ISecretsClient.V1SecretStorage4.g.cs index fc445689..52ba1a54 100644 --- a/src/libs/AI21/Generated/AI21.ISecretsClient.V1SecretStorage4.g.cs +++ b/src/libs/AI21/Generated/AI21.ISecretsClient.V1SecretStorage4.g.cs @@ -9,12 +9,28 @@ public partial interface ISecretsClient /// /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// global::System.Threading.Tasks.Task V1SecretStorage4Async( string secretId, global::AI21.UpdateSecretPayload request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Update Secret + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> V1SecretStorage4AsResponseAsync( + string secretId, + + global::AI21.UpdateSecretPayload request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); /// /// Update Secret @@ -22,12 +38,14 @@ public partial interface ISecretsClient /// /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// global::System.Threading.Tasks.Task V1SecretStorage4Async( string secretId, string? secretName = default, string? secretValue = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.ISecretsClient.g.cs b/src/libs/AI21/Generated/AI21.ISecretsClient.g.cs index c907e634..b402273c 100644 --- a/src/libs/AI21/Generated/AI21.ISecretsClient.g.cs +++ b/src/libs/AI21/Generated/AI21.ISecretsClient.g.cs @@ -32,6 +32,11 @@ public partial interface ISecretsClient : 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::AI21.AutoSDKClientOptions Options { get; } + /// /// diff --git a/src/libs/AI21/Generated/AI21.IWebsiteConnectorClient.V1WebsiteConnectorCreateConfig.g.cs b/src/libs/AI21/Generated/AI21.IWebsiteConnectorClient.V1WebsiteConnectorCreateConfig.g.cs index 86d9cef2..399bd67c 100644 --- a/src/libs/AI21/Generated/AI21.IWebsiteConnectorClient.V1WebsiteConnectorCreateConfig.g.cs +++ b/src/libs/AI21/Generated/AI21.IWebsiteConnectorClient.V1WebsiteConnectorCreateConfig.g.cs @@ -8,11 +8,25 @@ public partial interface IWebsiteConnectorClient /// Create Client 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 V1WebsiteConnectorCreateConfigAsync( global::AI21.WebsiteConnectorCreateConfigPayload request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Create Client 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> V1WebsiteConnectorCreateConfigAsResponseAsync( + + global::AI21.WebsiteConnectorCreateConfigPayload request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); /// /// Create Client Config @@ -27,6 +41,7 @@ public partial interface IWebsiteConnectorClient /// /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// global::System.Threading.Tasks.Task V1WebsiteConnectorCreateConfigAsync( @@ -36,6 +51,7 @@ public partial interface IWebsiteConnectorClient bool? extractLinkedFiles = default, bool? waitForDynamicContent = default, string? localization = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IWebsiteConnectorClient.V1WebsiteConnectorGetConfig.g.cs b/src/libs/AI21/Generated/AI21.IWebsiteConnectorClient.V1WebsiteConnectorGetConfig.g.cs index e3f97956..9f6fe084 100644 --- a/src/libs/AI21/Generated/AI21.IWebsiteConnectorClient.V1WebsiteConnectorGetConfig.g.cs +++ b/src/libs/AI21/Generated/AI21.IWebsiteConnectorClient.V1WebsiteConnectorGetConfig.g.cs @@ -8,10 +8,23 @@ public partial interface IWebsiteConnectorClient /// Get Client 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 V1WebsiteConnectorGetConfigAsync( string configName, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Get Client 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> V1WebsiteConnectorGetConfigAsResponseAsync( + string configName, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IWebsiteConnectorClient.V1WebsiteConnectorGetUrlStatus.g.cs b/src/libs/AI21/Generated/AI21.IWebsiteConnectorClient.V1WebsiteConnectorGetUrlStatus.g.cs index 3a652a93..56946002 100644 --- a/src/libs/AI21/Generated/AI21.IWebsiteConnectorClient.V1WebsiteConnectorGetUrlStatus.g.cs +++ b/src/libs/AI21/Generated/AI21.IWebsiteConnectorClient.V1WebsiteConnectorGetUrlStatus.g.cs @@ -8,10 +8,23 @@ public partial interface IWebsiteConnectorClient /// Get Url 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 V1WebsiteConnectorGetUrlStatusAsync( string urlId, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Get Url 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> V1WebsiteConnectorGetUrlStatusAsResponseAsync( + string urlId, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IWebsiteConnectorClient.V1WebsiteConnectorGetWebsiteStatus.g.cs b/src/libs/AI21/Generated/AI21.IWebsiteConnectorClient.V1WebsiteConnectorGetWebsiteStatus.g.cs index 0d7b7b51..8925e60a 100644 --- a/src/libs/AI21/Generated/AI21.IWebsiteConnectorClient.V1WebsiteConnectorGetWebsiteStatus.g.cs +++ b/src/libs/AI21/Generated/AI21.IWebsiteConnectorClient.V1WebsiteConnectorGetWebsiteStatus.g.cs @@ -8,10 +8,23 @@ public partial interface IWebsiteConnectorClient /// Get Website 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 V1WebsiteConnectorGetWebsiteStatusAsync( global::System.Guid websiteId, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Get Website 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> V1WebsiteConnectorGetWebsiteStatusAsResponseAsync( + global::System.Guid websiteId, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IWebsiteConnectorClient.V1WebsiteConnectorIngestUrl.g.cs b/src/libs/AI21/Generated/AI21.IWebsiteConnectorClient.V1WebsiteConnectorIngestUrl.g.cs index 07093148..53a18963 100644 --- a/src/libs/AI21/Generated/AI21.IWebsiteConnectorClient.V1WebsiteConnectorIngestUrl.g.cs +++ b/src/libs/AI21/Generated/AI21.IWebsiteConnectorClient.V1WebsiteConnectorIngestUrl.g.cs @@ -8,20 +8,36 @@ public partial interface IWebsiteConnectorClient /// Connect Website /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// global::System.Threading.Tasks.Task V1WebsiteConnectorIngestUrlAsync( global::AI21.WebsiteConnectorIngestUrlPayload request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Connect Website + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> V1WebsiteConnectorIngestUrlAsResponseAsync( + + global::AI21.WebsiteConnectorIngestUrlPayload request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); /// /// Connect Website /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// global::System.Threading.Tasks.Task V1WebsiteConnectorIngestUrlAsync( string url, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IWebsiteConnectorClient.V1WebsiteConnectorIngestWebsite.g.cs b/src/libs/AI21/Generated/AI21.IWebsiteConnectorClient.V1WebsiteConnectorIngestWebsite.g.cs index bb85a042..02d2ed1f 100644 --- a/src/libs/AI21/Generated/AI21.IWebsiteConnectorClient.V1WebsiteConnectorIngestWebsite.g.cs +++ b/src/libs/AI21/Generated/AI21.IWebsiteConnectorClient.V1WebsiteConnectorIngestWebsite.g.cs @@ -8,11 +8,25 @@ public partial interface IWebsiteConnectorClient /// Ingest Website /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// global::System.Threading.Tasks.Task V1WebsiteConnectorIngestWebsiteAsync( global::AI21.WebsiteConnectorIngestWebsitePayload request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Ingest Website + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> V1WebsiteConnectorIngestWebsiteAsResponseAsync( + + global::AI21.WebsiteConnectorIngestWebsitePayload request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); /// /// Ingest Website @@ -20,12 +34,14 @@ public partial interface IWebsiteConnectorClient /// /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// global::System.Threading.Tasks.Task V1WebsiteConnectorIngestWebsiteAsync( string sitemapUrl, string? clientConfig = default, global::System.Collections.Generic.IList? labels = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IWebsiteConnectorClient.V1WebsiteConnectorRetryIngestWebsite.g.cs b/src/libs/AI21/Generated/AI21.IWebsiteConnectorClient.V1WebsiteConnectorRetryIngestWebsite.g.cs index 0bb623fa..022471df 100644 --- a/src/libs/AI21/Generated/AI21.IWebsiteConnectorClient.V1WebsiteConnectorRetryIngestWebsite.g.cs +++ b/src/libs/AI21/Generated/AI21.IWebsiteConnectorClient.V1WebsiteConnectorRetryIngestWebsite.g.cs @@ -8,20 +8,36 @@ public partial interface IWebsiteConnectorClient /// Retry Ingest Website /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// global::System.Threading.Tasks.Task V1WebsiteConnectorRetryIngestWebsiteAsync( global::AI21.WebsiteConnectorRetryIngestWebsitePayload request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Retry Ingest Website + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> V1WebsiteConnectorRetryIngestWebsiteAsResponseAsync( + + global::AI21.WebsiteConnectorRetryIngestWebsitePayload request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); /// /// Retry Ingest Website /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// global::System.Threading.Tasks.Task V1WebsiteConnectorRetryIngestWebsiteAsync( global::System.Guid websiteId, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IWebsiteConnectorClient.g.cs b/src/libs/AI21/Generated/AI21.IWebsiteConnectorClient.g.cs index 8ea65461..6cbae123 100644 --- a/src/libs/AI21/Generated/AI21.IWebsiteConnectorClient.g.cs +++ b/src/libs/AI21/Generated/AI21.IWebsiteConnectorClient.g.cs @@ -32,6 +32,11 @@ public partial interface IWebsiteConnectorClient : 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::AI21.AutoSDKClientOptions Options { get; } + /// /// diff --git a/src/libs/AI21/Generated/AI21.JambaCompleteClient.V1ChatComplete.g.cs b/src/libs/AI21/Generated/AI21.JambaCompleteClient.V1ChatComplete.g.cs index 9d36c496..ca03f617 100644 --- a/src/libs/AI21/Generated/AI21.JambaCompleteClient.V1ChatComplete.g.cs +++ b/src/libs/AI21/Generated/AI21.JambaCompleteClient.V1ChatComplete.g.cs @@ -14,6 +14,7 @@ public partial class JambaCompleteClient { new global::AI21.EndPointAuthorizationRequirement { Type = "Http", + SchemeId = "HttpBearer", Location = "Header", Name = "Bearer", FriendlyName = "Bearer", @@ -49,11 +50,40 @@ partial void ProcessV1ChatCompleteResponseContent( /// token is generated, rather than waiting for the entire response. /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// public async global::System.Threading.Tasks.Task>> V1ChatCompleteAsync( global::AI21.ChatRequest request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await V1ChatCompleteAsResponseAsync( + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Studio Chat Complete
+ /// This is the endpoint for the [Jamba Instruct model](https://docs.ai21.com/docs/jamba-models).
+ /// This is a foundation model that supports both single-turn (question answering,
+ /// text completion) and multi-turn (chat style) interactions.
+ /// You can optionally stream results if you want to get the response as each
+ /// token is generated, rather than waiting for the entire response. + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task>>> V1ChatCompleteAsResponseAsync( + + global::AI21.ChatRequest request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) { request = request ?? throw new global::System.ArgumentNullException(nameof(request)); @@ -70,22 +100,44 @@ partial void ProcessV1ChatCompleteResponseContent( securityRequirements: s_V1ChatCompleteSecurityRequirements, operationName: "V1ChatCompleteAsync"); - var __pathBuilder = new global::AI21.PathBuilder( - path: "/studio/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)); + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: false); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: "/studio/v1/chat/completions", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.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; + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; #endif foreach (var __authorization in __authorizations) { if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2") + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") { __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( scheme: __authorization.Name, @@ -95,156 +147,336 @@ partial void ProcessV1ChatCompleteResponseContent( __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); - PrepareV1ChatCompleteRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - request: request); + 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::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareV1ChatCompleteRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + request: request); - ProcessResponse( - client: HttpClient, - response: __response); - ProcessV1ChatCompleteResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Validation Error - if ((int)__response.StatusCode == 422) + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::AI21.HTTPValidationError? __value_422 = null; - try + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) { - if (ReadResponseAsString) + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1ChatComplete", + methodName: "V1ChatCompleteAsync", + pathTemplate: "\"/studio/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 { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); } - else + catch (global::System.Net.Http.HttpRequestException __exception) { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1ChatComplete", + methodName: "V1ChatCompleteAsync", + pathTemplate: "\"/studio/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; + } - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1ChatComplete", + methodName: "V1ChatCompleteAsync", + pathTemplate: "\"/studio/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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; } - catch (global::System.Exception __ex) + + if (__response == null) { - __exception_422 = __ex; + throw new global::System.InvalidOperationException("No response received."); } - throw new global::AI21.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) + using (__response) { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - ProcessResponseContent( + ProcessResponse( client: HttpClient, - response: __response, - content: ref __content); - ProcessV1ChatCompleteResponseContent( + response: __response); + ProcessV1ChatCompleteResponse( httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) { - __response.EnsureSuccessStatusCode(); - - return - global::AI21.AnyOf>.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1ChatComplete", + methodName: "V1ChatCompleteAsync", + pathTemplate: "\"/studio/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); } - catch (global::System.Exception __ex) + else { - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1ChatComplete", + methodName: "V1ChatCompleteAsync", + pathTemplate: "\"/studio/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 - { - try - { - __response.EnsureSuccessStatusCode(); - using var __content = await __response.Content.ReadAsStreamAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::AI21.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - return - await global::AI21.AnyOf>.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) - { - } + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessV1ChatCompleteResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::AI21.AnyOf>.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::AI21.AutoSDKHttpResponse>>( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => 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::AI21.AnyOf>.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::AI21.AutoSDKHttpResponse>>( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; } } + finally + { + __httpRequest?.Dispose(); + } } /// /// Studio Chat Complete
@@ -313,6 +545,7 @@ partial void ProcessV1ChatCompleteResponseContent( /// /// Default Value: {"type":"text"} /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// public async global::System.Threading.Tasks.Task>> V1ChatCompleteAsync( @@ -328,6 +561,7 @@ partial void ProcessV1ChatCompleteResponseContent( global::AI21.MockResponseConfig? mockResponse = default, global::System.Collections.Generic.IList? documents = default, global::AI21.ResponseFormat? responseFormat = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) { var __request = new global::AI21.ChatRequest @@ -348,6 +582,7 @@ partial void ProcessV1ChatCompleteResponseContent( return await V1ChatCompleteAsync( request: __request, + requestOptions: requestOptions, cancellationToken: cancellationToken).ConfigureAwait(false); } } diff --git a/src/libs/AI21/Generated/AI21.JambaCompleteClient.g.cs b/src/libs/AI21/Generated/AI21.JambaCompleteClient.g.cs index 0d11eb06..c98f5abf 100644 --- a/src/libs/AI21/Generated/AI21.JambaCompleteClient.g.cs +++ b/src/libs/AI21/Generated/AI21.JambaCompleteClient.g.cs @@ -30,6 +30,9 @@ public sealed partial class JambaCompleteClient : global::AI21.IJambaCompleteCli #if DEBUG = true; #endif + + /// + public global::AI21.AutoSDKClientOptions Options { get; } /// /// /// @@ -49,11 +52,58 @@ public JambaCompleteClient( 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 JambaCompleteClient 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 JambaCompleteClient( + global::System.Net.Http.HttpClient? httpClient, + global::System.Collections.Generic.List? authorizations, + global::AI21.AutoSDKClientOptions? options, + bool disposeHttpClient = true) : this( + httpClient, + baseUri: null, + authorizations, + options, + disposeHttpClient: disposeHttpClient) + { + } + + /// + /// Creates a new instance of the JambaCompleteClient. + /// 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 JambaCompleteClient( + global::System.Net.Http.HttpClient? httpClient, + global::System.Uri? baseUri, + global::System.Collections.Generic.List? authorizations, + global::AI21.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::AI21.AutoSDKClientOptions(); _disposeHttpClient = disposeHttpClient; Initialized(HttpClient); diff --git a/src/libs/AI21/Generated/AI21.JsonConverters.AnyOf2.g.cs b/src/libs/AI21/Generated/AI21.JsonConverters.AnyOf2.g.cs index 32f791d7..724f46b9 100644 --- a/src/libs/AI21/Generated/AI21.JsonConverters.AnyOf2.g.cs +++ b/src/libs/AI21/Generated/AI21.JsonConverters.AnyOf2.g.cs @@ -3,7 +3,7 @@ namespace AI21.JsonConverters { /// - public class AnyOfJsonConverter<[global::System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembers(global::System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicProperties)] T1, [global::System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembers(global::System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicProperties)] T2> : global::System.Text.Json.Serialization.JsonConverter> + public class AnyOfJsonConverter : global::System.Text.Json.Serialization.JsonConverter> { /// public override global::AI21.AnyOf Read( @@ -107,7 +107,10 @@ public class AnyOfJsonConverter<[global::System.Diagnostics.CodeAnalysis.Dynamic catch (global::System.InvalidOperationException) { } + } + if (value1 == null && value2 == null) + { try { diff --git a/src/libs/AI21/Generated/AI21.JsonConverters.AnyOf4.g.cs b/src/libs/AI21/Generated/AI21.JsonConverters.AnyOf4.g.cs index 35bb24f2..989d04a0 100644 --- a/src/libs/AI21/Generated/AI21.JsonConverters.AnyOf4.g.cs +++ b/src/libs/AI21/Generated/AI21.JsonConverters.AnyOf4.g.cs @@ -3,7 +3,7 @@ namespace AI21.JsonConverters { /// - public class AnyOfJsonConverter<[global::System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembers(global::System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicProperties)] T1, [global::System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembers(global::System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicProperties)] T2, [global::System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembers(global::System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicProperties)] T3, [global::System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembers(global::System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicProperties)] T4> : global::System.Text.Json.Serialization.JsonConverter> + public class AnyOfJsonConverter : global::System.Text.Json.Serialization.JsonConverter> { /// public override global::AI21.AnyOf Read( @@ -167,7 +167,10 @@ public class AnyOfJsonConverter<[global::System.Diagnostics.CodeAnalysis.Dynamic catch (global::System.InvalidOperationException) { } + } + if (value1 == null && value2 == null && value3 == null && value4 == null) + { try { @@ -181,7 +184,10 @@ public class AnyOfJsonConverter<[global::System.Diagnostics.CodeAnalysis.Dynamic catch (global::System.InvalidOperationException) { } + } + if (value1 == null && value2 == null && value3 == null && value4 == null) + { try { @@ -195,7 +201,10 @@ public class AnyOfJsonConverter<[global::System.Diagnostics.CodeAnalysis.Dynamic catch (global::System.InvalidOperationException) { } + } + if (value1 == null && value2 == null && value3 == null && value4 == null) + { try { diff --git a/src/libs/AI21/Generated/AI21.JsonConverters.ConnectorsWorkflowStatus.g.cs b/src/libs/AI21/Generated/AI21.JsonConverters.ConnectorsWorkflowStatus.g.cs deleted file mode 100644 index 9e03796b..00000000 --- a/src/libs/AI21/Generated/AI21.JsonConverters.ConnectorsWorkflowStatus.g.cs +++ /dev/null @@ -1,53 +0,0 @@ -#nullable enable - -namespace AI21.JsonConverters -{ - /// - public sealed class ConnectorsWorkflowStatusJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::AI21.ConnectorsWorkflowStatus 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::AI21.ConnectorsWorkflowStatusExtensions.ToEnum(stringValue) ?? default; - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::AI21.ConnectorsWorkflowStatus)numValue; - } - case global::System.Text.Json.JsonTokenType.Null: - { - return default(global::AI21.ConnectorsWorkflowStatus); - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::AI21.ConnectorsWorkflowStatus value, - global::System.Text.Json.JsonSerializerOptions options) - { - writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - - writer.WriteStringValue(global::AI21.ConnectorsWorkflowStatusExtensions.ToValueString(value)); - } - } -} diff --git a/src/libs/AI21/Generated/AI21.JsonConverters.ConnectorsWorkflowStatusNullable.g.cs b/src/libs/AI21/Generated/AI21.JsonConverters.ConnectorsWorkflowStatusNullable.g.cs deleted file mode 100644 index 4a3a801f..00000000 --- a/src/libs/AI21/Generated/AI21.JsonConverters.ConnectorsWorkflowStatusNullable.g.cs +++ /dev/null @@ -1,60 +0,0 @@ -#nullable enable - -namespace AI21.JsonConverters -{ - /// - public sealed class ConnectorsWorkflowStatusNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::AI21.ConnectorsWorkflowStatus? 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::AI21.ConnectorsWorkflowStatusExtensions.ToEnum(stringValue); - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::AI21.ConnectorsWorkflowStatus)numValue; - } - case global::System.Text.Json.JsonTokenType.Null: - { - return default(global::AI21.ConnectorsWorkflowStatus?); - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::AI21.ConnectorsWorkflowStatus? 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::AI21.ConnectorsWorkflowStatusExtensions.ToValueString(value.Value)); - } - } - } -} diff --git a/src/libs/AI21/Generated/AI21.JsonConverters.LibrarySearchRequestLabelsFilterMode.g.cs b/src/libs/AI21/Generated/AI21.JsonConverters.LibrarySearchRequestLabelsFilterMode.g.cs deleted file mode 100644 index 7da1b95a..00000000 --- a/src/libs/AI21/Generated/AI21.JsonConverters.LibrarySearchRequestLabelsFilterMode.g.cs +++ /dev/null @@ -1,53 +0,0 @@ -#nullable enable - -namespace AI21.JsonConverters -{ - /// - public sealed class LibrarySearchRequestLabelsFilterModeJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::AI21.LibrarySearchRequestLabelsFilterMode 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::AI21.LibrarySearchRequestLabelsFilterModeExtensions.ToEnum(stringValue) ?? default; - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::AI21.LibrarySearchRequestLabelsFilterMode)numValue; - } - case global::System.Text.Json.JsonTokenType.Null: - { - return default(global::AI21.LibrarySearchRequestLabelsFilterMode); - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::AI21.LibrarySearchRequestLabelsFilterMode value, - global::System.Text.Json.JsonSerializerOptions options) - { - writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - - writer.WriteStringValue(global::AI21.LibrarySearchRequestLabelsFilterModeExtensions.ToValueString(value)); - } - } -} diff --git a/src/libs/AI21/Generated/AI21.JsonConverters.LibrarySearchRequestLabelsFilterModeNullable.g.cs b/src/libs/AI21/Generated/AI21.JsonConverters.LibrarySearchRequestLabelsFilterModeNullable.g.cs deleted file mode 100644 index d55d7160..00000000 --- a/src/libs/AI21/Generated/AI21.JsonConverters.LibrarySearchRequestLabelsFilterModeNullable.g.cs +++ /dev/null @@ -1,60 +0,0 @@ -#nullable enable - -namespace AI21.JsonConverters -{ - /// - public sealed class LibrarySearchRequestLabelsFilterModeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::AI21.LibrarySearchRequestLabelsFilterMode? 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::AI21.LibrarySearchRequestLabelsFilterModeExtensions.ToEnum(stringValue); - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::AI21.LibrarySearchRequestLabelsFilterMode)numValue; - } - case global::System.Text.Json.JsonTokenType.Null: - { - return default(global::AI21.LibrarySearchRequestLabelsFilterMode?); - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::AI21.LibrarySearchRequestLabelsFilterMode? 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::AI21.LibrarySearchRequestLabelsFilterModeExtensions.ToValueString(value.Value)); - } - } - } -} diff --git a/src/libs/AI21/Generated/AI21.JsonConverters.ParagonSyncStatus.g.cs b/src/libs/AI21/Generated/AI21.JsonConverters.ParagonSyncStatus.g.cs deleted file mode 100644 index cf839258..00000000 --- a/src/libs/AI21/Generated/AI21.JsonConverters.ParagonSyncStatus.g.cs +++ /dev/null @@ -1,53 +0,0 @@ -#nullable enable - -namespace AI21.JsonConverters -{ - /// - public sealed class ParagonSyncStatusJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::AI21.ParagonSyncStatus 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::AI21.ParagonSyncStatusExtensions.ToEnum(stringValue) ?? default; - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::AI21.ParagonSyncStatus)numValue; - } - case global::System.Text.Json.JsonTokenType.Null: - { - return default(global::AI21.ParagonSyncStatus); - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::AI21.ParagonSyncStatus value, - global::System.Text.Json.JsonSerializerOptions options) - { - writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - - writer.WriteStringValue(global::AI21.ParagonSyncStatusExtensions.ToValueString(value)); - } - } -} diff --git a/src/libs/AI21/Generated/AI21.JsonConverters.ParagonSyncStatusNullable.g.cs b/src/libs/AI21/Generated/AI21.JsonConverters.ParagonSyncStatusNullable.g.cs deleted file mode 100644 index 8caf6eef..00000000 --- a/src/libs/AI21/Generated/AI21.JsonConverters.ParagonSyncStatusNullable.g.cs +++ /dev/null @@ -1,60 +0,0 @@ -#nullable enable - -namespace AI21.JsonConverters -{ - /// - public sealed class ParagonSyncStatusNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::AI21.ParagonSyncStatus? 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::AI21.ParagonSyncStatusExtensions.ToEnum(stringValue); - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::AI21.ParagonSyncStatus)numValue; - } - case global::System.Text.Json.JsonTokenType.Null: - { - return default(global::AI21.ParagonSyncStatus?); - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::AI21.ParagonSyncStatus? 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::AI21.ParagonSyncStatusExtensions.ToValueString(value.Value)); - } - } - } -} diff --git a/src/libs/AI21/Generated/AI21.JsonConverters.QueryFilter.g.cs b/src/libs/AI21/Generated/AI21.JsonConverters.QueryFilter.g.cs index cde9bcb7..b64b07d9 100644 --- a/src/libs/AI21/Generated/AI21.JsonConverters.QueryFilter.g.cs +++ b/src/libs/AI21/Generated/AI21.JsonConverters.QueryFilter.g.cs @@ -138,7 +138,10 @@ public class QueryFilterJsonConverter : global::System.Text.Json.Serialization.J catch (global::System.InvalidOperationException) { } + } + if (comparisonOperator == null && logicalOperator == null && queryFilterVariant3 == null) + { try { @@ -152,7 +155,10 @@ public class QueryFilterJsonConverter : global::System.Text.Json.Serialization.J catch (global::System.InvalidOperationException) { } + } + if (comparisonOperator == null && logicalOperator == null && queryFilterVariant3 == null) + { try { diff --git a/src/libs/AI21/Generated/AI21.JsonConverters.WebsiteConnectorPayloadType.g.cs b/src/libs/AI21/Generated/AI21.JsonConverters.WebsiteConnectorPayloadType.g.cs deleted file mode 100644 index b05f295d..00000000 --- a/src/libs/AI21/Generated/AI21.JsonConverters.WebsiteConnectorPayloadType.g.cs +++ /dev/null @@ -1,53 +0,0 @@ -#nullable enable - -namespace AI21.JsonConverters -{ - /// - public sealed class WebsiteConnectorPayloadTypeJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::AI21.WebsiteConnectorPayloadType 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::AI21.WebsiteConnectorPayloadTypeExtensions.ToEnum(stringValue) ?? default; - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::AI21.WebsiteConnectorPayloadType)numValue; - } - case global::System.Text.Json.JsonTokenType.Null: - { - return default(global::AI21.WebsiteConnectorPayloadType); - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::AI21.WebsiteConnectorPayloadType value, - global::System.Text.Json.JsonSerializerOptions options) - { - writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - - writer.WriteStringValue(global::AI21.WebsiteConnectorPayloadTypeExtensions.ToValueString(value)); - } - } -} diff --git a/src/libs/AI21/Generated/AI21.JsonConverters.WebsiteConnectorPayloadTypeNullable.g.cs b/src/libs/AI21/Generated/AI21.JsonConverters.WebsiteConnectorPayloadTypeNullable.g.cs deleted file mode 100644 index 0a83fe7c..00000000 --- a/src/libs/AI21/Generated/AI21.JsonConverters.WebsiteConnectorPayloadTypeNullable.g.cs +++ /dev/null @@ -1,60 +0,0 @@ -#nullable enable - -namespace AI21.JsonConverters -{ - /// - public sealed class WebsiteConnectorPayloadTypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::AI21.WebsiteConnectorPayloadType? 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::AI21.WebsiteConnectorPayloadTypeExtensions.ToEnum(stringValue); - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::AI21.WebsiteConnectorPayloadType)numValue; - } - case global::System.Text.Json.JsonTokenType.Null: - { - return default(global::AI21.WebsiteConnectorPayloadType?); - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::AI21.WebsiteConnectorPayloadType? 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::AI21.WebsiteConnectorPayloadTypeExtensions.ToValueString(value.Value)); - } - } - } -} diff --git a/src/libs/AI21/Generated/AI21.JsonSerializerContext.g.cs b/src/libs/AI21/Generated/AI21.JsonSerializerContext.g.cs index ef287e0c..82c963db 100644 --- a/src/libs/AI21/Generated/AI21.JsonSerializerContext.g.cs +++ b/src/libs/AI21/Generated/AI21.JsonSerializerContext.g.cs @@ -41,10 +41,6 @@ namespace AI21 typeof(global::AI21.JsonConverters.ChatStreamingFirstDeltaRoleNullableJsonConverter), - typeof(global::AI21.JsonConverters.ConnectorsWorkflowStatusJsonConverter), - - typeof(global::AI21.JsonConverters.ConnectorsWorkflowStatusNullableJsonConverter), - typeof(global::AI21.JsonConverters.CreateMaestroRunsPayloadBudgetJsonConverter), typeof(global::AI21.JsonConverters.CreateMaestroRunsPayloadBudgetNullableJsonConverter), @@ -93,10 +89,6 @@ namespace AI21 typeof(global::AI21.JsonConverters.HTTPToolResourceTypeNullableJsonConverter), - typeof(global::AI21.JsonConverters.LibrarySearchRequestLabelsFilterModeJsonConverter), - - typeof(global::AI21.JsonConverters.LibrarySearchRequestLabelsFilterModeNullableJsonConverter), - typeof(global::AI21.JsonConverters.MCPToolResourceTypeJsonConverter), typeof(global::AI21.JsonConverters.MCPToolResourceTypeNullableJsonConverter), @@ -121,10 +113,6 @@ namespace AI21 typeof(global::AI21.JsonConverters.ModifyAssistantRequestResponseLanguageNullableJsonConverter), - typeof(global::AI21.JsonConverters.ParagonSyncStatusJsonConverter), - - typeof(global::AI21.JsonConverters.ParagonSyncStatusNullableJsonConverter), - typeof(global::AI21.JsonConverters.ResponseFormatTypeJsonConverter), typeof(global::AI21.JsonConverters.ResponseFormatTypeNullableJsonConverter), @@ -177,10 +165,6 @@ namespace AI21 typeof(global::AI21.JsonConverters.WebSearchToolResourceTypeNullableJsonConverter), - typeof(global::AI21.JsonConverters.WebsiteConnectorPayloadTypeJsonConverter), - - typeof(global::AI21.JsonConverters.WebsiteConnectorPayloadTypeNullableJsonConverter), - typeof(global::AI21.JsonConverters.LanguageStudioApiServerDataTypesChatToolDefinitionTypeJsonConverter), typeof(global::AI21.JsonConverters.LanguageStudioApiServerDataTypesChatToolDefinitionTypeNullableJsonConverter), @@ -207,21 +191,23 @@ namespace AI21 typeof(global::AI21.JsonConverters.AnyOfJsonConverter), - typeof(global::AI21.JsonConverters.AnyOfJsonConverter>), - typeof(global::AI21.JsonConverters.AnyOfJsonConverter>), typeof(global::AI21.JsonConverters.UnixTimestampJsonConverter), })] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::AI21.JsonSerializerContextTypes))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::AI21.Assistant))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::AI21.AgentCreate))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(string))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.DateTime))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(bool))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::AI21.AgentOptimization))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::AI21.AgentOut))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Guid))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.DateTime))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::AI21.AgentUpdate))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::AI21.Assistant))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::AI21.AnyOf, global::System.Collections.Generic.IList>), TypeInfoPropertyName = "AnyOfIListGuidIListString2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Guid))] - [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::AI21.LanguageStudioApiServerDataTypesExecutionEngineToolDefinition), TypeInfoPropertyName = "LanguageStudioApiServerDataTypesExecutionEngineToolDefinition2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] @@ -289,15 +275,11 @@ namespace AI21 [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::AI21.ToolCallDeltaStart))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::AI21.CompareTextRequest))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::AI21.ComparisonOperator))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::AI21.ConnectorConnectionStatus))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::AI21.ParagonSyncStatus), TypeInfoPropertyName = "ParagonSyncStatus2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::AI21.ConnectorsDataSources))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::AI21.DataSourceMetadata))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::AI21.ConnectorsStatus))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::AI21.ConnectorsWorkflowStatus), TypeInfoPropertyName = "ConnectorsWorkflowStatus2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::AI21.ConnectorsSyncParams))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::AI21.ConnectorsToken))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::AI21.ConfigProfileCreate))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::AI21.ConfigProfileOut))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::AI21.ConfigProfileUpdate))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::AI21.ConfigSchemaOut))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::AI21.CreateAssistantRequest))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::AI21.CreateMCPStorageRequest))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::AI21.CreateMaestroRunsPayload))] @@ -308,7 +290,6 @@ namespace AI21 [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::AI21.LanguageStudioApiServerDataTypesExecutionEngineRequirement))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::AI21.CreateMaestroRunsPayloadBudget), TypeInfoPropertyName = "CreateMaestroRunsPayloadBudget2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::AI21.CreateMaestroRunsPayloadVariant), TypeInfoPropertyName = "CreateMaestroRunsPayloadVariant2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::AI21.CreateMaestroRunsPayloadResponseLanguage), TypeInfoPropertyName = "CreateMaestroRunsPayloadResponseLanguage2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::AI21.CreateOrganizationSchemaRequest))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::AI21.CreatePlanPayload))] @@ -357,8 +338,6 @@ namespace AI21 [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::AI21.IngestionBatchStatusResponse))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::AI21.JambaExecuteRequest))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::AI21.LibrarySearchRequest))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::AI21.LibrarySearchRequestLabelsFilterMode), TypeInfoPropertyName = "LibrarySearchRequestLabelsFilterMode2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::AI21.ListAssistantsResponse))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::AI21.ListMCPsStorageResponse))] @@ -374,10 +353,6 @@ namespace AI21 [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::AI21.LogprobsData))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::AI21.TopLogprobsData))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::AI21.MCPDefinition))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::AI21.MCPDiscoveryResponse))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::AI21.MCPTool))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::AI21.MCPToolResource))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::AI21.MCPToolResourceType), TypeInfoPropertyName = "MCPToolResourceType2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::AI21.MaestroRunError))] @@ -407,8 +382,6 @@ namespace AI21 [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::AI21.RunAssistantRequestResponseLanguage), TypeInfoPropertyName = "RunAssistantRequestResponseLanguage2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::AI21.SecretResponse))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::AI21.SystemMessageRole), TypeInfoPropertyName = "SystemMessageRole2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::AI21.ThreadNameGenerationRequest))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::AI21.ThreadNameGenerationResponse))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::AI21.ToolCallType), TypeInfoPropertyName = "ToolCallType2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::AI21.ToolFunction))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::AI21.ToolFunctionDelta))] @@ -428,8 +401,6 @@ namespace AI21 [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::AI21.WebsiteConnectorCreateConfigPayload))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::AI21.WebsiteConnectorIngestUrlPayload))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::AI21.WebsiteConnectorIngestWebsitePayload))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::AI21.WebsiteConnectorPayload))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::AI21.WebsiteConnectorPayloadType), TypeInfoPropertyName = "WebsiteConnectorPayloadType2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::AI21.WebsiteConnectorRetryIngestWebsitePayload))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::AI21.WorkspaceModelResponse))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::AI21.WorkspaceModelUpdate))] @@ -443,9 +414,12 @@ namespace AI21 [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::AI21.AnyOf, 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))] @@ -460,11 +434,10 @@ namespace AI21 [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::AI21.AnyOf, string>))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] @@ -475,7 +448,6 @@ namespace AI21 [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.Dictionary>))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] @@ -486,6 +458,9 @@ namespace AI21 [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] public sealed partial class SourceGenerationContext : global::System.Text.Json.Serialization.JsonSerializerContext { } diff --git a/src/libs/AI21/Generated/AI21.JsonSerializerContextTypes.g.cs b/src/libs/AI21/Generated/AI21.JsonSerializerContextTypes.g.cs index 550dad63..88d47290 100644 --- a/src/libs/AI21/Generated/AI21.JsonSerializerContextTypes.g.cs +++ b/src/libs/AI21/Generated/AI21.JsonSerializerContextTypes.g.cs @@ -28,7 +28,7 @@ public sealed partial class JsonSerializerContextTypes /// /// /// - public global::AI21.Assistant? Type0 { get; set; } + public global::AI21.AgentCreate? Type0 { get; set; } /// /// /// @@ -36,19 +36,19 @@ public sealed partial class JsonSerializerContextTypes /// /// /// - public global::System.DateTime? Type2 { get; set; } + public bool? Type2 { get; set; } /// /// /// - public bool? Type3 { get; set; } + public global::AI21.AgentOptimization? Type3 { get; set; } /// /// /// - public global::AI21.AnyOf, global::System.Collections.Generic.IList>? Type4 { get; set; } + public global::System.Collections.Generic.IList? Type4 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type5 { get; set; } + public global::AI21.AgentOut? Type5 { get; set; } /// /// /// @@ -56,311 +56,311 @@ public sealed partial class JsonSerializerContextTypes /// /// /// - public global::System.Collections.Generic.IList? Type7 { get; set; } + public global::System.DateTime? Type7 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type8 { get; set; } + public global::AI21.AgentUpdate? Type8 { get; set; } /// /// /// - public global::AI21.LanguageStudioApiServerDataTypesExecutionEngineToolDefinition? Type9 { get; set; } + public global::AI21.Assistant? Type9 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type10 { get; set; } + public global::AI21.AnyOf, global::System.Collections.Generic.IList>? Type10 { get; set; } /// /// /// - public global::AI21.LanguageStudioApiServerDataTypesAssistantRequirement? Type11 { get; set; } + public global::System.Collections.Generic.IList? Type11 { get; set; } /// /// /// - public global::AI21.BudgetLevel? Type12 { get; set; } + public global::System.Collections.Generic.IList? Type12 { get; set; } /// /// /// - public global::AI21.Visibility? Type13 { get; set; } + public global::AI21.LanguageStudioApiServerDataTypesExecutionEngineToolDefinition? Type13 { get; set; } /// /// /// - public global::AI21.AssistantType? Type14 { get; set; } + public global::System.Collections.Generic.IList? Type14 { get; set; } /// /// /// - public global::AI21.AssistantResponseLanguage? Type15 { get; set; } + public global::AI21.LanguageStudioApiServerDataTypesAssistantRequirement? Type15 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type16 { get; set; } + public global::AI21.BudgetLevel? Type16 { get; set; } /// /// /// - public global::AI21.StarterQuestion? Type17 { get; set; } + public global::AI21.Visibility? Type17 { get; set; } /// /// /// - public global::AI21.WorkflowConfig? Type18 { get; set; } + public global::AI21.AssistantType? Type18 { get; set; } /// /// /// - public object? Type19 { get; set; } + public global::AI21.AssistantResponseLanguage? Type19 { get; set; } /// /// /// - public global::AI21.AssistantBasicInfo? Type20 { get; set; } + public global::System.Collections.Generic.IList? Type20 { get; set; } /// /// /// - public global::AI21.AssistantMessage? Type21 { get; set; } + public global::AI21.StarterQuestion? Type21 { get; set; } /// /// /// - public global::AI21.AssistantMessageRole? Type22 { get; set; } + public global::AI21.WorkflowConfig? Type22 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type23 { get; set; } + public object? Type23 { get; set; } /// /// /// - public global::AI21.ToolCall? Type24 { get; set; } + public global::AI21.AssistantBasicInfo? Type24 { get; set; } /// /// /// - public global::AI21.AssistantRoute? Type25 { get; set; } + public global::AI21.AssistantMessage? Type25 { get; set; } /// /// /// - public global::AI21.AssistantsByMcpResponse? Type26 { get; set; } + public global::AI21.AssistantMessageRole? Type26 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type27 { get; set; } + public global::System.Collections.Generic.IList? Type27 { get; set; } /// /// /// - public global::AI21.AuthenticationType? Type28 { get; set; } + public global::AI21.ToolCall? Type28 { get; set; } /// /// /// - public global::AI21.BodyConvertDocumentFileStudioV1ChatFilesConvertPost? Type29 { get; set; } + public global::AI21.AssistantRoute? Type29 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type30 { get; set; } + public global::AI21.AssistantsByMcpResponse? Type30 { get; set; } /// /// /// - public byte[]? Type31 { get; set; } + public global::System.Collections.Generic.IList? Type31 { get; set; } /// /// /// - public global::AI21.BodyParsePdfStudioV1DemosDocumentModifierParsePdfPost? Type32 { get; set; } + public global::AI21.AuthenticationType? Type32 { get; set; } /// /// /// - public global::AI21.BodyProcessRfiDocumentStudioV1DemosRfiProcessRfiPost? Type33 { get; set; } + public global::AI21.BodyConvertDocumentFileStudioV1ChatFilesConvertPost? Type33 { get; set; } /// /// /// - public global::AI21.BodyUploadCheckComplianceStudioV1DemosRegulationsUploadCheckCompliancePost? Type34 { get; set; } + public global::System.Collections.Generic.IList? Type34 { get; set; } /// /// /// - public global::AI21.BodyV1LibraryUpload? Type35 { get; set; } + public byte[]? Type35 { get; set; } /// /// /// - public global::AI21.UploadMode? Type36 { get; set; } + public global::AI21.BodyParsePdfStudioV1DemosDocumentModifierParsePdfPost? Type36 { get; set; } /// /// /// - public global::AI21.ChatCompletion? Type37 { get; set; } + public global::AI21.BodyProcessRfiDocumentStudioV1DemosRfiProcessRfiPost? Type37 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type38 { get; set; } + public global::AI21.BodyUploadCheckComplianceStudioV1DemosRegulationsUploadCheckCompliancePost? Type38 { get; set; } /// /// /// - public global::AI21.ChatCompletionResponseChoice? Type39 { get; set; } + public global::AI21.BodyV1LibraryUpload? Type39 { get; set; } /// /// /// - public global::AI21.UsageInfo? Type40 { get; set; } + public global::AI21.UploadMode? Type40 { get; set; } /// /// /// - public int? Type41 { get; set; } + public global::AI21.ChatCompletion? Type41 { get; set; } /// /// /// - public global::AI21.Logprobs? Type42 { get; set; } + public global::System.Collections.Generic.IList? Type42 { get; set; } /// /// /// - public global::AI21.ChatCompletionResponseDeltaChoice? Type43 { get; set; } + public global::AI21.ChatCompletionResponseChoice? Type43 { get; set; } /// /// /// - public global::AI21.AnyOf? Type44 { get; set; } + public global::AI21.UsageInfo? Type44 { get; set; } /// /// /// - public global::AI21.ChatStreamingFirstDelta? Type45 { get; set; } + public int? Type45 { get; set; } /// /// /// - public global::AI21.ChatStreamingContentDelta? Type46 { get; set; } + public global::AI21.Logprobs? Type46 { get; set; } /// /// /// - public global::AI21.ChatStreamingToolCallsFirstDelta? Type47 { get; set; } + public global::AI21.ChatCompletionResponseDeltaChoice? Type47 { get; set; } /// /// /// - public global::AI21.ChatStreamingToolCallsDelta? Type48 { get; set; } + public global::AI21.AnyOf? Type48 { get; set; } /// /// /// - public global::AI21.ChatCompletionVllmStreamingMessage? Type49 { get; set; } + public global::AI21.ChatStreamingFirstDelta? Type49 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type50 { get; set; } + public global::AI21.ChatStreamingContentDelta? Type50 { get; set; } /// /// /// - public global::AI21.ChatRequest? Type51 { get; set; } + public global::AI21.ChatStreamingToolCallsFirstDelta? Type51 { get; set; } /// /// /// - public global::AI21.ModelName? Type52 { get; set; } + public global::AI21.ChatStreamingToolCallsDelta? Type52 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type53 { get; set; } + public global::AI21.ChatCompletionVllmStreamingMessage? Type53 { get; set; } /// /// /// - public global::AI21.MessagesItem? Type54 { get; set; } + public global::System.Collections.Generic.IList? Type54 { get; set; } /// /// /// - public global::AI21.UserMessage? Type55 { get; set; } + public global::AI21.ChatRequest? Type55 { get; set; } /// /// /// - public global::AI21.ToolMessage? Type56 { get; set; } + public global::AI21.ModelName? Type56 { get; set; } /// /// /// - public global::AI21.SystemMessage? Type57 { get; set; } + public global::System.Collections.Generic.IList? Type57 { get; set; } /// /// /// - public global::AI21.ChatRequestMessageDiscriminator? Type58 { get; set; } + public global::AI21.MessagesItem? Type58 { get; set; } /// /// /// - public global::AI21.ChatRequestMessageDiscriminatorRole? Type59 { get; set; } + public global::AI21.UserMessage? Type59 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type60 { get; set; } + public global::AI21.ToolMessage? Type60 { get; set; } /// /// /// - public global::AI21.LanguageStudioApiServerDataTypesChatToolDefinition? Type61 { get; set; } + public global::AI21.SystemMessage? Type61 { get; set; } /// /// /// - public double? Type62 { get; set; } + public global::AI21.ChatRequestMessageDiscriminator? Type62 { get; set; } /// /// /// - public global::AI21.AnyOf>? Type63 { get; set; } + public global::AI21.ChatRequestMessageDiscriminatorRole? Type63 { get; set; } /// /// /// - public global::AI21.MockResponseConfig? Type64 { get; set; } + public global::System.Collections.Generic.IList? Type64 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type65 { get; set; } + public global::AI21.LanguageStudioApiServerDataTypesChatToolDefinition? Type65 { get; set; } /// /// /// - public global::AI21.DocumentSchema? Type66 { get; set; } + public double? Type66 { get; set; } /// /// /// - public global::AI21.ResponseFormat? Type67 { get; set; } + public global::AI21.AnyOf>? Type67 { get; set; } /// /// /// - public global::AI21.ChatStreamingFirstDeltaRole? Type68 { get; set; } + public global::AI21.MockResponseConfig? Type68 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type69 { get; set; } + public global::System.Collections.Generic.IList? Type69 { get; set; } /// /// /// - public global::AI21.ToolCallDelta? Type70 { get; set; } + public global::AI21.DocumentSchema? Type70 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type71 { get; set; } + public global::AI21.ResponseFormat? Type71 { get; set; } /// /// /// - public global::AI21.ToolCallDeltaStart? Type72 { get; set; } + public global::AI21.ChatStreamingFirstDeltaRole? Type72 { get; set; } /// /// /// - public global::AI21.CompareTextRequest? Type73 { get; set; } + public global::System.Collections.Generic.IList? Type73 { get; set; } /// /// /// - public global::AI21.ComparisonOperator? Type74 { get; set; } + public global::AI21.ToolCallDelta? Type74 { get; set; } /// /// /// - public global::AI21.ConnectorConnectionStatus? Type75 { get; set; } + public global::System.Collections.Generic.IList? Type75 { get; set; } /// /// /// - public global::AI21.ParagonSyncStatus? Type76 { get; set; } + public global::AI21.ToolCallDeltaStart? Type76 { get; set; } /// /// /// - public global::AI21.ConnectorsDataSources? Type77 { get; set; } + public global::AI21.CompareTextRequest? Type77 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type78 { get; set; } + public global::AI21.ComparisonOperator? Type78 { get; set; } /// /// /// - public global::AI21.DataSourceMetadata? Type79 { get; set; } + public global::AI21.ConfigProfileCreate? Type79 { get; set; } /// /// /// - public global::AI21.ConnectorsStatus? Type80 { get; set; } + public global::AI21.ConfigProfileOut? Type80 { get; set; } /// /// /// - public global::AI21.ConnectorsWorkflowStatus? Type81 { get; set; } + public global::AI21.ConfigProfileUpdate? Type81 { get; set; } /// /// /// - public global::AI21.ConnectorsSyncParams? Type82 { get; set; } + public global::AI21.ConfigSchemaOut? Type82 { get; set; } /// /// /// - public global::AI21.ConnectorsToken? Type83 { get; set; } + public global::System.Collections.Generic.IList? Type83 { get; set; } /// /// /// @@ -404,556 +404,524 @@ public sealed partial class JsonSerializerContextTypes /// /// /// - public global::System.Collections.Generic.IList? Type94 { get; set; } + public global::AI21.CreateMaestroRunsPayloadResponseLanguage? Type94 { get; set; } /// /// /// - public global::AI21.CreateMaestroRunsPayloadResponseLanguage? Type95 { get; set; } + public global::AI21.CreateOrganizationSchemaRequest? Type95 { get; set; } /// /// /// - public global::AI21.CreateOrganizationSchemaRequest? Type96 { get; set; } + public global::AI21.CreatePlanPayload? Type96 { get; set; } /// /// /// - public global::AI21.CreatePlanPayload? Type97 { get; set; } + public global::AI21.CreateRoutePayload? Type97 { get; set; } /// /// /// - public global::AI21.CreateRoutePayload? Type98 { get; set; } + public global::AI21.CreateSecretPayload? Type98 { get; set; } /// /// /// - public global::AI21.CreateSecretPayload? Type99 { get; set; } + public global::AI21.DeleteAssistantResponse? Type99 { get; set; } /// /// /// - public global::AI21.DeleteAssistantResponse? Type100 { get; set; } + public global::AI21.DeleteMCPStorageResponse? Type100 { get; set; } /// /// /// - public global::AI21.DeleteMCPStorageResponse? Type101 { get; set; } + public global::AI21.Demo? Type101 { get; set; } /// /// /// - public global::AI21.Demo? Type102 { get; set; } + public global::AI21.DemoVisibility? Type102 { get; set; } /// /// /// - public global::AI21.DemoVisibility? Type103 { get; set; } + public global::AI21.DemoStatus? Type103 { get; set; } /// /// /// - public global::AI21.DemoStatus? Type104 { get; set; } + public global::AI21.DemoCreate? Type104 { get; set; } /// /// /// - public global::AI21.DemoCreate? Type105 { get; set; } + public global::AI21.DemoUpdate? Type105 { get; set; } /// /// /// - public global::AI21.DemoUpdate? Type106 { get; set; } + public global::AI21.DetectSchemaRequest? Type106 { get; set; } /// /// /// - public global::AI21.DetectSchemaRequest? Type107 { get; set; } + public global::System.Collections.Generic.IList? Type107 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type108 { get; set; } + public global::AI21.DocumentReference? Type108 { get; set; } /// /// /// - public global::AI21.DocumentReference? Type109 { get; set; } + public global::AI21.DetectSchemaResponse? Type109 { get; set; } /// /// /// - public global::AI21.DetectSchemaResponse? Type110 { get; set; } + public global::System.Collections.Generic.Dictionary? Type110 { get; set; } /// /// /// - public global::System.Collections.Generic.Dictionary? Type111 { get; set; } + public global::AI21.DownloadModifiedDocumentRequest? Type111 { get; set; } /// /// /// - public global::AI21.DownloadModifiedDocumentRequest? Type112 { get; set; } + public global::AI21.FileResponse? Type112 { get; set; } /// /// /// - public global::AI21.FileResponse? Type113 { get; set; } + public long? Type113 { get; set; } /// /// /// - public long? Type114 { get; set; } + public global::AI21.FileSearchToolResource? Type114 { get; set; } /// /// /// - public global::AI21.FileSearchToolResource? Type115 { get; set; } + public global::AI21.FileSearchToolResourceType? Type115 { get; set; } /// /// /// - public global::AI21.FileSearchToolResourceType? Type116 { get; set; } + public global::AI21.FileSearchToolResourceLabelsFilterMode? Type116 { get; set; } /// /// /// - public global::AI21.FileSearchToolResourceLabelsFilterMode? Type117 { get; set; } + public global::AI21.QueryFilter? Type117 { get; set; } /// /// /// - public global::AI21.QueryFilter? Type118 { get; set; } + public global::AI21.RetrievalStrategy? Type118 { get; set; } /// /// /// - public global::AI21.RetrievalStrategy? Type119 { get; set; } + public global::AI21.FileSearchToolResourceResponseLanguage? Type119 { get; set; } /// /// /// - public global::AI21.FileSearchToolResourceResponseLanguage? Type120 { get; set; } + public global::AI21.FileStatus? Type120 { get; set; } /// /// /// - public global::AI21.FileStatus? Type121 { get; set; } + public global::AI21.FilesUpdateRequest? Type121 { get; set; } /// /// /// - public global::AI21.FilesUpdateRequest? Type122 { get; set; } + public global::AI21.FunctionToolDefinition? Type122 { get; set; } /// /// /// - public global::AI21.FunctionToolDefinition? Type123 { get; set; } + public global::AI21.ToolParameters? Type123 { get; set; } /// /// /// - public global::AI21.ToolParameters? Type124 { get; set; } + public global::AI21.GenerateAssistantRequest? Type124 { get; set; } /// /// /// - public global::AI21.GenerateAssistantRequest? Type125 { get; set; } + public global::AI21.GenerateAssistantResponse? Type125 { get; set; } /// /// /// - public global::AI21.GenerateAssistantResponse? Type126 { get; set; } + public global::AI21.GenerateAssistantResponseResponseLanguage? Type126 { get; set; } /// /// /// - public global::AI21.GenerateAssistantResponseResponseLanguage? Type127 { get; set; } + public global::AI21.HTTPToolEndpoint? Type127 { get; set; } /// /// /// - public global::AI21.HTTPToolEndpoint? Type128 { get; set; } + public global::AI21.HTTPToolFunction? Type128 { get; set; } /// /// /// - public global::AI21.HTTPToolFunction? Type129 { get; set; } + public global::AI21.HTTPToolFunctionParameters? Type129 { get; set; } /// /// /// - public global::AI21.HTTPToolFunctionParameters? Type130 { get; set; } + public global::AI21.HTTPToolFunctionParamProperties? Type130 { get; set; } /// /// /// - public global::AI21.HTTPToolFunctionParamProperties? Type131 { get; set; } + public global::AI21.HTTPToolFunctionParametersType? Type131 { get; set; } /// /// /// - public global::AI21.HTTPToolFunctionParametersType? Type132 { get; set; } + public global::System.Collections.Generic.Dictionary? Type132 { get; set; } /// /// /// - public global::System.Collections.Generic.Dictionary? Type133 { get; set; } + public global::AI21.HTTPToolResource? Type133 { get; set; } /// /// /// - public global::AI21.HTTPToolResource? Type134 { get; set; } + public global::AI21.HTTPToolResourceType? Type134 { get; set; } /// /// /// - public global::AI21.HTTPToolResourceType? Type135 { get; set; } + public global::AI21.HTTPValidationError? Type135 { get; set; } /// /// /// - public global::AI21.HTTPValidationError? Type136 { get; set; } + public global::System.Collections.Generic.IList? Type136 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type137 { get; set; } + public global::AI21.ValidationError? Type137 { get; set; } /// /// /// - public global::AI21.ValidationError? Type138 { get; set; } + public global::AI21.IgnestionBatchStatusCount? Type138 { get; set; } /// /// /// - public global::AI21.IgnestionBatchStatusCount? Type139 { get; set; } + public global::AI21.IngestionBatchStatusResponse? Type139 { get; set; } /// /// /// - public global::AI21.IngestionBatchStatusResponse? Type140 { get; set; } + public global::System.Collections.Generic.IList? Type140 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type141 { get; set; } + public global::AI21.JambaExecuteRequest? Type141 { get; set; } /// /// /// - public global::AI21.JambaExecuteRequest? Type142 { get; set; } + public global::AI21.ListAssistantsResponse? Type142 { get; set; } /// /// /// - public global::AI21.LibrarySearchRequest? Type143 { get; set; } + public global::System.Collections.Generic.IList? Type143 { get; set; } /// /// /// - public global::AI21.LibrarySearchRequestLabelsFilterMode? Type144 { get; set; } + public global::AI21.ListMCPsStorageResponse? Type144 { get; set; } /// /// /// - public global::AI21.ListAssistantsResponse? Type145 { get; set; } + public global::System.Collections.Generic.IList? Type145 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type146 { get; set; } + public global::AI21.MCPStorageResponse? Type146 { get; set; } /// /// /// - public global::AI21.ListMCPsStorageResponse? Type147 { get; set; } + public global::AI21.ListPlansResponse? Type147 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type148 { get; set; } + public global::System.Collections.Generic.IList? Type148 { get; set; } /// /// /// - public global::AI21.MCPStorageResponse? Type149 { get; set; } + public global::AI21.Plan? Type149 { get; set; } /// /// /// - public global::AI21.ListPlansResponse? Type150 { get; set; } + public global::AI21.ListRoutesResponse? Type150 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type151 { get; set; } + public global::System.Collections.Generic.IList? Type151 { get; set; } /// /// /// - public global::AI21.Plan? Type152 { get; set; } + public global::System.Collections.Generic.Dictionary>? Type152 { get; set; } /// /// /// - public global::AI21.ListRoutesResponse? Type153 { get; set; } + public global::System.Collections.Generic.IList? Type153 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type154 { get; set; } + public global::AI21.LogprobsData? Type154 { get; set; } /// /// /// - public global::System.Collections.Generic.Dictionary>? Type155 { get; set; } + public global::System.Collections.Generic.IList? Type155 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type156 { get; set; } + public global::AI21.TopLogprobsData? Type156 { get; set; } /// /// /// - public global::AI21.LogprobsData? Type157 { get; set; } + public global::AI21.MCPToolResource? Type157 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type158 { get; set; } + public global::AI21.MCPToolResourceType? Type158 { get; set; } /// /// /// - public global::AI21.TopLogprobsData? Type159 { get; set; } + public global::AI21.MaestroRunError? Type159 { get; set; } /// /// /// - public global::AI21.MCPDefinition? Type160 { get; set; } + public global::AI21.MaestroRunResult? Type160 { get; set; } /// /// /// - public global::AI21.MCPDiscoveryResponse? Type161 { get; set; } + public global::AI21.MaestroRunResultStatus? Type161 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type162 { get; set; } + public global::AI21.MarkdownRequest? Type162 { get; set; } /// /// /// - public global::AI21.MCPTool? Type163 { get; set; } + public global::AI21.MessageRole? Type163 { get; set; } /// /// /// - public global::AI21.MCPToolResource? Type164 { get; set; } + public global::AI21.ModelInfo? Type164 { get; set; } /// /// /// - public global::AI21.MCPToolResourceType? Type165 { get; set; } + public global::AI21.ModelQuantization? Type165 { get; set; } /// /// /// - public global::AI21.MaestroRunError? Type166 { get; set; } + public global::AI21.ModelPricing? Type166 { get; set; } /// /// /// - public global::AI21.MaestroRunResult? Type167 { get; set; } + public global::AI21.ModelsInfoResponse? Type167 { get; set; } /// /// /// - public global::AI21.MaestroRunResultStatus? Type168 { get; set; } + public global::System.Collections.Generic.IList? Type168 { get; set; } /// /// /// - public global::AI21.MarkdownRequest? Type169 { get; set; } + public global::AI21.ModifyAssistantRequest? Type169 { get; set; } /// /// /// - public global::AI21.MessageRole? Type170 { get; set; } + public global::AI21.RunOptimization? Type170 { get; set; } /// /// /// - public global::AI21.ModelInfo? Type171 { get; set; } + public global::AI21.ModifyAssistantRequestResponseLanguage? Type171 { get; set; } /// /// /// - public global::AI21.ModelQuantization? Type172 { get; set; } + public global::AI21.OrgSchema? Type172 { get; set; } /// /// /// - public global::AI21.ModelPricing? Type173 { get; set; } + public global::AI21.OrgSchemas? Type173 { get; set; } /// /// /// - public global::AI21.ModelsInfoResponse? Type174 { get; set; } + public global::System.Collections.Generic.IList? Type174 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type175 { get; set; } + public global::System.Collections.Generic.Dictionary? Type175 { get; set; } /// /// /// - public global::AI21.ModifyAssistantRequest? Type176 { get; set; } + public global::AI21.RFIResponseSection? Type176 { get; set; } /// /// /// - public global::AI21.RunOptimization? Type177 { get; set; } + public global::AI21.RequirementItem? Type177 { get; set; } /// /// /// - public global::AI21.ModifyAssistantRequestResponseLanguage? Type178 { get; set; } + public global::AI21.RequirementsGenerationRequest? Type178 { get; set; } /// /// /// - public global::AI21.OrgSchema? Type179 { get; set; } + public global::AI21.RequirementsGenerationResponse? Type179 { get; set; } /// /// /// - public global::AI21.OrgSchemas? Type180 { get; set; } + public global::System.Collections.Generic.IList? Type180 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type181 { get; set; } + public global::AI21.ResponseFormatType? Type181 { get; set; } /// /// /// - public global::System.Collections.Generic.Dictionary? Type182 { get; set; } + public global::AI21.RunAssistantRequest? Type182 { get; set; } /// /// /// - public global::AI21.RFIResponseSection? Type183 { get; set; } + public global::AI21.RunAssistantRequestResponseLanguage? Type183 { get; set; } /// /// /// - public global::AI21.RequirementItem? Type184 { get; set; } + public global::AI21.SecretResponse? Type184 { get; set; } /// /// /// - public global::AI21.RequirementsGenerationRequest? Type185 { get; set; } + public global::AI21.SystemMessageRole? Type185 { get; set; } /// /// /// - public global::AI21.RequirementsGenerationResponse? Type186 { get; set; } + public global::AI21.ToolCallType? Type186 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type187 { get; set; } + public global::AI21.ToolFunction? Type187 { get; set; } /// /// /// - public global::AI21.ResponseFormatType? Type188 { get; set; } + public global::AI21.ToolFunctionDelta? Type188 { get; set; } /// /// /// - public global::AI21.RunAssistantRequest? Type189 { get; set; } + public global::AI21.ToolCallDeltaStartType? Type189 { get; set; } /// /// /// - public global::AI21.RunAssistantRequestResponseLanguage? Type190 { get; set; } + public global::AI21.ToolFunctionDeltaStart? Type190 { get; set; } /// /// /// - public global::AI21.SecretResponse? Type191 { get; set; } + public global::AI21.ToolMessageRole? Type191 { get; set; } /// /// /// - public global::AI21.SystemMessageRole? Type192 { get; set; } + public global::AI21.ToolParametersType? Type192 { get; set; } /// /// /// - public global::AI21.ThreadNameGenerationRequest? Type193 { get; set; } + public global::AI21.UpdateMCPStorageRequest? Type193 { get; set; } /// /// /// - public global::AI21.ThreadNameGenerationResponse? Type194 { get; set; } + public global::AI21.UpdateRoutePayload? Type194 { get; set; } /// /// /// - public global::AI21.ToolCallType? Type195 { get; set; } + public global::AI21.UpdateSecretPayload? Type195 { get; set; } /// /// /// - public global::AI21.ToolFunction? Type196 { get; set; } + public global::AI21.UserMessageRole? Type196 { get; set; } /// /// /// - public global::AI21.ToolFunctionDelta? Type197 { get; set; } + public global::System.Collections.Generic.IList>? Type197 { get; set; } /// /// /// - public global::AI21.ToolCallDeltaStartType? Type198 { get; set; } + public global::AI21.AnyOf? Type198 { get; set; } /// /// /// - public global::AI21.ToolFunctionDeltaStart? Type199 { get; set; } + public global::AI21.ValidationResult? Type199 { get; set; } /// /// /// - public global::AI21.ToolMessageRole? Type200 { get; set; } + public global::AI21.WebSearchToolResource? Type200 { get; set; } /// /// /// - public global::AI21.ToolParametersType? Type201 { get; set; } + public global::AI21.WebSearchToolResourceType? Type201 { get; set; } /// /// /// - public global::AI21.UpdateMCPStorageRequest? Type202 { get; set; } + public global::AI21.WebsiteConnectorCreateConfigPayload? Type202 { get; set; } /// /// /// - public global::AI21.UpdateRoutePayload? Type203 { get; set; } + public global::AI21.WebsiteConnectorIngestUrlPayload? Type203 { get; set; } /// /// /// - public global::AI21.UpdateSecretPayload? Type204 { get; set; } + public global::AI21.WebsiteConnectorIngestWebsitePayload? Type204 { get; set; } /// /// /// - public global::AI21.UserMessageRole? Type205 { get; set; } + public global::AI21.WebsiteConnectorRetryIngestWebsitePayload? Type205 { get; set; } /// /// /// - public global::System.Collections.Generic.IList>? Type206 { get; set; } + public global::AI21.WorkspaceModelResponse? Type206 { get; set; } /// /// /// - public global::AI21.AnyOf? Type207 { get; set; } + public global::AI21.WorkspaceModelUpdate? Type207 { get; set; } /// /// /// - public global::AI21.ValidationResult? Type208 { get; set; } + public global::AI21.WorkspaceModelsResponse? Type208 { get; set; } /// /// /// - public global::AI21.WebSearchToolResource? Type209 { get; set; } + public global::System.Collections.Generic.IList? Type209 { get; set; } /// /// /// - public global::AI21.WebSearchToolResourceType? Type210 { get; set; } + public global::AI21.LanguageStudioApiServerDataTypesChatToolDefinitionType? Type210 { get; set; } /// /// /// - public global::AI21.WebsiteConnectorCreateConfigPayload? Type211 { get; set; } + public global::AI21.LanguageStudioApiServerDataTypesExecutionEngineToolDefinitionDiscriminator? Type211 { get; set; } /// /// /// - public global::AI21.WebsiteConnectorIngestUrlPayload? Type212 { get; set; } + public global::AI21.LanguageStudioApiServerDataTypesExecutionEngineToolDefinitionDiscriminatorType? Type212 { get; set; } /// /// /// - public global::AI21.WebsiteConnectorIngestWebsitePayload? Type213 { get; set; } + public global::AI21.AnyOf>? Type213 { get; set; } /// /// /// - public global::AI21.WebsiteConnectorPayload? Type214 { get; set; } + public global::System.Collections.Generic.IList? Type214 { get; set; } /// /// /// - public global::AI21.WebsiteConnectorPayloadType? Type215 { get; set; } + public global::System.Collections.Generic.IList? Type215 { get; set; } /// /// /// - public global::AI21.WebsiteConnectorRetryIngestWebsitePayload? Type216 { get; set; } + public global::System.Collections.Generic.IList? Type216 { get; set; } /// /// /// - public global::AI21.WorkspaceModelResponse? Type217 { get; set; } + public global::System.Collections.Generic.IList? Type217 { get; set; } /// /// /// - public global::AI21.WorkspaceModelUpdate? Type218 { get; set; } + public global::System.Collections.Generic.IList? Type218 { get; set; } /// /// /// - public global::AI21.WorkspaceModelsResponse? Type219 { get; set; } + public global::System.Collections.Generic.IList? Type219 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type220 { get; set; } - /// - /// - /// - public global::AI21.LanguageStudioApiServerDataTypesChatToolDefinitionType? Type221 { get; set; } - /// - /// - /// - public global::AI21.LanguageStudioApiServerDataTypesExecutionEngineToolDefinitionDiscriminator? Type222 { get; set; } - /// - /// - /// - public global::AI21.LanguageStudioApiServerDataTypesExecutionEngineToolDefinitionDiscriminatorType? Type223 { get; set; } - /// - /// - /// - public global::AI21.AnyOf>? Type224 { get; set; } - /// - /// - /// - public global::System.Collections.Generic.IList? Type225 { get; set; } - /// - /// - /// - public global::System.Collections.Generic.IList? Type226 { get; set; } - /// - /// - /// - public global::System.Collections.Generic.IList? Type227 { get; set; } - /// - /// - /// - public global::System.Collections.Generic.IList? Type228 { get; set; } + public global::System.Collections.Generic.IList? Type220 { get; set; } /// /// /// - public global::AI21.AnyOf, global::System.Collections.Generic.List>? ListType0 { get; set; } + public global::System.Collections.Generic.List? ListType0 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType1 { get; set; } + public global::AI21.AnyOf, 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; } /// /// /// @@ -1013,7 +981,7 @@ public sealed partial class JsonSerializerContextTypes /// /// /// - public global::System.Collections.Generic.List? ListType17 { get; set; } + public global::System.Collections.Generic.List? ListType17 { get; set; } /// /// /// @@ -1029,90 +997,94 @@ public sealed partial class JsonSerializerContextTypes /// /// /// - 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; } + public global::System.Collections.Generic.Dictionary>? ListType28 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType28 { get; set; } + public global::System.Collections.Generic.List? ListType29 { get; set; } /// /// /// - public global::System.Collections.Generic.Dictionary>? ListType29 { get; set; } + public global::System.Collections.Generic.List? ListType30 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType30 { get; set; } + public global::System.Collections.Generic.List? ListType31 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType31 { get; set; } + public global::System.Collections.Generic.List? ListType32 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType32 { get; set; } + public global::System.Collections.Generic.List? ListType33 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType33 { get; set; } + public global::System.Collections.Generic.List>? ListType34 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType34 { get; set; } + public global::System.Collections.Generic.List? ListType35 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType35 { get; set; } + public global::AI21.AnyOf>? ListType36 { get; set; } /// /// /// - public global::System.Collections.Generic.List>? ListType36 { get; set; } + public global::System.Collections.Generic.List? ListType37 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType37 { get; set; } + public global::System.Collections.Generic.List? ListType38 { get; set; } /// /// /// - public global::AI21.AnyOf>? ListType38 { get; set; } + public global::System.Collections.Generic.List? ListType39 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType39 { get; set; } + public global::System.Collections.Generic.List? ListType40 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType40 { get; set; } + public global::System.Collections.Generic.List? ListType41 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType41 { get; set; } + public global::System.Collections.Generic.List? ListType42 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType42 { get; set; } + public global::System.Collections.Generic.List? ListType43 { get; set; } } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.LibraryManagementClient.V1LibraryDelete.g.cs b/src/libs/AI21/Generated/AI21.LibraryManagementClient.V1LibraryDelete.g.cs index 16ed4c45..16d57dcf 100644 --- a/src/libs/AI21/Generated/AI21.LibraryManagementClient.V1LibraryDelete.g.cs +++ b/src/libs/AI21/Generated/AI21.LibraryManagementClient.V1LibraryDelete.g.cs @@ -14,6 +14,7 @@ public partial class LibraryManagementClient { new global::AI21.EndPointAuthorizationRequirement { Type = "Http", + SchemeId = "HttpBearer", Location = "Header", Name = "Bearer", FriendlyName = "Bearer", @@ -47,10 +48,35 @@ partial void ProcessV1LibraryDeleteResponseContent( /// Files in `PROCESSING` status cannot be deleted. Attempts to delete such files will result in a <span style="color:red">422</span> error. /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// public async global::System.Threading.Tasks.Task V1LibraryDeleteAsync( global::System.Guid fileId, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await V1LibraryDeleteAsResponseAsync( + fileId: fileId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Delete File
+ /// Delete the specified file from the library.
+ /// **Restrictions**:
+ /// Files in `PROCESSING` status cannot be deleted. Attempts to delete such files will result in a <span style="color:red">422</span> error. + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> V1LibraryDeleteAsResponseAsync( + global::System.Guid fileId, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( @@ -65,22 +91,44 @@ partial void ProcessV1LibraryDeleteResponseContent( securityRequirements: s_V1LibraryDeleteSecurityRequirements, operationName: "V1LibraryDeleteAsync"); - var __pathBuilder = new global::AI21.PathBuilder( - path: $"/studio/v1/library/files/{fileId}", - 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)); + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: $"/studio/v1/library/files/{fileId}", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.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; + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; #endif foreach (var __authorization in __authorizations) { if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2") + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") { __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( scheme: __authorization.Name, @@ -90,146 +138,326 @@ partial void ProcessV1LibraryDeleteResponseContent( __authorization.Location == "Header") { __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } + } } + global::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareV1LibraryDeleteRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - fileId: fileId); + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareV1LibraryDeleteRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + fileId: fileId!); - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); + return __httpRequest; + } - ProcessResponse( - client: HttpClient, - response: __response); - ProcessV1LibraryDeleteResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Validation Error - if ((int)__response.StatusCode == 422) + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::AI21.HTTPValidationError? __value_422 = null; - try + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) { - if (ReadResponseAsString) + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1LibraryDelete", + methodName: "V1LibraryDeleteAsync", + pathTemplate: "$\"/studio/v1/library/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 { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); } - else + catch (global::System.Net.Http.HttpRequestException __exception) { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1LibraryDelete", + methodName: "V1LibraryDeleteAsync", + pathTemplate: "$\"/studio/v1/library/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; + } - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1LibraryDelete", + methodName: "V1LibraryDeleteAsync", + pathTemplate: "$\"/studio/v1/library/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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; } - catch (global::System.Exception __ex) + + if (__response == null) { - __exception_422 = __ex; + throw new global::System.InvalidOperationException("No response received."); } - throw new global::AI21.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) + using (__response) { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - ProcessResponseContent( + ProcessResponse( client: HttpClient, - response: __response, - content: ref __content); - ProcessV1LibraryDeleteResponseContent( + response: __response); + ProcessV1LibraryDeleteResponse( httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) { - __response.EnsureSuccessStatusCode(); - - return __content; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1LibraryDelete", + methodName: "V1LibraryDeleteAsync", + pathTemplate: "$\"/studio/v1/library/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); } - catch (global::System.Exception __ex) + else { - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1LibraryDelete", + methodName: "V1LibraryDeleteAsync", + pathTemplate: "$\"/studio/v1/library/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 - { - try - { - __response.EnsureSuccessStatusCode(); - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::AI21.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).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) - { - } + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessV1LibraryDeleteResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? 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::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.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::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; } } + finally + { + __httpRequest?.Dispose(); + } } } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.LibraryManagementClient.V1LibraryManagement.g.cs b/src/libs/AI21/Generated/AI21.LibraryManagementClient.V1LibraryManagement.g.cs index a3efe391..c7a39182 100644 --- a/src/libs/AI21/Generated/AI21.LibraryManagementClient.V1LibraryManagement.g.cs +++ b/src/libs/AI21/Generated/AI21.LibraryManagementClient.V1LibraryManagement.g.cs @@ -14,6 +14,7 @@ public partial class LibraryManagementClient { new global::AI21.EndPointAuthorizationRequirement { Type = "Http", + SchemeId = "HttpBearer", Location = "Header", Name = "Bearer", FriendlyName = "Bearer", @@ -65,6 +66,7 @@ partial void ProcessV1LibraryManagementResponseContent( /// Default Value: 500000 /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// public async global::System.Threading.Tasks.Task> V1LibraryManagementAsync( @@ -74,6 +76,48 @@ partial void ProcessV1LibraryManagementResponseContent( global::System.Collections.Generic.IList? label = default, int? limit = default, int? offset = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await V1LibraryManagementAsResponseAsync( + name: name, + path: path, + status: status, + label: label, + limit: limit, + offset: offset, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Get Workspace Files
+ /// Get metadata about a specific file by file ID. The file ID is generated by
+ /// AI21 when you upload the file. + ///
+ /// + /// + /// + /// An enumeration. + /// + /// + /// + /// Default Value: 500000 + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task>> V1LibraryManagementAsResponseAsync( + string? name = default, + string? path = default, + global::AI21.FileStatus? status = default, + global::System.Collections.Generic.IList? label = default, + int? limit = default, + int? offset = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( @@ -93,30 +137,52 @@ partial void ProcessV1LibraryManagementResponseContent( securityRequirements: s_V1LibraryManagementSecurityRequirements, operationName: "V1LibraryManagementAsync"); - var __pathBuilder = new global::AI21.PathBuilder( - path: "/studio/v1/library/files", - baseUri: HttpClient.BaseAddress); - __pathBuilder - .AddOptionalParameter("name", name) - .AddOptionalParameter("path", path) - .AddOptionalParameter("status", status?.ToValueString()) - .AddOptionalParameter("label", label, delimiter: ",", explode: true) - .AddOptionalParameter("limit", limit?.ToString()) - .AddOptionalParameter("offset", offset?.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)); + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: "/studio/v1/library/files", + baseUri: HttpClient.BaseAddress); + __pathBuilder + .AddOptionalParameter("name", name) + .AddOptionalParameter("path", path) + .AddOptionalParameter("status", status?.ToValueString()) + .AddOptionalParameter("label", label, delimiter: ",", explode: true) + .AddOptionalParameter("limit", limit?.ToString()) + .AddOptionalParameter("offset", offset?.ToString()) + ; + var __path = __pathBuilder.ToString(); + __path = global::AI21.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; + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; #endif foreach (var __authorization in __authorizations) { if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2") + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") { __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( scheme: __authorization.Name, @@ -126,155 +192,335 @@ partial void ProcessV1LibraryManagementResponseContent( __authorization.Location == "Header") { __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } + } } + global::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareV1LibraryManagementRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - name: name, - path: path, - status: status, - label: label, - limit: limit, - offset: offset); + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareV1LibraryManagementRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + name: name, + path: path, + status: status, + label: label, + limit: limit, + offset: offset); - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); + return __httpRequest; + } - ProcessResponse( - client: HttpClient, - response: __response); - ProcessV1LibraryManagementResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Validation Error - if ((int)__response.StatusCode == 422) + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::AI21.HTTPValidationError? __value_422 = null; - try + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) { - if (ReadResponseAsString) + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1LibraryManagement", + methodName: "V1LibraryManagementAsync", + pathTemplate: "\"/studio/v1/library/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 { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); } - else + catch (global::System.Net.Http.HttpRequestException __exception) { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1LibraryManagement", + methodName: "V1LibraryManagementAsync", + pathTemplate: "\"/studio/v1/library/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; + } - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1LibraryManagement", + methodName: "V1LibraryManagementAsync", + pathTemplate: "\"/studio/v1/library/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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; } + + break; } - catch (global::System.Exception __ex) + + if (__response == null) { - __exception_422 = __ex; + throw new global::System.InvalidOperationException("No response received."); } - throw new global::AI21.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) + using (__response) { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - ProcessResponseContent( + ProcessResponse( client: HttpClient, - response: __response, - content: ref __content); - ProcessV1LibraryManagementResponseContent( + response: __response); + ProcessV1LibraryManagementResponse( httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) { - __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}\" "); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1LibraryManagement", + methodName: "V1LibraryManagementAsync", + pathTemplate: "\"/studio/v1/library/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); } - catch (global::System.Exception __ex) + else { - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1LibraryManagement", + methodName: "V1LibraryManagementAsync", + pathTemplate: "\"/studio/v1/library/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 - { - try - { - __response.EnsureSuccessStatusCode(); - using var __content = await __response.Content.ReadAsStreamAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::AI21.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).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) - { - } + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessV1LibraryManagementResponseContent( + 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::AI21.AutoSDKHttpResponse>( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => 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::AI21.AutoSDKHttpResponse>( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; } } + finally + { + __httpRequest?.Dispose(); + } } } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.LibraryManagementClient.V1LibraryManagement2.g.cs b/src/libs/AI21/Generated/AI21.LibraryManagementClient.V1LibraryManagement2.g.cs index 62f145da..2740e60a 100644 --- a/src/libs/AI21/Generated/AI21.LibraryManagementClient.V1LibraryManagement2.g.cs +++ b/src/libs/AI21/Generated/AI21.LibraryManagementClient.V1LibraryManagement2.g.cs @@ -14,6 +14,7 @@ public partial class LibraryManagementClient { new global::AI21.EndPointAuthorizationRequirement { Type = "Http", + SchemeId = "HttpBearer", Location = "Header", Name = "Bearer", FriendlyName = "Bearer", @@ -52,10 +53,40 @@ partial void ProcessV1LibraryManagement2ResponseContent( /// "financial" AND status UPLOADED will be returned. /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// public async global::System.Threading.Tasks.Task V1LibraryManagement2Async( global::System.Guid fileId, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await V1LibraryManagement2AsResponseAsync( + fileId: fileId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Get File By Id
+ /// Retrieve a list of documents in the user's library. Optionally specify a
+ /// filter to find only files with matching labels or paths. This method
+ /// returns only metadata about files; to download a file, call
+ /// `GET .../files/{file_id}/download`
+ /// When specifying qualifiers with your request, only files that match
+ /// _all_ qualifiers will be returns. So, for example, if you specify
+ /// `label='financial'` and `status='UPLOADED'`, only files with the label
+ /// "financial" AND status UPLOADED will be returned. + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> V1LibraryManagement2AsResponseAsync( + global::System.Guid fileId, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( @@ -70,22 +101,44 @@ partial void ProcessV1LibraryManagement2ResponseContent( securityRequirements: s_V1LibraryManagement2SecurityRequirements, operationName: "V1LibraryManagement2Async"); - var __pathBuilder = new global::AI21.PathBuilder( - path: $"/studio/v1/library/files/{fileId}", - 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)); + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: $"/studio/v1/library/files/{fileId}", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.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; + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; #endif foreach (var __authorization in __authorizations) { if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2") + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") { __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( scheme: __authorization.Name, @@ -95,150 +148,330 @@ partial void ProcessV1LibraryManagement2ResponseContent( __authorization.Location == "Header") { __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } + } } + global::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareV1LibraryManagement2Request( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - fileId: fileId); + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareV1LibraryManagement2Request( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + fileId: fileId!); - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); + return __httpRequest; + } - ProcessResponse( - client: HttpClient, - response: __response); - ProcessV1LibraryManagement2Response( - httpClient: HttpClient, - httpResponseMessage: __response); - // Validation Error - if ((int)__response.StatusCode == 422) + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::AI21.HTTPValidationError? __value_422 = null; - try + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) { - if (ReadResponseAsString) + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1LibraryManagement2", + methodName: "V1LibraryManagement2Async", + pathTemplate: "$\"/studio/v1/library/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 { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); } - else + catch (global::System.Net.Http.HttpRequestException __exception) { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1LibraryManagement2", + methodName: "V1LibraryManagement2Async", + pathTemplate: "$\"/studio/v1/library/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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1LibraryManagement2", + methodName: "V1LibraryManagement2Async", + pathTemplate: "$\"/studio/v1/library/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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; } + + break; } - catch (global::System.Exception __ex) + + if (__response == null) { - __exception_422 = __ex; + throw new global::System.InvalidOperationException("No response received."); } - throw new global::AI21.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) + using (__response) { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( + ProcessResponse( client: HttpClient, - response: __response, - content: ref __content); - ProcessV1LibraryManagement2ResponseContent( + response: __response); + ProcessV1LibraryManagement2Response( httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) { - __response.EnsureSuccessStatusCode(); - - return - global::AI21.FileResponse.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1LibraryManagement2", + methodName: "V1LibraryManagement2Async", + pathTemplate: "$\"/studio/v1/library/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); } - catch (global::System.Exception __ex) + else { - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1LibraryManagement2", + methodName: "V1LibraryManagement2Async", + pathTemplate: "$\"/studio/v1/library/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 - { - try - { - __response.EnsureSuccessStatusCode(); - using var __content = await __response.Content.ReadAsStreamAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::AI21.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - return - await global::AI21.FileResponse.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) - { - } + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessV1LibraryManagement2ResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::AI21.FileResponse.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => 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::AI21.FileResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; } } + finally + { + __httpRequest?.Dispose(); + } } } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.LibraryManagementClient.V1LibraryManagement3.g.cs b/src/libs/AI21/Generated/AI21.LibraryManagementClient.V1LibraryManagement3.g.cs index 79f74a8e..9fe5b9b2 100644 --- a/src/libs/AI21/Generated/AI21.LibraryManagementClient.V1LibraryManagement3.g.cs +++ b/src/libs/AI21/Generated/AI21.LibraryManagementClient.V1LibraryManagement3.g.cs @@ -14,6 +14,7 @@ public partial class LibraryManagementClient { new global::AI21.EndPointAuthorizationRequirement { Type = "Http", + SchemeId = "HttpBearer", Location = "Header", Name = "Bearer", FriendlyName = "Bearer", @@ -55,12 +56,47 @@ partial void ProcessV1LibraryManagement3ResponseContent( /// /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// public async global::System.Threading.Tasks.Task V1LibraryManagement3Async( global::System.Guid fileId, global::AI21.FilesUpdateRequest request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await V1LibraryManagement3AsResponseAsync( + fileId: fileId, + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Update File
+ /// Update the specified parameters of a specific document in the user's library.
+ /// This operation currently supports updating the publicUrl and labels parameters.
+ /// > **This operation overwrites the specified items with the new data you provide.**
+ /// > If you wish to add new labels to the labels list without removing the existing ones,
+ /// > you must submit a labels list that includes both the current and new labels.**
+ /// >
+ /// > For instance, if the current labels are "Label A" and "Label B", and you wish to
+ /// > add "New Label C" and "New Label D" to the list, you must specify `"labels": ["Label A", "Label B", "New Label C", "New Label D"]`. + ///
+ /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> V1LibraryManagement3AsResponseAsync( + global::System.Guid fileId, + + global::AI21.FilesUpdateRequest request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) { request = request ?? throw new global::System.ArgumentNullException(nameof(request)); @@ -78,22 +114,44 @@ partial void ProcessV1LibraryManagement3ResponseContent( securityRequirements: s_V1LibraryManagement3SecurityRequirements, operationName: "V1LibraryManagement3Async"); - var __pathBuilder = new global::AI21.PathBuilder( - path: $"/studio/v1/library/files/{fileId}", - 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)); + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: $"/studio/v1/library/files/{fileId}", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.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; + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; #endif foreach (var __authorization in __authorizations) { if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2") + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") { __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( scheme: __authorization.Name, @@ -103,153 +161,333 @@ partial void ProcessV1LibraryManagement3ResponseContent( __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); - PrepareV1LibraryManagement3Request( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - fileId: fileId, - request: request); + 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::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareV1LibraryManagement3Request( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + fileId: fileId!, + request: request); - ProcessResponse( - client: HttpClient, - response: __response); - ProcessV1LibraryManagement3Response( - httpClient: HttpClient, - httpResponseMessage: __response); - // Validation Error - if ((int)__response.StatusCode == 422) + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::AI21.HTTPValidationError? __value_422 = null; - try + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) { - if (ReadResponseAsString) + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1LibraryManagement3", + methodName: "V1LibraryManagement3Async", + pathTemplate: "$\"/studio/v1/library/files/{fileId}\"", + 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 { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); } - else + catch (global::System.Net.Http.HttpRequestException __exception) { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1LibraryManagement3", + methodName: "V1LibraryManagement3Async", + pathTemplate: "$\"/studio/v1/library/files/{fileId}\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1LibraryManagement3", + methodName: "V1LibraryManagement3Async", + pathTemplate: "$\"/studio/v1/library/files/{fileId}\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; } + + break; } - catch (global::System.Exception __ex) + + if (__response == null) { - __exception_422 = __ex; + throw new global::System.InvalidOperationException("No response received."); } - throw new global::AI21.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) + using (__response) { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( + ProcessResponse( client: HttpClient, - response: __response, - content: ref __content); - ProcessV1LibraryManagement3ResponseContent( + response: __response); + ProcessV1LibraryManagement3Response( httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) { - __response.EnsureSuccessStatusCode(); - - return __content; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1LibraryManagement3", + methodName: "V1LibraryManagement3Async", + pathTemplate: "$\"/studio/v1/library/files/{fileId}\"", + 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); } - catch (global::System.Exception __ex) + else { - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1LibraryManagement3", + methodName: "V1LibraryManagement3Async", + pathTemplate: "$\"/studio/v1/library/files/{fileId}\"", + 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 - { - try - { - __response.EnsureSuccessStatusCode(); - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::AI21.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).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) - { - } + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessV1LibraryManagement3ResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? 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::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.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::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; } } + finally + { + __httpRequest?.Dispose(); + } } /// /// Update File
@@ -272,12 +510,14 @@ partial void ProcessV1LibraryManagement3ResponseContent( /// Any labels to associate with this file. Separate multiple labels with commas. If
/// provided, will overwrite all existing labels. /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// public async global::System.Threading.Tasks.Task V1LibraryManagement3Async( global::System.Guid fileId, string? publicUrl = default, global::System.Collections.Generic.IList? labels = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) { var __request = new global::AI21.FilesUpdateRequest @@ -289,6 +529,7 @@ partial void ProcessV1LibraryManagement3ResponseContent( return await V1LibraryManagement3Async( fileId: fileId, request: __request, + requestOptions: requestOptions, cancellationToken: cancellationToken).ConfigureAwait(false); } } diff --git a/src/libs/AI21/Generated/AI21.LibraryManagementClient.V1LibraryUpload.g.cs b/src/libs/AI21/Generated/AI21.LibraryManagementClient.V1LibraryUpload.g.cs index 557fc8c8..813299da 100644 --- a/src/libs/AI21/Generated/AI21.LibraryManagementClient.V1LibraryUpload.g.cs +++ b/src/libs/AI21/Generated/AI21.LibraryManagementClient.V1LibraryUpload.g.cs @@ -14,6 +14,7 @@ public partial class LibraryManagementClient { new global::AI21.EndPointAuthorizationRequirement { Type = "Http", + SchemeId = "HttpBearer", Location = "Header", Name = "Bearer", FriendlyName = "Bearer", @@ -50,11 +51,41 @@ partial void ProcessV1LibraryUploadResponseContent( /// - **Supported file types:** PDF, DocX, HTML, TXT ///
/// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// public async global::System.Threading.Tasks.Task V1LibraryUploadAsync( global::AI21.BodyV1LibraryUpload request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await V1LibraryUploadAsResponseAsync( + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Upload Workspace File
+ /// Upload files to use for [RAG Engine document searches](https://docs.ai21.com/docs/rag-engine-overview).
+ /// You can assign metadata to your files to limit searches to specific files by file metadata.
+ /// There is no bulk upload method; files must be loaded one at a time.
+ /// - **Max number of files:** No limit. The playground limits bulk uploads to 50 files per request.
+ /// - **Max library size:** 1 GB total size. No limit to individual file size.
+ /// - **Supported file types:** PDF, DocX, HTML, TXT + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> V1LibraryUploadAsResponseAsync( + + global::AI21.BodyV1LibraryUpload request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) { request = request ?? throw new global::System.ArgumentNullException(nameof(request)); @@ -71,22 +102,44 @@ partial void ProcessV1LibraryUploadResponseContent( securityRequirements: s_V1LibraryUploadSecurityRequirements, operationName: "V1LibraryUploadAsync"); - var __pathBuilder = new global::AI21.PathBuilder( - path: "/studio/v1/library/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)); + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: false); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: "/studio/v1/library/files", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.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; + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; #endif foreach (var __authorization in __authorizations) { if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2") + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") { __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( scheme: __authorization.Name, @@ -96,212 +149,1024 @@ partial void ProcessV1LibraryUploadResponseContent( __authorization.Location == "Header") { __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - using var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); - 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; + } } - if (request.Path != default) - { - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent($"{request.Path}"), - name: "\"path\""); - } - if (request.Labels != default) - { + var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); + var __contentFile = new global::System.Net.Http.ByteArrayContent(request.File ?? global::System.Array.Empty()); + __contentFile.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( + request.Filename is null + ? "application/octet-stream" + : (global::System.IO.Path.GetExtension(request.Filename) ?? string.Empty).ToLowerInvariant() switch + { + ".aac" => "audio/aac", + ".flac" => "audio/flac", + ".gif" => "image/gif", + ".jpeg" => "image/jpeg", + ".jpg" => "image/jpeg", + ".json" => "application/json", + ".m4a" => "audio/mp4", + ".mp3" => "audio/mpeg", + ".mp4" => "video/mp4", + ".mpeg" => "audio/mpeg", + ".mpga" => "audio/mpeg", + ".oga" => "audio/ogg", + ".ogg" => "audio/ogg", + ".opus" => "audio/ogg", + ".pdf" => "application/pdf", + ".png" => "image/png", + ".txt" => "text/plain", + ".wav" => "audio/wav", + ".weba" => "audio/webm", + ".webm" => "video/webm", + ".webp" => "image/webp", + _ => "application/octet-stream", + }); + __httpRequestContent.Add( + content: __contentFile, + name: "\"file\"", + fileName: request.Filename != null ? $"\"{request.Filename}\"" : string.Empty); + if (__contentFile.Headers.ContentDisposition != null) + { + __contentFile.Headers.ContentDisposition.FileNameStar = null; + } - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent($"[{string.Join(",", global::System.Linq.Enumerable.Select(request.Labels, x => x))}]"), - name: "\"labels\""); - } - if (request.PublicUrl != default) - { + if (request.Path != default) + { - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent($"{request.PublicUrl}"), - name: "\"publicUrl\""); - } - if (request.CustomConfigs != default) - { + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.Path ?? string.Empty), + name: "\"path\""); - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent($"{request.CustomConfigs}"), - name: "\"custom_configs\""); - } - if (request.UploadMode != default) - { + } + if (request.Labels != default) + { - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent($"{request.UploadMode?.ToValueString()}"), - name: "\"upload_mode\""); - } - if (request.BatchId != default) - { + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent($"[{string.Join(",", global::System.Linq.Enumerable.Select(request.Labels, x => x))}]"), + name: "\"labels\""); - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent($"{request.BatchId}"), - name: "\"batch_id\""); - } - if (request.DataSource != default) - { + } + if (request.PublicUrl != default) + { - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent($"{request.DataSource}"), - name: "\"data_source\""); - } - if (request.Metadata != default) - { + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.PublicUrl ?? string.Empty), + name: "\"publicUrl\""); - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent($"{request.Metadata}"), - name: "\"metadata\""); - } - __httpRequest.Content = __httpRequestContent; + } + if (request.CustomConfigs != default) + { - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareV1LibraryUploadRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - request: request); + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.CustomConfigs ?? string.Empty), + name: "\"custom_configs\""); - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); + } + if (request.UploadMode != default) + { - ProcessResponse( - client: HttpClient, - response: __response); - ProcessV1LibraryUploadResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Validation Error - if ((int)__response.StatusCode == 422) + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((request.UploadMode).HasValue ? (request.UploadMode).GetValueOrDefault().ToValueString() : string.Empty), + name: "\"upload_mode\""); + + } + if (request.BatchId != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.BatchId.ToString() ?? string.Empty), + name: "\"batch_id\""); + + } + if (request.DataSource != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.DataSource ?? string.Empty), + name: "\"data_source\""); + + } + if (request.Metadata != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.Metadata ?? string.Empty), + name: "\"metadata\""); + + } + + __httpRequest.Content = __httpRequestContent; + + global::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareV1LibraryUploadRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + request: request); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::AI21.HTTPValidationError? __value_422 = null; - try + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) { - if (ReadResponseAsString) + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1LibraryUpload", + methodName: "V1LibraryUploadAsync", + pathTemplate: "\"/studio/v1/library/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 { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); } - else + catch (global::System.Net.Http.HttpRequestException __exception) { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1LibraryUpload", + methodName: "V1LibraryUploadAsync", + pathTemplate: "\"/studio/v1/library/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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1LibraryUpload", + methodName: "V1LibraryUploadAsync", + pathTemplate: "\"/studio/v1/library/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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; } + + break; } - catch (global::System.Exception __ex) + + if (__response == null) { - __exception_422 = __ex; + throw new global::System.InvalidOperationException("No response received."); } - throw new global::AI21.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) + using (__response) { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - ProcessResponseContent( + ProcessResponse( client: HttpClient, - response: __response, - content: ref __content); - ProcessV1LibraryUploadResponseContent( + response: __response); + ProcessV1LibraryUploadResponse( httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) { - __response.EnsureSuccessStatusCode(); - - return __content; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1LibraryUpload", + methodName: "V1LibraryUploadAsync", + pathTemplate: "\"/studio/v1/library/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); } - catch (global::System.Exception __ex) + else { - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1LibraryUpload", + methodName: "V1LibraryUploadAsync", + pathTemplate: "\"/studio/v1/library/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::AI21.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessV1LibraryUploadResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? 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::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.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::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + } } - else + finally { - try - { - __response.EnsureSuccessStatusCode(); - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken + __httpRequest?.Dispose(); + } + } + /// + /// Upload Workspace File
+ /// Upload files to use for [RAG Engine document searches](https://docs.ai21.com/docs/rag-engine-overview).
+ /// You can assign metadata to your files to limit searches to specific files by file metadata.
+ /// There is no bulk upload method; files must be loaded one at a time.
+ /// - **Max number of files:** No limit. The playground limits bulk uploads to 50 files per request.
+ /// - **Max library size:** 1 GB total size. No limit to individual file size.
+ /// - **Supported file types:** PDF, DocX, HTML, TXT + ///
+ /// + /// + /// + /// + /// + /// + /// + /// Default Value: immediate + /// + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task V1LibraryUploadAsync( + byte[] file, + string filename, + string? path = default, + global::System.Collections.Generic.IList? labels = default, + string? publicUrl = default, + string? customConfigs = default, + global::AI21.UploadMode? uploadMode = default, + global::System.Guid? batchId = default, + string? dataSource = default, + string? metadata = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __request = new global::AI21.BodyV1LibraryUpload + { + File = file, + Filename = filename, + Path = path, + Labels = labels, + PublicUrl = publicUrl, + CustomConfigs = customConfigs, + UploadMode = uploadMode, + BatchId = batchId, + DataSource = dataSource, + Metadata = metadata, + }; + + return await V1LibraryUploadAsync( + request: __request, + requestOptions: requestOptions, + cancellationToken: cancellationToken).ConfigureAwait(false); + } + + /// + /// Upload Workspace File
+ /// Upload files to use for [RAG Engine document searches](https://docs.ai21.com/docs/rag-engine-overview).
+ /// You can assign metadata to your files to limit searches to specific files by file metadata.
+ /// There is no bulk upload method; files must be loaded one at a time.
+ /// - **Max number of files:** No limit. The playground limits bulk uploads to 50 files per request.
+ /// - **Max library size:** 1 GB total size. No limit to individual file size.
+ /// - **Supported file types:** PDF, DocX, HTML, TXT + ///
+ /// + /// The stream to send as the multipart 'file' file part. + /// + /// + /// + /// + /// + /// + /// + /// Default Value: immediate + /// + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task V1LibraryUploadAsync( + global::System.IO.Stream file, + string filename, + string? path = default, + global::System.Collections.Generic.IList? labels = default, + string? publicUrl = default, + string? customConfigs = default, + global::AI21.UploadMode? uploadMode = default, + global::System.Guid? batchId = default, + string? dataSource = default, + string? metadata = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + + file = file ?? throw new global::System.ArgumentNullException(nameof(file)); + var request = new global::AI21.BodyV1LibraryUpload + { + File = global::System.Array.Empty(), + Filename = filename, + Path = path, + Labels = labels, + PublicUrl = publicUrl, + CustomConfigs = customConfigs, + UploadMode = uploadMode, + BatchId = batchId, + DataSource = dataSource, + Metadata = metadata, + }; + PrepareArguments( + client: HttpClient); + PrepareV1LibraryUploadArguments( + httpClient: HttpClient, + request: request); + + + var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_V1LibraryUploadSecurityRequirements, + operationName: "V1LibraryUploadAsync"); + + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: false); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: "/studio/v1/library/files", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.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 - ).ConfigureAwait(false); - return __content; + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); } - catch (global::System.Exception __ex) + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") { - string? __content = null; + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + + var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); + var __contentFile = new global::System.Net.Http.StreamContent(file); + __contentFile.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( + request.Filename is null + ? "application/octet-stream" + : (global::System.IO.Path.GetExtension(request.Filename) ?? string.Empty).ToLowerInvariant() switch + { + ".aac" => "audio/aac", + ".flac" => "audio/flac", + ".gif" => "image/gif", + ".jpeg" => "image/jpeg", + ".jpg" => "image/jpeg", + ".json" => "application/json", + ".m4a" => "audio/mp4", + ".mp3" => "audio/mpeg", + ".mp4" => "video/mp4", + ".mpeg" => "audio/mpeg", + ".mpga" => "audio/mpeg", + ".oga" => "audio/ogg", + ".ogg" => "audio/ogg", + ".opus" => "audio/ogg", + ".pdf" => "application/pdf", + ".png" => "image/png", + ".txt" => "text/plain", + ".wav" => "audio/wav", + ".weba" => "audio/webm", + ".webm" => "video/webm", + ".webp" => "image/webp", + _ => "application/octet-stream", + }); + __httpRequestContent.Add( + content: __contentFile, + name: "\"file\"", + fileName: request.Filename != null ? $"\"{request.Filename}\"" : string.Empty); + if (__contentFile.Headers.ContentDisposition != null) + { + __contentFile.Headers.ContentDisposition.FileNameStar = null; + } + + if (request.Path != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.Path ?? string.Empty), + name: "\"path\""); + + } + if (request.Labels != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent($"[{string.Join(",", global::System.Linq.Enumerable.Select(request.Labels, x => x))}]"), + name: "\"labels\""); + + } + if (request.PublicUrl != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.PublicUrl ?? string.Empty), + name: "\"publicUrl\""); + + } + if (request.CustomConfigs != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.CustomConfigs ?? string.Empty), + name: "\"custom_configs\""); + + } + if (request.UploadMode != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((request.UploadMode).HasValue ? (request.UploadMode).GetValueOrDefault().ToValueString() : string.Empty), + name: "\"upload_mode\""); + + } + if (request.BatchId != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.BatchId.ToString() ?? string.Empty), + name: "\"batch_id\""); + + } + if (request.DataSource != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.DataSource ?? string.Empty), + name: "\"data_source\""); + + } + if (request.Metadata != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.Metadata ?? string.Empty), + name: "\"metadata\""); + + } + + __httpRequest.Content = __httpRequestContent; + + global::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareV1LibraryUploadRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + request: request); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1LibraryUpload", + methodName: "V1LibraryUploadAsync", + pathTemplate: "\"/studio/v1/library/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 { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); } - catch (global::System.Exception) + catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1LibraryUpload", + methodName: "V1LibraryUploadAsync", + pathTemplate: "\"/studio/v1/library/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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; } - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1LibraryUpload", + methodName: "V1LibraryUploadAsync", + pathTemplate: "\"/studio/v1/library/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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessV1LibraryUploadResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1LibraryUpload", + methodName: "V1LibraryUploadAsync", + pathTemplate: "\"/studio/v1/library/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::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1LibraryUpload", + methodName: "V1LibraryUploadAsync", + pathTemplate: "\"/studio/v1/library/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::AI21.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessV1LibraryUploadResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return __content; + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? 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::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); } } /// @@ -313,7 +1178,9 @@ partial void ProcessV1LibraryUploadResponseContent( /// - **Max library size:** 1 GB total size. No limit to individual file size.
/// - **Supported file types:** PDF, DocX, HTML, TXT ///
- /// + /// + /// The stream to send as the multipart 'file' file part. + /// /// /// /// @@ -325,10 +1192,11 @@ partial void ProcessV1LibraryUploadResponseContent( /// /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task V1LibraryUploadAsync( - byte[] file, + /// + public async global::System.Threading.Tasks.Task> V1LibraryUploadAsResponseAsync( + global::System.IO.Stream file, string filename, string? path = default, global::System.Collections.Generic.IList? labels = default, @@ -338,11 +1206,14 @@ partial void ProcessV1LibraryUploadResponseContent( global::System.Guid? batchId = default, string? dataSource = default, string? metadata = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) { - var __request = new global::AI21.BodyV1LibraryUpload + + file = file ?? throw new global::System.ArgumentNullException(nameof(file)); + var request = new global::AI21.BodyV1LibraryUpload { - File = file, + File = global::System.Array.Empty(), Filename = filename, Path = path, Labels = labels, @@ -353,10 +1224,492 @@ partial void ProcessV1LibraryUploadResponseContent( DataSource = dataSource, Metadata = metadata, }; + PrepareArguments( + client: HttpClient); + PrepareV1LibraryUploadArguments( + httpClient: HttpClient, + request: request); - return await V1LibraryUploadAsync( - request: __request, - cancellationToken: cancellationToken).ConfigureAwait(false); + + var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_V1LibraryUploadSecurityRequirements, + operationName: "V1LibraryUploadAsync"); + + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: false); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: "/studio/v1/library/files", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Post, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + + var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); + var __contentFile = new global::System.Net.Http.StreamContent(file); + __contentFile.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( + request.Filename is null + ? "application/octet-stream" + : (global::System.IO.Path.GetExtension(request.Filename) ?? string.Empty).ToLowerInvariant() switch + { + ".aac" => "audio/aac", + ".flac" => "audio/flac", + ".gif" => "image/gif", + ".jpeg" => "image/jpeg", + ".jpg" => "image/jpeg", + ".json" => "application/json", + ".m4a" => "audio/mp4", + ".mp3" => "audio/mpeg", + ".mp4" => "video/mp4", + ".mpeg" => "audio/mpeg", + ".mpga" => "audio/mpeg", + ".oga" => "audio/ogg", + ".ogg" => "audio/ogg", + ".opus" => "audio/ogg", + ".pdf" => "application/pdf", + ".png" => "image/png", + ".txt" => "text/plain", + ".wav" => "audio/wav", + ".weba" => "audio/webm", + ".webm" => "video/webm", + ".webp" => "image/webp", + _ => "application/octet-stream", + }); + __httpRequestContent.Add( + content: __contentFile, + name: "\"file\"", + fileName: request.Filename != null ? $"\"{request.Filename}\"" : string.Empty); + if (__contentFile.Headers.ContentDisposition != null) + { + __contentFile.Headers.ContentDisposition.FileNameStar = null; + } + + if (request.Path != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.Path ?? string.Empty), + name: "\"path\""); + + } + if (request.Labels != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent($"[{string.Join(",", global::System.Linq.Enumerable.Select(request.Labels, x => x))}]"), + name: "\"labels\""); + + } + if (request.PublicUrl != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.PublicUrl ?? string.Empty), + name: "\"publicUrl\""); + + } + if (request.CustomConfigs != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.CustomConfigs ?? string.Empty), + name: "\"custom_configs\""); + + } + if (request.UploadMode != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((request.UploadMode).HasValue ? (request.UploadMode).GetValueOrDefault().ToValueString() : string.Empty), + name: "\"upload_mode\""); + + } + if (request.BatchId != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.BatchId.ToString() ?? string.Empty), + name: "\"batch_id\""); + + } + if (request.DataSource != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.DataSource ?? string.Empty), + name: "\"data_source\""); + + } + if (request.Metadata != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.Metadata ?? string.Empty), + name: "\"metadata\""); + + } + + __httpRequest.Content = __httpRequestContent; + + global::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareV1LibraryUploadRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + request: request); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1LibraryUpload", + methodName: "V1LibraryUploadAsync", + pathTemplate: "\"/studio/v1/library/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::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1LibraryUpload", + methodName: "V1LibraryUploadAsync", + pathTemplate: "\"/studio/v1/library/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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1LibraryUpload", + methodName: "V1LibraryUploadAsync", + pathTemplate: "\"/studio/v1/library/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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessV1LibraryUploadResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1LibraryUpload", + methodName: "V1LibraryUploadAsync", + pathTemplate: "\"/studio/v1/library/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::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1LibraryUpload", + methodName: "V1LibraryUploadAsync", + pathTemplate: "\"/studio/v1/library/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::AI21.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessV1LibraryUploadResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? 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::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.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::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } } } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.LibraryManagementClient.g.cs b/src/libs/AI21/Generated/AI21.LibraryManagementClient.g.cs index 167b6395..90aacca1 100644 --- a/src/libs/AI21/Generated/AI21.LibraryManagementClient.g.cs +++ b/src/libs/AI21/Generated/AI21.LibraryManagementClient.g.cs @@ -30,6 +30,9 @@ public sealed partial class LibraryManagementClient : global::AI21.ILibraryManag #if DEBUG = true; #endif + + /// + public global::AI21.AutoSDKClientOptions Options { get; } /// /// /// @@ -49,11 +52,58 @@ public LibraryManagementClient( 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 LibraryManagementClient 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 LibraryManagementClient( + global::System.Net.Http.HttpClient? httpClient, + global::System.Collections.Generic.List? authorizations, + global::AI21.AutoSDKClientOptions? options, + bool disposeHttpClient = true) : this( + httpClient, + baseUri: null, + authorizations, + options, + disposeHttpClient: disposeHttpClient) + { + } + + /// + /// Creates a new instance of the LibraryManagementClient. + /// 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 LibraryManagementClient( + global::System.Net.Http.HttpClient? httpClient, + global::System.Uri? baseUri, + global::System.Collections.Generic.List? authorizations, + global::AI21.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::AI21.AutoSDKClientOptions(); _disposeHttpClient = disposeHttpClient; Initialized(HttpClient); diff --git a/src/libs/AI21/Generated/AI21.Models.AgentCreate.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.AgentCreate.Json.g.cs new file mode 100644 index 00000000..e43a2404 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.AgentCreate.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace AI21 +{ + public sealed partial class AgentCreate + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::AI21.AgentCreate? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::AI21.AgentCreate), + jsonSerializerContext) as global::AI21.AgentCreate; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::AI21.AgentCreate? FromJson( + string json) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::AI21.AgentCreate? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::AI21.AgentCreate), + jsonSerializerContext).ConfigureAwait(false)) as global::AI21.AgentCreate; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/AI21/Generated/AI21.Models.AgentCreate.g.cs b/src/libs/AI21/Generated/AI21.Models.AgentCreate.g.cs new file mode 100644 index 00000000..8b25f843 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.AgentCreate.g.cs @@ -0,0 +1,94 @@ + +#nullable enable + +namespace AI21 +{ + /// + /// Body for ``POST /tokenwise/settings/agents``. + /// + public sealed partial class AgentCreate + { + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("agent_id")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string AgentId { get; set; } + + /// + /// Default Value: other + /// + [global::System.Text.Json.Serialization.JsonPropertyName("kind")] + public string? Kind { get; set; } + + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("name")] + public string? Name { get; set; } + + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("description")] + public string? Description { get; set; } + + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("config_id")] + public string? ConfigId { get; set; } + + /// + /// Default Value: true + /// + [global::System.Text.Json.Serialization.JsonPropertyName("enabled")] + public bool? Enabled { 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: other + /// + /// + /// + /// + /// + /// Default Value: true + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public AgentCreate( + string agentId, + string? kind, + string? name, + string? description, + string? configId, + bool? enabled) + { + this.AgentId = agentId ?? throw new global::System.ArgumentNullException(nameof(agentId)); + this.Kind = kind; + this.Name = name; + this.Description = description; + this.ConfigId = configId; + this.Enabled = enabled; + } + + /// + /// Initializes a new instance of the class. + /// + public AgentCreate() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.AgentOptimization.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.AgentOptimization.Json.g.cs new file mode 100644 index 00000000..620b9bfe --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.AgentOptimization.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace AI21 +{ + public sealed partial class AgentOptimization + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::AI21.AgentOptimization? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::AI21.AgentOptimization), + jsonSerializerContext) as global::AI21.AgentOptimization; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::AI21.AgentOptimization? FromJson( + string json) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::AI21.AgentOptimization? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::AI21.AgentOptimization), + jsonSerializerContext).ConfigureAwait(false)) as global::AI21.AgentOptimization; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/AI21/Generated/AI21.Models.AgentOptimization.g.cs b/src/libs/AI21/Generated/AI21.Models.AgentOptimization.g.cs new file mode 100644 index 00000000..91d85222 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.AgentOptimization.g.cs @@ -0,0 +1,114 @@ + +#nullable enable + +namespace AI21 +{ + /// + /// Response shape for one card in ``GET /tokenwise/settings/agents/{agent_id}/optimizations``.
+ /// String-ish fields stay plain ``str`` (not ``Literal``) so a new gateway enum
+ /// value (a new ``availability`` / ``safety`` / ``category``) doesn't force an
+ /// api-server release. The gateway filters ``hidden`` cards, so we never see them. + ///
+ public sealed partial class AgentOptimization + { + /// + /// A unique ID for the request (not the message). Repeated identical requests
+ /// get different IDs. However, for a streaming response, the ID will be the same
+ /// for all responses in the stream. + ///
+ [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("keys")] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::System.Collections.Generic.IList Keys { get; set; } + + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("name")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Name { get; set; } + + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("description")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Description { get; set; } + + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("category")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Category { get; set; } + + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("availability")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Availability { get; set; } + + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("safety")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Safety { 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 unique ID for the request (not the message). Repeated identical requests
+ /// get different IDs. However, for a streaming response, the ID will be the same
+ /// for all responses in the stream. + /// + /// + /// + /// + /// + /// + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public AgentOptimization( + string id, + global::System.Collections.Generic.IList keys, + string name, + string description, + string category, + string availability, + string safety) + { + this.Id = id ?? throw new global::System.ArgumentNullException(nameof(id)); + this.Keys = keys ?? throw new global::System.ArgumentNullException(nameof(keys)); + this.Name = name ?? throw new global::System.ArgumentNullException(nameof(name)); + this.Description = description ?? throw new global::System.ArgumentNullException(nameof(description)); + this.Category = category ?? throw new global::System.ArgumentNullException(nameof(category)); + this.Availability = availability ?? throw new global::System.ArgumentNullException(nameof(availability)); + this.Safety = safety ?? throw new global::System.ArgumentNullException(nameof(safety)); + } + + /// + /// Initializes a new instance of the class. + /// + public AgentOptimization() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.AgentOut.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.AgentOut.Json.g.cs new file mode 100644 index 00000000..1a77f890 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.AgentOut.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace AI21 +{ + public sealed partial class AgentOut + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::AI21.AgentOut? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::AI21.AgentOut), + jsonSerializerContext) as global::AI21.AgentOut; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::AI21.AgentOut? FromJson( + string json) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::AI21.AgentOut? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::AI21.AgentOut), + jsonSerializerContext).ConfigureAwait(false)) as global::AI21.AgentOut; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/AI21/Generated/AI21.Models.AgentOut.g.cs b/src/libs/AI21/Generated/AI21.Models.AgentOut.g.cs new file mode 100644 index 00000000..7ebc5756 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.AgentOut.g.cs @@ -0,0 +1,149 @@ + +#nullable enable + +namespace AI21 +{ + /// + /// Response shape for agent GET / POST / PUT. + /// + public sealed partial class AgentOut + { + /// + /// A unique ID for the request (not the message). Repeated identical requests
+ /// get different IDs. However, for a streaming response, the ID will be the same
+ /// for all responses in the stream. + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("id")] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::System.Guid Id { get; set; } + + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("workspace_id")] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::System.Guid WorkspaceId { get; set; } + + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("agent_id")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string AgentId { 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("kind")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Kind { get; set; } + + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("description")] + public string? Description { get; set; } + + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("config_id")] + public string? ConfigId { get; set; } + + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("enabled")] + [global::System.Text.Json.Serialization.JsonRequired] + public required bool Enabled { get; set; } + + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("used")] + [global::System.Text.Json.Serialization.JsonRequired] + public required bool Used { get; set; } + + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("created_at")] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::System.DateTime CreatedAt { get; set; } + + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("updated_at")] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::System.DateTime UpdatedAt { 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 unique ID for the request (not the message). Repeated identical requests
+ /// get different IDs. However, for a streaming response, the ID will be the same
+ /// for all responses in the stream. + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public AgentOut( + global::System.Guid id, + global::System.Guid workspaceId, + string agentId, + string name, + string kind, + bool enabled, + bool used, + global::System.DateTime createdAt, + global::System.DateTime updatedAt, + string? description, + string? configId) + { + this.Id = id; + this.WorkspaceId = workspaceId; + this.AgentId = agentId ?? throw new global::System.ArgumentNullException(nameof(agentId)); + this.Name = name ?? throw new global::System.ArgumentNullException(nameof(name)); + this.Kind = kind ?? throw new global::System.ArgumentNullException(nameof(kind)); + this.Description = description; + this.ConfigId = configId; + this.Enabled = enabled; + this.Used = used; + this.CreatedAt = createdAt; + this.UpdatedAt = updatedAt; + } + + /// + /// Initializes a new instance of the class. + /// + public AgentOut() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.AgentUpdate.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.AgentUpdate.Json.g.cs new file mode 100644 index 00000000..2d8aa95d --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.AgentUpdate.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace AI21 +{ + public sealed partial class AgentUpdate + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::AI21.AgentUpdate? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::AI21.AgentUpdate), + jsonSerializerContext) as global::AI21.AgentUpdate; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::AI21.AgentUpdate? FromJson( + string json) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::AI21.AgentUpdate? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::AI21.AgentUpdate), + jsonSerializerContext).ConfigureAwait(false)) as global::AI21.AgentUpdate; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/AI21/Generated/AI21.Models.AgentUpdate.g.cs b/src/libs/AI21/Generated/AI21.Models.AgentUpdate.g.cs new file mode 100644 index 00000000..a3981341 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.AgentUpdate.g.cs @@ -0,0 +1,80 @@ + +#nullable enable + +namespace AI21 +{ + /// + /// Body for ``PUT /tokenwise/settings/agents/{agent_id}`` — partial update. + /// + public sealed partial class AgentUpdate + { + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("name")] + public string? Name { get; set; } + + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("kind")] + public string? Kind { get; set; } + + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("description")] + public string? Description { get; set; } + + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("config_id")] + public string? ConfigId { get; set; } + + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("enabled")] + public bool? Enabled { 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 AgentUpdate( + string? name, + string? kind, + string? description, + string? configId, + bool? enabled) + { + this.Name = name; + this.Kind = kind; + this.Description = description; + this.ConfigId = configId; + this.Enabled = enabled; + } + + /// + /// Initializes a new instance of the class. + /// + public AgentUpdate() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.AnalyticsAgentsGatewayAnalyticsV1AgentsGetResponse.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.AnalyticsAgentsGatewayAnalyticsV1AgentsGetResponse.Json.g.cs new file mode 100644 index 00000000..e917ee54 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.AnalyticsAgentsGatewayAnalyticsV1AgentsGetResponse.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace AI21 +{ + public sealed partial class AnalyticsAgentsGatewayAnalyticsV1AgentsGetResponse + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::AI21.AnalyticsAgentsGatewayAnalyticsV1AgentsGetResponse? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::AI21.AnalyticsAgentsGatewayAnalyticsV1AgentsGetResponse), + jsonSerializerContext) as global::AI21.AnalyticsAgentsGatewayAnalyticsV1AgentsGetResponse; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::AI21.AnalyticsAgentsGatewayAnalyticsV1AgentsGetResponse? FromJson( + string json) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::AI21.AnalyticsAgentsGatewayAnalyticsV1AgentsGetResponse? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::AI21.AnalyticsAgentsGatewayAnalyticsV1AgentsGetResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::AI21.AnalyticsAgentsGatewayAnalyticsV1AgentsGetResponse; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/AI21/Generated/AI21.Models.AnalyticsAgentsGatewayAnalyticsV1AgentsGetResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.AnalyticsAgentsGatewayAnalyticsV1AgentsGetResponse.g.cs new file mode 100644 index 00000000..ba3c1f1a --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.AnalyticsAgentsGatewayAnalyticsV1AgentsGetResponse.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace AI21 +{ + /// + /// + /// + public sealed partial class AnalyticsAgentsGatewayAnalyticsV1AgentsGetResponse + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.AnalyticsAgentsTokenwiseAnalyticsV1AgentsGetResponse.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.AnalyticsAgentsTokenwiseAnalyticsV1AgentsGetResponse.Json.g.cs new file mode 100644 index 00000000..cfe32460 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.AnalyticsAgentsTokenwiseAnalyticsV1AgentsGetResponse.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace AI21 +{ + public sealed partial class AnalyticsAgentsTokenwiseAnalyticsV1AgentsGetResponse + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::AI21.AnalyticsAgentsTokenwiseAnalyticsV1AgentsGetResponse? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::AI21.AnalyticsAgentsTokenwiseAnalyticsV1AgentsGetResponse), + jsonSerializerContext) as global::AI21.AnalyticsAgentsTokenwiseAnalyticsV1AgentsGetResponse; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::AI21.AnalyticsAgentsTokenwiseAnalyticsV1AgentsGetResponse? FromJson( + string json) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::AI21.AnalyticsAgentsTokenwiseAnalyticsV1AgentsGetResponse? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::AI21.AnalyticsAgentsTokenwiseAnalyticsV1AgentsGetResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::AI21.AnalyticsAgentsTokenwiseAnalyticsV1AgentsGetResponse; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/AI21/Generated/AI21.Models.AnalyticsAgentsTokenwiseAnalyticsV1AgentsGetResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.AnalyticsAgentsTokenwiseAnalyticsV1AgentsGetResponse.g.cs new file mode 100644 index 00000000..90cac009 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.AnalyticsAgentsTokenwiseAnalyticsV1AgentsGetResponse.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace AI21 +{ + /// + /// + /// + public sealed partial class AnalyticsAgentsTokenwiseAnalyticsV1AgentsGetResponse + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.AnalyticsContextBashGatewayAnalyticsV1ContextBashGetResponse.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.AnalyticsContextBashGatewayAnalyticsV1ContextBashGetResponse.Json.g.cs new file mode 100644 index 00000000..4386e40a --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.AnalyticsContextBashGatewayAnalyticsV1ContextBashGetResponse.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace AI21 +{ + public sealed partial class AnalyticsContextBashGatewayAnalyticsV1ContextBashGetResponse + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::AI21.AnalyticsContextBashGatewayAnalyticsV1ContextBashGetResponse? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::AI21.AnalyticsContextBashGatewayAnalyticsV1ContextBashGetResponse), + jsonSerializerContext) as global::AI21.AnalyticsContextBashGatewayAnalyticsV1ContextBashGetResponse; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::AI21.AnalyticsContextBashGatewayAnalyticsV1ContextBashGetResponse? FromJson( + string json) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::AI21.AnalyticsContextBashGatewayAnalyticsV1ContextBashGetResponse? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::AI21.AnalyticsContextBashGatewayAnalyticsV1ContextBashGetResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::AI21.AnalyticsContextBashGatewayAnalyticsV1ContextBashGetResponse; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/AI21/Generated/AI21.Models.AnalyticsContextBashGatewayAnalyticsV1ContextBashGetResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.AnalyticsContextBashGatewayAnalyticsV1ContextBashGetResponse.g.cs new file mode 100644 index 00000000..4cf85dc7 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.AnalyticsContextBashGatewayAnalyticsV1ContextBashGetResponse.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace AI21 +{ + /// + /// + /// + public sealed partial class AnalyticsContextBashGatewayAnalyticsV1ContextBashGetResponse + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.AnalyticsContextBashTokenwiseAnalyticsV1ContextBashGetResponse.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.AnalyticsContextBashTokenwiseAnalyticsV1ContextBashGetResponse.Json.g.cs new file mode 100644 index 00000000..093394a3 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.AnalyticsContextBashTokenwiseAnalyticsV1ContextBashGetResponse.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace AI21 +{ + public sealed partial class AnalyticsContextBashTokenwiseAnalyticsV1ContextBashGetResponse + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::AI21.AnalyticsContextBashTokenwiseAnalyticsV1ContextBashGetResponse? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::AI21.AnalyticsContextBashTokenwiseAnalyticsV1ContextBashGetResponse), + jsonSerializerContext) as global::AI21.AnalyticsContextBashTokenwiseAnalyticsV1ContextBashGetResponse; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::AI21.AnalyticsContextBashTokenwiseAnalyticsV1ContextBashGetResponse? FromJson( + string json) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::AI21.AnalyticsContextBashTokenwiseAnalyticsV1ContextBashGetResponse? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::AI21.AnalyticsContextBashTokenwiseAnalyticsV1ContextBashGetResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::AI21.AnalyticsContextBashTokenwiseAnalyticsV1ContextBashGetResponse; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/AI21/Generated/AI21.Models.AnalyticsContextBashTokenwiseAnalyticsV1ContextBashGetResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.AnalyticsContextBashTokenwiseAnalyticsV1ContextBashGetResponse.g.cs new file mode 100644 index 00000000..716d5d1e --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.AnalyticsContextBashTokenwiseAnalyticsV1ContextBashGetResponse.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace AI21 +{ + /// + /// + /// + public sealed partial class AnalyticsContextBashTokenwiseAnalyticsV1ContextBashGetResponse + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.AnalyticsContextBlocksGatewayAnalyticsV1ContextBlocksGetResponse.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.AnalyticsContextBlocksGatewayAnalyticsV1ContextBlocksGetResponse.Json.g.cs new file mode 100644 index 00000000..18d3e709 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.AnalyticsContextBlocksGatewayAnalyticsV1ContextBlocksGetResponse.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace AI21 +{ + public sealed partial class AnalyticsContextBlocksGatewayAnalyticsV1ContextBlocksGetResponse + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::AI21.AnalyticsContextBlocksGatewayAnalyticsV1ContextBlocksGetResponse? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::AI21.AnalyticsContextBlocksGatewayAnalyticsV1ContextBlocksGetResponse), + jsonSerializerContext) as global::AI21.AnalyticsContextBlocksGatewayAnalyticsV1ContextBlocksGetResponse; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::AI21.AnalyticsContextBlocksGatewayAnalyticsV1ContextBlocksGetResponse? FromJson( + string json) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::AI21.AnalyticsContextBlocksGatewayAnalyticsV1ContextBlocksGetResponse? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::AI21.AnalyticsContextBlocksGatewayAnalyticsV1ContextBlocksGetResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::AI21.AnalyticsContextBlocksGatewayAnalyticsV1ContextBlocksGetResponse; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/AI21/Generated/AI21.Models.AnalyticsContextBlocksGatewayAnalyticsV1ContextBlocksGetResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.AnalyticsContextBlocksGatewayAnalyticsV1ContextBlocksGetResponse.g.cs new file mode 100644 index 00000000..51c76643 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.AnalyticsContextBlocksGatewayAnalyticsV1ContextBlocksGetResponse.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace AI21 +{ + /// + /// + /// + public sealed partial class AnalyticsContextBlocksGatewayAnalyticsV1ContextBlocksGetResponse + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.AnalyticsContextBlocksTokenwiseAnalyticsV1ContextBlocksGetResponse.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.AnalyticsContextBlocksTokenwiseAnalyticsV1ContextBlocksGetResponse.Json.g.cs new file mode 100644 index 00000000..0c24127f --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.AnalyticsContextBlocksTokenwiseAnalyticsV1ContextBlocksGetResponse.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace AI21 +{ + public sealed partial class AnalyticsContextBlocksTokenwiseAnalyticsV1ContextBlocksGetResponse + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::AI21.AnalyticsContextBlocksTokenwiseAnalyticsV1ContextBlocksGetResponse? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::AI21.AnalyticsContextBlocksTokenwiseAnalyticsV1ContextBlocksGetResponse), + jsonSerializerContext) as global::AI21.AnalyticsContextBlocksTokenwiseAnalyticsV1ContextBlocksGetResponse; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::AI21.AnalyticsContextBlocksTokenwiseAnalyticsV1ContextBlocksGetResponse? FromJson( + string json) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::AI21.AnalyticsContextBlocksTokenwiseAnalyticsV1ContextBlocksGetResponse? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::AI21.AnalyticsContextBlocksTokenwiseAnalyticsV1ContextBlocksGetResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::AI21.AnalyticsContextBlocksTokenwiseAnalyticsV1ContextBlocksGetResponse; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/AI21/Generated/AI21.Models.AnalyticsContextBlocksTokenwiseAnalyticsV1ContextBlocksGetResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.AnalyticsContextBlocksTokenwiseAnalyticsV1ContextBlocksGetResponse.g.cs new file mode 100644 index 00000000..15328273 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.AnalyticsContextBlocksTokenwiseAnalyticsV1ContextBlocksGetResponse.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace AI21 +{ + /// + /// + /// + public sealed partial class AnalyticsContextBlocksTokenwiseAnalyticsV1ContextBlocksGetResponse + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.AnalyticsContextPrefixGatewayAnalyticsV1ContextPrefixGetResponse.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.AnalyticsContextPrefixGatewayAnalyticsV1ContextPrefixGetResponse.Json.g.cs new file mode 100644 index 00000000..9b5a6186 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.AnalyticsContextPrefixGatewayAnalyticsV1ContextPrefixGetResponse.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace AI21 +{ + public sealed partial class AnalyticsContextPrefixGatewayAnalyticsV1ContextPrefixGetResponse + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::AI21.AnalyticsContextPrefixGatewayAnalyticsV1ContextPrefixGetResponse? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::AI21.AnalyticsContextPrefixGatewayAnalyticsV1ContextPrefixGetResponse), + jsonSerializerContext) as global::AI21.AnalyticsContextPrefixGatewayAnalyticsV1ContextPrefixGetResponse; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::AI21.AnalyticsContextPrefixGatewayAnalyticsV1ContextPrefixGetResponse? FromJson( + string json) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::AI21.AnalyticsContextPrefixGatewayAnalyticsV1ContextPrefixGetResponse? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::AI21.AnalyticsContextPrefixGatewayAnalyticsV1ContextPrefixGetResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::AI21.AnalyticsContextPrefixGatewayAnalyticsV1ContextPrefixGetResponse; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/AI21/Generated/AI21.Models.AnalyticsContextPrefixGatewayAnalyticsV1ContextPrefixGetResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.AnalyticsContextPrefixGatewayAnalyticsV1ContextPrefixGetResponse.g.cs new file mode 100644 index 00000000..452f30e5 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.AnalyticsContextPrefixGatewayAnalyticsV1ContextPrefixGetResponse.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace AI21 +{ + /// + /// + /// + public sealed partial class AnalyticsContextPrefixGatewayAnalyticsV1ContextPrefixGetResponse + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.AnalyticsContextPrefixTokenwiseAnalyticsV1ContextPrefixGetResponse.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.AnalyticsContextPrefixTokenwiseAnalyticsV1ContextPrefixGetResponse.Json.g.cs new file mode 100644 index 00000000..b903957e --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.AnalyticsContextPrefixTokenwiseAnalyticsV1ContextPrefixGetResponse.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace AI21 +{ + public sealed partial class AnalyticsContextPrefixTokenwiseAnalyticsV1ContextPrefixGetResponse + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::AI21.AnalyticsContextPrefixTokenwiseAnalyticsV1ContextPrefixGetResponse? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::AI21.AnalyticsContextPrefixTokenwiseAnalyticsV1ContextPrefixGetResponse), + jsonSerializerContext) as global::AI21.AnalyticsContextPrefixTokenwiseAnalyticsV1ContextPrefixGetResponse; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::AI21.AnalyticsContextPrefixTokenwiseAnalyticsV1ContextPrefixGetResponse? FromJson( + string json) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::AI21.AnalyticsContextPrefixTokenwiseAnalyticsV1ContextPrefixGetResponse? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::AI21.AnalyticsContextPrefixTokenwiseAnalyticsV1ContextPrefixGetResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::AI21.AnalyticsContextPrefixTokenwiseAnalyticsV1ContextPrefixGetResponse; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/AI21/Generated/AI21.Models.AnalyticsContextPrefixTokenwiseAnalyticsV1ContextPrefixGetResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.AnalyticsContextPrefixTokenwiseAnalyticsV1ContextPrefixGetResponse.g.cs new file mode 100644 index 00000000..23952548 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.AnalyticsContextPrefixTokenwiseAnalyticsV1ContextPrefixGetResponse.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace AI21 +{ + /// + /// + /// + public sealed partial class AnalyticsContextPrefixTokenwiseAnalyticsV1ContextPrefixGetResponse + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.AnalyticsContextToolsGatewayAnalyticsV1ContextToolsGetResponse.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.AnalyticsContextToolsGatewayAnalyticsV1ContextToolsGetResponse.Json.g.cs new file mode 100644 index 00000000..7f32277f --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.AnalyticsContextToolsGatewayAnalyticsV1ContextToolsGetResponse.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace AI21 +{ + public sealed partial class AnalyticsContextToolsGatewayAnalyticsV1ContextToolsGetResponse + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::AI21.AnalyticsContextToolsGatewayAnalyticsV1ContextToolsGetResponse? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::AI21.AnalyticsContextToolsGatewayAnalyticsV1ContextToolsGetResponse), + jsonSerializerContext) as global::AI21.AnalyticsContextToolsGatewayAnalyticsV1ContextToolsGetResponse; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::AI21.AnalyticsContextToolsGatewayAnalyticsV1ContextToolsGetResponse? FromJson( + string json) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::AI21.AnalyticsContextToolsGatewayAnalyticsV1ContextToolsGetResponse? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::AI21.AnalyticsContextToolsGatewayAnalyticsV1ContextToolsGetResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::AI21.AnalyticsContextToolsGatewayAnalyticsV1ContextToolsGetResponse; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/AI21/Generated/AI21.Models.AnalyticsContextToolsGatewayAnalyticsV1ContextToolsGetResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.AnalyticsContextToolsGatewayAnalyticsV1ContextToolsGetResponse.g.cs new file mode 100644 index 00000000..fa270cdc --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.AnalyticsContextToolsGatewayAnalyticsV1ContextToolsGetResponse.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace AI21 +{ + /// + /// + /// + public sealed partial class AnalyticsContextToolsGatewayAnalyticsV1ContextToolsGetResponse + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.AnalyticsContextToolsTokenwiseAnalyticsV1ContextToolsGetResponse.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.AnalyticsContextToolsTokenwiseAnalyticsV1ContextToolsGetResponse.Json.g.cs new file mode 100644 index 00000000..dc5798d0 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.AnalyticsContextToolsTokenwiseAnalyticsV1ContextToolsGetResponse.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace AI21 +{ + public sealed partial class AnalyticsContextToolsTokenwiseAnalyticsV1ContextToolsGetResponse + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::AI21.AnalyticsContextToolsTokenwiseAnalyticsV1ContextToolsGetResponse? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::AI21.AnalyticsContextToolsTokenwiseAnalyticsV1ContextToolsGetResponse), + jsonSerializerContext) as global::AI21.AnalyticsContextToolsTokenwiseAnalyticsV1ContextToolsGetResponse; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::AI21.AnalyticsContextToolsTokenwiseAnalyticsV1ContextToolsGetResponse? FromJson( + string json) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::AI21.AnalyticsContextToolsTokenwiseAnalyticsV1ContextToolsGetResponse? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::AI21.AnalyticsContextToolsTokenwiseAnalyticsV1ContextToolsGetResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::AI21.AnalyticsContextToolsTokenwiseAnalyticsV1ContextToolsGetResponse; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/AI21/Generated/AI21.Models.AnalyticsContextToolsTokenwiseAnalyticsV1ContextToolsGetResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.AnalyticsContextToolsTokenwiseAnalyticsV1ContextToolsGetResponse.g.cs new file mode 100644 index 00000000..4a5a8bfb --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.AnalyticsContextToolsTokenwiseAnalyticsV1ContextToolsGetResponse.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace AI21 +{ + /// + /// + /// + public sealed partial class AnalyticsContextToolsTokenwiseAnalyticsV1ContextToolsGetResponse + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.AnalyticsErrorsGatewayAnalyticsV1ErrorsGetResponse.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.AnalyticsErrorsGatewayAnalyticsV1ErrorsGetResponse.Json.g.cs new file mode 100644 index 00000000..0227d015 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.AnalyticsErrorsGatewayAnalyticsV1ErrorsGetResponse.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace AI21 +{ + public sealed partial class AnalyticsErrorsGatewayAnalyticsV1ErrorsGetResponse + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::AI21.AnalyticsErrorsGatewayAnalyticsV1ErrorsGetResponse? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::AI21.AnalyticsErrorsGatewayAnalyticsV1ErrorsGetResponse), + jsonSerializerContext) as global::AI21.AnalyticsErrorsGatewayAnalyticsV1ErrorsGetResponse; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::AI21.AnalyticsErrorsGatewayAnalyticsV1ErrorsGetResponse? FromJson( + string json) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::AI21.AnalyticsErrorsGatewayAnalyticsV1ErrorsGetResponse? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::AI21.AnalyticsErrorsGatewayAnalyticsV1ErrorsGetResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::AI21.AnalyticsErrorsGatewayAnalyticsV1ErrorsGetResponse; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/AI21/Generated/AI21.Models.AnalyticsErrorsGatewayAnalyticsV1ErrorsGetResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.AnalyticsErrorsGatewayAnalyticsV1ErrorsGetResponse.g.cs new file mode 100644 index 00000000..09591085 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.AnalyticsErrorsGatewayAnalyticsV1ErrorsGetResponse.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace AI21 +{ + /// + /// + /// + public sealed partial class AnalyticsErrorsGatewayAnalyticsV1ErrorsGetResponse + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.AnalyticsErrorsTokenwiseAnalyticsV1ErrorsGetResponse.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.AnalyticsErrorsTokenwiseAnalyticsV1ErrorsGetResponse.Json.g.cs new file mode 100644 index 00000000..1f5d15b1 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.AnalyticsErrorsTokenwiseAnalyticsV1ErrorsGetResponse.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace AI21 +{ + public sealed partial class AnalyticsErrorsTokenwiseAnalyticsV1ErrorsGetResponse + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::AI21.AnalyticsErrorsTokenwiseAnalyticsV1ErrorsGetResponse? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::AI21.AnalyticsErrorsTokenwiseAnalyticsV1ErrorsGetResponse), + jsonSerializerContext) as global::AI21.AnalyticsErrorsTokenwiseAnalyticsV1ErrorsGetResponse; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::AI21.AnalyticsErrorsTokenwiseAnalyticsV1ErrorsGetResponse? FromJson( + string json) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::AI21.AnalyticsErrorsTokenwiseAnalyticsV1ErrorsGetResponse? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::AI21.AnalyticsErrorsTokenwiseAnalyticsV1ErrorsGetResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::AI21.AnalyticsErrorsTokenwiseAnalyticsV1ErrorsGetResponse; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/AI21/Generated/AI21.Models.AnalyticsErrorsTokenwiseAnalyticsV1ErrorsGetResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.AnalyticsErrorsTokenwiseAnalyticsV1ErrorsGetResponse.g.cs new file mode 100644 index 00000000..fc46d557 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.AnalyticsErrorsTokenwiseAnalyticsV1ErrorsGetResponse.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace AI21 +{ + /// + /// + /// + public sealed partial class AnalyticsErrorsTokenwiseAnalyticsV1ErrorsGetResponse + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.AnalyticsFiltersGatewayAnalyticsV1FiltersGetResponse.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.AnalyticsFiltersGatewayAnalyticsV1FiltersGetResponse.Json.g.cs new file mode 100644 index 00000000..86a74652 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.AnalyticsFiltersGatewayAnalyticsV1FiltersGetResponse.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace AI21 +{ + public sealed partial class AnalyticsFiltersGatewayAnalyticsV1FiltersGetResponse + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::AI21.AnalyticsFiltersGatewayAnalyticsV1FiltersGetResponse? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::AI21.AnalyticsFiltersGatewayAnalyticsV1FiltersGetResponse), + jsonSerializerContext) as global::AI21.AnalyticsFiltersGatewayAnalyticsV1FiltersGetResponse; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::AI21.AnalyticsFiltersGatewayAnalyticsV1FiltersGetResponse? FromJson( + string json) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::AI21.AnalyticsFiltersGatewayAnalyticsV1FiltersGetResponse? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::AI21.AnalyticsFiltersGatewayAnalyticsV1FiltersGetResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::AI21.AnalyticsFiltersGatewayAnalyticsV1FiltersGetResponse; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/AI21/Generated/AI21.Models.AnalyticsFiltersGatewayAnalyticsV1FiltersGetResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.AnalyticsFiltersGatewayAnalyticsV1FiltersGetResponse.g.cs new file mode 100644 index 00000000..3c083d52 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.AnalyticsFiltersGatewayAnalyticsV1FiltersGetResponse.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace AI21 +{ + /// + /// + /// + public sealed partial class AnalyticsFiltersGatewayAnalyticsV1FiltersGetResponse + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.AnalyticsFiltersTokenwiseAnalyticsV1FiltersGetResponse.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.AnalyticsFiltersTokenwiseAnalyticsV1FiltersGetResponse.Json.g.cs new file mode 100644 index 00000000..1ea5b47b --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.AnalyticsFiltersTokenwiseAnalyticsV1FiltersGetResponse.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace AI21 +{ + public sealed partial class AnalyticsFiltersTokenwiseAnalyticsV1FiltersGetResponse + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::AI21.AnalyticsFiltersTokenwiseAnalyticsV1FiltersGetResponse? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::AI21.AnalyticsFiltersTokenwiseAnalyticsV1FiltersGetResponse), + jsonSerializerContext) as global::AI21.AnalyticsFiltersTokenwiseAnalyticsV1FiltersGetResponse; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::AI21.AnalyticsFiltersTokenwiseAnalyticsV1FiltersGetResponse? FromJson( + string json) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::AI21.AnalyticsFiltersTokenwiseAnalyticsV1FiltersGetResponse? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::AI21.AnalyticsFiltersTokenwiseAnalyticsV1FiltersGetResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::AI21.AnalyticsFiltersTokenwiseAnalyticsV1FiltersGetResponse; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/AI21/Generated/AI21.Models.AnalyticsFiltersTokenwiseAnalyticsV1FiltersGetResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.AnalyticsFiltersTokenwiseAnalyticsV1FiltersGetResponse.g.cs new file mode 100644 index 00000000..0195d09c --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.AnalyticsFiltersTokenwiseAnalyticsV1FiltersGetResponse.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace AI21 +{ + /// + /// + /// + public sealed partial class AnalyticsFiltersTokenwiseAnalyticsV1FiltersGetResponse + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.AnalyticsSessionDetailGatewayAnalyticsV1SessionsSessionIdGetResponse.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.AnalyticsSessionDetailGatewayAnalyticsV1SessionsSessionIdGetResponse.Json.g.cs new file mode 100644 index 00000000..98647906 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.AnalyticsSessionDetailGatewayAnalyticsV1SessionsSessionIdGetResponse.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace AI21 +{ + public sealed partial class AnalyticsSessionDetailGatewayAnalyticsV1SessionsSessionIdGetResponse + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::AI21.AnalyticsSessionDetailGatewayAnalyticsV1SessionsSessionIdGetResponse? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::AI21.AnalyticsSessionDetailGatewayAnalyticsV1SessionsSessionIdGetResponse), + jsonSerializerContext) as global::AI21.AnalyticsSessionDetailGatewayAnalyticsV1SessionsSessionIdGetResponse; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::AI21.AnalyticsSessionDetailGatewayAnalyticsV1SessionsSessionIdGetResponse? FromJson( + string json) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::AI21.AnalyticsSessionDetailGatewayAnalyticsV1SessionsSessionIdGetResponse? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::AI21.AnalyticsSessionDetailGatewayAnalyticsV1SessionsSessionIdGetResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::AI21.AnalyticsSessionDetailGatewayAnalyticsV1SessionsSessionIdGetResponse; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/AI21/Generated/AI21.Models.AnalyticsSessionDetailGatewayAnalyticsV1SessionsSessionIdGetResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.AnalyticsSessionDetailGatewayAnalyticsV1SessionsSessionIdGetResponse.g.cs new file mode 100644 index 00000000..db40225d --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.AnalyticsSessionDetailGatewayAnalyticsV1SessionsSessionIdGetResponse.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace AI21 +{ + /// + /// + /// + public sealed partial class AnalyticsSessionDetailGatewayAnalyticsV1SessionsSessionIdGetResponse + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.AnalyticsSessionDetailTokenwiseAnalyticsV1SessionsSessionIdGetResponse.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.AnalyticsSessionDetailTokenwiseAnalyticsV1SessionsSessionIdGetResponse.Json.g.cs new file mode 100644 index 00000000..7af7ba0f --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.AnalyticsSessionDetailTokenwiseAnalyticsV1SessionsSessionIdGetResponse.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace AI21 +{ + public sealed partial class AnalyticsSessionDetailTokenwiseAnalyticsV1SessionsSessionIdGetResponse + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::AI21.AnalyticsSessionDetailTokenwiseAnalyticsV1SessionsSessionIdGetResponse? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::AI21.AnalyticsSessionDetailTokenwiseAnalyticsV1SessionsSessionIdGetResponse), + jsonSerializerContext) as global::AI21.AnalyticsSessionDetailTokenwiseAnalyticsV1SessionsSessionIdGetResponse; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::AI21.AnalyticsSessionDetailTokenwiseAnalyticsV1SessionsSessionIdGetResponse? FromJson( + string json) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::AI21.AnalyticsSessionDetailTokenwiseAnalyticsV1SessionsSessionIdGetResponse? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::AI21.AnalyticsSessionDetailTokenwiseAnalyticsV1SessionsSessionIdGetResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::AI21.AnalyticsSessionDetailTokenwiseAnalyticsV1SessionsSessionIdGetResponse; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/AI21/Generated/AI21.Models.AnalyticsSessionDetailTokenwiseAnalyticsV1SessionsSessionIdGetResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.AnalyticsSessionDetailTokenwiseAnalyticsV1SessionsSessionIdGetResponse.g.cs new file mode 100644 index 00000000..41383aa2 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.AnalyticsSessionDetailTokenwiseAnalyticsV1SessionsSessionIdGetResponse.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace AI21 +{ + /// + /// + /// + public sealed partial class AnalyticsSessionDetailTokenwiseAnalyticsV1SessionsSessionIdGetResponse + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.AnalyticsSessionsGatewayAnalyticsV1SessionsGetResponse.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.AnalyticsSessionsGatewayAnalyticsV1SessionsGetResponse.Json.g.cs new file mode 100644 index 00000000..7c606611 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.AnalyticsSessionsGatewayAnalyticsV1SessionsGetResponse.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace AI21 +{ + public sealed partial class AnalyticsSessionsGatewayAnalyticsV1SessionsGetResponse + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::AI21.AnalyticsSessionsGatewayAnalyticsV1SessionsGetResponse? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::AI21.AnalyticsSessionsGatewayAnalyticsV1SessionsGetResponse), + jsonSerializerContext) as global::AI21.AnalyticsSessionsGatewayAnalyticsV1SessionsGetResponse; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::AI21.AnalyticsSessionsGatewayAnalyticsV1SessionsGetResponse? FromJson( + string json) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::AI21.AnalyticsSessionsGatewayAnalyticsV1SessionsGetResponse? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::AI21.AnalyticsSessionsGatewayAnalyticsV1SessionsGetResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::AI21.AnalyticsSessionsGatewayAnalyticsV1SessionsGetResponse; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/AI21/Generated/AI21.Models.AnalyticsSessionsGatewayAnalyticsV1SessionsGetResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.AnalyticsSessionsGatewayAnalyticsV1SessionsGetResponse.g.cs new file mode 100644 index 00000000..bf4b19d0 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.AnalyticsSessionsGatewayAnalyticsV1SessionsGetResponse.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace AI21 +{ + /// + /// + /// + public sealed partial class AnalyticsSessionsGatewayAnalyticsV1SessionsGetResponse + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.AnalyticsSessionsTokenwiseAnalyticsV1SessionsGetResponse.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.AnalyticsSessionsTokenwiseAnalyticsV1SessionsGetResponse.Json.g.cs new file mode 100644 index 00000000..dafb1024 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.AnalyticsSessionsTokenwiseAnalyticsV1SessionsGetResponse.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace AI21 +{ + public sealed partial class AnalyticsSessionsTokenwiseAnalyticsV1SessionsGetResponse + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::AI21.AnalyticsSessionsTokenwiseAnalyticsV1SessionsGetResponse? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::AI21.AnalyticsSessionsTokenwiseAnalyticsV1SessionsGetResponse), + jsonSerializerContext) as global::AI21.AnalyticsSessionsTokenwiseAnalyticsV1SessionsGetResponse; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::AI21.AnalyticsSessionsTokenwiseAnalyticsV1SessionsGetResponse? FromJson( + string json) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::AI21.AnalyticsSessionsTokenwiseAnalyticsV1SessionsGetResponse? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::AI21.AnalyticsSessionsTokenwiseAnalyticsV1SessionsGetResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::AI21.AnalyticsSessionsTokenwiseAnalyticsV1SessionsGetResponse; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/AI21/Generated/AI21.Models.AnalyticsSessionsTokenwiseAnalyticsV1SessionsGetResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.AnalyticsSessionsTokenwiseAnalyticsV1SessionsGetResponse.g.cs new file mode 100644 index 00000000..98463774 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.AnalyticsSessionsTokenwiseAnalyticsV1SessionsGetResponse.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace AI21 +{ + /// + /// + /// + public sealed partial class AnalyticsSessionsTokenwiseAnalyticsV1SessionsGetResponse + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.AnalyticsSummaryGatewayAnalyticsV1SummaryGetResponse.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.AnalyticsSummaryGatewayAnalyticsV1SummaryGetResponse.Json.g.cs new file mode 100644 index 00000000..7bf04474 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.AnalyticsSummaryGatewayAnalyticsV1SummaryGetResponse.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace AI21 +{ + public sealed partial class AnalyticsSummaryGatewayAnalyticsV1SummaryGetResponse + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::AI21.AnalyticsSummaryGatewayAnalyticsV1SummaryGetResponse? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::AI21.AnalyticsSummaryGatewayAnalyticsV1SummaryGetResponse), + jsonSerializerContext) as global::AI21.AnalyticsSummaryGatewayAnalyticsV1SummaryGetResponse; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::AI21.AnalyticsSummaryGatewayAnalyticsV1SummaryGetResponse? FromJson( + string json) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::AI21.AnalyticsSummaryGatewayAnalyticsV1SummaryGetResponse? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::AI21.AnalyticsSummaryGatewayAnalyticsV1SummaryGetResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::AI21.AnalyticsSummaryGatewayAnalyticsV1SummaryGetResponse; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/AI21/Generated/AI21.Models.AnalyticsSummaryGatewayAnalyticsV1SummaryGetResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.AnalyticsSummaryGatewayAnalyticsV1SummaryGetResponse.g.cs new file mode 100644 index 00000000..a5edebd6 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.AnalyticsSummaryGatewayAnalyticsV1SummaryGetResponse.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace AI21 +{ + /// + /// + /// + public sealed partial class AnalyticsSummaryGatewayAnalyticsV1SummaryGetResponse + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.AnalyticsSummaryTokenwiseAnalyticsV1SummaryGetResponse.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.AnalyticsSummaryTokenwiseAnalyticsV1SummaryGetResponse.Json.g.cs new file mode 100644 index 00000000..de4ac154 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.AnalyticsSummaryTokenwiseAnalyticsV1SummaryGetResponse.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace AI21 +{ + public sealed partial class AnalyticsSummaryTokenwiseAnalyticsV1SummaryGetResponse + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::AI21.AnalyticsSummaryTokenwiseAnalyticsV1SummaryGetResponse? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::AI21.AnalyticsSummaryTokenwiseAnalyticsV1SummaryGetResponse), + jsonSerializerContext) as global::AI21.AnalyticsSummaryTokenwiseAnalyticsV1SummaryGetResponse; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::AI21.AnalyticsSummaryTokenwiseAnalyticsV1SummaryGetResponse? FromJson( + string json) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::AI21.AnalyticsSummaryTokenwiseAnalyticsV1SummaryGetResponse? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::AI21.AnalyticsSummaryTokenwiseAnalyticsV1SummaryGetResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::AI21.AnalyticsSummaryTokenwiseAnalyticsV1SummaryGetResponse; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/AI21/Generated/AI21.Models.AnalyticsSummaryTokenwiseAnalyticsV1SummaryGetResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.AnalyticsSummaryTokenwiseAnalyticsV1SummaryGetResponse.g.cs new file mode 100644 index 00000000..5751c80b --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.AnalyticsSummaryTokenwiseAnalyticsV1SummaryGetResponse.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace AI21 +{ + /// + /// + /// + public sealed partial class AnalyticsSummaryTokenwiseAnalyticsV1SummaryGetResponse + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.AnalyticsTransformersGatewayAnalyticsV1TransformersGetResponse.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.AnalyticsTransformersGatewayAnalyticsV1TransformersGetResponse.Json.g.cs new file mode 100644 index 00000000..b1c389f8 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.AnalyticsTransformersGatewayAnalyticsV1TransformersGetResponse.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace AI21 +{ + public sealed partial class AnalyticsTransformersGatewayAnalyticsV1TransformersGetResponse + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::AI21.AnalyticsTransformersGatewayAnalyticsV1TransformersGetResponse? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::AI21.AnalyticsTransformersGatewayAnalyticsV1TransformersGetResponse), + jsonSerializerContext) as global::AI21.AnalyticsTransformersGatewayAnalyticsV1TransformersGetResponse; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::AI21.AnalyticsTransformersGatewayAnalyticsV1TransformersGetResponse? FromJson( + string json) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::AI21.AnalyticsTransformersGatewayAnalyticsV1TransformersGetResponse? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::AI21.AnalyticsTransformersGatewayAnalyticsV1TransformersGetResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::AI21.AnalyticsTransformersGatewayAnalyticsV1TransformersGetResponse; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/AI21/Generated/AI21.Models.AnalyticsTransformersGatewayAnalyticsV1TransformersGetResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.AnalyticsTransformersGatewayAnalyticsV1TransformersGetResponse.g.cs new file mode 100644 index 00000000..1014c69e --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.AnalyticsTransformersGatewayAnalyticsV1TransformersGetResponse.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace AI21 +{ + /// + /// + /// + public sealed partial class AnalyticsTransformersGatewayAnalyticsV1TransformersGetResponse + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.AnalyticsTransformersTokenwiseAnalyticsV1TransformersGetResponse.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.AnalyticsTransformersTokenwiseAnalyticsV1TransformersGetResponse.Json.g.cs new file mode 100644 index 00000000..0d9d5d68 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.AnalyticsTransformersTokenwiseAnalyticsV1TransformersGetResponse.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace AI21 +{ + public sealed partial class AnalyticsTransformersTokenwiseAnalyticsV1TransformersGetResponse + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::AI21.AnalyticsTransformersTokenwiseAnalyticsV1TransformersGetResponse? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::AI21.AnalyticsTransformersTokenwiseAnalyticsV1TransformersGetResponse), + jsonSerializerContext) as global::AI21.AnalyticsTransformersTokenwiseAnalyticsV1TransformersGetResponse; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::AI21.AnalyticsTransformersTokenwiseAnalyticsV1TransformersGetResponse? FromJson( + string json) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::AI21.AnalyticsTransformersTokenwiseAnalyticsV1TransformersGetResponse? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::AI21.AnalyticsTransformersTokenwiseAnalyticsV1TransformersGetResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::AI21.AnalyticsTransformersTokenwiseAnalyticsV1TransformersGetResponse; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/AI21/Generated/AI21.Models.AnalyticsTransformersTokenwiseAnalyticsV1TransformersGetResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.AnalyticsTransformersTokenwiseAnalyticsV1TransformersGetResponse.g.cs new file mode 100644 index 00000000..331d5b27 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.AnalyticsTransformersTokenwiseAnalyticsV1TransformersGetResponse.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace AI21 +{ + /// + /// + /// + public sealed partial class AnalyticsTransformersTokenwiseAnalyticsV1TransformersGetResponse + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.AnalyticsTrendsGatewayAnalyticsV1TrendsGetResponse.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.AnalyticsTrendsGatewayAnalyticsV1TrendsGetResponse.Json.g.cs new file mode 100644 index 00000000..220fabd3 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.AnalyticsTrendsGatewayAnalyticsV1TrendsGetResponse.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace AI21 +{ + public sealed partial class AnalyticsTrendsGatewayAnalyticsV1TrendsGetResponse + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::AI21.AnalyticsTrendsGatewayAnalyticsV1TrendsGetResponse? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::AI21.AnalyticsTrendsGatewayAnalyticsV1TrendsGetResponse), + jsonSerializerContext) as global::AI21.AnalyticsTrendsGatewayAnalyticsV1TrendsGetResponse; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::AI21.AnalyticsTrendsGatewayAnalyticsV1TrendsGetResponse? FromJson( + string json) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::AI21.AnalyticsTrendsGatewayAnalyticsV1TrendsGetResponse? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::AI21.AnalyticsTrendsGatewayAnalyticsV1TrendsGetResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::AI21.AnalyticsTrendsGatewayAnalyticsV1TrendsGetResponse; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/AI21/Generated/AI21.Models.AnalyticsTrendsGatewayAnalyticsV1TrendsGetResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.AnalyticsTrendsGatewayAnalyticsV1TrendsGetResponse.g.cs new file mode 100644 index 00000000..77cd77e3 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.AnalyticsTrendsGatewayAnalyticsV1TrendsGetResponse.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace AI21 +{ + /// + /// + /// + public sealed partial class AnalyticsTrendsGatewayAnalyticsV1TrendsGetResponse + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.AnalyticsTrendsTokenwiseAnalyticsV1TrendsGetResponse.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.AnalyticsTrendsTokenwiseAnalyticsV1TrendsGetResponse.Json.g.cs new file mode 100644 index 00000000..46926f3a --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.AnalyticsTrendsTokenwiseAnalyticsV1TrendsGetResponse.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace AI21 +{ + public sealed partial class AnalyticsTrendsTokenwiseAnalyticsV1TrendsGetResponse + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::AI21.AnalyticsTrendsTokenwiseAnalyticsV1TrendsGetResponse? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::AI21.AnalyticsTrendsTokenwiseAnalyticsV1TrendsGetResponse), + jsonSerializerContext) as global::AI21.AnalyticsTrendsTokenwiseAnalyticsV1TrendsGetResponse; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::AI21.AnalyticsTrendsTokenwiseAnalyticsV1TrendsGetResponse? FromJson( + string json) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::AI21.AnalyticsTrendsTokenwiseAnalyticsV1TrendsGetResponse? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::AI21.AnalyticsTrendsTokenwiseAnalyticsV1TrendsGetResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::AI21.AnalyticsTrendsTokenwiseAnalyticsV1TrendsGetResponse; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/AI21/Generated/AI21.Models.AnalyticsTrendsTokenwiseAnalyticsV1TrendsGetResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.AnalyticsTrendsTokenwiseAnalyticsV1TrendsGetResponse.g.cs new file mode 100644 index 00000000..86c0cb0b --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.AnalyticsTrendsTokenwiseAnalyticsV1TrendsGetResponse.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace AI21 +{ + /// + /// + /// + public sealed partial class AnalyticsTrendsTokenwiseAnalyticsV1TrendsGetResponse + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.Assistant.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.Assistant.Json.g.cs index 2f239bfc..94705078 100644 --- a/src/libs/AI21/Generated/AI21.Models.Assistant.Json.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.Assistant.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::AI21.Assistant; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::AI21.Assistant? FromJson( + string json) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::AI21.Assistant; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/AI21/Generated/AI21.Models.Assistant.g.cs b/src/libs/AI21/Generated/AI21.Models.Assistant.g.cs index 2c380d15..02763ca1 100644 --- a/src/libs/AI21/Generated/AI21.Models.Assistant.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.Assistant.g.cs @@ -274,5 +274,6 @@ public Assistant( public Assistant() { } + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.AssistantBasicInfo.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.AssistantBasicInfo.Json.g.cs index e2d0ccc7..95c58c9e 100644 --- a/src/libs/AI21/Generated/AI21.Models.AssistantBasicInfo.Json.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.AssistantBasicInfo.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::AI21.AssistantBasicInfo; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::AI21.AssistantBasicInfo? FromJson( + string json) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::AI21.AssistantBasicInfo; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/AI21/Generated/AI21.Models.AssistantBasicInfo.g.cs b/src/libs/AI21/Generated/AI21.Models.AssistantBasicInfo.g.cs index 49e67f48..f2c7dfaa 100644 --- a/src/libs/AI21/Generated/AI21.Models.AssistantBasicInfo.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.AssistantBasicInfo.g.cs @@ -56,5 +56,6 @@ public AssistantBasicInfo( public AssistantBasicInfo() { } + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.AssistantConfigOverrides.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.AssistantConfigOverrides.Json.g.cs index c8992eb4..e34db954 100644 --- a/src/libs/AI21/Generated/AI21.Models.AssistantConfigOverrides.Json.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.AssistantConfigOverrides.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::AI21.AssistantConfigOverrides; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::AI21.AssistantConfigOverrides? FromJson( + string json) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::AI21.AssistantConfigOverrides; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/AI21/Generated/AI21.Models.AssistantConfigOverrides.g.cs b/src/libs/AI21/Generated/AI21.Models.AssistantConfigOverrides.g.cs index 36c7b0c4..7b3b49d1 100644 --- a/src/libs/AI21/Generated/AI21.Models.AssistantConfigOverrides.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.AssistantConfigOverrides.g.cs @@ -14,5 +14,6 @@ public sealed partial class AssistantConfigOverrides /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.AssistantMessage.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.AssistantMessage.Json.g.cs index b1e675dd..1043927b 100644 --- a/src/libs/AI21/Generated/AI21.Models.AssistantMessage.Json.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.AssistantMessage.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::AI21.AssistantMessage; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::AI21.AssistantMessage? FromJson( + string json) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::AI21.AssistantMessage; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/AI21/Generated/AI21.Models.AssistantMessage.g.cs b/src/libs/AI21/Generated/AI21.Models.AssistantMessage.g.cs index 5384e5d0..34c048e2 100644 --- a/src/libs/AI21/Generated/AI21.Models.AssistantMessage.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.AssistantMessage.g.cs @@ -89,5 +89,6 @@ public AssistantMessage( public AssistantMessage() { } + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.AssistantRoute.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.AssistantRoute.Json.g.cs index 471f1d8a..f5cac9b0 100644 --- a/src/libs/AI21/Generated/AI21.Models.AssistantRoute.Json.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.AssistantRoute.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::AI21.AssistantRoute; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::AI21.AssistantRoute? FromJson( + string json) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::AI21.AssistantRoute; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/AI21/Generated/AI21.Models.AssistantRoute.g.cs b/src/libs/AI21/Generated/AI21.Models.AssistantRoute.g.cs index 2c1b1cb0..a20a2653 100644 --- a/src/libs/AI21/Generated/AI21.Models.AssistantRoute.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.AssistantRoute.g.cs @@ -116,5 +116,6 @@ public AssistantRoute( public AssistantRoute() { } + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.AssistantsByMcpResponse.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.AssistantsByMcpResponse.Json.g.cs index a02d9348..35b904db 100644 --- a/src/libs/AI21/Generated/AI21.Models.AssistantsByMcpResponse.Json.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.AssistantsByMcpResponse.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::AI21.AssistantsByMcpResponse; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::AI21.AssistantsByMcpResponse? FromJson( + string json) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::AI21.AssistantsByMcpResponse; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/AI21/Generated/AI21.Models.AssistantsByMcpResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.AssistantsByMcpResponse.g.cs index 131c9442..be92f0a1 100644 --- a/src/libs/AI21/Generated/AI21.Models.AssistantsByMcpResponse.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.AssistantsByMcpResponse.g.cs @@ -40,5 +40,6 @@ public AssistantsByMcpResponse( public AssistantsByMcpResponse() { } + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.BodyConvertDocumentFileStudioV1ChatFilesConvertPost.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.BodyConvertDocumentFileStudioV1ChatFilesConvertPost.Json.g.cs index 886c3d7e..b79d0326 100644 --- a/src/libs/AI21/Generated/AI21.Models.BodyConvertDocumentFileStudioV1ChatFilesConvertPost.Json.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.BodyConvertDocumentFileStudioV1ChatFilesConvertPost.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::AI21.BodyConvertDocumentFileStudioV1ChatFilesConvertPost; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::AI21.BodyConvertDocumentFileStudioV1ChatFilesConvertPost? FromJson( + string json) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::AI21.BodyConvertDocumentFileStudioV1ChatFilesConvertPost; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/AI21/Generated/AI21.Models.BodyConvertDocumentFileStudioV1ChatFilesConvertPost.g.cs b/src/libs/AI21/Generated/AI21.Models.BodyConvertDocumentFileStudioV1ChatFilesConvertPost.g.cs index 138392fe..d08d1dbb 100644 --- a/src/libs/AI21/Generated/AI21.Models.BodyConvertDocumentFileStudioV1ChatFilesConvertPost.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.BodyConvertDocumentFileStudioV1ChatFilesConvertPost.g.cs @@ -40,5 +40,6 @@ public BodyConvertDocumentFileStudioV1ChatFilesConvertPost( public BodyConvertDocumentFileStudioV1ChatFilesConvertPost() { } + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.BodyParsePdfStudioV1DemosDocumentModifierParsePdfPost.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.BodyParsePdfStudioV1DemosDocumentModifierParsePdfPost.Json.g.cs index 91da5629..703115fc 100644 --- a/src/libs/AI21/Generated/AI21.Models.BodyParsePdfStudioV1DemosDocumentModifierParsePdfPost.Json.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.BodyParsePdfStudioV1DemosDocumentModifierParsePdfPost.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::AI21.BodyParsePdfStudioV1DemosDocumentModifierParsePdfPost; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::AI21.BodyParsePdfStudioV1DemosDocumentModifierParsePdfPost? FromJson( + string json) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::AI21.BodyParsePdfStudioV1DemosDocumentModifierParsePdfPost; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/AI21/Generated/AI21.Models.BodyParsePdfStudioV1DemosDocumentModifierParsePdfPost.g.cs b/src/libs/AI21/Generated/AI21.Models.BodyParsePdfStudioV1DemosDocumentModifierParsePdfPost.g.cs index 28174963..f55cbb7e 100644 --- a/src/libs/AI21/Generated/AI21.Models.BodyParsePdfStudioV1DemosDocumentModifierParsePdfPost.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.BodyParsePdfStudioV1DemosDocumentModifierParsePdfPost.g.cs @@ -50,5 +50,6 @@ public BodyParsePdfStudioV1DemosDocumentModifierParsePdfPost( public BodyParsePdfStudioV1DemosDocumentModifierParsePdfPost() { } + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.BodyProcessRfiDocumentStudioV1DemosRfiProcessRfiPost.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.BodyProcessRfiDocumentStudioV1DemosRfiProcessRfiPost.Json.g.cs index 88f00106..2f561d9e 100644 --- a/src/libs/AI21/Generated/AI21.Models.BodyProcessRfiDocumentStudioV1DemosRfiProcessRfiPost.Json.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.BodyProcessRfiDocumentStudioV1DemosRfiProcessRfiPost.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::AI21.BodyProcessRfiDocumentStudioV1DemosRfiProcessRfiPost; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::AI21.BodyProcessRfiDocumentStudioV1DemosRfiProcessRfiPost? FromJson( + string json) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::AI21.BodyProcessRfiDocumentStudioV1DemosRfiProcessRfiPost; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/AI21/Generated/AI21.Models.BodyProcessRfiDocumentStudioV1DemosRfiProcessRfiPost.g.cs b/src/libs/AI21/Generated/AI21.Models.BodyProcessRfiDocumentStudioV1DemosRfiProcessRfiPost.g.cs index e0005551..50a060a5 100644 --- a/src/libs/AI21/Generated/AI21.Models.BodyProcessRfiDocumentStudioV1DemosRfiProcessRfiPost.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.BodyProcessRfiDocumentStudioV1DemosRfiProcessRfiPost.g.cs @@ -78,5 +78,6 @@ public BodyProcessRfiDocumentStudioV1DemosRfiProcessRfiPost( public BodyProcessRfiDocumentStudioV1DemosRfiProcessRfiPost() { } + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.BodyUploadCheckComplianceStudioV1DemosRegulationsUploadCheckCompliancePost.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.BodyUploadCheckComplianceStudioV1DemosRegulationsUploadCheckCompliancePost.Json.g.cs index 2c345ffc..a3138103 100644 --- a/src/libs/AI21/Generated/AI21.Models.BodyUploadCheckComplianceStudioV1DemosRegulationsUploadCheckCompliancePost.Json.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.BodyUploadCheckComplianceStudioV1DemosRegulationsUploadCheckCompliancePost.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::AI21.BodyUploadCheckComplianceStudioV1DemosRegulationsUploadCheckCompliancePost; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::AI21.BodyUploadCheckComplianceStudioV1DemosRegulationsUploadCheckCompliancePost? FromJson( + string json) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::AI21.BodyUploadCheckComplianceStudioV1DemosRegulationsUploadCheckCompliancePost; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/AI21/Generated/AI21.Models.BodyUploadCheckComplianceStudioV1DemosRegulationsUploadCheckCompliancePost.g.cs b/src/libs/AI21/Generated/AI21.Models.BodyUploadCheckComplianceStudioV1DemosRegulationsUploadCheckCompliancePost.g.cs index 225c010f..36b116cd 100644 --- a/src/libs/AI21/Generated/AI21.Models.BodyUploadCheckComplianceStudioV1DemosRegulationsUploadCheckCompliancePost.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.BodyUploadCheckComplianceStudioV1DemosRegulationsUploadCheckCompliancePost.g.cs @@ -72,5 +72,6 @@ public BodyUploadCheckComplianceStudioV1DemosRegulationsUploadCheckCompliancePos public BodyUploadCheckComplianceStudioV1DemosRegulationsUploadCheckCompliancePost() { } + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.BodyV1LibraryUpload.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.BodyV1LibraryUpload.Json.g.cs index 2d9060ee..eb3d677b 100644 --- a/src/libs/AI21/Generated/AI21.Models.BodyV1LibraryUpload.Json.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.BodyV1LibraryUpload.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::AI21.BodyV1LibraryUpload; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::AI21.BodyV1LibraryUpload? FromJson( + string json) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::AI21.BodyV1LibraryUpload; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/AI21/Generated/AI21.Models.BodyV1LibraryUpload.g.cs b/src/libs/AI21/Generated/AI21.Models.BodyV1LibraryUpload.g.cs index 10d8f2e7..a41736bb 100644 --- a/src/libs/AI21/Generated/AI21.Models.BodyV1LibraryUpload.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.BodyV1LibraryUpload.g.cs @@ -125,5 +125,6 @@ public BodyV1LibraryUpload( public BodyV1LibraryUpload() { } + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.CanIframeStudioV1DemosScraperCanIframeGetResponse.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.CanIframeStudioV1DemosScraperCanIframeGetResponse.Json.g.cs index 0b3e4cec..5c0d1981 100644 --- a/src/libs/AI21/Generated/AI21.Models.CanIframeStudioV1DemosScraperCanIframeGetResponse.Json.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.CanIframeStudioV1DemosScraperCanIframeGetResponse.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::AI21.CanIframeStudioV1DemosScraperCanIframeGetResponse; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::AI21.CanIframeStudioV1DemosScraperCanIframeGetResponse? FromJson( + string json) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::AI21.CanIframeStudioV1DemosScraperCanIframeGetResponse; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/AI21/Generated/AI21.Models.CanIframeStudioV1DemosScraperCanIframeGetResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.CanIframeStudioV1DemosScraperCanIframeGetResponse.g.cs index 2c361bd5..ee413dd4 100644 --- a/src/libs/AI21/Generated/AI21.Models.CanIframeStudioV1DemosScraperCanIframeGetResponse.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.CanIframeStudioV1DemosScraperCanIframeGetResponse.g.cs @@ -14,5 +14,6 @@ public sealed partial class CanIframeStudioV1DemosScraperCanIframeGetResponse /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.ChatCompletion.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.ChatCompletion.Json.g.cs index a368f1ff..af41085f 100644 --- a/src/libs/AI21/Generated/AI21.Models.ChatCompletion.Json.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.ChatCompletion.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::AI21.ChatCompletion; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::AI21.ChatCompletion? FromJson( + string json) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::AI21.ChatCompletion; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/AI21/Generated/AI21.Models.ChatCompletion.g.cs b/src/libs/AI21/Generated/AI21.Models.ChatCompletion.g.cs index 36e1dccf..66a6b367 100644 --- a/src/libs/AI21/Generated/AI21.Models.ChatCompletion.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.ChatCompletion.g.cs @@ -81,5 +81,6 @@ public ChatCompletion( public ChatCompletion() { } + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.ChatCompletionMeta.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.ChatCompletionMeta.Json.g.cs index db6253e5..f5e8e930 100644 --- a/src/libs/AI21/Generated/AI21.Models.ChatCompletionMeta.Json.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.ChatCompletionMeta.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::AI21.ChatCompletionMeta; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::AI21.ChatCompletionMeta? FromJson( + string json) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::AI21.ChatCompletionMeta; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/AI21/Generated/AI21.Models.ChatCompletionMeta.g.cs b/src/libs/AI21/Generated/AI21.Models.ChatCompletionMeta.g.cs index 423ff9b8..4f75594f 100644 --- a/src/libs/AI21/Generated/AI21.Models.ChatCompletionMeta.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.ChatCompletionMeta.g.cs @@ -14,5 +14,6 @@ public sealed partial class ChatCompletionMeta /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.ChatCompletionResponseChoice.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.ChatCompletionResponseChoice.Json.g.cs index 51338c0a..e40455ee 100644 --- a/src/libs/AI21/Generated/AI21.Models.ChatCompletionResponseChoice.Json.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.ChatCompletionResponseChoice.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::AI21.ChatCompletionResponseChoice; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::AI21.ChatCompletionResponseChoice? FromJson( + string json) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::AI21.ChatCompletionResponseChoice; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/AI21/Generated/AI21.Models.ChatCompletionResponseChoice.g.cs b/src/libs/AI21/Generated/AI21.Models.ChatCompletionResponseChoice.g.cs index 44670b06..d7985777 100644 --- a/src/libs/AI21/Generated/AI21.Models.ChatCompletionResponseChoice.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.ChatCompletionResponseChoice.g.cs @@ -85,5 +85,6 @@ public ChatCompletionResponseChoice( public ChatCompletionResponseChoice() { } + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.ChatCompletionResponseDeltaChoice.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.ChatCompletionResponseDeltaChoice.Json.g.cs index 3ee460ab..b9140fe3 100644 --- a/src/libs/AI21/Generated/AI21.Models.ChatCompletionResponseDeltaChoice.Json.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.ChatCompletionResponseDeltaChoice.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::AI21.ChatCompletionResponseDeltaChoice; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::AI21.ChatCompletionResponseDeltaChoice? FromJson( + string json) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::AI21.ChatCompletionResponseDeltaChoice; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/AI21/Generated/AI21.Models.ChatCompletionResponseDeltaChoice.g.cs b/src/libs/AI21/Generated/AI21.Models.ChatCompletionResponseDeltaChoice.g.cs index a17874e8..93da7b5b 100644 --- a/src/libs/AI21/Generated/AI21.Models.ChatCompletionResponseDeltaChoice.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.ChatCompletionResponseDeltaChoice.g.cs @@ -87,5 +87,6 @@ public ChatCompletionResponseDeltaChoice( public ChatCompletionResponseDeltaChoice() { } + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.ChatCompletionVllmStreamingMessage.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.ChatCompletionVllmStreamingMessage.Json.g.cs index c81518be..1e853f7a 100644 --- a/src/libs/AI21/Generated/AI21.Models.ChatCompletionVllmStreamingMessage.Json.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.ChatCompletionVllmStreamingMessage.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::AI21.ChatCompletionVllmStreamingMessage; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::AI21.ChatCompletionVllmStreamingMessage? FromJson( + string json) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::AI21.ChatCompletionVllmStreamingMessage; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/AI21/Generated/AI21.Models.ChatCompletionVllmStreamingMessage.g.cs b/src/libs/AI21/Generated/AI21.Models.ChatCompletionVllmStreamingMessage.g.cs index 246be14a..ea9458fa 100644 --- a/src/libs/AI21/Generated/AI21.Models.ChatCompletionVllmStreamingMessage.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.ChatCompletionVllmStreamingMessage.g.cs @@ -78,5 +78,6 @@ public ChatCompletionVllmStreamingMessage( public ChatCompletionVllmStreamingMessage() { } + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.ChatCompletionVllmStreamingMessageMeta.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.ChatCompletionVllmStreamingMessageMeta.Json.g.cs index fff4d30a..122b52bd 100644 --- a/src/libs/AI21/Generated/AI21.Models.ChatCompletionVllmStreamingMessageMeta.Json.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.ChatCompletionVllmStreamingMessageMeta.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::AI21.ChatCompletionVllmStreamingMessageMeta; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::AI21.ChatCompletionVllmStreamingMessageMeta? FromJson( + string json) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::AI21.ChatCompletionVllmStreamingMessageMeta; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/AI21/Generated/AI21.Models.ChatCompletionVllmStreamingMessageMeta.g.cs b/src/libs/AI21/Generated/AI21.Models.ChatCompletionVllmStreamingMessageMeta.g.cs index 1919626d..ac902f78 100644 --- a/src/libs/AI21/Generated/AI21.Models.ChatCompletionVllmStreamingMessageMeta.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.ChatCompletionVllmStreamingMessageMeta.g.cs @@ -14,5 +14,6 @@ public sealed partial class ChatCompletionVllmStreamingMessageMeta /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.ChatRequest.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.ChatRequest.Json.g.cs index c4914513..4b8a04a2 100644 --- a/src/libs/AI21/Generated/AI21.Models.ChatRequest.Json.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.ChatRequest.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::AI21.ChatRequest; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::AI21.ChatRequest? FromJson( + string json) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::AI21.ChatRequest; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/AI21/Generated/AI21.Models.ChatRequest.g.cs b/src/libs/AI21/Generated/AI21.Models.ChatRequest.g.cs index 37b23ac8..19b7bfd6 100644 --- a/src/libs/AI21/Generated/AI21.Models.ChatRequest.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.ChatRequest.g.cs @@ -216,5 +216,6 @@ public ChatRequest( public ChatRequest() { } + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.ChatRequestMessageDiscriminator.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.ChatRequestMessageDiscriminator.Json.g.cs index bc65cb62..c6b4fa1c 100644 --- a/src/libs/AI21/Generated/AI21.Models.ChatRequestMessageDiscriminator.Json.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.ChatRequestMessageDiscriminator.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::AI21.ChatRequestMessageDiscriminator; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::AI21.ChatRequestMessageDiscriminator? FromJson( + string json) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::AI21.ChatRequestMessageDiscriminator; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/AI21/Generated/AI21.Models.ChatRequestMessageDiscriminator.g.cs b/src/libs/AI21/Generated/AI21.Models.ChatRequestMessageDiscriminator.g.cs index 5e68e13c..d406e931 100644 --- a/src/libs/AI21/Generated/AI21.Models.ChatRequestMessageDiscriminator.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.ChatRequestMessageDiscriminator.g.cs @@ -40,5 +40,6 @@ public ChatRequestMessageDiscriminator( public ChatRequestMessageDiscriminator() { } + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.ChatStreamingContentDelta.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.ChatStreamingContentDelta.Json.g.cs index c27a2ce1..00f6d822 100644 --- a/src/libs/AI21/Generated/AI21.Models.ChatStreamingContentDelta.Json.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.ChatStreamingContentDelta.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::AI21.ChatStreamingContentDelta; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::AI21.ChatStreamingContentDelta? FromJson( + string json) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::AI21.ChatStreamingContentDelta; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/AI21/Generated/AI21.Models.ChatStreamingContentDelta.g.cs b/src/libs/AI21/Generated/AI21.Models.ChatStreamingContentDelta.g.cs index 0572388b..5faf535e 100644 --- a/src/libs/AI21/Generated/AI21.Models.ChatStreamingContentDelta.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.ChatStreamingContentDelta.g.cs @@ -40,5 +40,6 @@ public ChatStreamingContentDelta( public ChatStreamingContentDelta() { } + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.ChatStreamingFirstDelta.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.ChatStreamingFirstDelta.Json.g.cs index c1219e7c..e1a1767f 100644 --- a/src/libs/AI21/Generated/AI21.Models.ChatStreamingFirstDelta.Json.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.ChatStreamingFirstDelta.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::AI21.ChatStreamingFirstDelta; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::AI21.ChatStreamingFirstDelta? FromJson( + string json) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::AI21.ChatStreamingFirstDelta; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/AI21/Generated/AI21.Models.ChatStreamingFirstDelta.g.cs b/src/libs/AI21/Generated/AI21.Models.ChatStreamingFirstDelta.g.cs index 43ab9208..d1053941 100644 --- a/src/libs/AI21/Generated/AI21.Models.ChatStreamingFirstDelta.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.ChatStreamingFirstDelta.g.cs @@ -61,5 +61,6 @@ public ChatStreamingFirstDelta( public ChatStreamingFirstDelta() { } + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.ChatStreamingToolCallsDelta.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.ChatStreamingToolCallsDelta.Json.g.cs index 60637fd7..a441a0aa 100644 --- a/src/libs/AI21/Generated/AI21.Models.ChatStreamingToolCallsDelta.Json.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.ChatStreamingToolCallsDelta.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::AI21.ChatStreamingToolCallsDelta; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::AI21.ChatStreamingToolCallsDelta? FromJson( + string json) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::AI21.ChatStreamingToolCallsDelta; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/AI21/Generated/AI21.Models.ChatStreamingToolCallsDelta.g.cs b/src/libs/AI21/Generated/AI21.Models.ChatStreamingToolCallsDelta.g.cs index 63c05e1a..30dc4d6e 100644 --- a/src/libs/AI21/Generated/AI21.Models.ChatStreamingToolCallsDelta.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.ChatStreamingToolCallsDelta.g.cs @@ -40,5 +40,6 @@ public ChatStreamingToolCallsDelta( public ChatStreamingToolCallsDelta() { } + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.ChatStreamingToolCallsFirstDelta.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.ChatStreamingToolCallsFirstDelta.Json.g.cs index 64660d29..ebd413f3 100644 --- a/src/libs/AI21/Generated/AI21.Models.ChatStreamingToolCallsFirstDelta.Json.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.ChatStreamingToolCallsFirstDelta.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::AI21.ChatStreamingToolCallsFirstDelta; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::AI21.ChatStreamingToolCallsFirstDelta? FromJson( + string json) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::AI21.ChatStreamingToolCallsFirstDelta; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/AI21/Generated/AI21.Models.ChatStreamingToolCallsFirstDelta.g.cs b/src/libs/AI21/Generated/AI21.Models.ChatStreamingToolCallsFirstDelta.g.cs index 94ca76d2..e9fe3e4c 100644 --- a/src/libs/AI21/Generated/AI21.Models.ChatStreamingToolCallsFirstDelta.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.ChatStreamingToolCallsFirstDelta.g.cs @@ -40,5 +40,6 @@ public ChatStreamingToolCallsFirstDelta( public ChatStreamingToolCallsFirstDelta() { } + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.ClarotyProductLookupSolutionsClarotyProductLookupPostResponse.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.ClarotyProductLookupSolutionsClarotyProductLookupPostResponse.Json.g.cs deleted file mode 100644 index 6feb73d5..00000000 --- a/src/libs/AI21/Generated/AI21.Models.ClarotyProductLookupSolutionsClarotyProductLookupPostResponse.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace AI21 -{ - public sealed partial class ClarotyProductLookupSolutionsClarotyProductLookupPostResponse - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::AI21.ClarotyProductLookupSolutionsClarotyProductLookupPostResponse? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::AI21.ClarotyProductLookupSolutionsClarotyProductLookupPostResponse), - jsonSerializerContext) as global::AI21.ClarotyProductLookupSolutionsClarotyProductLookupPostResponse; - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::AI21.ClarotyProductLookupSolutionsClarotyProductLookupPostResponse? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::AI21.ClarotyProductLookupSolutionsClarotyProductLookupPostResponse), - jsonSerializerContext).ConfigureAwait(false)) as global::AI21.ClarotyProductLookupSolutionsClarotyProductLookupPostResponse; - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/AI21/Generated/AI21.Models.ClarotyProductLookupSolutionsClarotyProductLookupPostResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.ClarotyProductLookupSolutionsClarotyProductLookupPostResponse.g.cs deleted file mode 100644 index 214d2ea1..00000000 --- a/src/libs/AI21/Generated/AI21.Models.ClarotyProductLookupSolutionsClarotyProductLookupPostResponse.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace AI21 -{ - /// - /// - /// - public sealed partial class ClarotyProductLookupSolutionsClarotyProductLookupPostResponse - { - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.ClarotyScrapeUrlSolutionsClarotyScrapeUrlPostResponse.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.ClarotyScrapeUrlSolutionsClarotyScrapeUrlPostResponse.Json.g.cs deleted file mode 100644 index 197cbae5..00000000 --- a/src/libs/AI21/Generated/AI21.Models.ClarotyScrapeUrlSolutionsClarotyScrapeUrlPostResponse.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace AI21 -{ - public sealed partial class ClarotyScrapeUrlSolutionsClarotyScrapeUrlPostResponse - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::AI21.ClarotyScrapeUrlSolutionsClarotyScrapeUrlPostResponse? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::AI21.ClarotyScrapeUrlSolutionsClarotyScrapeUrlPostResponse), - jsonSerializerContext) as global::AI21.ClarotyScrapeUrlSolutionsClarotyScrapeUrlPostResponse; - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::AI21.ClarotyScrapeUrlSolutionsClarotyScrapeUrlPostResponse? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::AI21.ClarotyScrapeUrlSolutionsClarotyScrapeUrlPostResponse), - jsonSerializerContext).ConfigureAwait(false)) as global::AI21.ClarotyScrapeUrlSolutionsClarotyScrapeUrlPostResponse; - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/AI21/Generated/AI21.Models.ClarotyScrapeUrlSolutionsClarotyScrapeUrlPostResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.ClarotyScrapeUrlSolutionsClarotyScrapeUrlPostResponse.g.cs deleted file mode 100644 index 4563db0f..00000000 --- a/src/libs/AI21/Generated/AI21.Models.ClarotyScrapeUrlSolutionsClarotyScrapeUrlPostResponse.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace AI21 -{ - /// - /// - /// - public sealed partial class ClarotyScrapeUrlSolutionsClarotyScrapeUrlPostResponse - { - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.ClarotySuggestVendorModelSolutionsClarotySuggestVendorModelPostResponse.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.ClarotySuggestVendorModelSolutionsClarotySuggestVendorModelPostResponse.Json.g.cs deleted file mode 100644 index a8e9ecd8..00000000 --- a/src/libs/AI21/Generated/AI21.Models.ClarotySuggestVendorModelSolutionsClarotySuggestVendorModelPostResponse.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace AI21 -{ - public sealed partial class ClarotySuggestVendorModelSolutionsClarotySuggestVendorModelPostResponse - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::AI21.ClarotySuggestVendorModelSolutionsClarotySuggestVendorModelPostResponse? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::AI21.ClarotySuggestVendorModelSolutionsClarotySuggestVendorModelPostResponse), - jsonSerializerContext) as global::AI21.ClarotySuggestVendorModelSolutionsClarotySuggestVendorModelPostResponse; - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::AI21.ClarotySuggestVendorModelSolutionsClarotySuggestVendorModelPostResponse? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::AI21.ClarotySuggestVendorModelSolutionsClarotySuggestVendorModelPostResponse), - jsonSerializerContext).ConfigureAwait(false)) as global::AI21.ClarotySuggestVendorModelSolutionsClarotySuggestVendorModelPostResponse; - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/AI21/Generated/AI21.Models.ClarotySuggestVendorModelSolutionsClarotySuggestVendorModelPostResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.ClarotySuggestVendorModelSolutionsClarotySuggestVendorModelPostResponse.g.cs deleted file mode 100644 index 191c7f10..00000000 --- a/src/libs/AI21/Generated/AI21.Models.ClarotySuggestVendorModelSolutionsClarotySuggestVendorModelPostResponse.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace AI21 -{ - /// - /// - /// - public sealed partial class ClarotySuggestVendorModelSolutionsClarotySuggestVendorModelPostResponse - { - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.CompareTextRequest.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.CompareTextRequest.Json.g.cs index b89b23ab..e00cbff2 100644 --- a/src/libs/AI21/Generated/AI21.Models.CompareTextRequest.Json.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.CompareTextRequest.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::AI21.CompareTextRequest; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::AI21.CompareTextRequest? FromJson( + string json) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::AI21.CompareTextRequest; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/AI21/Generated/AI21.Models.CompareTextRequest.g.cs b/src/libs/AI21/Generated/AI21.Models.CompareTextRequest.g.cs index 77d2b2d5..25007661 100644 --- a/src/libs/AI21/Generated/AI21.Models.CompareTextRequest.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.CompareTextRequest.g.cs @@ -50,5 +50,6 @@ public CompareTextRequest( public CompareTextRequest() { } + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.CompareTextStudioV1DemosDocumentModifierCompareTextPostResponse.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.CompareTextStudioV1DemosDocumentModifierCompareTextPostResponse.Json.g.cs index 543e66cc..81596e0b 100644 --- a/src/libs/AI21/Generated/AI21.Models.CompareTextStudioV1DemosDocumentModifierCompareTextPostResponse.Json.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.CompareTextStudioV1DemosDocumentModifierCompareTextPostResponse.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::AI21.CompareTextStudioV1DemosDocumentModifierCompareTextPostResponse; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::AI21.CompareTextStudioV1DemosDocumentModifierCompareTextPostResponse? FromJson( + string json) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::AI21.CompareTextStudioV1DemosDocumentModifierCompareTextPostResponse; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/AI21/Generated/AI21.Models.CompareTextStudioV1DemosDocumentModifierCompareTextPostResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.CompareTextStudioV1DemosDocumentModifierCompareTextPostResponse.g.cs index 17d99f02..69dc1e1a 100644 --- a/src/libs/AI21/Generated/AI21.Models.CompareTextStudioV1DemosDocumentModifierCompareTextPostResponse.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.CompareTextStudioV1DemosDocumentModifierCompareTextPostResponse.g.cs @@ -14,5 +14,6 @@ public sealed partial class CompareTextStudioV1DemosDocumentModifierCompareTextP /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.ComparisonOperator.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.ComparisonOperator.Json.g.cs index 50597d61..cec06fb0 100644 --- a/src/libs/AI21/Generated/AI21.Models.ComparisonOperator.Json.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.ComparisonOperator.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::AI21.ComparisonOperator; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::AI21.ComparisonOperator? FromJson( + string json) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::AI21.ComparisonOperator; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/AI21/Generated/AI21.Models.ComparisonOperator.g.cs b/src/libs/AI21/Generated/AI21.Models.ComparisonOperator.g.cs index 3bdefb14..e58a247a 100644 --- a/src/libs/AI21/Generated/AI21.Models.ComparisonOperator.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.ComparisonOperator.g.cs @@ -14,5 +14,6 @@ public sealed partial class ComparisonOperator /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.ConfigProfileCreate.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.ConfigProfileCreate.Json.g.cs new file mode 100644 index 00000000..577a4f57 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.ConfigProfileCreate.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace AI21 +{ + public sealed partial class ConfigProfileCreate + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::AI21.ConfigProfileCreate? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::AI21.ConfigProfileCreate), + jsonSerializerContext) as global::AI21.ConfigProfileCreate; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::AI21.ConfigProfileCreate? FromJson( + string json) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::AI21.ConfigProfileCreate? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::AI21.ConfigProfileCreate), + jsonSerializerContext).ConfigureAwait(false)) as global::AI21.ConfigProfileCreate; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/AI21/Generated/AI21.Models.ConfigProfileCreate.g.cs b/src/libs/AI21/Generated/AI21.Models.ConfigProfileCreate.g.cs new file mode 100644 index 00000000..5715faea --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.ConfigProfileCreate.g.cs @@ -0,0 +1,83 @@ + +#nullable enable + +namespace AI21 +{ + /// + /// Body for ``POST /tokenwise/settings/configs``. + /// + public sealed partial class ConfigProfileCreate + { + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("config_id")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string ConfigId { get; set; } + + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("name")] + public string? Name { get; set; } + + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("description")] + public string? Description { get; set; } + + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("overrides")] + public object? Overrides { get; set; } + + /// + /// Default Value: true + /// + [global::System.Text.Json.Serialization.JsonPropertyName("enabled")] + public bool? Enabled { 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: true + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public ConfigProfileCreate( + string configId, + string? name, + string? description, + object? overrides, + bool? enabled) + { + this.ConfigId = configId ?? throw new global::System.ArgumentNullException(nameof(configId)); + this.Name = name; + this.Description = description; + this.Overrides = overrides; + this.Enabled = enabled; + } + + /// + /// Initializes a new instance of the class. + /// + public ConfigProfileCreate() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.ConfigProfileCreateOverrides.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.ConfigProfileCreateOverrides.Json.g.cs new file mode 100644 index 00000000..39008189 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.ConfigProfileCreateOverrides.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace AI21 +{ + public sealed partial class ConfigProfileCreateOverrides + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::AI21.ConfigProfileCreateOverrides? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::AI21.ConfigProfileCreateOverrides), + jsonSerializerContext) as global::AI21.ConfigProfileCreateOverrides; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::AI21.ConfigProfileCreateOverrides? FromJson( + string json) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::AI21.ConfigProfileCreateOverrides? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::AI21.ConfigProfileCreateOverrides), + jsonSerializerContext).ConfigureAwait(false)) as global::AI21.ConfigProfileCreateOverrides; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/AI21/Generated/AI21.Models.ConfigProfileCreateOverrides.g.cs b/src/libs/AI21/Generated/AI21.Models.ConfigProfileCreateOverrides.g.cs new file mode 100644 index 00000000..2dc74074 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.ConfigProfileCreateOverrides.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace AI21 +{ + /// + /// + /// + public sealed partial class ConfigProfileCreateOverrides + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.ConfigProfileOut.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.ConfigProfileOut.Json.g.cs new file mode 100644 index 00000000..a0cc5dca --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.ConfigProfileOut.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace AI21 +{ + public sealed partial class ConfigProfileOut + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::AI21.ConfigProfileOut? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::AI21.ConfigProfileOut), + jsonSerializerContext) as global::AI21.ConfigProfileOut; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::AI21.ConfigProfileOut? FromJson( + string json) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::AI21.ConfigProfileOut? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::AI21.ConfigProfileOut), + jsonSerializerContext).ConfigureAwait(false)) as global::AI21.ConfigProfileOut; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/AI21/Generated/AI21.Models.ConfigProfileOut.g.cs b/src/libs/AI21/Generated/AI21.Models.ConfigProfileOut.g.cs new file mode 100644 index 00000000..c4cfeab9 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.ConfigProfileOut.g.cs @@ -0,0 +1,130 @@ + +#nullable enable + +namespace AI21 +{ + /// + /// Response shape for config GET / POST / PUT. + /// + public sealed partial class ConfigProfileOut + { + /// + /// A unique ID for the request (not the message). Repeated identical requests
+ /// get different IDs. However, for a streaming response, the ID will be the same
+ /// for all responses in the stream. + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("id")] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::System.Guid Id { get; set; } + + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("workspace_id")] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::System.Guid WorkspaceId { get; set; } + + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("config_id")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string ConfigId { get; set; } + + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("name")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Name { get; set; } + + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("description")] + public string? Description { get; set; } + + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("overrides")] + [global::System.Text.Json.Serialization.JsonRequired] + public required object Overrides { get; set; } + + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("enabled")] + [global::System.Text.Json.Serialization.JsonRequired] + public required bool Enabled { get; set; } + + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("created_at")] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::System.DateTime CreatedAt { get; set; } + + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("updated_at")] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::System.DateTime UpdatedAt { 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 unique ID for the request (not the message). Repeated identical requests
+ /// get different IDs. However, for a streaming response, the ID will be the same
+ /// for all responses in the stream. + /// + /// + /// + /// + /// + /// + /// + /// + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public ConfigProfileOut( + global::System.Guid id, + global::System.Guid workspaceId, + string configId, + string name, + object overrides, + bool enabled, + global::System.DateTime createdAt, + global::System.DateTime updatedAt, + string? description) + { + this.Id = id; + this.WorkspaceId = workspaceId; + this.ConfigId = configId ?? throw new global::System.ArgumentNullException(nameof(configId)); + this.Name = name ?? throw new global::System.ArgumentNullException(nameof(name)); + this.Description = description; + this.Overrides = overrides ?? throw new global::System.ArgumentNullException(nameof(overrides)); + this.Enabled = enabled; + this.CreatedAt = createdAt; + this.UpdatedAt = updatedAt; + } + + /// + /// Initializes a new instance of the class. + /// + public ConfigProfileOut() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.ConfigProfileOutOverrides.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.ConfigProfileOutOverrides.Json.g.cs new file mode 100644 index 00000000..1df5f4c6 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.ConfigProfileOutOverrides.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace AI21 +{ + public sealed partial class ConfigProfileOutOverrides + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::AI21.ConfigProfileOutOverrides? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::AI21.ConfigProfileOutOverrides), + jsonSerializerContext) as global::AI21.ConfigProfileOutOverrides; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::AI21.ConfigProfileOutOverrides? FromJson( + string json) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::AI21.ConfigProfileOutOverrides? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::AI21.ConfigProfileOutOverrides), + jsonSerializerContext).ConfigureAwait(false)) as global::AI21.ConfigProfileOutOverrides; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/AI21/Generated/AI21.Models.ConfigProfileOutOverrides.g.cs b/src/libs/AI21/Generated/AI21.Models.ConfigProfileOutOverrides.g.cs new file mode 100644 index 00000000..c2204898 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.ConfigProfileOutOverrides.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace AI21 +{ + /// + /// + /// + public sealed partial class ConfigProfileOutOverrides + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.ConfigProfileUpdate.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.ConfigProfileUpdate.Json.g.cs new file mode 100644 index 00000000..19fc37d6 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.ConfigProfileUpdate.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace AI21 +{ + public sealed partial class ConfigProfileUpdate + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::AI21.ConfigProfileUpdate? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::AI21.ConfigProfileUpdate), + jsonSerializerContext) as global::AI21.ConfigProfileUpdate; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::AI21.ConfigProfileUpdate? FromJson( + string json) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::AI21.ConfigProfileUpdate? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::AI21.ConfigProfileUpdate), + jsonSerializerContext).ConfigureAwait(false)) as global::AI21.ConfigProfileUpdate; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/AI21/Generated/AI21.Models.ConfigProfileUpdate.g.cs b/src/libs/AI21/Generated/AI21.Models.ConfigProfileUpdate.g.cs new file mode 100644 index 00000000..7d098ced --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.ConfigProfileUpdate.g.cs @@ -0,0 +1,73 @@ + +#nullable enable + +namespace AI21 +{ + /// + /// Body for ``PUT /tokenwise/settings/configs/{config_id}`` — partial update.
+ /// An explicit ``overrides: null`` is "leave unchanged"; ``{}`` clears them.
+ /// The gateway enforces the same semantics; we forward the JSON verbatim. + ///
+ public sealed partial class ConfigProfileUpdate + { + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("name")] + public string? Name { get; set; } + + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("description")] + public string? Description { get; set; } + + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("overrides")] + public object? Overrides { get; set; } + + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("enabled")] + public bool? Enabled { 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 ConfigProfileUpdate( + string? name, + string? description, + object? overrides, + bool? enabled) + { + this.Name = name; + this.Description = description; + this.Overrides = overrides; + this.Enabled = enabled; + } + + /// + /// Initializes a new instance of the class. + /// + public ConfigProfileUpdate() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.ConfigProfileUpdateOverrides.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.ConfigProfileUpdateOverrides.Json.g.cs new file mode 100644 index 00000000..c4972039 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.ConfigProfileUpdateOverrides.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace AI21 +{ + public sealed partial class ConfigProfileUpdateOverrides + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::AI21.ConfigProfileUpdateOverrides? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::AI21.ConfigProfileUpdateOverrides), + jsonSerializerContext) as global::AI21.ConfigProfileUpdateOverrides; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::AI21.ConfigProfileUpdateOverrides? FromJson( + string json) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::AI21.ConfigProfileUpdateOverrides? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::AI21.ConfigProfileUpdateOverrides), + jsonSerializerContext).ConfigureAwait(false)) as global::AI21.ConfigProfileUpdateOverrides; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/AI21/Generated/AI21.Models.ConfigProfileUpdateOverrides.g.cs b/src/libs/AI21/Generated/AI21.Models.ConfigProfileUpdateOverrides.g.cs new file mode 100644 index 00000000..afe636cc --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.ConfigProfileUpdateOverrides.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace AI21 +{ + /// + /// + /// + public sealed partial class ConfigProfileUpdateOverrides + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.ConfigSchemaOut.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.ConfigSchemaOut.Json.g.cs new file mode 100644 index 00000000..513c85c0 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.ConfigSchemaOut.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace AI21 +{ + public sealed partial class ConfigSchemaOut + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::AI21.ConfigSchemaOut? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::AI21.ConfigSchemaOut), + jsonSerializerContext) as global::AI21.ConfigSchemaOut; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::AI21.ConfigSchemaOut? FromJson( + string json) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::AI21.ConfigSchemaOut? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::AI21.ConfigSchemaOut), + jsonSerializerContext).ConfigureAwait(false)) as global::AI21.ConfigSchemaOut; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/AI21/Generated/AI21.Models.ConfigSchemaOut.g.cs b/src/libs/AI21/Generated/AI21.Models.ConfigSchemaOut.g.cs new file mode 100644 index 00000000..5b523afe --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.ConfigSchemaOut.g.cs @@ -0,0 +1,48 @@ + +#nullable enable + +namespace AI21 +{ + /// + /// Response shape for ``GET /tokenwise/settings/configs/schema``.
+ /// Loosely typed — the gateway derives this from its ``ProxySettings`` and the
+ /// shape evolves with new transformer groups. Kept as a flexible envelope so
+ /// api-server does not need a release every time the gateway adds a knob. + ///
+ public sealed partial class ConfigSchemaOut + { + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("groups")] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::System.Collections.Generic.IList Groups { 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 ConfigSchemaOut( + global::System.Collections.Generic.IList groups) + { + this.Groups = groups ?? throw new global::System.ArgumentNullException(nameof(groups)); + } + + /// + /// Initializes a new instance of the class. + /// + public ConfigSchemaOut() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.ConfigSchemaOutGroup.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.ConfigSchemaOutGroup.Json.g.cs new file mode 100644 index 00000000..8735bf16 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.ConfigSchemaOutGroup.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace AI21 +{ + public sealed partial class ConfigSchemaOutGroup + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::AI21.ConfigSchemaOutGroup? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::AI21.ConfigSchemaOutGroup), + jsonSerializerContext) as global::AI21.ConfigSchemaOutGroup; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::AI21.ConfigSchemaOutGroup? FromJson( + string json) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::AI21.ConfigSchemaOutGroup? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::AI21.ConfigSchemaOutGroup), + jsonSerializerContext).ConfigureAwait(false)) as global::AI21.ConfigSchemaOutGroup; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/AI21/Generated/AI21.Models.ConfigSchemaOutGroup.g.cs b/src/libs/AI21/Generated/AI21.Models.ConfigSchemaOutGroup.g.cs new file mode 100644 index 00000000..b1c35363 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.ConfigSchemaOutGroup.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace AI21 +{ + /// + /// + /// + public sealed partial class ConfigSchemaOutGroup + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.ConnectorConnectionStatus.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.ConnectorConnectionStatus.Json.g.cs deleted file mode 100644 index 3d451094..00000000 --- a/src/libs/AI21/Generated/AI21.Models.ConnectorConnectionStatus.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace AI21 -{ - public sealed partial class ConnectorConnectionStatus - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::AI21.ConnectorConnectionStatus? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::AI21.ConnectorConnectionStatus), - jsonSerializerContext) as global::AI21.ConnectorConnectionStatus; - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::AI21.ConnectorConnectionStatus? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::AI21.ConnectorConnectionStatus), - jsonSerializerContext).ConfigureAwait(false)) as global::AI21.ConnectorConnectionStatus; - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/AI21/Generated/AI21.Models.ConnectorConnectionStatus.g.cs b/src/libs/AI21/Generated/AI21.Models.ConnectorConnectionStatus.g.cs deleted file mode 100644 index 4be7cfd5..00000000 --- a/src/libs/AI21/Generated/AI21.Models.ConnectorConnectionStatus.g.cs +++ /dev/null @@ -1,85 +0,0 @@ - -#nullable enable - -namespace AI21 -{ - /// - /// - /// - public sealed partial class ConnectorConnectionStatus - { - /// - /// - /// - [global::System.Text.Json.Serialization.JsonPropertyName("latest_updated")] - public global::System.DateTime? LatestUpdated { get; set; } - - /// - /// - /// - [global::System.Text.Json.Serialization.JsonPropertyName("files_indexed")] - [global::System.Text.Json.Serialization.JsonRequired] - public required int FilesIndexed { get; set; } - - /// - /// - /// - [global::System.Text.Json.Serialization.JsonPropertyName("creation_date")] - [global::System.Text.Json.Serialization.JsonRequired] - public required global::System.DateTime CreationDate { get; set; } - - /// - /// An enumeration. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("status")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::AI21.JsonConverters.ParagonSyncStatusJsonConverter))] - [global::System.Text.Json.Serialization.JsonRequired] - public required global::AI21.ParagonSyncStatus Status { get; set; } - - /// - /// - /// - [global::System.Text.Json.Serialization.JsonPropertyName("last_synced_at")] - public string? LastSyncedAt { 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 enumeration. - /// - /// - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public ConnectorConnectionStatus( - int filesIndexed, - global::System.DateTime creationDate, - global::AI21.ParagonSyncStatus status, - global::System.DateTime? latestUpdated, - string? lastSyncedAt) - { - this.LatestUpdated = latestUpdated; - this.FilesIndexed = filesIndexed; - this.CreationDate = creationDate; - this.Status = status; - this.LastSyncedAt = lastSyncedAt; - } - - /// - /// Initializes a new instance of the class. - /// - public ConnectorConnectionStatus() - { - } - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.ConnectorsDataSources.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.ConnectorsDataSources.Json.g.cs deleted file mode 100644 index db39aa3b..00000000 --- a/src/libs/AI21/Generated/AI21.Models.ConnectorsDataSources.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace AI21 -{ - public sealed partial class ConnectorsDataSources - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::AI21.ConnectorsDataSources? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::AI21.ConnectorsDataSources), - jsonSerializerContext) as global::AI21.ConnectorsDataSources; - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::AI21.ConnectorsDataSources? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::AI21.ConnectorsDataSources), - jsonSerializerContext).ConfigureAwait(false)) as global::AI21.ConnectorsDataSources; - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/AI21/Generated/AI21.Models.ConnectorsDataSources.g.cs b/src/libs/AI21/Generated/AI21.Models.ConnectorsDataSources.g.cs deleted file mode 100644 index d7835198..00000000 --- a/src/libs/AI21/Generated/AI21.Models.ConnectorsDataSources.g.cs +++ /dev/null @@ -1,44 +0,0 @@ - -#nullable enable - -namespace AI21 -{ - /// - /// - /// - public sealed partial class ConnectorsDataSources - { - /// - /// - /// - [global::System.Text.Json.Serialization.JsonPropertyName("data_sources")] - [global::System.Text.Json.Serialization.JsonRequired] - public required global::System.Collections.Generic.IList DataSources { 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 ConnectorsDataSources( - global::System.Collections.Generic.IList dataSources) - { - this.DataSources = dataSources ?? throw new global::System.ArgumentNullException(nameof(dataSources)); - } - - /// - /// Initializes a new instance of the class. - /// - public ConnectorsDataSources() - { - } - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.ConnectorsStatus.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.ConnectorsStatus.Json.g.cs deleted file mode 100644 index c09bcde9..00000000 --- a/src/libs/AI21/Generated/AI21.Models.ConnectorsStatus.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace AI21 -{ - public sealed partial class ConnectorsStatus - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::AI21.ConnectorsStatus? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::AI21.ConnectorsStatus), - jsonSerializerContext) as global::AI21.ConnectorsStatus; - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::AI21.ConnectorsStatus? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::AI21.ConnectorsStatus), - jsonSerializerContext).ConfigureAwait(false)) as global::AI21.ConnectorsStatus; - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/AI21/Generated/AI21.Models.ConnectorsStatus.g.cs b/src/libs/AI21/Generated/AI21.Models.ConnectorsStatus.g.cs deleted file mode 100644 index 2b36ce79..00000000 --- a/src/libs/AI21/Generated/AI21.Models.ConnectorsStatus.g.cs +++ /dev/null @@ -1,77 +0,0 @@ - -#nullable enable - -namespace AI21 -{ - /// - /// - /// - public sealed partial class ConnectorsStatus - { - /// - /// - /// - [global::System.Text.Json.Serialization.JsonPropertyName("created_at")] - [global::System.Text.Json.Serialization.JsonRequired] - public required string CreatedAt { get; set; } - - /// - /// An enumeration. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("workflow_status")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::AI21.JsonConverters.ConnectorsWorkflowStatusJsonConverter))] - [global::System.Text.Json.Serialization.JsonRequired] - public required global::AI21.ConnectorsWorkflowStatus WorkflowStatus { get; set; } - - /// - /// - /// - [global::System.Text.Json.Serialization.JsonPropertyName("files_successfully_uploaded")] - [global::System.Text.Json.Serialization.JsonRequired] - public required int FilesSuccessfullyUploaded { get; set; } - - /// - /// - /// - [global::System.Text.Json.Serialization.JsonPropertyName("failed_uploaded_files")] - [global::System.Text.Json.Serialization.JsonRequired] - public required int FailedUploadedFiles { 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 enumeration. - /// - /// - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public ConnectorsStatus( - string createdAt, - global::AI21.ConnectorsWorkflowStatus workflowStatus, - int filesSuccessfullyUploaded, - int failedUploadedFiles) - { - this.CreatedAt = createdAt ?? throw new global::System.ArgumentNullException(nameof(createdAt)); - this.WorkflowStatus = workflowStatus; - this.FilesSuccessfullyUploaded = filesSuccessfullyUploaded; - this.FailedUploadedFiles = failedUploadedFiles; - } - - /// - /// Initializes a new instance of the class. - /// - public ConnectorsStatus() - { - } - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.ConnectorsSyncParams.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.ConnectorsSyncParams.Json.g.cs deleted file mode 100644 index 077bde19..00000000 --- a/src/libs/AI21/Generated/AI21.Models.ConnectorsSyncParams.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace AI21 -{ - public sealed partial class ConnectorsSyncParams - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::AI21.ConnectorsSyncParams? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::AI21.ConnectorsSyncParams), - jsonSerializerContext) as global::AI21.ConnectorsSyncParams; - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::AI21.ConnectorsSyncParams? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::AI21.ConnectorsSyncParams), - jsonSerializerContext).ConfigureAwait(false)) as global::AI21.ConnectorsSyncParams; - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/AI21/Generated/AI21.Models.ConnectorsSyncParams.g.cs b/src/libs/AI21/Generated/AI21.Models.ConnectorsSyncParams.g.cs deleted file mode 100644 index 3d1e7c93..00000000 --- a/src/libs/AI21/Generated/AI21.Models.ConnectorsSyncParams.g.cs +++ /dev/null @@ -1,92 +0,0 @@ - -#nullable enable - -namespace AI21 -{ - /// - /// - /// - public sealed partial class ConnectorsSyncParams - { - /// - /// - /// - [global::System.Text.Json.Serialization.JsonPropertyName("token")] - [global::System.Text.Json.Serialization.JsonRequired] - public required string Token { get; set; } - - /// - /// - /// - [global::System.Text.Json.Serialization.JsonPropertyName("data_source")] - [global::System.Text.Json.Serialization.JsonRequired] - public required string DataSource { get; set; } - - /// - /// - /// - [global::System.Text.Json.Serialization.JsonPropertyName("organization_id")] - [global::System.Text.Json.Serialization.JsonRequired] - public required string OrganizationId { get; set; } - - /// - /// - /// - [global::System.Text.Json.Serialization.JsonPropertyName("pipeline")] - [global::System.Text.Json.Serialization.JsonRequired] - public required string Pipeline { get; set; } - - /// - /// - /// - [global::System.Text.Json.Serialization.JsonPropertyName("configuration")] - public object? Configuration { get; set; } - - /// - /// - /// - [global::System.Text.Json.Serialization.JsonPropertyName("configuration_name")] - public string? ConfigurationName { 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 ConnectorsSyncParams( - string token, - string dataSource, - string organizationId, - string pipeline, - object? configuration, - string? configurationName) - { - this.Token = token ?? throw new global::System.ArgumentNullException(nameof(token)); - this.DataSource = dataSource ?? throw new global::System.ArgumentNullException(nameof(dataSource)); - this.OrganizationId = organizationId ?? throw new global::System.ArgumentNullException(nameof(organizationId)); - this.Pipeline = pipeline ?? throw new global::System.ArgumentNullException(nameof(pipeline)); - this.Configuration = configuration; - this.ConfigurationName = configurationName; - } - - /// - /// Initializes a new instance of the class. - /// - public ConnectorsSyncParams() - { - } - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.ConnectorsSyncParamsConfiguration.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.ConnectorsSyncParamsConfiguration.Json.g.cs deleted file mode 100644 index b5e0a22c..00000000 --- a/src/libs/AI21/Generated/AI21.Models.ConnectorsSyncParamsConfiguration.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace AI21 -{ - public sealed partial class ConnectorsSyncParamsConfiguration - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::AI21.ConnectorsSyncParamsConfiguration? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::AI21.ConnectorsSyncParamsConfiguration), - jsonSerializerContext) as global::AI21.ConnectorsSyncParamsConfiguration; - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::AI21.ConnectorsSyncParamsConfiguration? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::AI21.ConnectorsSyncParamsConfiguration), - jsonSerializerContext).ConfigureAwait(false)) as global::AI21.ConnectorsSyncParamsConfiguration; - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/AI21/Generated/AI21.Models.ConnectorsSyncParamsConfiguration.g.cs b/src/libs/AI21/Generated/AI21.Models.ConnectorsSyncParamsConfiguration.g.cs deleted file mode 100644 index 503a158d..00000000 --- a/src/libs/AI21/Generated/AI21.Models.ConnectorsSyncParamsConfiguration.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace AI21 -{ - /// - /// - /// - public sealed partial class ConnectorsSyncParamsConfiguration - { - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.ConnectorsToken.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.ConnectorsToken.Json.g.cs deleted file mode 100644 index e7742e2f..00000000 --- a/src/libs/AI21/Generated/AI21.Models.ConnectorsToken.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace AI21 -{ - public sealed partial class ConnectorsToken - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::AI21.ConnectorsToken? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::AI21.ConnectorsToken), - jsonSerializerContext) as global::AI21.ConnectorsToken; - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::AI21.ConnectorsToken? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::AI21.ConnectorsToken), - jsonSerializerContext).ConfigureAwait(false)) as global::AI21.ConnectorsToken; - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/AI21/Generated/AI21.Models.ConnectorsToken.g.cs b/src/libs/AI21/Generated/AI21.Models.ConnectorsToken.g.cs deleted file mode 100644 index dc2c29e9..00000000 --- a/src/libs/AI21/Generated/AI21.Models.ConnectorsToken.g.cs +++ /dev/null @@ -1,44 +0,0 @@ - -#nullable enable - -namespace AI21 -{ - /// - /// - /// - public sealed partial class ConnectorsToken - { - /// - /// - /// - [global::System.Text.Json.Serialization.JsonPropertyName("token")] - [global::System.Text.Json.Serialization.JsonRequired] - public required string Token { 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 ConnectorsToken( - string token) - { - this.Token = token ?? throw new global::System.ArgumentNullException(nameof(token)); - } - - /// - /// Initializes a new instance of the class. - /// - public ConnectorsToken() - { - } - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.ConnectorsWorkflowStatus.g.cs b/src/libs/AI21/Generated/AI21.Models.ConnectorsWorkflowStatus.g.cs deleted file mode 100644 index 77814155..00000000 --- a/src/libs/AI21/Generated/AI21.Models.ConnectorsWorkflowStatus.g.cs +++ /dev/null @@ -1,63 +0,0 @@ - -#nullable enable - -namespace AI21 -{ - /// - /// An enumeration. - /// - public enum ConnectorsWorkflowStatus - { - /// - /// - /// - Failed, - /// - /// - /// - InProgress, - /// - /// - /// - PartiallyCompleted, - /// - /// - /// - Succeeded, - } - - /// - /// Enum extensions to do fast conversions without the reflection. - /// - public static class ConnectorsWorkflowStatusExtensions - { - /// - /// Converts an enum to a string. - /// - public static string ToValueString(this ConnectorsWorkflowStatus value) - { - return value switch - { - ConnectorsWorkflowStatus.Failed => "FAILED", - ConnectorsWorkflowStatus.InProgress => "IN_PROGRESS", - ConnectorsWorkflowStatus.PartiallyCompleted => "PARTIALLY_COMPLETED", - ConnectorsWorkflowStatus.Succeeded => "SUCCEEDED", - _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), - }; - } - /// - /// Converts an string to a enum. - /// - public static ConnectorsWorkflowStatus? ToEnum(string value) - { - return value switch - { - "FAILED" => ConnectorsWorkflowStatus.Failed, - "IN_PROGRESS" => ConnectorsWorkflowStatus.InProgress, - "PARTIALLY_COMPLETED" => ConnectorsWorkflowStatus.PartiallyCompleted, - "SUCCEEDED" => ConnectorsWorkflowStatus.Succeeded, - _ => null, - }; - } - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.ConvertDocumentFileStudioV1ChatFilesConvertPostResponse.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.ConvertDocumentFileStudioV1ChatFilesConvertPostResponse.Json.g.cs index 0cee4799..1eb0a396 100644 --- a/src/libs/AI21/Generated/AI21.Models.ConvertDocumentFileStudioV1ChatFilesConvertPostResponse.Json.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.ConvertDocumentFileStudioV1ChatFilesConvertPostResponse.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::AI21.ConvertDocumentFileStudioV1ChatFilesConvertPostResponse; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::AI21.ConvertDocumentFileStudioV1ChatFilesConvertPostResponse? FromJson( + string json) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::AI21.ConvertDocumentFileStudioV1ChatFilesConvertPostResponse; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/AI21/Generated/AI21.Models.ConvertDocumentFileStudioV1ChatFilesConvertPostResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.ConvertDocumentFileStudioV1ChatFilesConvertPostResponse.g.cs index 25d52590..e023eb45 100644 --- a/src/libs/AI21/Generated/AI21.Models.ConvertDocumentFileStudioV1ChatFilesConvertPostResponse.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.ConvertDocumentFileStudioV1ChatFilesConvertPostResponse.g.cs @@ -14,5 +14,6 @@ public sealed partial class ConvertDocumentFileStudioV1ChatFilesConvertPostRespo /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.CreateAssistantRequest.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.CreateAssistantRequest.Json.g.cs index b7d83011..a883562f 100644 --- a/src/libs/AI21/Generated/AI21.Models.CreateAssistantRequest.Json.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.CreateAssistantRequest.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::AI21.CreateAssistantRequest; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::AI21.CreateAssistantRequest? FromJson( + string json) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::AI21.CreateAssistantRequest; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/AI21/Generated/AI21.Models.CreateAssistantRequest.g.cs b/src/libs/AI21/Generated/AI21.Models.CreateAssistantRequest.g.cs index 9bcf018c..27bd2f39 100644 --- a/src/libs/AI21/Generated/AI21.Models.CreateAssistantRequest.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.CreateAssistantRequest.g.cs @@ -154,5 +154,6 @@ public CreateAssistantRequest( public CreateAssistantRequest() { } + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.CreateAssistantRequestConfigOverrides.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.CreateAssistantRequestConfigOverrides.Json.g.cs index 96e1b2f2..084dfd32 100644 --- a/src/libs/AI21/Generated/AI21.Models.CreateAssistantRequestConfigOverrides.Json.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.CreateAssistantRequestConfigOverrides.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::AI21.CreateAssistantRequestConfigOverrides; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::AI21.CreateAssistantRequestConfigOverrides? FromJson( + string json) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::AI21.CreateAssistantRequestConfigOverrides; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/AI21/Generated/AI21.Models.CreateAssistantRequestConfigOverrides.g.cs b/src/libs/AI21/Generated/AI21.Models.CreateAssistantRequestConfigOverrides.g.cs index f31f5970..5f30ff4e 100644 --- a/src/libs/AI21/Generated/AI21.Models.CreateAssistantRequestConfigOverrides.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.CreateAssistantRequestConfigOverrides.g.cs @@ -14,5 +14,6 @@ public sealed partial class CreateAssistantRequestConfigOverrides /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.CreateMCPStorageRequest.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.CreateMCPStorageRequest.Json.g.cs index 48f333cc..4ba699e7 100644 --- a/src/libs/AI21/Generated/AI21.Models.CreateMCPStorageRequest.Json.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.CreateMCPStorageRequest.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::AI21.CreateMCPStorageRequest; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::AI21.CreateMCPStorageRequest? FromJson( + string json) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::AI21.CreateMCPStorageRequest; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/AI21/Generated/AI21.Models.CreateMCPStorageRequest.g.cs b/src/libs/AI21/Generated/AI21.Models.CreateMCPStorageRequest.g.cs index 869d433c..f0ae9746 100644 --- a/src/libs/AI21/Generated/AI21.Models.CreateMCPStorageRequest.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.CreateMCPStorageRequest.g.cs @@ -98,5 +98,6 @@ public CreateMCPStorageRequest( public CreateMCPStorageRequest() { } + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.CreateMaestroRunsPayload.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.CreateMaestroRunsPayload.Json.g.cs index fbd00e8c..d9ae1a9c 100644 --- a/src/libs/AI21/Generated/AI21.Models.CreateMaestroRunsPayload.Json.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.CreateMaestroRunsPayload.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::AI21.CreateMaestroRunsPayload; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::AI21.CreateMaestroRunsPayload? FromJson( + string json) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::AI21.CreateMaestroRunsPayload; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/AI21/Generated/AI21.Models.CreateMaestroRunsPayload.g.cs b/src/libs/AI21/Generated/AI21.Models.CreateMaestroRunsPayload.g.cs index dc1e378e..219bbe7e 100644 --- a/src/libs/AI21/Generated/AI21.Models.CreateMaestroRunsPayload.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.CreateMaestroRunsPayload.g.cs @@ -210,5 +210,6 @@ public CreateMaestroRunsPayload( public CreateMaestroRunsPayload() { } + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.CreateMaestroRunsPayloadContext.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.CreateMaestroRunsPayloadContext.Json.g.cs index 5179535f..68056167 100644 --- a/src/libs/AI21/Generated/AI21.Models.CreateMaestroRunsPayloadContext.Json.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.CreateMaestroRunsPayloadContext.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::AI21.CreateMaestroRunsPayloadContext; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::AI21.CreateMaestroRunsPayloadContext? FromJson( + string json) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::AI21.CreateMaestroRunsPayloadContext; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/AI21/Generated/AI21.Models.CreateMaestroRunsPayloadContext.g.cs b/src/libs/AI21/Generated/AI21.Models.CreateMaestroRunsPayloadContext.g.cs index 66088e51..9c3741c8 100644 --- a/src/libs/AI21/Generated/AI21.Models.CreateMaestroRunsPayloadContext.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.CreateMaestroRunsPayloadContext.g.cs @@ -14,5 +14,6 @@ public sealed partial class CreateMaestroRunsPayloadContext /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.CreateMaestroRunsPayloadCustomRetrievalConfig.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.CreateMaestroRunsPayloadCustomRetrievalConfig.Json.g.cs index 9a0623db..0ba98f97 100644 --- a/src/libs/AI21/Generated/AI21.Models.CreateMaestroRunsPayloadCustomRetrievalConfig.Json.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.CreateMaestroRunsPayloadCustomRetrievalConfig.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::AI21.CreateMaestroRunsPayloadCustomRetrievalConfig; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::AI21.CreateMaestroRunsPayloadCustomRetrievalConfig? FromJson( + string json) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::AI21.CreateMaestroRunsPayloadCustomRetrievalConfig; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/AI21/Generated/AI21.Models.CreateMaestroRunsPayloadCustomRetrievalConfig.g.cs b/src/libs/AI21/Generated/AI21.Models.CreateMaestroRunsPayloadCustomRetrievalConfig.g.cs index c8efb8cd..1b534176 100644 --- a/src/libs/AI21/Generated/AI21.Models.CreateMaestroRunsPayloadCustomRetrievalConfig.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.CreateMaestroRunsPayloadCustomRetrievalConfig.g.cs @@ -14,5 +14,6 @@ public sealed partial class CreateMaestroRunsPayloadCustomRetrievalConfig /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.CreateMaestroRunsPayloadOutputType.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.CreateMaestroRunsPayloadOutputType.Json.g.cs index f06cb979..2024116d 100644 --- a/src/libs/AI21/Generated/AI21.Models.CreateMaestroRunsPayloadOutputType.Json.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.CreateMaestroRunsPayloadOutputType.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::AI21.CreateMaestroRunsPayloadOutputType; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::AI21.CreateMaestroRunsPayloadOutputType? FromJson( + string json) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::AI21.CreateMaestroRunsPayloadOutputType; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/AI21/Generated/AI21.Models.CreateMaestroRunsPayloadOutputType.g.cs b/src/libs/AI21/Generated/AI21.Models.CreateMaestroRunsPayloadOutputType.g.cs index 153b7013..c6ff7850 100644 --- a/src/libs/AI21/Generated/AI21.Models.CreateMaestroRunsPayloadOutputType.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.CreateMaestroRunsPayloadOutputType.g.cs @@ -14,5 +14,6 @@ public sealed partial class CreateMaestroRunsPayloadOutputType /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.CreateOrganizationSchemaRequest.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.CreateOrganizationSchemaRequest.Json.g.cs index 39042323..21a81ddc 100644 --- a/src/libs/AI21/Generated/AI21.Models.CreateOrganizationSchemaRequest.Json.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.CreateOrganizationSchemaRequest.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::AI21.CreateOrganizationSchemaRequest; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::AI21.CreateOrganizationSchemaRequest? FromJson( + string json) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::AI21.CreateOrganizationSchemaRequest; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/AI21/Generated/AI21.Models.CreateOrganizationSchemaRequest.g.cs b/src/libs/AI21/Generated/AI21.Models.CreateOrganizationSchemaRequest.g.cs index 654b90a9..109a86c2 100644 --- a/src/libs/AI21/Generated/AI21.Models.CreateOrganizationSchemaRequest.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.CreateOrganizationSchemaRequest.g.cs @@ -61,5 +61,6 @@ public CreateOrganizationSchemaRequest( public CreateOrganizationSchemaRequest() { } + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.CreateOrganizationSchemaRequestSchemaObject.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.CreateOrganizationSchemaRequestSchemaObject.Json.g.cs index 68ab9926..94be7d10 100644 --- a/src/libs/AI21/Generated/AI21.Models.CreateOrganizationSchemaRequestSchemaObject.Json.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.CreateOrganizationSchemaRequestSchemaObject.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::AI21.CreateOrganizationSchemaRequestSchemaObject; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::AI21.CreateOrganizationSchemaRequestSchemaObject? FromJson( + string json) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::AI21.CreateOrganizationSchemaRequestSchemaObject; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/AI21/Generated/AI21.Models.CreateOrganizationSchemaRequestSchemaObject.g.cs b/src/libs/AI21/Generated/AI21.Models.CreateOrganizationSchemaRequestSchemaObject.g.cs index 745d990e..8df8aea2 100644 --- a/src/libs/AI21/Generated/AI21.Models.CreateOrganizationSchemaRequestSchemaObject.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.CreateOrganizationSchemaRequestSchemaObject.g.cs @@ -14,5 +14,6 @@ public sealed partial class CreateOrganizationSchemaRequestSchemaObject /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.CreateOrganizationSchemaStudioV1StructuredRagOrganizationsOrganizationIdSchemasPostResponse.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.CreateOrganizationSchemaStudioV1StructuredRagOrganizationsOrganizationIdSchemasPostResponse.Json.g.cs index 9199016b..1b3b2e95 100644 --- a/src/libs/AI21/Generated/AI21.Models.CreateOrganizationSchemaStudioV1StructuredRagOrganizationsOrganizationIdSchemasPostResponse.Json.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.CreateOrganizationSchemaStudioV1StructuredRagOrganizationsOrganizationIdSchemasPostResponse.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::AI21.CreateOrganizationSchemaStudioV1StructuredRagOrganizationsOrganizationIdSchemasPostResponse; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::AI21.CreateOrganizationSchemaStudioV1StructuredRagOrganizationsOrganizationIdSchemasPostResponse? FromJson( + string json) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::AI21.CreateOrganizationSchemaStudioV1StructuredRagOrganizationsOrganizationIdSchemasPostResponse; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/AI21/Generated/AI21.Models.CreateOrganizationSchemaStudioV1StructuredRagOrganizationsOrganizationIdSchemasPostResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.CreateOrganizationSchemaStudioV1StructuredRagOrganizationsOrganizationIdSchemasPostResponse.g.cs index 4ff0b1aa..af3040cb 100644 --- a/src/libs/AI21/Generated/AI21.Models.CreateOrganizationSchemaStudioV1StructuredRagOrganizationsOrganizationIdSchemasPostResponse.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.CreateOrganizationSchemaStudioV1StructuredRagOrganizationsOrganizationIdSchemasPostResponse.g.cs @@ -14,5 +14,6 @@ public sealed partial class CreateOrganizationSchemaStudioV1StructuredRagOrganiz /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.CreatePlanPayload.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.CreatePlanPayload.Json.g.cs index ebb6d87b..b6c6b449 100644 --- a/src/libs/AI21/Generated/AI21.Models.CreatePlanPayload.Json.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.CreatePlanPayload.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::AI21.CreatePlanPayload; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::AI21.CreatePlanPayload? FromJson( + string json) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::AI21.CreatePlanPayload; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/AI21/Generated/AI21.Models.CreatePlanPayload.g.cs b/src/libs/AI21/Generated/AI21.Models.CreatePlanPayload.g.cs index c594e651..3e999f48 100644 --- a/src/libs/AI21/Generated/AI21.Models.CreatePlanPayload.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.CreatePlanPayload.g.cs @@ -49,5 +49,6 @@ public CreatePlanPayload( public CreatePlanPayload() { } + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.CreatePlanPayloadSchema.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.CreatePlanPayloadSchema.Json.g.cs index 03a23aaa..f55cf367 100644 --- a/src/libs/AI21/Generated/AI21.Models.CreatePlanPayloadSchema.Json.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.CreatePlanPayloadSchema.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::AI21.CreatePlanPayloadSchema; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::AI21.CreatePlanPayloadSchema? FromJson( + string json) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::AI21.CreatePlanPayloadSchema; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/AI21/Generated/AI21.Models.CreatePlanPayloadSchema.g.cs b/src/libs/AI21/Generated/AI21.Models.CreatePlanPayloadSchema.g.cs index 68da8c59..665ff712 100644 --- a/src/libs/AI21/Generated/AI21.Models.CreatePlanPayloadSchema.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.CreatePlanPayloadSchema.g.cs @@ -14,5 +14,6 @@ public sealed partial class CreatePlanPayloadSchema /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.CreateRoutePayload.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.CreateRoutePayload.Json.g.cs index a8c69253..dfbf04b2 100644 --- a/src/libs/AI21/Generated/AI21.Models.CreateRoutePayload.Json.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.CreateRoutePayload.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::AI21.CreateRoutePayload; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::AI21.CreateRoutePayload? FromJson( + string json) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::AI21.CreateRoutePayload; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/AI21/Generated/AI21.Models.CreateRoutePayload.g.cs b/src/libs/AI21/Generated/AI21.Models.CreateRoutePayload.g.cs index 670ff368..0fcab1eb 100644 --- a/src/libs/AI21/Generated/AI21.Models.CreateRoutePayload.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.CreateRoutePayload.g.cs @@ -70,5 +70,6 @@ public CreateRoutePayload( public CreateRoutePayload() { } + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.CreateSecretPayload.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.CreateSecretPayload.Json.g.cs index 5de4a6cd..d506901f 100644 --- a/src/libs/AI21/Generated/AI21.Models.CreateSecretPayload.Json.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.CreateSecretPayload.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::AI21.CreateSecretPayload; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::AI21.CreateSecretPayload? FromJson( + string json) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::AI21.CreateSecretPayload; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/AI21/Generated/AI21.Models.CreateSecretPayload.g.cs b/src/libs/AI21/Generated/AI21.Models.CreateSecretPayload.g.cs index 6dafd77c..b8ce9776 100644 --- a/src/libs/AI21/Generated/AI21.Models.CreateSecretPayload.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.CreateSecretPayload.g.cs @@ -50,5 +50,6 @@ public CreateSecretPayload( public CreateSecretPayload() { } + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.DataSourceMetadata.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.DataSourceMetadata.Json.g.cs deleted file mode 100644 index 0a23a5b7..00000000 --- a/src/libs/AI21/Generated/AI21.Models.DataSourceMetadata.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace AI21 -{ - public sealed partial class DataSourceMetadata - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::AI21.DataSourceMetadata? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::AI21.DataSourceMetadata), - jsonSerializerContext) as global::AI21.DataSourceMetadata; - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::AI21.DataSourceMetadata? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::AI21.DataSourceMetadata), - jsonSerializerContext).ConfigureAwait(false)) as global::AI21.DataSourceMetadata; - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/AI21/Generated/AI21.Models.DataSourceMetadata.g.cs b/src/libs/AI21/Generated/AI21.Models.DataSourceMetadata.g.cs deleted file mode 100644 index 647a0d1e..00000000 --- a/src/libs/AI21/Generated/AI21.Models.DataSourceMetadata.g.cs +++ /dev/null @@ -1,84 +0,0 @@ - -#nullable enable - -namespace AI21 -{ - /// - /// - /// - public sealed partial class DataSourceMetadata - { - /// - /// - /// - [global::System.Text.Json.Serialization.JsonPropertyName("name")] - [global::System.Text.Json.Serialization.JsonRequired] - public required string Name { get; set; } - - /// - /// - /// - [global::System.Text.Json.Serialization.JsonPropertyName("type")] - [global::System.Text.Json.Serialization.JsonRequired] - public required string Type { get; set; } - - /// - /// - /// - [global::System.Text.Json.Serialization.JsonPropertyName("description")] - [global::System.Text.Json.Serialization.JsonRequired] - public required string Description { get; set; } - - /// - /// - /// - [global::System.Text.Json.Serialization.JsonPropertyName("icon")] - [global::System.Text.Json.Serialization.JsonRequired] - public required string Icon { get; set; } - - /// - /// - /// - [global::System.Text.Json.Serialization.JsonPropertyName("connected")] - [global::System.Text.Json.Serialization.JsonRequired] - public required bool Connected { 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 DataSourceMetadata( - string name, - string type, - string description, - string icon, - bool connected) - { - this.Name = name ?? throw new global::System.ArgumentNullException(nameof(name)); - this.Type = type ?? throw new global::System.ArgumentNullException(nameof(type)); - this.Description = description ?? throw new global::System.ArgumentNullException(nameof(description)); - this.Icon = icon ?? throw new global::System.ArgumentNullException(nameof(icon)); - this.Connected = connected; - } - - /// - /// Initializes a new instance of the class. - /// - public DataSourceMetadata() - { - } - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.DeleteAssistantResponse.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.DeleteAssistantResponse.Json.g.cs index 8fbd88eb..560af974 100644 --- a/src/libs/AI21/Generated/AI21.Models.DeleteAssistantResponse.Json.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.DeleteAssistantResponse.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::AI21.DeleteAssistantResponse; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::AI21.DeleteAssistantResponse? FromJson( + string json) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::AI21.DeleteAssistantResponse; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/AI21/Generated/AI21.Models.DeleteAssistantResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.DeleteAssistantResponse.g.cs index 4c4fdacb..97df09f0 100644 --- a/src/libs/AI21/Generated/AI21.Models.DeleteAssistantResponse.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.DeleteAssistantResponse.g.cs @@ -68,5 +68,6 @@ public DeleteAssistantResponse( public DeleteAssistantResponse() { } + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.DeleteDemoStudioV1DemosDemoIdDeleteResponse.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.DeleteDemoStudioV1DemosDemoIdDeleteResponse.Json.g.cs index b8cac32b..942f0fac 100644 --- a/src/libs/AI21/Generated/AI21.Models.DeleteDemoStudioV1DemosDemoIdDeleteResponse.Json.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.DeleteDemoStudioV1DemosDemoIdDeleteResponse.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::AI21.DeleteDemoStudioV1DemosDemoIdDeleteResponse; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::AI21.DeleteDemoStudioV1DemosDemoIdDeleteResponse? FromJson( + string json) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::AI21.DeleteDemoStudioV1DemosDemoIdDeleteResponse; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/AI21/Generated/AI21.Models.DeleteDemoStudioV1DemosDemoIdDeleteResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.DeleteDemoStudioV1DemosDemoIdDeleteResponse.g.cs index 6f6e8b80..996f2fee 100644 --- a/src/libs/AI21/Generated/AI21.Models.DeleteDemoStudioV1DemosDemoIdDeleteResponse.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.DeleteDemoStudioV1DemosDemoIdDeleteResponse.g.cs @@ -14,5 +14,6 @@ public sealed partial class DeleteDemoStudioV1DemosDemoIdDeleteResponse /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.DeleteMCPStorageResponse.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.DeleteMCPStorageResponse.Json.g.cs index 8546330f..92617cdd 100644 --- a/src/libs/AI21/Generated/AI21.Models.DeleteMCPStorageResponse.Json.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.DeleteMCPStorageResponse.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::AI21.DeleteMCPStorageResponse; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::AI21.DeleteMCPStorageResponse? FromJson( + string json) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::AI21.DeleteMCPStorageResponse; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/AI21/Generated/AI21.Models.DeleteMCPStorageResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.DeleteMCPStorageResponse.g.cs index 80bef1c8..dbf493ee 100644 --- a/src/libs/AI21/Generated/AI21.Models.DeleteMCPStorageResponse.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.DeleteMCPStorageResponse.g.cs @@ -46,5 +46,6 @@ public DeleteMCPStorageResponse( public DeleteMCPStorageResponse() { } + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.DeleteOrganizationSchemaStudioV1StructuredRagOrganizationsOrganizationIdSchemasSchemaNameDeleteResponse.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.DeleteOrganizationSchemaStudioV1StructuredRagOrganizationsOrganizationIdSchemasSchemaNameDeleteResponse.Json.g.cs index 7f4f0714..7c285c73 100644 --- a/src/libs/AI21/Generated/AI21.Models.DeleteOrganizationSchemaStudioV1StructuredRagOrganizationsOrganizationIdSchemasSchemaNameDeleteResponse.Json.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.DeleteOrganizationSchemaStudioV1StructuredRagOrganizationsOrganizationIdSchemasSchemaNameDeleteResponse.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::AI21.DeleteOrganizationSchemaStudioV1StructuredRagOrganizationsOrganizationIdSchemasSchemaNameDeleteResponse; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::AI21.DeleteOrganizationSchemaStudioV1StructuredRagOrganizationsOrganizationIdSchemasSchemaNameDeleteResponse? FromJson( + string json) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::AI21.DeleteOrganizationSchemaStudioV1StructuredRagOrganizationsOrganizationIdSchemasSchemaNameDeleteResponse; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/AI21/Generated/AI21.Models.DeleteOrganizationSchemaStudioV1StructuredRagOrganizationsOrganizationIdSchemasSchemaNameDeleteResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.DeleteOrganizationSchemaStudioV1StructuredRagOrganizationsOrganizationIdSchemasSchemaNameDeleteResponse.g.cs index f8a4be31..f0f6f86c 100644 --- a/src/libs/AI21/Generated/AI21.Models.DeleteOrganizationSchemaStudioV1StructuredRagOrganizationsOrganizationIdSchemasSchemaNameDeleteResponse.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.DeleteOrganizationSchemaStudioV1StructuredRagOrganizationsOrganizationIdSchemasSchemaNameDeleteResponse.g.cs @@ -14,5 +14,6 @@ public sealed partial class DeleteOrganizationSchemaStudioV1StructuredRagOrganiz /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.DeleteWebsiteConnectorStudioV1ConnectorsWebsiteConnectorIdDeleteResponse.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.DeleteWebsiteConnectorStudioV1ConnectorsWebsiteConnectorIdDeleteResponse.Json.g.cs deleted file mode 100644 index a086d715..00000000 --- a/src/libs/AI21/Generated/AI21.Models.DeleteWebsiteConnectorStudioV1ConnectorsWebsiteConnectorIdDeleteResponse.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace AI21 -{ - public sealed partial class DeleteWebsiteConnectorStudioV1ConnectorsWebsiteConnectorIdDeleteResponse - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::AI21.DeleteWebsiteConnectorStudioV1ConnectorsWebsiteConnectorIdDeleteResponse? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::AI21.DeleteWebsiteConnectorStudioV1ConnectorsWebsiteConnectorIdDeleteResponse), - jsonSerializerContext) as global::AI21.DeleteWebsiteConnectorStudioV1ConnectorsWebsiteConnectorIdDeleteResponse; - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::AI21.DeleteWebsiteConnectorStudioV1ConnectorsWebsiteConnectorIdDeleteResponse? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::AI21.DeleteWebsiteConnectorStudioV1ConnectorsWebsiteConnectorIdDeleteResponse), - jsonSerializerContext).ConfigureAwait(false)) as global::AI21.DeleteWebsiteConnectorStudioV1ConnectorsWebsiteConnectorIdDeleteResponse; - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/AI21/Generated/AI21.Models.DeleteWebsiteConnectorStudioV1ConnectorsWebsiteConnectorIdDeleteResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.DeleteWebsiteConnectorStudioV1ConnectorsWebsiteConnectorIdDeleteResponse.g.cs deleted file mode 100644 index c01c7a2e..00000000 --- a/src/libs/AI21/Generated/AI21.Models.DeleteWebsiteConnectorStudioV1ConnectorsWebsiteConnectorIdDeleteResponse.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace AI21 -{ - /// - /// - /// - public sealed partial class DeleteWebsiteConnectorStudioV1ConnectorsWebsiteConnectorIdDeleteResponse - { - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.DeleteWorkspaceModelEndpointStudioV1SettingsModelsNameDeleteResponse.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.DeleteWorkspaceModelEndpointStudioV1SettingsModelsNameDeleteResponse.Json.g.cs deleted file mode 100644 index 4ad16973..00000000 --- a/src/libs/AI21/Generated/AI21.Models.DeleteWorkspaceModelEndpointStudioV1SettingsModelsNameDeleteResponse.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace AI21 -{ - public sealed partial class DeleteWorkspaceModelEndpointStudioV1SettingsModelsNameDeleteResponse - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::AI21.DeleteWorkspaceModelEndpointStudioV1SettingsModelsNameDeleteResponse? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::AI21.DeleteWorkspaceModelEndpointStudioV1SettingsModelsNameDeleteResponse), - jsonSerializerContext) as global::AI21.DeleteWorkspaceModelEndpointStudioV1SettingsModelsNameDeleteResponse; - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::AI21.DeleteWorkspaceModelEndpointStudioV1SettingsModelsNameDeleteResponse? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::AI21.DeleteWorkspaceModelEndpointStudioV1SettingsModelsNameDeleteResponse), - jsonSerializerContext).ConfigureAwait(false)) as global::AI21.DeleteWorkspaceModelEndpointStudioV1SettingsModelsNameDeleteResponse; - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/AI21/Generated/AI21.Models.DeleteWorkspaceModelEndpointStudioV1SettingsModelsNameDeleteResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.DeleteWorkspaceModelEndpointStudioV1SettingsModelsNameDeleteResponse.g.cs deleted file mode 100644 index 491da4d4..00000000 --- a/src/libs/AI21/Generated/AI21.Models.DeleteWorkspaceModelEndpointStudioV1SettingsModelsNameDeleteResponse.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace AI21 -{ - /// - /// - /// - public sealed partial class DeleteWorkspaceModelEndpointStudioV1SettingsModelsNameDeleteResponse - { - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.Demo.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.Demo.Json.g.cs index 4358a76b..17764b5d 100644 --- a/src/libs/AI21/Generated/AI21.Models.Demo.Json.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.Demo.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::AI21.Demo; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::AI21.Demo? FromJson( + string json) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::AI21.Demo; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/AI21/Generated/AI21.Models.Demo.g.cs b/src/libs/AI21/Generated/AI21.Models.Demo.g.cs index 615b6254..3486f557 100644 --- a/src/libs/AI21/Generated/AI21.Models.Demo.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.Demo.g.cs @@ -107,5 +107,6 @@ public Demo( public Demo() { } + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.DemoConfig.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.DemoConfig.Json.g.cs index 7ac5e157..e914a933 100644 --- a/src/libs/AI21/Generated/AI21.Models.DemoConfig.Json.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.DemoConfig.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::AI21.DemoConfig; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::AI21.DemoConfig? FromJson( + string json) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::AI21.DemoConfig; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/AI21/Generated/AI21.Models.DemoConfig.g.cs b/src/libs/AI21/Generated/AI21.Models.DemoConfig.g.cs index 85efe952..f251d2a2 100644 --- a/src/libs/AI21/Generated/AI21.Models.DemoConfig.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.DemoConfig.g.cs @@ -14,5 +14,6 @@ public sealed partial class DemoConfig /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.DemoCreate.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.DemoCreate.Json.g.cs index 87d79c21..bcec8833 100644 --- a/src/libs/AI21/Generated/AI21.Models.DemoCreate.Json.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.DemoCreate.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::AI21.DemoCreate; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::AI21.DemoCreate? FromJson( + string json) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::AI21.DemoCreate; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/AI21/Generated/AI21.Models.DemoCreate.g.cs b/src/libs/AI21/Generated/AI21.Models.DemoCreate.g.cs index a9c3a9e6..8b54a6c5 100644 --- a/src/libs/AI21/Generated/AI21.Models.DemoCreate.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.DemoCreate.g.cs @@ -91,5 +91,6 @@ public DemoCreate( public DemoCreate() { } + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.DemoCreateConfig.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.DemoCreateConfig.Json.g.cs index 87c3e497..a7b84495 100644 --- a/src/libs/AI21/Generated/AI21.Models.DemoCreateConfig.Json.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.DemoCreateConfig.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::AI21.DemoCreateConfig; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::AI21.DemoCreateConfig? FromJson( + string json) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::AI21.DemoCreateConfig; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/AI21/Generated/AI21.Models.DemoCreateConfig.g.cs b/src/libs/AI21/Generated/AI21.Models.DemoCreateConfig.g.cs index 2004b319..849cd3d9 100644 --- a/src/libs/AI21/Generated/AI21.Models.DemoCreateConfig.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.DemoCreateConfig.g.cs @@ -14,5 +14,6 @@ public sealed partial class DemoCreateConfig /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.DemoUpdate.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.DemoUpdate.Json.g.cs index cbbfac7e..56433c89 100644 --- a/src/libs/AI21/Generated/AI21.Models.DemoUpdate.Json.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.DemoUpdate.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::AI21.DemoUpdate; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::AI21.DemoUpdate? FromJson( + string json) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::AI21.DemoUpdate; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/AI21/Generated/AI21.Models.DemoUpdate.g.cs b/src/libs/AI21/Generated/AI21.Models.DemoUpdate.g.cs index 4bea02cc..47b839c2 100644 --- a/src/libs/AI21/Generated/AI21.Models.DemoUpdate.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.DemoUpdate.g.cs @@ -87,5 +87,6 @@ public DemoUpdate( public DemoUpdate() { } + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.DemoUpdateConfig.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.DemoUpdateConfig.Json.g.cs index 22d7f3f4..024496d3 100644 --- a/src/libs/AI21/Generated/AI21.Models.DemoUpdateConfig.Json.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.DemoUpdateConfig.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::AI21.DemoUpdateConfig; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::AI21.DemoUpdateConfig? FromJson( + string json) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::AI21.DemoUpdateConfig; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/AI21/Generated/AI21.Models.DemoUpdateConfig.g.cs b/src/libs/AI21/Generated/AI21.Models.DemoUpdateConfig.g.cs index a6c449f6..dda7c340 100644 --- a/src/libs/AI21/Generated/AI21.Models.DemoUpdateConfig.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.DemoUpdateConfig.g.cs @@ -14,5 +14,6 @@ public sealed partial class DemoUpdateConfig /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.DetectSchemaRequest.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.DetectSchemaRequest.Json.g.cs index 35bcdcf0..7c861f22 100644 --- a/src/libs/AI21/Generated/AI21.Models.DetectSchemaRequest.Json.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.DetectSchemaRequest.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::AI21.DetectSchemaRequest; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::AI21.DetectSchemaRequest? FromJson( + string json) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::AI21.DetectSchemaRequest; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/AI21/Generated/AI21.Models.DetectSchemaRequest.g.cs b/src/libs/AI21/Generated/AI21.Models.DetectSchemaRequest.g.cs index 7265afc1..81e6957a 100644 --- a/src/libs/AI21/Generated/AI21.Models.DetectSchemaRequest.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.DetectSchemaRequest.g.cs @@ -49,5 +49,6 @@ public DetectSchemaRequest( public DetectSchemaRequest() { } + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.DetectSchemaResponse.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.DetectSchemaResponse.Json.g.cs index b1cbea0c..462d1026 100644 --- a/src/libs/AI21/Generated/AI21.Models.DetectSchemaResponse.Json.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.DetectSchemaResponse.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::AI21.DetectSchemaResponse; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::AI21.DetectSchemaResponse? FromJson( + string json) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::AI21.DetectSchemaResponse; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/AI21/Generated/AI21.Models.DetectSchemaResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.DetectSchemaResponse.g.cs index a2ef604a..d6fea2ee 100644 --- a/src/libs/AI21/Generated/AI21.Models.DetectSchemaResponse.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.DetectSchemaResponse.g.cs @@ -50,5 +50,6 @@ public DetectSchemaResponse( public DetectSchemaResponse() { } + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.DetectSchemaResponseSchemaDefinition.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.DetectSchemaResponseSchemaDefinition.Json.g.cs index 58a59208..0518429e 100644 --- a/src/libs/AI21/Generated/AI21.Models.DetectSchemaResponseSchemaDefinition.Json.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.DetectSchemaResponseSchemaDefinition.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::AI21.DetectSchemaResponseSchemaDefinition; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::AI21.DetectSchemaResponseSchemaDefinition? FromJson( + string json) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::AI21.DetectSchemaResponseSchemaDefinition; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/AI21/Generated/AI21.Models.DetectSchemaResponseSchemaDefinition.g.cs b/src/libs/AI21/Generated/AI21.Models.DetectSchemaResponseSchemaDefinition.g.cs index a67fca73..bd89f014 100644 --- a/src/libs/AI21/Generated/AI21.Models.DetectSchemaResponseSchemaDefinition.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.DetectSchemaResponseSchemaDefinition.g.cs @@ -14,5 +14,6 @@ public sealed partial class DetectSchemaResponseSchemaDefinition /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.DocumentReference.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.DocumentReference.Json.g.cs index 69362938..a0d1f57c 100644 --- a/src/libs/AI21/Generated/AI21.Models.DocumentReference.Json.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.DocumentReference.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::AI21.DocumentReference; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::AI21.DocumentReference? FromJson( + string json) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::AI21.DocumentReference; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/AI21/Generated/AI21.Models.DocumentReference.g.cs b/src/libs/AI21/Generated/AI21.Models.DocumentReference.g.cs index 1b517aba..d58b231f 100644 --- a/src/libs/AI21/Generated/AI21.Models.DocumentReference.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.DocumentReference.g.cs @@ -50,5 +50,6 @@ public DocumentReference( public DocumentReference() { } + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.DocumentSchema.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.DocumentSchema.Json.g.cs index 26484de3..5b9fc6ed 100644 --- a/src/libs/AI21/Generated/AI21.Models.DocumentSchema.Json.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.DocumentSchema.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::AI21.DocumentSchema; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::AI21.DocumentSchema? FromJson( + string json) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::AI21.DocumentSchema; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/AI21/Generated/AI21.Models.DocumentSchema.g.cs b/src/libs/AI21/Generated/AI21.Models.DocumentSchema.g.cs index 138f50bb..311b3484 100644 --- a/src/libs/AI21/Generated/AI21.Models.DocumentSchema.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.DocumentSchema.g.cs @@ -66,5 +66,6 @@ public DocumentSchema( public DocumentSchema() { } + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.DocumentSchemaMetadata.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.DocumentSchemaMetadata.Json.g.cs index c6cbd002..b0b8e546 100644 --- a/src/libs/AI21/Generated/AI21.Models.DocumentSchemaMetadata.Json.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.DocumentSchemaMetadata.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::AI21.DocumentSchemaMetadata; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::AI21.DocumentSchemaMetadata? FromJson( + string json) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::AI21.DocumentSchemaMetadata; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/AI21/Generated/AI21.Models.DocumentSchemaMetadata.g.cs b/src/libs/AI21/Generated/AI21.Models.DocumentSchemaMetadata.g.cs index 16893eb7..c0509de4 100644 --- a/src/libs/AI21/Generated/AI21.Models.DocumentSchemaMetadata.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.DocumentSchemaMetadata.g.cs @@ -14,5 +14,6 @@ public sealed partial class DocumentSchemaMetadata /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.DownloadModifiedDocumentRequest.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.DownloadModifiedDocumentRequest.Json.g.cs index 01dba80a..2e02c3c1 100644 --- a/src/libs/AI21/Generated/AI21.Models.DownloadModifiedDocumentRequest.Json.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.DownloadModifiedDocumentRequest.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::AI21.DownloadModifiedDocumentRequest; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::AI21.DownloadModifiedDocumentRequest? FromJson( + string json) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::AI21.DownloadModifiedDocumentRequest; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/AI21/Generated/AI21.Models.DownloadModifiedDocumentRequest.g.cs b/src/libs/AI21/Generated/AI21.Models.DownloadModifiedDocumentRequest.g.cs index adb0e273..193b00c8 100644 --- a/src/libs/AI21/Generated/AI21.Models.DownloadModifiedDocumentRequest.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.DownloadModifiedDocumentRequest.g.cs @@ -50,5 +50,6 @@ public DownloadModifiedDocumentRequest( public DownloadModifiedDocumentRequest() { } + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.DownloadModifiedDocumentStudioV1DemosDocumentModifierDownloadPostResponse.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.DownloadModifiedDocumentStudioV1DemosDocumentModifierDownloadPostResponse.Json.g.cs index 67590d77..3bd22905 100644 --- a/src/libs/AI21/Generated/AI21.Models.DownloadModifiedDocumentStudioV1DemosDocumentModifierDownloadPostResponse.Json.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.DownloadModifiedDocumentStudioV1DemosDocumentModifierDownloadPostResponse.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::AI21.DownloadModifiedDocumentStudioV1DemosDocumentModifierDownloadPostResponse; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::AI21.DownloadModifiedDocumentStudioV1DemosDocumentModifierDownloadPostResponse? FromJson( + string json) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::AI21.DownloadModifiedDocumentStudioV1DemosDocumentModifierDownloadPostResponse; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/AI21/Generated/AI21.Models.DownloadModifiedDocumentStudioV1DemosDocumentModifierDownloadPostResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.DownloadModifiedDocumentStudioV1DemosDocumentModifierDownloadPostResponse.g.cs index 014eef75..bbab2d37 100644 --- a/src/libs/AI21/Generated/AI21.Models.DownloadModifiedDocumentStudioV1DemosDocumentModifierDownloadPostResponse.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.DownloadModifiedDocumentStudioV1DemosDocumentModifierDownloadPostResponse.g.cs @@ -14,5 +14,6 @@ public sealed partial class DownloadModifiedDocumentStudioV1DemosDocumentModifie /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.FileResponse.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.FileResponse.Json.g.cs index 49e4ef54..93a7901a 100644 --- a/src/libs/AI21/Generated/AI21.Models.FileResponse.Json.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.FileResponse.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::AI21.FileResponse; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::AI21.FileResponse? FromJson( + string json) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::AI21.FileResponse; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/AI21/Generated/AI21.Models.FileResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.FileResponse.g.cs index e42f7d56..ac5c43f5 100644 --- a/src/libs/AI21/Generated/AI21.Models.FileResponse.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.FileResponse.g.cs @@ -202,5 +202,6 @@ public FileResponse( public FileResponse() { } + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.FileSearchToolResource.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.FileSearchToolResource.Json.g.cs index 6c6c235a..2354b7f1 100644 --- a/src/libs/AI21/Generated/AI21.Models.FileSearchToolResource.Json.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.FileSearchToolResource.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::AI21.FileSearchToolResource; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::AI21.FileSearchToolResource? FromJson( + string json) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::AI21.FileSearchToolResource; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/AI21/Generated/AI21.Models.FileSearchToolResource.g.cs b/src/libs/AI21/Generated/AI21.Models.FileSearchToolResource.g.cs index cfb3c164..26db1412 100644 --- a/src/libs/AI21/Generated/AI21.Models.FileSearchToolResource.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.FileSearchToolResource.g.cs @@ -155,5 +155,6 @@ public FileSearchToolResource( public FileSearchToolResource() { } + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.FilesUpdateRequest.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.FilesUpdateRequest.Json.g.cs index 587a30d8..4e574223 100644 --- a/src/libs/AI21/Generated/AI21.Models.FilesUpdateRequest.Json.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.FilesUpdateRequest.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::AI21.FilesUpdateRequest; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::AI21.FilesUpdateRequest? FromJson( + string json) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::AI21.FilesUpdateRequest; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/AI21/Generated/AI21.Models.FilesUpdateRequest.g.cs b/src/libs/AI21/Generated/AI21.Models.FilesUpdateRequest.g.cs index fa191187..40162039 100644 --- a/src/libs/AI21/Generated/AI21.Models.FilesUpdateRequest.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.FilesUpdateRequest.g.cs @@ -58,5 +58,6 @@ public FilesUpdateRequest( public FilesUpdateRequest() { } + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.FnacAftersalesBatchPredictPrefixPreviewSolutionsPreviewFdAftersalesPartsClassificationBatchPostResponse.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.FnacAftersalesBatchPredictPrefixPreviewSolutionsPreviewFdAftersalesPartsClassificationBatchPostResponse.Json.g.cs deleted file mode 100644 index 5011e451..00000000 --- a/src/libs/AI21/Generated/AI21.Models.FnacAftersalesBatchPredictPrefixPreviewSolutionsPreviewFdAftersalesPartsClassificationBatchPostResponse.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace AI21 -{ - public sealed partial class FnacAftersalesBatchPredictPrefixPreviewSolutionsPreviewFdAftersalesPartsClassificationBatchPostResponse - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::AI21.FnacAftersalesBatchPredictPrefixPreviewSolutionsPreviewFdAftersalesPartsClassificationBatchPostResponse? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::AI21.FnacAftersalesBatchPredictPrefixPreviewSolutionsPreviewFdAftersalesPartsClassificationBatchPostResponse), - jsonSerializerContext) as global::AI21.FnacAftersalesBatchPredictPrefixPreviewSolutionsPreviewFdAftersalesPartsClassificationBatchPostResponse; - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::AI21.FnacAftersalesBatchPredictPrefixPreviewSolutionsPreviewFdAftersalesPartsClassificationBatchPostResponse? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::AI21.FnacAftersalesBatchPredictPrefixPreviewSolutionsPreviewFdAftersalesPartsClassificationBatchPostResponse), - jsonSerializerContext).ConfigureAwait(false)) as global::AI21.FnacAftersalesBatchPredictPrefixPreviewSolutionsPreviewFdAftersalesPartsClassificationBatchPostResponse; - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/AI21/Generated/AI21.Models.FnacAftersalesBatchPredictPrefixPreviewSolutionsPreviewFdAftersalesPartsClassificationBatchPostResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.FnacAftersalesBatchPredictPrefixPreviewSolutionsPreviewFdAftersalesPartsClassificationBatchPostResponse.g.cs deleted file mode 100644 index b5d81d60..00000000 --- a/src/libs/AI21/Generated/AI21.Models.FnacAftersalesBatchPredictPrefixPreviewSolutionsPreviewFdAftersalesPartsClassificationBatchPostResponse.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace AI21 -{ - /// - /// - /// - public sealed partial class FnacAftersalesBatchPredictPrefixPreviewSolutionsPreviewFdAftersalesPartsClassificationBatchPostResponse - { - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.FnacAftersalesBatchPredictSolutionsFdAftersalesPartsClassificationBatchPostResponse.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.FnacAftersalesBatchPredictSolutionsFdAftersalesPartsClassificationBatchPostResponse.Json.g.cs deleted file mode 100644 index 8b2a350b..00000000 --- a/src/libs/AI21/Generated/AI21.Models.FnacAftersalesBatchPredictSolutionsFdAftersalesPartsClassificationBatchPostResponse.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace AI21 -{ - public sealed partial class FnacAftersalesBatchPredictSolutionsFdAftersalesPartsClassificationBatchPostResponse - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::AI21.FnacAftersalesBatchPredictSolutionsFdAftersalesPartsClassificationBatchPostResponse? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::AI21.FnacAftersalesBatchPredictSolutionsFdAftersalesPartsClassificationBatchPostResponse), - jsonSerializerContext) as global::AI21.FnacAftersalesBatchPredictSolutionsFdAftersalesPartsClassificationBatchPostResponse; - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::AI21.FnacAftersalesBatchPredictSolutionsFdAftersalesPartsClassificationBatchPostResponse? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::AI21.FnacAftersalesBatchPredictSolutionsFdAftersalesPartsClassificationBatchPostResponse), - jsonSerializerContext).ConfigureAwait(false)) as global::AI21.FnacAftersalesBatchPredictSolutionsFdAftersalesPartsClassificationBatchPostResponse; - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/AI21/Generated/AI21.Models.FnacAftersalesBatchPredictSolutionsFdAftersalesPartsClassificationBatchPostResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.FnacAftersalesBatchPredictSolutionsFdAftersalesPartsClassificationBatchPostResponse.g.cs deleted file mode 100644 index 8e3ca11c..00000000 --- a/src/libs/AI21/Generated/AI21.Models.FnacAftersalesBatchPredictSolutionsFdAftersalesPartsClassificationBatchPostResponse.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace AI21 -{ - /// - /// - /// - public sealed partial class FnacAftersalesBatchPredictSolutionsFdAftersalesPartsClassificationBatchPostResponse - { - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.FnacAftersalesBatchPredictStatusPrefixPreviewSolutionsPreviewFdAftersalesPartsClassificationBatchBatchIdStatusGetResponse.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.FnacAftersalesBatchPredictStatusPrefixPreviewSolutionsPreviewFdAftersalesPartsClassificationBatchBatchIdStatusGetResponse.Json.g.cs deleted file mode 100644 index e8bc55d2..00000000 --- a/src/libs/AI21/Generated/AI21.Models.FnacAftersalesBatchPredictStatusPrefixPreviewSolutionsPreviewFdAftersalesPartsClassificationBatchBatchIdStatusGetResponse.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace AI21 -{ - public sealed partial class FnacAftersalesBatchPredictStatusPrefixPreviewSolutionsPreviewFdAftersalesPartsClassificationBatchBatchIdStatusGetResponse - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::AI21.FnacAftersalesBatchPredictStatusPrefixPreviewSolutionsPreviewFdAftersalesPartsClassificationBatchBatchIdStatusGetResponse? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::AI21.FnacAftersalesBatchPredictStatusPrefixPreviewSolutionsPreviewFdAftersalesPartsClassificationBatchBatchIdStatusGetResponse), - jsonSerializerContext) as global::AI21.FnacAftersalesBatchPredictStatusPrefixPreviewSolutionsPreviewFdAftersalesPartsClassificationBatchBatchIdStatusGetResponse; - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::AI21.FnacAftersalesBatchPredictStatusPrefixPreviewSolutionsPreviewFdAftersalesPartsClassificationBatchBatchIdStatusGetResponse? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::AI21.FnacAftersalesBatchPredictStatusPrefixPreviewSolutionsPreviewFdAftersalesPartsClassificationBatchBatchIdStatusGetResponse), - jsonSerializerContext).ConfigureAwait(false)) as global::AI21.FnacAftersalesBatchPredictStatusPrefixPreviewSolutionsPreviewFdAftersalesPartsClassificationBatchBatchIdStatusGetResponse; - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/AI21/Generated/AI21.Models.FnacAftersalesBatchPredictStatusPrefixPreviewSolutionsPreviewFdAftersalesPartsClassificationBatchBatchIdStatusGetResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.FnacAftersalesBatchPredictStatusPrefixPreviewSolutionsPreviewFdAftersalesPartsClassificationBatchBatchIdStatusGetResponse.g.cs deleted file mode 100644 index aa29d960..00000000 --- a/src/libs/AI21/Generated/AI21.Models.FnacAftersalesBatchPredictStatusPrefixPreviewSolutionsPreviewFdAftersalesPartsClassificationBatchBatchIdStatusGetResponse.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace AI21 -{ - /// - /// - /// - public sealed partial class FnacAftersalesBatchPredictStatusPrefixPreviewSolutionsPreviewFdAftersalesPartsClassificationBatchBatchIdStatusGetResponse - { - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.FnacAftersalesBatchPredictStatusSolutionsFdAftersalesPartsClassificationBatchBatchIdStatusGetResponse.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.FnacAftersalesBatchPredictStatusSolutionsFdAftersalesPartsClassificationBatchBatchIdStatusGetResponse.Json.g.cs deleted file mode 100644 index 59159123..00000000 --- a/src/libs/AI21/Generated/AI21.Models.FnacAftersalesBatchPredictStatusSolutionsFdAftersalesPartsClassificationBatchBatchIdStatusGetResponse.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace AI21 -{ - public sealed partial class FnacAftersalesBatchPredictStatusSolutionsFdAftersalesPartsClassificationBatchBatchIdStatusGetResponse - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::AI21.FnacAftersalesBatchPredictStatusSolutionsFdAftersalesPartsClassificationBatchBatchIdStatusGetResponse? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::AI21.FnacAftersalesBatchPredictStatusSolutionsFdAftersalesPartsClassificationBatchBatchIdStatusGetResponse), - jsonSerializerContext) as global::AI21.FnacAftersalesBatchPredictStatusSolutionsFdAftersalesPartsClassificationBatchBatchIdStatusGetResponse; - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::AI21.FnacAftersalesBatchPredictStatusSolutionsFdAftersalesPartsClassificationBatchBatchIdStatusGetResponse? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::AI21.FnacAftersalesBatchPredictStatusSolutionsFdAftersalesPartsClassificationBatchBatchIdStatusGetResponse), - jsonSerializerContext).ConfigureAwait(false)) as global::AI21.FnacAftersalesBatchPredictStatusSolutionsFdAftersalesPartsClassificationBatchBatchIdStatusGetResponse; - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/AI21/Generated/AI21.Models.FnacAftersalesBatchPredictStatusSolutionsFdAftersalesPartsClassificationBatchBatchIdStatusGetResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.FnacAftersalesBatchPredictStatusSolutionsFdAftersalesPartsClassificationBatchBatchIdStatusGetResponse.g.cs deleted file mode 100644 index 50a158d5..00000000 --- a/src/libs/AI21/Generated/AI21.Models.FnacAftersalesBatchPredictStatusSolutionsFdAftersalesPartsClassificationBatchBatchIdStatusGetResponse.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace AI21 -{ - /// - /// - /// - public sealed partial class FnacAftersalesBatchPredictStatusSolutionsFdAftersalesPartsClassificationBatchBatchIdStatusGetResponse - { - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.FnacBatchClassificationsPrefixPreviewSolutionsPreviewFdBatchesV1ClassificationsPostResponse.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.FnacBatchClassificationsPrefixPreviewSolutionsPreviewFdBatchesV1ClassificationsPostResponse.Json.g.cs deleted file mode 100644 index 080d86cb..00000000 --- a/src/libs/AI21/Generated/AI21.Models.FnacBatchClassificationsPrefixPreviewSolutionsPreviewFdBatchesV1ClassificationsPostResponse.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace AI21 -{ - public sealed partial class FnacBatchClassificationsPrefixPreviewSolutionsPreviewFdBatchesV1ClassificationsPostResponse - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::AI21.FnacBatchClassificationsPrefixPreviewSolutionsPreviewFdBatchesV1ClassificationsPostResponse? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::AI21.FnacBatchClassificationsPrefixPreviewSolutionsPreviewFdBatchesV1ClassificationsPostResponse), - jsonSerializerContext) as global::AI21.FnacBatchClassificationsPrefixPreviewSolutionsPreviewFdBatchesV1ClassificationsPostResponse; - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::AI21.FnacBatchClassificationsPrefixPreviewSolutionsPreviewFdBatchesV1ClassificationsPostResponse? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::AI21.FnacBatchClassificationsPrefixPreviewSolutionsPreviewFdBatchesV1ClassificationsPostResponse), - jsonSerializerContext).ConfigureAwait(false)) as global::AI21.FnacBatchClassificationsPrefixPreviewSolutionsPreviewFdBatchesV1ClassificationsPostResponse; - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/AI21/Generated/AI21.Models.FnacBatchClassificationsPrefixPreviewSolutionsPreviewFdBatchesV1ClassificationsPostResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.FnacBatchClassificationsPrefixPreviewSolutionsPreviewFdBatchesV1ClassificationsPostResponse.g.cs deleted file mode 100644 index f97f85e4..00000000 --- a/src/libs/AI21/Generated/AI21.Models.FnacBatchClassificationsPrefixPreviewSolutionsPreviewFdBatchesV1ClassificationsPostResponse.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace AI21 -{ - /// - /// - /// - public sealed partial class FnacBatchClassificationsPrefixPreviewSolutionsPreviewFdBatchesV1ClassificationsPostResponse - { - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.FnacBatchClassificationsResultsPrefixPreviewSolutionsPreviewFdBatchesV1ClassificationsBatchIdResultsPostResponse.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.FnacBatchClassificationsResultsPrefixPreviewSolutionsPreviewFdBatchesV1ClassificationsBatchIdResultsPostResponse.Json.g.cs deleted file mode 100644 index cf5ba652..00000000 --- a/src/libs/AI21/Generated/AI21.Models.FnacBatchClassificationsResultsPrefixPreviewSolutionsPreviewFdBatchesV1ClassificationsBatchIdResultsPostResponse.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace AI21 -{ - public sealed partial class FnacBatchClassificationsResultsPrefixPreviewSolutionsPreviewFdBatchesV1ClassificationsBatchIdResultsPostResponse - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::AI21.FnacBatchClassificationsResultsPrefixPreviewSolutionsPreviewFdBatchesV1ClassificationsBatchIdResultsPostResponse? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::AI21.FnacBatchClassificationsResultsPrefixPreviewSolutionsPreviewFdBatchesV1ClassificationsBatchIdResultsPostResponse), - jsonSerializerContext) as global::AI21.FnacBatchClassificationsResultsPrefixPreviewSolutionsPreviewFdBatchesV1ClassificationsBatchIdResultsPostResponse; - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::AI21.FnacBatchClassificationsResultsPrefixPreviewSolutionsPreviewFdBatchesV1ClassificationsBatchIdResultsPostResponse? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::AI21.FnacBatchClassificationsResultsPrefixPreviewSolutionsPreviewFdBatchesV1ClassificationsBatchIdResultsPostResponse), - jsonSerializerContext).ConfigureAwait(false)) as global::AI21.FnacBatchClassificationsResultsPrefixPreviewSolutionsPreviewFdBatchesV1ClassificationsBatchIdResultsPostResponse; - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/AI21/Generated/AI21.Models.FnacBatchClassificationsResultsPrefixPreviewSolutionsPreviewFdBatchesV1ClassificationsBatchIdResultsPostResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.FnacBatchClassificationsResultsPrefixPreviewSolutionsPreviewFdBatchesV1ClassificationsBatchIdResultsPostResponse.g.cs deleted file mode 100644 index fe5ba421..00000000 --- a/src/libs/AI21/Generated/AI21.Models.FnacBatchClassificationsResultsPrefixPreviewSolutionsPreviewFdBatchesV1ClassificationsBatchIdResultsPostResponse.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace AI21 -{ - /// - /// - /// - public sealed partial class FnacBatchClassificationsResultsPrefixPreviewSolutionsPreviewFdBatchesV1ClassificationsBatchIdResultsPostResponse - { - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.FnacBatchClassificationsResultsSolutionsFdBatchesV1ClassificationsBatchIdResultsPostResponse.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.FnacBatchClassificationsResultsSolutionsFdBatchesV1ClassificationsBatchIdResultsPostResponse.Json.g.cs deleted file mode 100644 index 3bce0446..00000000 --- a/src/libs/AI21/Generated/AI21.Models.FnacBatchClassificationsResultsSolutionsFdBatchesV1ClassificationsBatchIdResultsPostResponse.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace AI21 -{ - public sealed partial class FnacBatchClassificationsResultsSolutionsFdBatchesV1ClassificationsBatchIdResultsPostResponse - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::AI21.FnacBatchClassificationsResultsSolutionsFdBatchesV1ClassificationsBatchIdResultsPostResponse? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::AI21.FnacBatchClassificationsResultsSolutionsFdBatchesV1ClassificationsBatchIdResultsPostResponse), - jsonSerializerContext) as global::AI21.FnacBatchClassificationsResultsSolutionsFdBatchesV1ClassificationsBatchIdResultsPostResponse; - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::AI21.FnacBatchClassificationsResultsSolutionsFdBatchesV1ClassificationsBatchIdResultsPostResponse? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::AI21.FnacBatchClassificationsResultsSolutionsFdBatchesV1ClassificationsBatchIdResultsPostResponse), - jsonSerializerContext).ConfigureAwait(false)) as global::AI21.FnacBatchClassificationsResultsSolutionsFdBatchesV1ClassificationsBatchIdResultsPostResponse; - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/AI21/Generated/AI21.Models.FnacBatchClassificationsResultsSolutionsFdBatchesV1ClassificationsBatchIdResultsPostResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.FnacBatchClassificationsResultsSolutionsFdBatchesV1ClassificationsBatchIdResultsPostResponse.g.cs deleted file mode 100644 index 0b57894f..00000000 --- a/src/libs/AI21/Generated/AI21.Models.FnacBatchClassificationsResultsSolutionsFdBatchesV1ClassificationsBatchIdResultsPostResponse.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace AI21 -{ - /// - /// - /// - public sealed partial class FnacBatchClassificationsResultsSolutionsFdBatchesV1ClassificationsBatchIdResultsPostResponse - { - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.FnacBatchClassificationsSolutionsFdBatchesV1ClassificationsPostResponse.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.FnacBatchClassificationsSolutionsFdBatchesV1ClassificationsPostResponse.Json.g.cs deleted file mode 100644 index 8b867e65..00000000 --- a/src/libs/AI21/Generated/AI21.Models.FnacBatchClassificationsSolutionsFdBatchesV1ClassificationsPostResponse.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace AI21 -{ - public sealed partial class FnacBatchClassificationsSolutionsFdBatchesV1ClassificationsPostResponse - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::AI21.FnacBatchClassificationsSolutionsFdBatchesV1ClassificationsPostResponse? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::AI21.FnacBatchClassificationsSolutionsFdBatchesV1ClassificationsPostResponse), - jsonSerializerContext) as global::AI21.FnacBatchClassificationsSolutionsFdBatchesV1ClassificationsPostResponse; - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::AI21.FnacBatchClassificationsSolutionsFdBatchesV1ClassificationsPostResponse? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::AI21.FnacBatchClassificationsSolutionsFdBatchesV1ClassificationsPostResponse), - jsonSerializerContext).ConfigureAwait(false)) as global::AI21.FnacBatchClassificationsSolutionsFdBatchesV1ClassificationsPostResponse; - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/AI21/Generated/AI21.Models.FnacBatchClassificationsSolutionsFdBatchesV1ClassificationsPostResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.FnacBatchClassificationsSolutionsFdBatchesV1ClassificationsPostResponse.g.cs deleted file mode 100644 index 98353f33..00000000 --- a/src/libs/AI21/Generated/AI21.Models.FnacBatchClassificationsSolutionsFdBatchesV1ClassificationsPostResponse.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace AI21 -{ - /// - /// - /// - public sealed partial class FnacBatchClassificationsSolutionsFdBatchesV1ClassificationsPostResponse - { - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.FnacBatchClassificationsStatusPrefixPreviewSolutionsPreviewFdBatchesV1ClassificationsBatchIdStatusPostResponse.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.FnacBatchClassificationsStatusPrefixPreviewSolutionsPreviewFdBatchesV1ClassificationsBatchIdStatusPostResponse.Json.g.cs deleted file mode 100644 index a63dd691..00000000 --- a/src/libs/AI21/Generated/AI21.Models.FnacBatchClassificationsStatusPrefixPreviewSolutionsPreviewFdBatchesV1ClassificationsBatchIdStatusPostResponse.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace AI21 -{ - public sealed partial class FnacBatchClassificationsStatusPrefixPreviewSolutionsPreviewFdBatchesV1ClassificationsBatchIdStatusPostResponse - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::AI21.FnacBatchClassificationsStatusPrefixPreviewSolutionsPreviewFdBatchesV1ClassificationsBatchIdStatusPostResponse? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::AI21.FnacBatchClassificationsStatusPrefixPreviewSolutionsPreviewFdBatchesV1ClassificationsBatchIdStatusPostResponse), - jsonSerializerContext) as global::AI21.FnacBatchClassificationsStatusPrefixPreviewSolutionsPreviewFdBatchesV1ClassificationsBatchIdStatusPostResponse; - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::AI21.FnacBatchClassificationsStatusPrefixPreviewSolutionsPreviewFdBatchesV1ClassificationsBatchIdStatusPostResponse? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::AI21.FnacBatchClassificationsStatusPrefixPreviewSolutionsPreviewFdBatchesV1ClassificationsBatchIdStatusPostResponse), - jsonSerializerContext).ConfigureAwait(false)) as global::AI21.FnacBatchClassificationsStatusPrefixPreviewSolutionsPreviewFdBatchesV1ClassificationsBatchIdStatusPostResponse; - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/AI21/Generated/AI21.Models.FnacBatchClassificationsStatusPrefixPreviewSolutionsPreviewFdBatchesV1ClassificationsBatchIdStatusPostResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.FnacBatchClassificationsStatusPrefixPreviewSolutionsPreviewFdBatchesV1ClassificationsBatchIdStatusPostResponse.g.cs deleted file mode 100644 index dc2e89c2..00000000 --- a/src/libs/AI21/Generated/AI21.Models.FnacBatchClassificationsStatusPrefixPreviewSolutionsPreviewFdBatchesV1ClassificationsBatchIdStatusPostResponse.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace AI21 -{ - /// - /// - /// - public sealed partial class FnacBatchClassificationsStatusPrefixPreviewSolutionsPreviewFdBatchesV1ClassificationsBatchIdStatusPostResponse - { - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.FnacBatchClassificationsStatusSolutionsFdBatchesV1ClassificationsBatchIdStatusPostResponse.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.FnacBatchClassificationsStatusSolutionsFdBatchesV1ClassificationsBatchIdStatusPostResponse.Json.g.cs deleted file mode 100644 index 6cd80939..00000000 --- a/src/libs/AI21/Generated/AI21.Models.FnacBatchClassificationsStatusSolutionsFdBatchesV1ClassificationsBatchIdStatusPostResponse.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace AI21 -{ - public sealed partial class FnacBatchClassificationsStatusSolutionsFdBatchesV1ClassificationsBatchIdStatusPostResponse - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::AI21.FnacBatchClassificationsStatusSolutionsFdBatchesV1ClassificationsBatchIdStatusPostResponse? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::AI21.FnacBatchClassificationsStatusSolutionsFdBatchesV1ClassificationsBatchIdStatusPostResponse), - jsonSerializerContext) as global::AI21.FnacBatchClassificationsStatusSolutionsFdBatchesV1ClassificationsBatchIdStatusPostResponse; - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::AI21.FnacBatchClassificationsStatusSolutionsFdBatchesV1ClassificationsBatchIdStatusPostResponse? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::AI21.FnacBatchClassificationsStatusSolutionsFdBatchesV1ClassificationsBatchIdStatusPostResponse), - jsonSerializerContext).ConfigureAwait(false)) as global::AI21.FnacBatchClassificationsStatusSolutionsFdBatchesV1ClassificationsBatchIdStatusPostResponse; - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/AI21/Generated/AI21.Models.FnacBatchClassificationsStatusSolutionsFdBatchesV1ClassificationsBatchIdStatusPostResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.FnacBatchClassificationsStatusSolutionsFdBatchesV1ClassificationsBatchIdStatusPostResponse.g.cs deleted file mode 100644 index 983d06ed..00000000 --- a/src/libs/AI21/Generated/AI21.Models.FnacBatchClassificationsStatusSolutionsFdBatchesV1ClassificationsBatchIdStatusPostResponse.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace AI21 -{ - /// - /// - /// - public sealed partial class FnacBatchClassificationsStatusSolutionsFdBatchesV1ClassificationsBatchIdStatusPostResponse - { - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.FnacBatchDescriptionsPrefixPreviewSolutionsPreviewFdBatchesV1DescriptionsPostResponse.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.FnacBatchDescriptionsPrefixPreviewSolutionsPreviewFdBatchesV1DescriptionsPostResponse.Json.g.cs deleted file mode 100644 index c5ced781..00000000 --- a/src/libs/AI21/Generated/AI21.Models.FnacBatchDescriptionsPrefixPreviewSolutionsPreviewFdBatchesV1DescriptionsPostResponse.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace AI21 -{ - public sealed partial class FnacBatchDescriptionsPrefixPreviewSolutionsPreviewFdBatchesV1DescriptionsPostResponse - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::AI21.FnacBatchDescriptionsPrefixPreviewSolutionsPreviewFdBatchesV1DescriptionsPostResponse? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::AI21.FnacBatchDescriptionsPrefixPreviewSolutionsPreviewFdBatchesV1DescriptionsPostResponse), - jsonSerializerContext) as global::AI21.FnacBatchDescriptionsPrefixPreviewSolutionsPreviewFdBatchesV1DescriptionsPostResponse; - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::AI21.FnacBatchDescriptionsPrefixPreviewSolutionsPreviewFdBatchesV1DescriptionsPostResponse? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::AI21.FnacBatchDescriptionsPrefixPreviewSolutionsPreviewFdBatchesV1DescriptionsPostResponse), - jsonSerializerContext).ConfigureAwait(false)) as global::AI21.FnacBatchDescriptionsPrefixPreviewSolutionsPreviewFdBatchesV1DescriptionsPostResponse; - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/AI21/Generated/AI21.Models.FnacBatchDescriptionsPrefixPreviewSolutionsPreviewFdBatchesV1DescriptionsPostResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.FnacBatchDescriptionsPrefixPreviewSolutionsPreviewFdBatchesV1DescriptionsPostResponse.g.cs deleted file mode 100644 index 2b4c4dc5..00000000 --- a/src/libs/AI21/Generated/AI21.Models.FnacBatchDescriptionsPrefixPreviewSolutionsPreviewFdBatchesV1DescriptionsPostResponse.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace AI21 -{ - /// - /// - /// - public sealed partial class FnacBatchDescriptionsPrefixPreviewSolutionsPreviewFdBatchesV1DescriptionsPostResponse - { - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.FnacBatchDescriptionsResultsPrefixPreviewSolutionsPreviewFdBatchesV1DescriptionsBatchIdResultsPostResponse.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.FnacBatchDescriptionsResultsPrefixPreviewSolutionsPreviewFdBatchesV1DescriptionsBatchIdResultsPostResponse.Json.g.cs deleted file mode 100644 index 04c96a74..00000000 --- a/src/libs/AI21/Generated/AI21.Models.FnacBatchDescriptionsResultsPrefixPreviewSolutionsPreviewFdBatchesV1DescriptionsBatchIdResultsPostResponse.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace AI21 -{ - public sealed partial class FnacBatchDescriptionsResultsPrefixPreviewSolutionsPreviewFdBatchesV1DescriptionsBatchIdResultsPostResponse - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::AI21.FnacBatchDescriptionsResultsPrefixPreviewSolutionsPreviewFdBatchesV1DescriptionsBatchIdResultsPostResponse? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::AI21.FnacBatchDescriptionsResultsPrefixPreviewSolutionsPreviewFdBatchesV1DescriptionsBatchIdResultsPostResponse), - jsonSerializerContext) as global::AI21.FnacBatchDescriptionsResultsPrefixPreviewSolutionsPreviewFdBatchesV1DescriptionsBatchIdResultsPostResponse; - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::AI21.FnacBatchDescriptionsResultsPrefixPreviewSolutionsPreviewFdBatchesV1DescriptionsBatchIdResultsPostResponse? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::AI21.FnacBatchDescriptionsResultsPrefixPreviewSolutionsPreviewFdBatchesV1DescriptionsBatchIdResultsPostResponse), - jsonSerializerContext).ConfigureAwait(false)) as global::AI21.FnacBatchDescriptionsResultsPrefixPreviewSolutionsPreviewFdBatchesV1DescriptionsBatchIdResultsPostResponse; - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/AI21/Generated/AI21.Models.FnacBatchDescriptionsResultsPrefixPreviewSolutionsPreviewFdBatchesV1DescriptionsBatchIdResultsPostResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.FnacBatchDescriptionsResultsPrefixPreviewSolutionsPreviewFdBatchesV1DescriptionsBatchIdResultsPostResponse.g.cs deleted file mode 100644 index 6501dcfe..00000000 --- a/src/libs/AI21/Generated/AI21.Models.FnacBatchDescriptionsResultsPrefixPreviewSolutionsPreviewFdBatchesV1DescriptionsBatchIdResultsPostResponse.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace AI21 -{ - /// - /// - /// - public sealed partial class FnacBatchDescriptionsResultsPrefixPreviewSolutionsPreviewFdBatchesV1DescriptionsBatchIdResultsPostResponse - { - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.FnacBatchDescriptionsResultsSolutionsFdBatchesV1DescriptionsBatchIdResultsPostResponse.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.FnacBatchDescriptionsResultsSolutionsFdBatchesV1DescriptionsBatchIdResultsPostResponse.Json.g.cs deleted file mode 100644 index 7b727bf8..00000000 --- a/src/libs/AI21/Generated/AI21.Models.FnacBatchDescriptionsResultsSolutionsFdBatchesV1DescriptionsBatchIdResultsPostResponse.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace AI21 -{ - public sealed partial class FnacBatchDescriptionsResultsSolutionsFdBatchesV1DescriptionsBatchIdResultsPostResponse - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::AI21.FnacBatchDescriptionsResultsSolutionsFdBatchesV1DescriptionsBatchIdResultsPostResponse? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::AI21.FnacBatchDescriptionsResultsSolutionsFdBatchesV1DescriptionsBatchIdResultsPostResponse), - jsonSerializerContext) as global::AI21.FnacBatchDescriptionsResultsSolutionsFdBatchesV1DescriptionsBatchIdResultsPostResponse; - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::AI21.FnacBatchDescriptionsResultsSolutionsFdBatchesV1DescriptionsBatchIdResultsPostResponse? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::AI21.FnacBatchDescriptionsResultsSolutionsFdBatchesV1DescriptionsBatchIdResultsPostResponse), - jsonSerializerContext).ConfigureAwait(false)) as global::AI21.FnacBatchDescriptionsResultsSolutionsFdBatchesV1DescriptionsBatchIdResultsPostResponse; - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/AI21/Generated/AI21.Models.FnacBatchDescriptionsResultsSolutionsFdBatchesV1DescriptionsBatchIdResultsPostResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.FnacBatchDescriptionsResultsSolutionsFdBatchesV1DescriptionsBatchIdResultsPostResponse.g.cs deleted file mode 100644 index bfc4103f..00000000 --- a/src/libs/AI21/Generated/AI21.Models.FnacBatchDescriptionsResultsSolutionsFdBatchesV1DescriptionsBatchIdResultsPostResponse.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace AI21 -{ - /// - /// - /// - public sealed partial class FnacBatchDescriptionsResultsSolutionsFdBatchesV1DescriptionsBatchIdResultsPostResponse - { - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.FnacBatchDescriptionsSolutionsFdBatchesV1DescriptionsPostResponse.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.FnacBatchDescriptionsSolutionsFdBatchesV1DescriptionsPostResponse.Json.g.cs deleted file mode 100644 index 66730cc2..00000000 --- a/src/libs/AI21/Generated/AI21.Models.FnacBatchDescriptionsSolutionsFdBatchesV1DescriptionsPostResponse.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace AI21 -{ - public sealed partial class FnacBatchDescriptionsSolutionsFdBatchesV1DescriptionsPostResponse - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::AI21.FnacBatchDescriptionsSolutionsFdBatchesV1DescriptionsPostResponse? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::AI21.FnacBatchDescriptionsSolutionsFdBatchesV1DescriptionsPostResponse), - jsonSerializerContext) as global::AI21.FnacBatchDescriptionsSolutionsFdBatchesV1DescriptionsPostResponse; - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::AI21.FnacBatchDescriptionsSolutionsFdBatchesV1DescriptionsPostResponse? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::AI21.FnacBatchDescriptionsSolutionsFdBatchesV1DescriptionsPostResponse), - jsonSerializerContext).ConfigureAwait(false)) as global::AI21.FnacBatchDescriptionsSolutionsFdBatchesV1DescriptionsPostResponse; - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/AI21/Generated/AI21.Models.FnacBatchDescriptionsSolutionsFdBatchesV1DescriptionsPostResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.FnacBatchDescriptionsSolutionsFdBatchesV1DescriptionsPostResponse.g.cs deleted file mode 100644 index 1caee80e..00000000 --- a/src/libs/AI21/Generated/AI21.Models.FnacBatchDescriptionsSolutionsFdBatchesV1DescriptionsPostResponse.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace AI21 -{ - /// - /// - /// - public sealed partial class FnacBatchDescriptionsSolutionsFdBatchesV1DescriptionsPostResponse - { - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.FnacBatchDescriptionsStatusPrefixPreviewSolutionsPreviewFdBatchesV1DescriptionsBatchIdStatusPostResponse.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.FnacBatchDescriptionsStatusPrefixPreviewSolutionsPreviewFdBatchesV1DescriptionsBatchIdStatusPostResponse.Json.g.cs deleted file mode 100644 index cd05d290..00000000 --- a/src/libs/AI21/Generated/AI21.Models.FnacBatchDescriptionsStatusPrefixPreviewSolutionsPreviewFdBatchesV1DescriptionsBatchIdStatusPostResponse.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace AI21 -{ - public sealed partial class FnacBatchDescriptionsStatusPrefixPreviewSolutionsPreviewFdBatchesV1DescriptionsBatchIdStatusPostResponse - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::AI21.FnacBatchDescriptionsStatusPrefixPreviewSolutionsPreviewFdBatchesV1DescriptionsBatchIdStatusPostResponse? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::AI21.FnacBatchDescriptionsStatusPrefixPreviewSolutionsPreviewFdBatchesV1DescriptionsBatchIdStatusPostResponse), - jsonSerializerContext) as global::AI21.FnacBatchDescriptionsStatusPrefixPreviewSolutionsPreviewFdBatchesV1DescriptionsBatchIdStatusPostResponse; - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::AI21.FnacBatchDescriptionsStatusPrefixPreviewSolutionsPreviewFdBatchesV1DescriptionsBatchIdStatusPostResponse? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::AI21.FnacBatchDescriptionsStatusPrefixPreviewSolutionsPreviewFdBatchesV1DescriptionsBatchIdStatusPostResponse), - jsonSerializerContext).ConfigureAwait(false)) as global::AI21.FnacBatchDescriptionsStatusPrefixPreviewSolutionsPreviewFdBatchesV1DescriptionsBatchIdStatusPostResponse; - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/AI21/Generated/AI21.Models.FnacBatchDescriptionsStatusPrefixPreviewSolutionsPreviewFdBatchesV1DescriptionsBatchIdStatusPostResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.FnacBatchDescriptionsStatusPrefixPreviewSolutionsPreviewFdBatchesV1DescriptionsBatchIdStatusPostResponse.g.cs deleted file mode 100644 index a40e9e0c..00000000 --- a/src/libs/AI21/Generated/AI21.Models.FnacBatchDescriptionsStatusPrefixPreviewSolutionsPreviewFdBatchesV1DescriptionsBatchIdStatusPostResponse.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace AI21 -{ - /// - /// - /// - public sealed partial class FnacBatchDescriptionsStatusPrefixPreviewSolutionsPreviewFdBatchesV1DescriptionsBatchIdStatusPostResponse - { - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.FnacBatchDescriptionsStatusSolutionsFdBatchesV1DescriptionsBatchIdStatusPostResponse.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.FnacBatchDescriptionsStatusSolutionsFdBatchesV1DescriptionsBatchIdStatusPostResponse.Json.g.cs deleted file mode 100644 index 2d90b72c..00000000 --- a/src/libs/AI21/Generated/AI21.Models.FnacBatchDescriptionsStatusSolutionsFdBatchesV1DescriptionsBatchIdStatusPostResponse.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace AI21 -{ - public sealed partial class FnacBatchDescriptionsStatusSolutionsFdBatchesV1DescriptionsBatchIdStatusPostResponse - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::AI21.FnacBatchDescriptionsStatusSolutionsFdBatchesV1DescriptionsBatchIdStatusPostResponse? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::AI21.FnacBatchDescriptionsStatusSolutionsFdBatchesV1DescriptionsBatchIdStatusPostResponse), - jsonSerializerContext) as global::AI21.FnacBatchDescriptionsStatusSolutionsFdBatchesV1DescriptionsBatchIdStatusPostResponse; - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::AI21.FnacBatchDescriptionsStatusSolutionsFdBatchesV1DescriptionsBatchIdStatusPostResponse? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::AI21.FnacBatchDescriptionsStatusSolutionsFdBatchesV1DescriptionsBatchIdStatusPostResponse), - jsonSerializerContext).ConfigureAwait(false)) as global::AI21.FnacBatchDescriptionsStatusSolutionsFdBatchesV1DescriptionsBatchIdStatusPostResponse; - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/AI21/Generated/AI21.Models.FnacBatchDescriptionsStatusSolutionsFdBatchesV1DescriptionsBatchIdStatusPostResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.FnacBatchDescriptionsStatusSolutionsFdBatchesV1DescriptionsBatchIdStatusPostResponse.g.cs deleted file mode 100644 index aed48d22..00000000 --- a/src/libs/AI21/Generated/AI21.Models.FnacBatchDescriptionsStatusSolutionsFdBatchesV1DescriptionsBatchIdStatusPostResponse.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace AI21 -{ - /// - /// - /// - public sealed partial class FnacBatchDescriptionsStatusSolutionsFdBatchesV1DescriptionsBatchIdStatusPostResponse - { - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.FnacV1ClassificationsPrefixPreviewSolutionsPreviewFnacV1ClassificationsPostResponse.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.FnacV1ClassificationsPrefixPreviewSolutionsPreviewFnacV1ClassificationsPostResponse.Json.g.cs deleted file mode 100644 index 30ed239b..00000000 --- a/src/libs/AI21/Generated/AI21.Models.FnacV1ClassificationsPrefixPreviewSolutionsPreviewFnacV1ClassificationsPostResponse.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace AI21 -{ - public sealed partial class FnacV1ClassificationsPrefixPreviewSolutionsPreviewFnacV1ClassificationsPostResponse - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::AI21.FnacV1ClassificationsPrefixPreviewSolutionsPreviewFnacV1ClassificationsPostResponse? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::AI21.FnacV1ClassificationsPrefixPreviewSolutionsPreviewFnacV1ClassificationsPostResponse), - jsonSerializerContext) as global::AI21.FnacV1ClassificationsPrefixPreviewSolutionsPreviewFnacV1ClassificationsPostResponse; - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::AI21.FnacV1ClassificationsPrefixPreviewSolutionsPreviewFnacV1ClassificationsPostResponse? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::AI21.FnacV1ClassificationsPrefixPreviewSolutionsPreviewFnacV1ClassificationsPostResponse), - jsonSerializerContext).ConfigureAwait(false)) as global::AI21.FnacV1ClassificationsPrefixPreviewSolutionsPreviewFnacV1ClassificationsPostResponse; - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/AI21/Generated/AI21.Models.FnacV1ClassificationsPrefixPreviewSolutionsPreviewFnacV1ClassificationsPostResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.FnacV1ClassificationsPrefixPreviewSolutionsPreviewFnacV1ClassificationsPostResponse.g.cs deleted file mode 100644 index 3145a868..00000000 --- a/src/libs/AI21/Generated/AI21.Models.FnacV1ClassificationsPrefixPreviewSolutionsPreviewFnacV1ClassificationsPostResponse.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace AI21 -{ - /// - /// - /// - public sealed partial class FnacV1ClassificationsPrefixPreviewSolutionsPreviewFnacV1ClassificationsPostResponse - { - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.FnacV1ClassificationsSolutionsFnacV1ClassificationsPostResponse.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.FnacV1ClassificationsSolutionsFnacV1ClassificationsPostResponse.Json.g.cs deleted file mode 100644 index 3b1cce43..00000000 --- a/src/libs/AI21/Generated/AI21.Models.FnacV1ClassificationsSolutionsFnacV1ClassificationsPostResponse.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace AI21 -{ - public sealed partial class FnacV1ClassificationsSolutionsFnacV1ClassificationsPostResponse - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::AI21.FnacV1ClassificationsSolutionsFnacV1ClassificationsPostResponse? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::AI21.FnacV1ClassificationsSolutionsFnacV1ClassificationsPostResponse), - jsonSerializerContext) as global::AI21.FnacV1ClassificationsSolutionsFnacV1ClassificationsPostResponse; - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::AI21.FnacV1ClassificationsSolutionsFnacV1ClassificationsPostResponse? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::AI21.FnacV1ClassificationsSolutionsFnacV1ClassificationsPostResponse), - jsonSerializerContext).ConfigureAwait(false)) as global::AI21.FnacV1ClassificationsSolutionsFnacV1ClassificationsPostResponse; - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/AI21/Generated/AI21.Models.FnacV1ClassificationsSolutionsFnacV1ClassificationsPostResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.FnacV1ClassificationsSolutionsFnacV1ClassificationsPostResponse.g.cs deleted file mode 100644 index 1d302569..00000000 --- a/src/libs/AI21/Generated/AI21.Models.FnacV1ClassificationsSolutionsFnacV1ClassificationsPostResponse.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace AI21 -{ - /// - /// - /// - public sealed partial class FnacV1ClassificationsSolutionsFnacV1ClassificationsPostResponse - { - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.FnacV1DeprecatedClassificationsPrefixPreviewSolutionsPreviewFnacV1DeprecatedClassificationsPostResponse.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.FnacV1DeprecatedClassificationsPrefixPreviewSolutionsPreviewFnacV1DeprecatedClassificationsPostResponse.Json.g.cs deleted file mode 100644 index a7797a71..00000000 --- a/src/libs/AI21/Generated/AI21.Models.FnacV1DeprecatedClassificationsPrefixPreviewSolutionsPreviewFnacV1DeprecatedClassificationsPostResponse.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace AI21 -{ - public sealed partial class FnacV1DeprecatedClassificationsPrefixPreviewSolutionsPreviewFnacV1DeprecatedClassificationsPostResponse - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::AI21.FnacV1DeprecatedClassificationsPrefixPreviewSolutionsPreviewFnacV1DeprecatedClassificationsPostResponse? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::AI21.FnacV1DeprecatedClassificationsPrefixPreviewSolutionsPreviewFnacV1DeprecatedClassificationsPostResponse), - jsonSerializerContext) as global::AI21.FnacV1DeprecatedClassificationsPrefixPreviewSolutionsPreviewFnacV1DeprecatedClassificationsPostResponse; - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::AI21.FnacV1DeprecatedClassificationsPrefixPreviewSolutionsPreviewFnacV1DeprecatedClassificationsPostResponse? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::AI21.FnacV1DeprecatedClassificationsPrefixPreviewSolutionsPreviewFnacV1DeprecatedClassificationsPostResponse), - jsonSerializerContext).ConfigureAwait(false)) as global::AI21.FnacV1DeprecatedClassificationsPrefixPreviewSolutionsPreviewFnacV1DeprecatedClassificationsPostResponse; - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/AI21/Generated/AI21.Models.FnacV1DeprecatedClassificationsPrefixPreviewSolutionsPreviewFnacV1DeprecatedClassificationsPostResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.FnacV1DeprecatedClassificationsPrefixPreviewSolutionsPreviewFnacV1DeprecatedClassificationsPostResponse.g.cs deleted file mode 100644 index fc62dc07..00000000 --- a/src/libs/AI21/Generated/AI21.Models.FnacV1DeprecatedClassificationsPrefixPreviewSolutionsPreviewFnacV1DeprecatedClassificationsPostResponse.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace AI21 -{ - /// - /// - /// - public sealed partial class FnacV1DeprecatedClassificationsPrefixPreviewSolutionsPreviewFnacV1DeprecatedClassificationsPostResponse - { - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.FnacV1DeprecatedClassificationsSolutionsFnacV1DeprecatedClassificationsPostResponse.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.FnacV1DeprecatedClassificationsSolutionsFnacV1DeprecatedClassificationsPostResponse.Json.g.cs deleted file mode 100644 index da916e66..00000000 --- a/src/libs/AI21/Generated/AI21.Models.FnacV1DeprecatedClassificationsSolutionsFnacV1DeprecatedClassificationsPostResponse.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace AI21 -{ - public sealed partial class FnacV1DeprecatedClassificationsSolutionsFnacV1DeprecatedClassificationsPostResponse - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::AI21.FnacV1DeprecatedClassificationsSolutionsFnacV1DeprecatedClassificationsPostResponse? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::AI21.FnacV1DeprecatedClassificationsSolutionsFnacV1DeprecatedClassificationsPostResponse), - jsonSerializerContext) as global::AI21.FnacV1DeprecatedClassificationsSolutionsFnacV1DeprecatedClassificationsPostResponse; - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::AI21.FnacV1DeprecatedClassificationsSolutionsFnacV1DeprecatedClassificationsPostResponse? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::AI21.FnacV1DeprecatedClassificationsSolutionsFnacV1DeprecatedClassificationsPostResponse), - jsonSerializerContext).ConfigureAwait(false)) as global::AI21.FnacV1DeprecatedClassificationsSolutionsFnacV1DeprecatedClassificationsPostResponse; - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/AI21/Generated/AI21.Models.FnacV1DeprecatedClassificationsSolutionsFnacV1DeprecatedClassificationsPostResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.FnacV1DeprecatedClassificationsSolutionsFnacV1DeprecatedClassificationsPostResponse.g.cs deleted file mode 100644 index 3ca25822..00000000 --- a/src/libs/AI21/Generated/AI21.Models.FnacV1DeprecatedClassificationsSolutionsFnacV1DeprecatedClassificationsPostResponse.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace AI21 -{ - /// - /// - /// - public sealed partial class FnacV1DeprecatedClassificationsSolutionsFnacV1DeprecatedClassificationsPostResponse - { - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.FnacV1DeprecatedDescriptionsPrefixPreviewSolutionsPreviewFnacV1DeprecatedDescriptionsPostResponse.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.FnacV1DeprecatedDescriptionsPrefixPreviewSolutionsPreviewFnacV1DeprecatedDescriptionsPostResponse.Json.g.cs deleted file mode 100644 index 44517be6..00000000 --- a/src/libs/AI21/Generated/AI21.Models.FnacV1DeprecatedDescriptionsPrefixPreviewSolutionsPreviewFnacV1DeprecatedDescriptionsPostResponse.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace AI21 -{ - public sealed partial class FnacV1DeprecatedDescriptionsPrefixPreviewSolutionsPreviewFnacV1DeprecatedDescriptionsPostResponse - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::AI21.FnacV1DeprecatedDescriptionsPrefixPreviewSolutionsPreviewFnacV1DeprecatedDescriptionsPostResponse? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::AI21.FnacV1DeprecatedDescriptionsPrefixPreviewSolutionsPreviewFnacV1DeprecatedDescriptionsPostResponse), - jsonSerializerContext) as global::AI21.FnacV1DeprecatedDescriptionsPrefixPreviewSolutionsPreviewFnacV1DeprecatedDescriptionsPostResponse; - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::AI21.FnacV1DeprecatedDescriptionsPrefixPreviewSolutionsPreviewFnacV1DeprecatedDescriptionsPostResponse? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::AI21.FnacV1DeprecatedDescriptionsPrefixPreviewSolutionsPreviewFnacV1DeprecatedDescriptionsPostResponse), - jsonSerializerContext).ConfigureAwait(false)) as global::AI21.FnacV1DeprecatedDescriptionsPrefixPreviewSolutionsPreviewFnacV1DeprecatedDescriptionsPostResponse; - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/AI21/Generated/AI21.Models.FnacV1DeprecatedDescriptionsPrefixPreviewSolutionsPreviewFnacV1DeprecatedDescriptionsPostResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.FnacV1DeprecatedDescriptionsPrefixPreviewSolutionsPreviewFnacV1DeprecatedDescriptionsPostResponse.g.cs deleted file mode 100644 index 215f260f..00000000 --- a/src/libs/AI21/Generated/AI21.Models.FnacV1DeprecatedDescriptionsPrefixPreviewSolutionsPreviewFnacV1DeprecatedDescriptionsPostResponse.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace AI21 -{ - /// - /// - /// - public sealed partial class FnacV1DeprecatedDescriptionsPrefixPreviewSolutionsPreviewFnacV1DeprecatedDescriptionsPostResponse - { - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.FnacV1DeprecatedDescriptionsSolutionsFnacV1DeprecatedDescriptionsPostResponse.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.FnacV1DeprecatedDescriptionsSolutionsFnacV1DeprecatedDescriptionsPostResponse.Json.g.cs deleted file mode 100644 index 451d1b2c..00000000 --- a/src/libs/AI21/Generated/AI21.Models.FnacV1DeprecatedDescriptionsSolutionsFnacV1DeprecatedDescriptionsPostResponse.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace AI21 -{ - public sealed partial class FnacV1DeprecatedDescriptionsSolutionsFnacV1DeprecatedDescriptionsPostResponse - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::AI21.FnacV1DeprecatedDescriptionsSolutionsFnacV1DeprecatedDescriptionsPostResponse? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::AI21.FnacV1DeprecatedDescriptionsSolutionsFnacV1DeprecatedDescriptionsPostResponse), - jsonSerializerContext) as global::AI21.FnacV1DeprecatedDescriptionsSolutionsFnacV1DeprecatedDescriptionsPostResponse; - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::AI21.FnacV1DeprecatedDescriptionsSolutionsFnacV1DeprecatedDescriptionsPostResponse? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::AI21.FnacV1DeprecatedDescriptionsSolutionsFnacV1DeprecatedDescriptionsPostResponse), - jsonSerializerContext).ConfigureAwait(false)) as global::AI21.FnacV1DeprecatedDescriptionsSolutionsFnacV1DeprecatedDescriptionsPostResponse; - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/AI21/Generated/AI21.Models.FnacV1DeprecatedDescriptionsSolutionsFnacV1DeprecatedDescriptionsPostResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.FnacV1DeprecatedDescriptionsSolutionsFnacV1DeprecatedDescriptionsPostResponse.g.cs deleted file mode 100644 index 20c71661..00000000 --- a/src/libs/AI21/Generated/AI21.Models.FnacV1DeprecatedDescriptionsSolutionsFnacV1DeprecatedDescriptionsPostResponse.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace AI21 -{ - /// - /// - /// - public sealed partial class FnacV1DeprecatedDescriptionsSolutionsFnacV1DeprecatedDescriptionsPostResponse - { - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.FnacV1DescriptionsPrefixPreviewSolutionsPreviewFnacV1DescriptionsPostResponse.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.FnacV1DescriptionsPrefixPreviewSolutionsPreviewFnacV1DescriptionsPostResponse.Json.g.cs deleted file mode 100644 index c4829709..00000000 --- a/src/libs/AI21/Generated/AI21.Models.FnacV1DescriptionsPrefixPreviewSolutionsPreviewFnacV1DescriptionsPostResponse.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace AI21 -{ - public sealed partial class FnacV1DescriptionsPrefixPreviewSolutionsPreviewFnacV1DescriptionsPostResponse - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::AI21.FnacV1DescriptionsPrefixPreviewSolutionsPreviewFnacV1DescriptionsPostResponse? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::AI21.FnacV1DescriptionsPrefixPreviewSolutionsPreviewFnacV1DescriptionsPostResponse), - jsonSerializerContext) as global::AI21.FnacV1DescriptionsPrefixPreviewSolutionsPreviewFnacV1DescriptionsPostResponse; - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::AI21.FnacV1DescriptionsPrefixPreviewSolutionsPreviewFnacV1DescriptionsPostResponse? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::AI21.FnacV1DescriptionsPrefixPreviewSolutionsPreviewFnacV1DescriptionsPostResponse), - jsonSerializerContext).ConfigureAwait(false)) as global::AI21.FnacV1DescriptionsPrefixPreviewSolutionsPreviewFnacV1DescriptionsPostResponse; - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/AI21/Generated/AI21.Models.FnacV1DescriptionsPrefixPreviewSolutionsPreviewFnacV1DescriptionsPostResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.FnacV1DescriptionsPrefixPreviewSolutionsPreviewFnacV1DescriptionsPostResponse.g.cs deleted file mode 100644 index 44697dd1..00000000 --- a/src/libs/AI21/Generated/AI21.Models.FnacV1DescriptionsPrefixPreviewSolutionsPreviewFnacV1DescriptionsPostResponse.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace AI21 -{ - /// - /// - /// - public sealed partial class FnacV1DescriptionsPrefixPreviewSolutionsPreviewFnacV1DescriptionsPostResponse - { - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.FnacV1DescriptionsSolutionsFnacV1DescriptionsPostResponse.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.FnacV1DescriptionsSolutionsFnacV1DescriptionsPostResponse.Json.g.cs deleted file mode 100644 index 3c297edc..00000000 --- a/src/libs/AI21/Generated/AI21.Models.FnacV1DescriptionsSolutionsFnacV1DescriptionsPostResponse.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace AI21 -{ - public sealed partial class FnacV1DescriptionsSolutionsFnacV1DescriptionsPostResponse - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::AI21.FnacV1DescriptionsSolutionsFnacV1DescriptionsPostResponse? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::AI21.FnacV1DescriptionsSolutionsFnacV1DescriptionsPostResponse), - jsonSerializerContext) as global::AI21.FnacV1DescriptionsSolutionsFnacV1DescriptionsPostResponse; - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::AI21.FnacV1DescriptionsSolutionsFnacV1DescriptionsPostResponse? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::AI21.FnacV1DescriptionsSolutionsFnacV1DescriptionsPostResponse), - jsonSerializerContext).ConfigureAwait(false)) as global::AI21.FnacV1DescriptionsSolutionsFnacV1DescriptionsPostResponse; - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/AI21/Generated/AI21.Models.FnacV1DescriptionsSolutionsFnacV1DescriptionsPostResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.FnacV1DescriptionsSolutionsFnacV1DescriptionsPostResponse.g.cs deleted file mode 100644 index 62c6c675..00000000 --- a/src/libs/AI21/Generated/AI21.Models.FnacV1DescriptionsSolutionsFnacV1DescriptionsPostResponse.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace AI21 -{ - /// - /// - /// - public sealed partial class FnacV1DescriptionsSolutionsFnacV1DescriptionsPostResponse - { - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.ForwardParagonWebhookStudioV1ConnectorsParagonWebhookPostResponse.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.ForwardParagonWebhookStudioV1ConnectorsParagonWebhookPostResponse.Json.g.cs deleted file mode 100644 index 0f01aa0d..00000000 --- a/src/libs/AI21/Generated/AI21.Models.ForwardParagonWebhookStudioV1ConnectorsParagonWebhookPostResponse.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace AI21 -{ - public sealed partial class ForwardParagonWebhookStudioV1ConnectorsParagonWebhookPostResponse - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::AI21.ForwardParagonWebhookStudioV1ConnectorsParagonWebhookPostResponse? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::AI21.ForwardParagonWebhookStudioV1ConnectorsParagonWebhookPostResponse), - jsonSerializerContext) as global::AI21.ForwardParagonWebhookStudioV1ConnectorsParagonWebhookPostResponse; - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::AI21.ForwardParagonWebhookStudioV1ConnectorsParagonWebhookPostResponse? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::AI21.ForwardParagonWebhookStudioV1ConnectorsParagonWebhookPostResponse), - jsonSerializerContext).ConfigureAwait(false)) as global::AI21.ForwardParagonWebhookStudioV1ConnectorsParagonWebhookPostResponse; - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/AI21/Generated/AI21.Models.ForwardParagonWebhookStudioV1ConnectorsParagonWebhookPostResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.ForwardParagonWebhookStudioV1ConnectorsParagonWebhookPostResponse.g.cs deleted file mode 100644 index 68d87d1d..00000000 --- a/src/libs/AI21/Generated/AI21.Models.ForwardParagonWebhookStudioV1ConnectorsParagonWebhookPostResponse.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace AI21 -{ - /// - /// - /// - public sealed partial class ForwardParagonWebhookStudioV1ConnectorsParagonWebhookPostResponse - { - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.FunctionToolDefinition.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.FunctionToolDefinition.Json.g.cs index 1f900605..7060b7ce 100644 --- a/src/libs/AI21/Generated/AI21.Models.FunctionToolDefinition.Json.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.FunctionToolDefinition.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::AI21.FunctionToolDefinition; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::AI21.FunctionToolDefinition? FromJson( + string json) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::AI21.FunctionToolDefinition; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/AI21/Generated/AI21.Models.FunctionToolDefinition.g.cs b/src/libs/AI21/Generated/AI21.Models.FunctionToolDefinition.g.cs index 22a92a03..1fc54b7c 100644 --- a/src/libs/AI21/Generated/AI21.Models.FunctionToolDefinition.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.FunctionToolDefinition.g.cs @@ -58,5 +58,6 @@ public FunctionToolDefinition( public FunctionToolDefinition() { } + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.GenerateAssistantRequest.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.GenerateAssistantRequest.Json.g.cs index 9d06c365..8913c98d 100644 --- a/src/libs/AI21/Generated/AI21.Models.GenerateAssistantRequest.Json.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.GenerateAssistantRequest.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::AI21.GenerateAssistantRequest; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::AI21.GenerateAssistantRequest? FromJson( + string json) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::AI21.GenerateAssistantRequest; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/AI21/Generated/AI21.Models.GenerateAssistantRequest.g.cs b/src/libs/AI21/Generated/AI21.Models.GenerateAssistantRequest.g.cs index 8ff04ddb..7ad809c6 100644 --- a/src/libs/AI21/Generated/AI21.Models.GenerateAssistantRequest.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.GenerateAssistantRequest.g.cs @@ -49,5 +49,6 @@ public GenerateAssistantRequest( public GenerateAssistantRequest() { } + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.GenerateAssistantResponse.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.GenerateAssistantResponse.Json.g.cs index b6bec849..9a9af789 100644 --- a/src/libs/AI21/Generated/AI21.Models.GenerateAssistantResponse.Json.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.GenerateAssistantResponse.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::AI21.GenerateAssistantResponse; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::AI21.GenerateAssistantResponse? FromJson( + string json) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::AI21.GenerateAssistantResponse; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/AI21/Generated/AI21.Models.GenerateAssistantResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.GenerateAssistantResponse.g.cs index a73ece44..76dc166a 100644 --- a/src/libs/AI21/Generated/AI21.Models.GenerateAssistantResponse.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.GenerateAssistantResponse.g.cs @@ -292,5 +292,6 @@ public GenerateAssistantResponse( public GenerateAssistantResponse() { } + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.GenerateAssistantResponseConfigOverrides.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.GenerateAssistantResponseConfigOverrides.Json.g.cs index 4fd6c082..dcb02693 100644 --- a/src/libs/AI21/Generated/AI21.Models.GenerateAssistantResponseConfigOverrides.Json.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.GenerateAssistantResponseConfigOverrides.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::AI21.GenerateAssistantResponseConfigOverrides; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::AI21.GenerateAssistantResponseConfigOverrides? FromJson( + string json) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::AI21.GenerateAssistantResponseConfigOverrides; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/AI21/Generated/AI21.Models.GenerateAssistantResponseConfigOverrides.g.cs b/src/libs/AI21/Generated/AI21.Models.GenerateAssistantResponseConfigOverrides.g.cs index 44780c04..c495e756 100644 --- a/src/libs/AI21/Generated/AI21.Models.GenerateAssistantResponseConfigOverrides.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.GenerateAssistantResponseConfigOverrides.g.cs @@ -14,5 +14,6 @@ public sealed partial class GenerateAssistantResponseConfigOverrides /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.GenerateAssistantResponseCustomToolNeeded.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.GenerateAssistantResponseCustomToolNeeded.Json.g.cs index de8b6019..b5a78a0c 100644 --- a/src/libs/AI21/Generated/AI21.Models.GenerateAssistantResponseCustomToolNeeded.Json.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.GenerateAssistantResponseCustomToolNeeded.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::AI21.GenerateAssistantResponseCustomToolNeeded; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::AI21.GenerateAssistantResponseCustomToolNeeded? FromJson( + string json) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::AI21.GenerateAssistantResponseCustomToolNeeded; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/AI21/Generated/AI21.Models.GenerateAssistantResponseCustomToolNeeded.g.cs b/src/libs/AI21/Generated/AI21.Models.GenerateAssistantResponseCustomToolNeeded.g.cs index ee271d1b..96ea0da5 100644 --- a/src/libs/AI21/Generated/AI21.Models.GenerateAssistantResponseCustomToolNeeded.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.GenerateAssistantResponseCustomToolNeeded.g.cs @@ -14,5 +14,6 @@ public sealed partial class GenerateAssistantResponseCustomToolNeeded /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.GenerateResponsePdfStudioV1DemosRfiGenerateResponsePdfPostResponse.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.GenerateResponsePdfStudioV1DemosRfiGenerateResponsePdfPostResponse.Json.g.cs index 3824afbb..f7f2c4ed 100644 --- a/src/libs/AI21/Generated/AI21.Models.GenerateResponsePdfStudioV1DemosRfiGenerateResponsePdfPostResponse.Json.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.GenerateResponsePdfStudioV1DemosRfiGenerateResponsePdfPostResponse.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::AI21.GenerateResponsePdfStudioV1DemosRfiGenerateResponsePdfPostResponse; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::AI21.GenerateResponsePdfStudioV1DemosRfiGenerateResponsePdfPostResponse? FromJson( + string json) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::AI21.GenerateResponsePdfStudioV1DemosRfiGenerateResponsePdfPostResponse; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/AI21/Generated/AI21.Models.GenerateResponsePdfStudioV1DemosRfiGenerateResponsePdfPostResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.GenerateResponsePdfStudioV1DemosRfiGenerateResponsePdfPostResponse.g.cs index bb8f0812..4fcc3990 100644 --- a/src/libs/AI21/Generated/AI21.Models.GenerateResponsePdfStudioV1DemosRfiGenerateResponsePdfPostResponse.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.GenerateResponsePdfStudioV1DemosRfiGenerateResponsePdfPostResponse.g.cs @@ -14,5 +14,6 @@ public sealed partial class GenerateResponsePdfStudioV1DemosRfiGenerateResponseP /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.GetAvailableModelsEndpointStudioV1SettingsModelsAvailableGetResponse.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.GetAvailableModelsEndpointStudioV1SettingsModelsAvailableGetResponse.Json.g.cs index 050178af..2a6c1a93 100644 --- a/src/libs/AI21/Generated/AI21.Models.GetAvailableModelsEndpointStudioV1SettingsModelsAvailableGetResponse.Json.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.GetAvailableModelsEndpointStudioV1SettingsModelsAvailableGetResponse.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::AI21.GetAvailableModelsEndpointStudioV1SettingsModelsAvailableGetResponse; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::AI21.GetAvailableModelsEndpointStudioV1SettingsModelsAvailableGetResponse? FromJson( + string json) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::AI21.GetAvailableModelsEndpointStudioV1SettingsModelsAvailableGetResponse; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/AI21/Generated/AI21.Models.GetAvailableModelsEndpointStudioV1SettingsModelsAvailableGetResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.GetAvailableModelsEndpointStudioV1SettingsModelsAvailableGetResponse.g.cs index 8fc391f1..0ee6ea6d 100644 --- a/src/libs/AI21/Generated/AI21.Models.GetAvailableModelsEndpointStudioV1SettingsModelsAvailableGetResponse.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.GetAvailableModelsEndpointStudioV1SettingsModelsAvailableGetResponse.g.cs @@ -14,5 +14,6 @@ public sealed partial class GetAvailableModelsEndpointStudioV1SettingsModelsAvai /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.GetFileUrlStudioV1DemosScraperFileUrlFileIdGetResponse.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.GetFileUrlStudioV1DemosScraperFileUrlFileIdGetResponse.Json.g.cs index a60d6a69..3a914dd7 100644 --- a/src/libs/AI21/Generated/AI21.Models.GetFileUrlStudioV1DemosScraperFileUrlFileIdGetResponse.Json.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.GetFileUrlStudioV1DemosScraperFileUrlFileIdGetResponse.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::AI21.GetFileUrlStudioV1DemosScraperFileUrlFileIdGetResponse; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::AI21.GetFileUrlStudioV1DemosScraperFileUrlFileIdGetResponse? FromJson( + string json) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::AI21.GetFileUrlStudioV1DemosScraperFileUrlFileIdGetResponse; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/AI21/Generated/AI21.Models.GetFileUrlStudioV1DemosScraperFileUrlFileIdGetResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.GetFileUrlStudioV1DemosScraperFileUrlFileIdGetResponse.g.cs index 030d8b50..73973954 100644 --- a/src/libs/AI21/Generated/AI21.Models.GetFileUrlStudioV1DemosScraperFileUrlFileIdGetResponse.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.GetFileUrlStudioV1DemosScraperFileUrlFileIdGetResponse.g.cs @@ -14,5 +14,6 @@ public sealed partial class GetFileUrlStudioV1DemosScraperFileUrlFileIdGetRespon /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.GetOutputExplanationStudioV1ExecutionsExecutionIdExplanationsOutputGetResponse.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.GetOutputExplanationStudioV1ExecutionsExecutionIdExplanationsOutputGetResponse.Json.g.cs deleted file mode 100644 index 09747f39..00000000 --- a/src/libs/AI21/Generated/AI21.Models.GetOutputExplanationStudioV1ExecutionsExecutionIdExplanationsOutputGetResponse.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace AI21 -{ - public sealed partial class GetOutputExplanationStudioV1ExecutionsExecutionIdExplanationsOutputGetResponse - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::AI21.GetOutputExplanationStudioV1ExecutionsExecutionIdExplanationsOutputGetResponse? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::AI21.GetOutputExplanationStudioV1ExecutionsExecutionIdExplanationsOutputGetResponse), - jsonSerializerContext) as global::AI21.GetOutputExplanationStudioV1ExecutionsExecutionIdExplanationsOutputGetResponse; - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::AI21.GetOutputExplanationStudioV1ExecutionsExecutionIdExplanationsOutputGetResponse? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::AI21.GetOutputExplanationStudioV1ExecutionsExecutionIdExplanationsOutputGetResponse), - jsonSerializerContext).ConfigureAwait(false)) as global::AI21.GetOutputExplanationStudioV1ExecutionsExecutionIdExplanationsOutputGetResponse; - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/AI21/Generated/AI21.Models.GetOutputExplanationStudioV1ExecutionsExecutionIdExplanationsOutputGetResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.GetOutputExplanationStudioV1ExecutionsExecutionIdExplanationsOutputGetResponse.g.cs deleted file mode 100644 index d64118b0..00000000 --- a/src/libs/AI21/Generated/AI21.Models.GetOutputExplanationStudioV1ExecutionsExecutionIdExplanationsOutputGetResponse.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace AI21 -{ - /// - /// - /// - public sealed partial class GetOutputExplanationStudioV1ExecutionsExecutionIdExplanationsOutputGetResponse - { - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.GetParsedFileStudioV1DemosDocumentModifierGetParsedFileGetResponse.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.GetParsedFileStudioV1DemosDocumentModifierGetParsedFileGetResponse.Json.g.cs index ecabef7b..585fbea7 100644 --- a/src/libs/AI21/Generated/AI21.Models.GetParsedFileStudioV1DemosDocumentModifierGetParsedFileGetResponse.Json.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.GetParsedFileStudioV1DemosDocumentModifierGetParsedFileGetResponse.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::AI21.GetParsedFileStudioV1DemosDocumentModifierGetParsedFileGetResponse; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::AI21.GetParsedFileStudioV1DemosDocumentModifierGetParsedFileGetResponse? FromJson( + string json) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::AI21.GetParsedFileStudioV1DemosDocumentModifierGetParsedFileGetResponse; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/AI21/Generated/AI21.Models.GetParsedFileStudioV1DemosDocumentModifierGetParsedFileGetResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.GetParsedFileStudioV1DemosDocumentModifierGetParsedFileGetResponse.g.cs index 184eb2d4..e3a24106 100644 --- a/src/libs/AI21/Generated/AI21.Models.GetParsedFileStudioV1DemosDocumentModifierGetParsedFileGetResponse.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.GetParsedFileStudioV1DemosDocumentModifierGetParsedFileGetResponse.g.cs @@ -14,5 +14,6 @@ public sealed partial class GetParsedFileStudioV1DemosDocumentModifierGetParsedF /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.GetStepExplanationsStudioV1ExecutionsExecutionIdExplanationsStepsGetResponse.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.GetStepExplanationsStudioV1ExecutionsExecutionIdExplanationsStepsGetResponse.Json.g.cs deleted file mode 100644 index b9343d7b..00000000 --- a/src/libs/AI21/Generated/AI21.Models.GetStepExplanationsStudioV1ExecutionsExecutionIdExplanationsStepsGetResponse.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace AI21 -{ - public sealed partial class GetStepExplanationsStudioV1ExecutionsExecutionIdExplanationsStepsGetResponse - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::AI21.GetStepExplanationsStudioV1ExecutionsExecutionIdExplanationsStepsGetResponse? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::AI21.GetStepExplanationsStudioV1ExecutionsExecutionIdExplanationsStepsGetResponse), - jsonSerializerContext) as global::AI21.GetStepExplanationsStudioV1ExecutionsExecutionIdExplanationsStepsGetResponse; - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::AI21.GetStepExplanationsStudioV1ExecutionsExecutionIdExplanationsStepsGetResponse? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::AI21.GetStepExplanationsStudioV1ExecutionsExecutionIdExplanationsStepsGetResponse), - jsonSerializerContext).ConfigureAwait(false)) as global::AI21.GetStepExplanationsStudioV1ExecutionsExecutionIdExplanationsStepsGetResponse; - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/AI21/Generated/AI21.Models.GetStepExplanationsStudioV1ExecutionsExecutionIdExplanationsStepsGetResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.GetStepExplanationsStudioV1ExecutionsExecutionIdExplanationsStepsGetResponse.g.cs deleted file mode 100644 index f976ac87..00000000 --- a/src/libs/AI21/Generated/AI21.Models.GetStepExplanationsStudioV1ExecutionsExecutionIdExplanationsStepsGetResponse.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace AI21 -{ - /// - /// - /// - public sealed partial class GetStepExplanationsStudioV1ExecutionsExecutionIdExplanationsStepsGetResponse - { - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.GetVectorStoreStudioV1DemosRegulationsVectorStoreVectorStoreIdGetResponse.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.GetVectorStoreStudioV1DemosRegulationsVectorStoreVectorStoreIdGetResponse.Json.g.cs index 9a731d81..c18e054f 100644 --- a/src/libs/AI21/Generated/AI21.Models.GetVectorStoreStudioV1DemosRegulationsVectorStoreVectorStoreIdGetResponse.Json.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.GetVectorStoreStudioV1DemosRegulationsVectorStoreVectorStoreIdGetResponse.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::AI21.GetVectorStoreStudioV1DemosRegulationsVectorStoreVectorStoreIdGetResponse; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::AI21.GetVectorStoreStudioV1DemosRegulationsVectorStoreVectorStoreIdGetResponse? FromJson( + string json) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::AI21.GetVectorStoreStudioV1DemosRegulationsVectorStoreVectorStoreIdGetResponse; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/AI21/Generated/AI21.Models.GetVectorStoreStudioV1DemosRegulationsVectorStoreVectorStoreIdGetResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.GetVectorStoreStudioV1DemosRegulationsVectorStoreVectorStoreIdGetResponse.g.cs index d748e0d8..5f9e6198 100644 --- a/src/libs/AI21/Generated/AI21.Models.GetVectorStoreStudioV1DemosRegulationsVectorStoreVectorStoreIdGetResponse.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.GetVectorStoreStudioV1DemosRegulationsVectorStoreVectorStoreIdGetResponse.g.cs @@ -14,5 +14,6 @@ public sealed partial class GetVectorStoreStudioV1DemosRegulationsVectorStoreVec /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.GetWebsiteConnectorByIdStudioV1ConnectorsWebsiteConnectorIdGetResponse.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.GetWebsiteConnectorByIdStudioV1ConnectorsWebsiteConnectorIdGetResponse.Json.g.cs deleted file mode 100644 index 9b3922fb..00000000 --- a/src/libs/AI21/Generated/AI21.Models.GetWebsiteConnectorByIdStudioV1ConnectorsWebsiteConnectorIdGetResponse.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace AI21 -{ - public sealed partial class GetWebsiteConnectorByIdStudioV1ConnectorsWebsiteConnectorIdGetResponse - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::AI21.GetWebsiteConnectorByIdStudioV1ConnectorsWebsiteConnectorIdGetResponse? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::AI21.GetWebsiteConnectorByIdStudioV1ConnectorsWebsiteConnectorIdGetResponse), - jsonSerializerContext) as global::AI21.GetWebsiteConnectorByIdStudioV1ConnectorsWebsiteConnectorIdGetResponse; - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::AI21.GetWebsiteConnectorByIdStudioV1ConnectorsWebsiteConnectorIdGetResponse? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::AI21.GetWebsiteConnectorByIdStudioV1ConnectorsWebsiteConnectorIdGetResponse), - jsonSerializerContext).ConfigureAwait(false)) as global::AI21.GetWebsiteConnectorByIdStudioV1ConnectorsWebsiteConnectorIdGetResponse; - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/AI21/Generated/AI21.Models.GetWebsiteConnectorByIdStudioV1ConnectorsWebsiteConnectorIdGetResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.GetWebsiteConnectorByIdStudioV1ConnectorsWebsiteConnectorIdGetResponse.g.cs deleted file mode 100644 index 5b58467f..00000000 --- a/src/libs/AI21/Generated/AI21.Models.GetWebsiteConnectorByIdStudioV1ConnectorsWebsiteConnectorIdGetResponse.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace AI21 -{ - /// - /// - /// - public sealed partial class GetWebsiteConnectorByIdStudioV1ConnectorsWebsiteConnectorIdGetResponse - { - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.GetWebsiteConnectorStudioV1ConnectorsWebsiteGetResponse.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.GetWebsiteConnectorStudioV1ConnectorsWebsiteGetResponse.Json.g.cs deleted file mode 100644 index df3fda3c..00000000 --- a/src/libs/AI21/Generated/AI21.Models.GetWebsiteConnectorStudioV1ConnectorsWebsiteGetResponse.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace AI21 -{ - public sealed partial class GetWebsiteConnectorStudioV1ConnectorsWebsiteGetResponse - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::AI21.GetWebsiteConnectorStudioV1ConnectorsWebsiteGetResponse? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::AI21.GetWebsiteConnectorStudioV1ConnectorsWebsiteGetResponse), - jsonSerializerContext) as global::AI21.GetWebsiteConnectorStudioV1ConnectorsWebsiteGetResponse; - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::AI21.GetWebsiteConnectorStudioV1ConnectorsWebsiteGetResponse? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::AI21.GetWebsiteConnectorStudioV1ConnectorsWebsiteGetResponse), - jsonSerializerContext).ConfigureAwait(false)) as global::AI21.GetWebsiteConnectorStudioV1ConnectorsWebsiteGetResponse; - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/AI21/Generated/AI21.Models.GetWebsiteConnectorStudioV1ConnectorsWebsiteGetResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.GetWebsiteConnectorStudioV1ConnectorsWebsiteGetResponse.g.cs deleted file mode 100644 index ac1ce528..00000000 --- a/src/libs/AI21/Generated/AI21.Models.GetWebsiteConnectorStudioV1ConnectorsWebsiteGetResponse.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace AI21 -{ - /// - /// - /// - public sealed partial class GetWebsiteConnectorStudioV1ConnectorsWebsiteGetResponse - { - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.HTTPToolEndpoint.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.HTTPToolEndpoint.Json.g.cs index da58c9c9..a3994451 100644 --- a/src/libs/AI21/Generated/AI21.Models.HTTPToolEndpoint.Json.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.HTTPToolEndpoint.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::AI21.HTTPToolEndpoint; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::AI21.HTTPToolEndpoint? FromJson( + string json) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::AI21.HTTPToolEndpoint; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/AI21/Generated/AI21.Models.HTTPToolEndpoint.g.cs b/src/libs/AI21/Generated/AI21.Models.HTTPToolEndpoint.g.cs index 658f52ca..89b9d6c3 100644 --- a/src/libs/AI21/Generated/AI21.Models.HTTPToolEndpoint.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.HTTPToolEndpoint.g.cs @@ -49,5 +49,6 @@ public HTTPToolEndpoint( public HTTPToolEndpoint() { } + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.HTTPToolEndpointHeaders.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.HTTPToolEndpointHeaders.Json.g.cs index f9f02319..fdcdc43c 100644 --- a/src/libs/AI21/Generated/AI21.Models.HTTPToolEndpointHeaders.Json.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.HTTPToolEndpointHeaders.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::AI21.HTTPToolEndpointHeaders; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::AI21.HTTPToolEndpointHeaders? FromJson( + string json) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::AI21.HTTPToolEndpointHeaders; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/AI21/Generated/AI21.Models.HTTPToolEndpointHeaders.g.cs b/src/libs/AI21/Generated/AI21.Models.HTTPToolEndpointHeaders.g.cs index cd18d603..5d5515b1 100644 --- a/src/libs/AI21/Generated/AI21.Models.HTTPToolEndpointHeaders.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.HTTPToolEndpointHeaders.g.cs @@ -14,5 +14,6 @@ public sealed partial class HTTPToolEndpointHeaders /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.HTTPToolFunction.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.HTTPToolFunction.Json.g.cs index 116bfab5..668e435c 100644 --- a/src/libs/AI21/Generated/AI21.Models.HTTPToolFunction.Json.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.HTTPToolFunction.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::AI21.HTTPToolFunction; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::AI21.HTTPToolFunction? FromJson( + string json) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::AI21.HTTPToolFunction; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/AI21/Generated/AI21.Models.HTTPToolFunction.g.cs b/src/libs/AI21/Generated/AI21.Models.HTTPToolFunction.g.cs index d3ec688a..32eb6b24 100644 --- a/src/libs/AI21/Generated/AI21.Models.HTTPToolFunction.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.HTTPToolFunction.g.cs @@ -60,5 +60,6 @@ public HTTPToolFunction( public HTTPToolFunction() { } + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.HTTPToolFunctionParamProperties.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.HTTPToolFunctionParamProperties.Json.g.cs index 5c1c4de4..6aabeeeb 100644 --- a/src/libs/AI21/Generated/AI21.Models.HTTPToolFunctionParamProperties.Json.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.HTTPToolFunctionParamProperties.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::AI21.HTTPToolFunctionParamProperties; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::AI21.HTTPToolFunctionParamProperties? FromJson( + string json) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::AI21.HTTPToolFunctionParamProperties; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/AI21/Generated/AI21.Models.HTTPToolFunctionParamProperties.g.cs b/src/libs/AI21/Generated/AI21.Models.HTTPToolFunctionParamProperties.g.cs index f09ed051..f46b2ce7 100644 --- a/src/libs/AI21/Generated/AI21.Models.HTTPToolFunctionParamProperties.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.HTTPToolFunctionParamProperties.g.cs @@ -50,5 +50,6 @@ public HTTPToolFunctionParamProperties( public HTTPToolFunctionParamProperties() { } + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.HTTPToolFunctionParameters.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.HTTPToolFunctionParameters.Json.g.cs index d33dbceb..520efb04 100644 --- a/src/libs/AI21/Generated/AI21.Models.HTTPToolFunctionParameters.Json.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.HTTPToolFunctionParameters.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::AI21.HTTPToolFunctionParameters; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::AI21.HTTPToolFunctionParameters? FromJson( + string json) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::AI21.HTTPToolFunctionParameters; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/AI21/Generated/AI21.Models.HTTPToolFunctionParameters.g.cs b/src/libs/AI21/Generated/AI21.Models.HTTPToolFunctionParameters.g.cs index a8019538..b7a3571e 100644 --- a/src/libs/AI21/Generated/AI21.Models.HTTPToolFunctionParameters.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.HTTPToolFunctionParameters.g.cs @@ -62,5 +62,6 @@ public HTTPToolFunctionParameters( public HTTPToolFunctionParameters() { } + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.HTTPToolFunctionParametersProperties.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.HTTPToolFunctionParametersProperties.Json.g.cs index b6ce9fd6..80d84e7a 100644 --- a/src/libs/AI21/Generated/AI21.Models.HTTPToolFunctionParametersProperties.Json.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.HTTPToolFunctionParametersProperties.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::AI21.HTTPToolFunctionParametersProperties; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::AI21.HTTPToolFunctionParametersProperties? FromJson( + string json) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::AI21.HTTPToolFunctionParametersProperties; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/AI21/Generated/AI21.Models.HTTPToolFunctionParametersProperties.g.cs b/src/libs/AI21/Generated/AI21.Models.HTTPToolFunctionParametersProperties.g.cs index dfcb6800..7f43f808 100644 --- a/src/libs/AI21/Generated/AI21.Models.HTTPToolFunctionParametersProperties.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.HTTPToolFunctionParametersProperties.g.cs @@ -14,5 +14,6 @@ public sealed partial class HTTPToolFunctionParametersProperties /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.HTTPToolResource.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.HTTPToolResource.Json.g.cs index 638ea2c6..773eeea9 100644 --- a/src/libs/AI21/Generated/AI21.Models.HTTPToolResource.Json.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.HTTPToolResource.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::AI21.HTTPToolResource; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::AI21.HTTPToolResource? FromJson( + string json) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::AI21.HTTPToolResource; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/AI21/Generated/AI21.Models.HTTPToolResource.g.cs b/src/libs/AI21/Generated/AI21.Models.HTTPToolResource.g.cs index dc08b344..2bc60086 100644 --- a/src/libs/AI21/Generated/AI21.Models.HTTPToolResource.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.HTTPToolResource.g.cs @@ -62,5 +62,6 @@ public HTTPToolResource( public HTTPToolResource() { } + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.HTTPValidationError.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.HTTPValidationError.Json.g.cs index 245dad87..9520bc15 100644 --- a/src/libs/AI21/Generated/AI21.Models.HTTPValidationError.Json.g.cs +++ b/src/libs/AI21/Generated/AI21.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::AI21.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::AI21.HTTPValidationError; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::AI21.HTTPValidationError? FromJson( + string json) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::AI21.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::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/AI21/Generated/AI21.Models.HTTPValidationError.g.cs b/src/libs/AI21/Generated/AI21.Models.HTTPValidationError.g.cs index 46a40562..eba0eaea 100644 --- a/src/libs/AI21/Generated/AI21.Models.HTTPValidationError.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.HTTPValidationError.g.cs @@ -39,5 +39,6 @@ public HTTPValidationError( public HTTPValidationError() { } + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.IgnestionBatchStatusCount.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.IgnestionBatchStatusCount.Json.g.cs index 1055198b..e06004ea 100644 --- a/src/libs/AI21/Generated/AI21.Models.IgnestionBatchStatusCount.Json.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.IgnestionBatchStatusCount.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::AI21.IgnestionBatchStatusCount; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::AI21.IgnestionBatchStatusCount? FromJson( + string json) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::AI21.IgnestionBatchStatusCount; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/AI21/Generated/AI21.Models.IgnestionBatchStatusCount.g.cs b/src/libs/AI21/Generated/AI21.Models.IgnestionBatchStatusCount.g.cs index 914fb046..6bd82913 100644 --- a/src/libs/AI21/Generated/AI21.Models.IgnestionBatchStatusCount.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.IgnestionBatchStatusCount.g.cs @@ -50,5 +50,6 @@ public IgnestionBatchStatusCount( public IgnestionBatchStatusCount() { } + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.IngestionBatchStatusResponse.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.IngestionBatchStatusResponse.Json.g.cs index c4a28a19..41260d60 100644 --- a/src/libs/AI21/Generated/AI21.Models.IngestionBatchStatusResponse.Json.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.IngestionBatchStatusResponse.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::AI21.IngestionBatchStatusResponse; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::AI21.IngestionBatchStatusResponse? FromJson( + string json) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::AI21.IngestionBatchStatusResponse; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/AI21/Generated/AI21.Models.IngestionBatchStatusResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.IngestionBatchStatusResponse.g.cs index 28ea3e97..7c067a34 100644 --- a/src/libs/AI21/Generated/AI21.Models.IngestionBatchStatusResponse.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.IngestionBatchStatusResponse.g.cs @@ -66,5 +66,6 @@ public IngestionBatchStatusResponse( public IngestionBatchStatusResponse() { } + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.JambaExecuteRequest.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.JambaExecuteRequest.Json.g.cs index 86495bfa..3fe24c83 100644 --- a/src/libs/AI21/Generated/AI21.Models.JambaExecuteRequest.Json.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.JambaExecuteRequest.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::AI21.JambaExecuteRequest; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::AI21.JambaExecuteRequest? FromJson( + string json) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::AI21.JambaExecuteRequest; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/AI21/Generated/AI21.Models.JambaExecuteRequest.g.cs b/src/libs/AI21/Generated/AI21.Models.JambaExecuteRequest.g.cs index 3a960c88..741707e9 100644 --- a/src/libs/AI21/Generated/AI21.Models.JambaExecuteRequest.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.JambaExecuteRequest.g.cs @@ -69,5 +69,6 @@ public JambaExecuteRequest( public JambaExecuteRequest() { } + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.JambaExecuteStudioV1DemosDocumentModifierJambaExecutePostResponse.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.JambaExecuteStudioV1DemosDocumentModifierJambaExecutePostResponse.Json.g.cs index 4bbde348..3a483273 100644 --- a/src/libs/AI21/Generated/AI21.Models.JambaExecuteStudioV1DemosDocumentModifierJambaExecutePostResponse.Json.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.JambaExecuteStudioV1DemosDocumentModifierJambaExecutePostResponse.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::AI21.JambaExecuteStudioV1DemosDocumentModifierJambaExecutePostResponse; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::AI21.JambaExecuteStudioV1DemosDocumentModifierJambaExecutePostResponse? FromJson( + string json) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::AI21.JambaExecuteStudioV1DemosDocumentModifierJambaExecutePostResponse; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/AI21/Generated/AI21.Models.JambaExecuteStudioV1DemosDocumentModifierJambaExecutePostResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.JambaExecuteStudioV1DemosDocumentModifierJambaExecutePostResponse.g.cs index 0ee7306f..ac5c3c8a 100644 --- a/src/libs/AI21/Generated/AI21.Models.JambaExecuteStudioV1DemosDocumentModifierJambaExecutePostResponse.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.JambaExecuteStudioV1DemosDocumentModifierJambaExecutePostResponse.g.cs @@ -14,5 +14,6 @@ public sealed partial class JambaExecuteStudioV1DemosDocumentModifierJambaExecut /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.KirshDocumentUploadProcessPrefixPreviewSolutionsPreviewKirshDocumentUploadProcessPostResponse.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.KirshDocumentUploadProcessPrefixPreviewSolutionsPreviewKirshDocumentUploadProcessPostResponse.Json.g.cs deleted file mode 100644 index 50a09613..00000000 --- a/src/libs/AI21/Generated/AI21.Models.KirshDocumentUploadProcessPrefixPreviewSolutionsPreviewKirshDocumentUploadProcessPostResponse.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace AI21 -{ - public sealed partial class KirshDocumentUploadProcessPrefixPreviewSolutionsPreviewKirshDocumentUploadProcessPostResponse - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::AI21.KirshDocumentUploadProcessPrefixPreviewSolutionsPreviewKirshDocumentUploadProcessPostResponse? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::AI21.KirshDocumentUploadProcessPrefixPreviewSolutionsPreviewKirshDocumentUploadProcessPostResponse), - jsonSerializerContext) as global::AI21.KirshDocumentUploadProcessPrefixPreviewSolutionsPreviewKirshDocumentUploadProcessPostResponse; - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::AI21.KirshDocumentUploadProcessPrefixPreviewSolutionsPreviewKirshDocumentUploadProcessPostResponse? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::AI21.KirshDocumentUploadProcessPrefixPreviewSolutionsPreviewKirshDocumentUploadProcessPostResponse), - jsonSerializerContext).ConfigureAwait(false)) as global::AI21.KirshDocumentUploadProcessPrefixPreviewSolutionsPreviewKirshDocumentUploadProcessPostResponse; - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/AI21/Generated/AI21.Models.KirshDocumentUploadProcessPrefixPreviewSolutionsPreviewKirshDocumentUploadProcessPostResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.KirshDocumentUploadProcessPrefixPreviewSolutionsPreviewKirshDocumentUploadProcessPostResponse.g.cs deleted file mode 100644 index 418c4b6f..00000000 --- a/src/libs/AI21/Generated/AI21.Models.KirshDocumentUploadProcessPrefixPreviewSolutionsPreviewKirshDocumentUploadProcessPostResponse.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace AI21 -{ - /// - /// - /// - public sealed partial class KirshDocumentUploadProcessPrefixPreviewSolutionsPreviewKirshDocumentUploadProcessPostResponse - { - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.KirshDocumentUploadProcessSolutionsKirshDocumentUploadProcessPostResponse.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.KirshDocumentUploadProcessSolutionsKirshDocumentUploadProcessPostResponse.Json.g.cs deleted file mode 100644 index d805bfee..00000000 --- a/src/libs/AI21/Generated/AI21.Models.KirshDocumentUploadProcessSolutionsKirshDocumentUploadProcessPostResponse.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace AI21 -{ - public sealed partial class KirshDocumentUploadProcessSolutionsKirshDocumentUploadProcessPostResponse - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::AI21.KirshDocumentUploadProcessSolutionsKirshDocumentUploadProcessPostResponse? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::AI21.KirshDocumentUploadProcessSolutionsKirshDocumentUploadProcessPostResponse), - jsonSerializerContext) as global::AI21.KirshDocumentUploadProcessSolutionsKirshDocumentUploadProcessPostResponse; - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::AI21.KirshDocumentUploadProcessSolutionsKirshDocumentUploadProcessPostResponse? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::AI21.KirshDocumentUploadProcessSolutionsKirshDocumentUploadProcessPostResponse), - jsonSerializerContext).ConfigureAwait(false)) as global::AI21.KirshDocumentUploadProcessSolutionsKirshDocumentUploadProcessPostResponse; - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/AI21/Generated/AI21.Models.KirshDocumentUploadProcessSolutionsKirshDocumentUploadProcessPostResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.KirshDocumentUploadProcessSolutionsKirshDocumentUploadProcessPostResponse.g.cs deleted file mode 100644 index cccd8529..00000000 --- a/src/libs/AI21/Generated/AI21.Models.KirshDocumentUploadProcessSolutionsKirshDocumentUploadProcessPostResponse.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace AI21 -{ - /// - /// - /// - public sealed partial class KirshDocumentUploadProcessSolutionsKirshDocumentUploadProcessPostResponse - { - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.KirshEmailAssistantPrefixPreviewSolutionsPreviewKirshEmailAssistantPostResponse.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.KirshEmailAssistantPrefixPreviewSolutionsPreviewKirshEmailAssistantPostResponse.Json.g.cs deleted file mode 100644 index 09ec9ba3..00000000 --- a/src/libs/AI21/Generated/AI21.Models.KirshEmailAssistantPrefixPreviewSolutionsPreviewKirshEmailAssistantPostResponse.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace AI21 -{ - public sealed partial class KirshEmailAssistantPrefixPreviewSolutionsPreviewKirshEmailAssistantPostResponse - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::AI21.KirshEmailAssistantPrefixPreviewSolutionsPreviewKirshEmailAssistantPostResponse? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::AI21.KirshEmailAssistantPrefixPreviewSolutionsPreviewKirshEmailAssistantPostResponse), - jsonSerializerContext) as global::AI21.KirshEmailAssistantPrefixPreviewSolutionsPreviewKirshEmailAssistantPostResponse; - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::AI21.KirshEmailAssistantPrefixPreviewSolutionsPreviewKirshEmailAssistantPostResponse? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::AI21.KirshEmailAssistantPrefixPreviewSolutionsPreviewKirshEmailAssistantPostResponse), - jsonSerializerContext).ConfigureAwait(false)) as global::AI21.KirshEmailAssistantPrefixPreviewSolutionsPreviewKirshEmailAssistantPostResponse; - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/AI21/Generated/AI21.Models.KirshEmailAssistantPrefixPreviewSolutionsPreviewKirshEmailAssistantPostResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.KirshEmailAssistantPrefixPreviewSolutionsPreviewKirshEmailAssistantPostResponse.g.cs deleted file mode 100644 index 444cfe20..00000000 --- a/src/libs/AI21/Generated/AI21.Models.KirshEmailAssistantPrefixPreviewSolutionsPreviewKirshEmailAssistantPostResponse.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace AI21 -{ - /// - /// - /// - public sealed partial class KirshEmailAssistantPrefixPreviewSolutionsPreviewKirshEmailAssistantPostResponse - { - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.KirshEmailAssistantSolutionsKirshEmailAssistantPostResponse.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.KirshEmailAssistantSolutionsKirshEmailAssistantPostResponse.Json.g.cs deleted file mode 100644 index 57676eb9..00000000 --- a/src/libs/AI21/Generated/AI21.Models.KirshEmailAssistantSolutionsKirshEmailAssistantPostResponse.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace AI21 -{ - public sealed partial class KirshEmailAssistantSolutionsKirshEmailAssistantPostResponse - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::AI21.KirshEmailAssistantSolutionsKirshEmailAssistantPostResponse? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::AI21.KirshEmailAssistantSolutionsKirshEmailAssistantPostResponse), - jsonSerializerContext) as global::AI21.KirshEmailAssistantSolutionsKirshEmailAssistantPostResponse; - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::AI21.KirshEmailAssistantSolutionsKirshEmailAssistantPostResponse? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::AI21.KirshEmailAssistantSolutionsKirshEmailAssistantPostResponse), - jsonSerializerContext).ConfigureAwait(false)) as global::AI21.KirshEmailAssistantSolutionsKirshEmailAssistantPostResponse; - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/AI21/Generated/AI21.Models.KirshEmailAssistantSolutionsKirshEmailAssistantPostResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.KirshEmailAssistantSolutionsKirshEmailAssistantPostResponse.g.cs deleted file mode 100644 index bee31302..00000000 --- a/src/libs/AI21/Generated/AI21.Models.KirshEmailAssistantSolutionsKirshEmailAssistantPostResponse.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace AI21 -{ - /// - /// - /// - public sealed partial class KirshEmailAssistantSolutionsKirshEmailAssistantPostResponse - { - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.KirshFundingAndCategorizationCheckPrefixPreviewSolutionsPreviewKirshFundingAndCategorizationCheckPostResponse.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.KirshFundingAndCategorizationCheckPrefixPreviewSolutionsPreviewKirshFundingAndCategorizationCheckPostResponse.Json.g.cs deleted file mode 100644 index 941976a5..00000000 --- a/src/libs/AI21/Generated/AI21.Models.KirshFundingAndCategorizationCheckPrefixPreviewSolutionsPreviewKirshFundingAndCategorizationCheckPostResponse.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace AI21 -{ - public sealed partial class KirshFundingAndCategorizationCheckPrefixPreviewSolutionsPreviewKirshFundingAndCategorizationCheckPostResponse - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::AI21.KirshFundingAndCategorizationCheckPrefixPreviewSolutionsPreviewKirshFundingAndCategorizationCheckPostResponse? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::AI21.KirshFundingAndCategorizationCheckPrefixPreviewSolutionsPreviewKirshFundingAndCategorizationCheckPostResponse), - jsonSerializerContext) as global::AI21.KirshFundingAndCategorizationCheckPrefixPreviewSolutionsPreviewKirshFundingAndCategorizationCheckPostResponse; - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::AI21.KirshFundingAndCategorizationCheckPrefixPreviewSolutionsPreviewKirshFundingAndCategorizationCheckPostResponse? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::AI21.KirshFundingAndCategorizationCheckPrefixPreviewSolutionsPreviewKirshFundingAndCategorizationCheckPostResponse), - jsonSerializerContext).ConfigureAwait(false)) as global::AI21.KirshFundingAndCategorizationCheckPrefixPreviewSolutionsPreviewKirshFundingAndCategorizationCheckPostResponse; - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/AI21/Generated/AI21.Models.KirshFundingAndCategorizationCheckPrefixPreviewSolutionsPreviewKirshFundingAndCategorizationCheckPostResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.KirshFundingAndCategorizationCheckPrefixPreviewSolutionsPreviewKirshFundingAndCategorizationCheckPostResponse.g.cs deleted file mode 100644 index cf1eca4d..00000000 --- a/src/libs/AI21/Generated/AI21.Models.KirshFundingAndCategorizationCheckPrefixPreviewSolutionsPreviewKirshFundingAndCategorizationCheckPostResponse.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace AI21 -{ - /// - /// - /// - public sealed partial class KirshFundingAndCategorizationCheckPrefixPreviewSolutionsPreviewKirshFundingAndCategorizationCheckPostResponse - { - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.KirshFundingAndCategorizationCheckSolutionsKirshFundingAndCategorizationCheckPostResponse.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.KirshFundingAndCategorizationCheckSolutionsKirshFundingAndCategorizationCheckPostResponse.Json.g.cs deleted file mode 100644 index a14e4fd4..00000000 --- a/src/libs/AI21/Generated/AI21.Models.KirshFundingAndCategorizationCheckSolutionsKirshFundingAndCategorizationCheckPostResponse.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace AI21 -{ - public sealed partial class KirshFundingAndCategorizationCheckSolutionsKirshFundingAndCategorizationCheckPostResponse - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::AI21.KirshFundingAndCategorizationCheckSolutionsKirshFundingAndCategorizationCheckPostResponse? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::AI21.KirshFundingAndCategorizationCheckSolutionsKirshFundingAndCategorizationCheckPostResponse), - jsonSerializerContext) as global::AI21.KirshFundingAndCategorizationCheckSolutionsKirshFundingAndCategorizationCheckPostResponse; - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::AI21.KirshFundingAndCategorizationCheckSolutionsKirshFundingAndCategorizationCheckPostResponse? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::AI21.KirshFundingAndCategorizationCheckSolutionsKirshFundingAndCategorizationCheckPostResponse), - jsonSerializerContext).ConfigureAwait(false)) as global::AI21.KirshFundingAndCategorizationCheckSolutionsKirshFundingAndCategorizationCheckPostResponse; - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/AI21/Generated/AI21.Models.KirshFundingAndCategorizationCheckSolutionsKirshFundingAndCategorizationCheckPostResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.KirshFundingAndCategorizationCheckSolutionsKirshFundingAndCategorizationCheckPostResponse.g.cs deleted file mode 100644 index 1c053a31..00000000 --- a/src/libs/AI21/Generated/AI21.Models.KirshFundingAndCategorizationCheckSolutionsKirshFundingAndCategorizationCheckPostResponse.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace AI21 -{ - /// - /// - /// - public sealed partial class KirshFundingAndCategorizationCheckSolutionsKirshFundingAndCategorizationCheckPostResponse - { - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.KirshGrantCompliancePrefixPreviewSolutionsPreviewKirshGrantCompliancePostResponse.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.KirshGrantCompliancePrefixPreviewSolutionsPreviewKirshGrantCompliancePostResponse.Json.g.cs deleted file mode 100644 index ea5c20b6..00000000 --- a/src/libs/AI21/Generated/AI21.Models.KirshGrantCompliancePrefixPreviewSolutionsPreviewKirshGrantCompliancePostResponse.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace AI21 -{ - public sealed partial class KirshGrantCompliancePrefixPreviewSolutionsPreviewKirshGrantCompliancePostResponse - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::AI21.KirshGrantCompliancePrefixPreviewSolutionsPreviewKirshGrantCompliancePostResponse? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::AI21.KirshGrantCompliancePrefixPreviewSolutionsPreviewKirshGrantCompliancePostResponse), - jsonSerializerContext) as global::AI21.KirshGrantCompliancePrefixPreviewSolutionsPreviewKirshGrantCompliancePostResponse; - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::AI21.KirshGrantCompliancePrefixPreviewSolutionsPreviewKirshGrantCompliancePostResponse? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::AI21.KirshGrantCompliancePrefixPreviewSolutionsPreviewKirshGrantCompliancePostResponse), - jsonSerializerContext).ConfigureAwait(false)) as global::AI21.KirshGrantCompliancePrefixPreviewSolutionsPreviewKirshGrantCompliancePostResponse; - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/AI21/Generated/AI21.Models.KirshGrantCompliancePrefixPreviewSolutionsPreviewKirshGrantCompliancePostResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.KirshGrantCompliancePrefixPreviewSolutionsPreviewKirshGrantCompliancePostResponse.g.cs deleted file mode 100644 index ec4c20df..00000000 --- a/src/libs/AI21/Generated/AI21.Models.KirshGrantCompliancePrefixPreviewSolutionsPreviewKirshGrantCompliancePostResponse.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace AI21 -{ - /// - /// - /// - public sealed partial class KirshGrantCompliancePrefixPreviewSolutionsPreviewKirshGrantCompliancePostResponse - { - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.KirshGrantComplianceSolutionsKirshGrantCompliancePostResponse.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.KirshGrantComplianceSolutionsKirshGrantCompliancePostResponse.Json.g.cs deleted file mode 100644 index 30382f99..00000000 --- a/src/libs/AI21/Generated/AI21.Models.KirshGrantComplianceSolutionsKirshGrantCompliancePostResponse.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace AI21 -{ - public sealed partial class KirshGrantComplianceSolutionsKirshGrantCompliancePostResponse - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::AI21.KirshGrantComplianceSolutionsKirshGrantCompliancePostResponse? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::AI21.KirshGrantComplianceSolutionsKirshGrantCompliancePostResponse), - jsonSerializerContext) as global::AI21.KirshGrantComplianceSolutionsKirshGrantCompliancePostResponse; - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::AI21.KirshGrantComplianceSolutionsKirshGrantCompliancePostResponse? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::AI21.KirshGrantComplianceSolutionsKirshGrantCompliancePostResponse), - jsonSerializerContext).ConfigureAwait(false)) as global::AI21.KirshGrantComplianceSolutionsKirshGrantCompliancePostResponse; - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/AI21/Generated/AI21.Models.KirshGrantComplianceSolutionsKirshGrantCompliancePostResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.KirshGrantComplianceSolutionsKirshGrantCompliancePostResponse.g.cs deleted file mode 100644 index eec4a5b5..00000000 --- a/src/libs/AI21/Generated/AI21.Models.KirshGrantComplianceSolutionsKirshGrantCompliancePostResponse.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace AI21 -{ - /// - /// - /// - public sealed partial class KirshGrantComplianceSolutionsKirshGrantCompliancePostResponse - { - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.KirshGrantMetadataPrefixPreviewSolutionsPreviewKirshGrantMetadataPostResponse.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.KirshGrantMetadataPrefixPreviewSolutionsPreviewKirshGrantMetadataPostResponse.Json.g.cs deleted file mode 100644 index 40713fbc..00000000 --- a/src/libs/AI21/Generated/AI21.Models.KirshGrantMetadataPrefixPreviewSolutionsPreviewKirshGrantMetadataPostResponse.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace AI21 -{ - public sealed partial class KirshGrantMetadataPrefixPreviewSolutionsPreviewKirshGrantMetadataPostResponse - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::AI21.KirshGrantMetadataPrefixPreviewSolutionsPreviewKirshGrantMetadataPostResponse? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::AI21.KirshGrantMetadataPrefixPreviewSolutionsPreviewKirshGrantMetadataPostResponse), - jsonSerializerContext) as global::AI21.KirshGrantMetadataPrefixPreviewSolutionsPreviewKirshGrantMetadataPostResponse; - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::AI21.KirshGrantMetadataPrefixPreviewSolutionsPreviewKirshGrantMetadataPostResponse? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::AI21.KirshGrantMetadataPrefixPreviewSolutionsPreviewKirshGrantMetadataPostResponse), - jsonSerializerContext).ConfigureAwait(false)) as global::AI21.KirshGrantMetadataPrefixPreviewSolutionsPreviewKirshGrantMetadataPostResponse; - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/AI21/Generated/AI21.Models.KirshGrantMetadataPrefixPreviewSolutionsPreviewKirshGrantMetadataPostResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.KirshGrantMetadataPrefixPreviewSolutionsPreviewKirshGrantMetadataPostResponse.g.cs deleted file mode 100644 index 57242cdb..00000000 --- a/src/libs/AI21/Generated/AI21.Models.KirshGrantMetadataPrefixPreviewSolutionsPreviewKirshGrantMetadataPostResponse.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace AI21 -{ - /// - /// - /// - public sealed partial class KirshGrantMetadataPrefixPreviewSolutionsPreviewKirshGrantMetadataPostResponse - { - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.KirshGrantMetadataSolutionsKirshGrantMetadataPostResponse.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.KirshGrantMetadataSolutionsKirshGrantMetadataPostResponse.Json.g.cs deleted file mode 100644 index ec607a48..00000000 --- a/src/libs/AI21/Generated/AI21.Models.KirshGrantMetadataSolutionsKirshGrantMetadataPostResponse.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace AI21 -{ - public sealed partial class KirshGrantMetadataSolutionsKirshGrantMetadataPostResponse - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::AI21.KirshGrantMetadataSolutionsKirshGrantMetadataPostResponse? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::AI21.KirshGrantMetadataSolutionsKirshGrantMetadataPostResponse), - jsonSerializerContext) as global::AI21.KirshGrantMetadataSolutionsKirshGrantMetadataPostResponse; - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::AI21.KirshGrantMetadataSolutionsKirshGrantMetadataPostResponse? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::AI21.KirshGrantMetadataSolutionsKirshGrantMetadataPostResponse), - jsonSerializerContext).ConfigureAwait(false)) as global::AI21.KirshGrantMetadataSolutionsKirshGrantMetadataPostResponse; - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/AI21/Generated/AI21.Models.KirshGrantMetadataSolutionsKirshGrantMetadataPostResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.KirshGrantMetadataSolutionsKirshGrantMetadataPostResponse.g.cs deleted file mode 100644 index 49d38b3b..00000000 --- a/src/libs/AI21/Generated/AI21.Models.KirshGrantMetadataSolutionsKirshGrantMetadataPostResponse.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace AI21 -{ - /// - /// - /// - public sealed partial class KirshGrantMetadataSolutionsKirshGrantMetadataPostResponse - { - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.KirshPublicInformationCheckPrefixPreviewSolutionsPreviewKirshPublicInformationCheckPostResponse.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.KirshPublicInformationCheckPrefixPreviewSolutionsPreviewKirshPublicInformationCheckPostResponse.Json.g.cs deleted file mode 100644 index 606a2f32..00000000 --- a/src/libs/AI21/Generated/AI21.Models.KirshPublicInformationCheckPrefixPreviewSolutionsPreviewKirshPublicInformationCheckPostResponse.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace AI21 -{ - public sealed partial class KirshPublicInformationCheckPrefixPreviewSolutionsPreviewKirshPublicInformationCheckPostResponse - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::AI21.KirshPublicInformationCheckPrefixPreviewSolutionsPreviewKirshPublicInformationCheckPostResponse? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::AI21.KirshPublicInformationCheckPrefixPreviewSolutionsPreviewKirshPublicInformationCheckPostResponse), - jsonSerializerContext) as global::AI21.KirshPublicInformationCheckPrefixPreviewSolutionsPreviewKirshPublicInformationCheckPostResponse; - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::AI21.KirshPublicInformationCheckPrefixPreviewSolutionsPreviewKirshPublicInformationCheckPostResponse? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::AI21.KirshPublicInformationCheckPrefixPreviewSolutionsPreviewKirshPublicInformationCheckPostResponse), - jsonSerializerContext).ConfigureAwait(false)) as global::AI21.KirshPublicInformationCheckPrefixPreviewSolutionsPreviewKirshPublicInformationCheckPostResponse; - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/AI21/Generated/AI21.Models.KirshPublicInformationCheckPrefixPreviewSolutionsPreviewKirshPublicInformationCheckPostResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.KirshPublicInformationCheckPrefixPreviewSolutionsPreviewKirshPublicInformationCheckPostResponse.g.cs deleted file mode 100644 index 69234d49..00000000 --- a/src/libs/AI21/Generated/AI21.Models.KirshPublicInformationCheckPrefixPreviewSolutionsPreviewKirshPublicInformationCheckPostResponse.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace AI21 -{ - /// - /// - /// - public sealed partial class KirshPublicInformationCheckPrefixPreviewSolutionsPreviewKirshPublicInformationCheckPostResponse - { - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.KirshPublicInformationCheckSolutionsKirshPublicInformationCheckPostResponse.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.KirshPublicInformationCheckSolutionsKirshPublicInformationCheckPostResponse.Json.g.cs deleted file mode 100644 index 304db196..00000000 --- a/src/libs/AI21/Generated/AI21.Models.KirshPublicInformationCheckSolutionsKirshPublicInformationCheckPostResponse.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace AI21 -{ - public sealed partial class KirshPublicInformationCheckSolutionsKirshPublicInformationCheckPostResponse - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::AI21.KirshPublicInformationCheckSolutionsKirshPublicInformationCheckPostResponse? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::AI21.KirshPublicInformationCheckSolutionsKirshPublicInformationCheckPostResponse), - jsonSerializerContext) as global::AI21.KirshPublicInformationCheckSolutionsKirshPublicInformationCheckPostResponse; - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::AI21.KirshPublicInformationCheckSolutionsKirshPublicInformationCheckPostResponse? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::AI21.KirshPublicInformationCheckSolutionsKirshPublicInformationCheckPostResponse), - jsonSerializerContext).ConfigureAwait(false)) as global::AI21.KirshPublicInformationCheckSolutionsKirshPublicInformationCheckPostResponse; - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/AI21/Generated/AI21.Models.KirshPublicInformationCheckSolutionsKirshPublicInformationCheckPostResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.KirshPublicInformationCheckSolutionsKirshPublicInformationCheckPostResponse.g.cs deleted file mode 100644 index 8788e910..00000000 --- a/src/libs/AI21/Generated/AI21.Models.KirshPublicInformationCheckSolutionsKirshPublicInformationCheckPostResponse.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace AI21 -{ - /// - /// - /// - public sealed partial class KirshPublicInformationCheckSolutionsKirshPublicInformationCheckPostResponse - { - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.LanguageStudioApiServerDataTypesAssistantRequirement.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.LanguageStudioApiServerDataTypesAssistantRequirement.Json.g.cs index f3fee028..cb64ca89 100644 --- a/src/libs/AI21/Generated/AI21.Models.LanguageStudioApiServerDataTypesAssistantRequirement.Json.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.LanguageStudioApiServerDataTypesAssistantRequirement.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::AI21.LanguageStudioApiServerDataTypesAssistantRequirement; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::AI21.LanguageStudioApiServerDataTypesAssistantRequirement? FromJson( + string json) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::AI21.LanguageStudioApiServerDataTypesAssistantRequirement; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/AI21/Generated/AI21.Models.LanguageStudioApiServerDataTypesAssistantRequirement.g.cs b/src/libs/AI21/Generated/AI21.Models.LanguageStudioApiServerDataTypesAssistantRequirement.g.cs index bfa204a5..54c530c3 100644 --- a/src/libs/AI21/Generated/AI21.Models.LanguageStudioApiServerDataTypesAssistantRequirement.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.LanguageStudioApiServerDataTypesAssistantRequirement.g.cs @@ -72,5 +72,6 @@ public LanguageStudioApiServerDataTypesAssistantRequirement( public LanguageStudioApiServerDataTypesAssistantRequirement() { } + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.LanguageStudioApiServerDataTypesChatToolDefinition.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.LanguageStudioApiServerDataTypesChatToolDefinition.Json.g.cs index 238da8a7..2a9fd02e 100644 --- a/src/libs/AI21/Generated/AI21.Models.LanguageStudioApiServerDataTypesChatToolDefinition.Json.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.LanguageStudioApiServerDataTypesChatToolDefinition.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::AI21.LanguageStudioApiServerDataTypesChatToolDefinition; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::AI21.LanguageStudioApiServerDataTypesChatToolDefinition? FromJson( + string json) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::AI21.LanguageStudioApiServerDataTypesChatToolDefinition; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/AI21/Generated/AI21.Models.LanguageStudioApiServerDataTypesChatToolDefinition.g.cs b/src/libs/AI21/Generated/AI21.Models.LanguageStudioApiServerDataTypesChatToolDefinition.g.cs index 7304f9c0..dd59947c 100644 --- a/src/libs/AI21/Generated/AI21.Models.LanguageStudioApiServerDataTypesChatToolDefinition.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.LanguageStudioApiServerDataTypesChatToolDefinition.g.cs @@ -50,5 +50,6 @@ public LanguageStudioApiServerDataTypesChatToolDefinition( public LanguageStudioApiServerDataTypesChatToolDefinition() { } + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.LanguageStudioApiServerDataTypesExecutionEngineRequirement.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.LanguageStudioApiServerDataTypesExecutionEngineRequirement.Json.g.cs index d8056d72..f6a685fc 100644 --- a/src/libs/AI21/Generated/AI21.Models.LanguageStudioApiServerDataTypesExecutionEngineRequirement.Json.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.LanguageStudioApiServerDataTypesExecutionEngineRequirement.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::AI21.LanguageStudioApiServerDataTypesExecutionEngineRequirement; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::AI21.LanguageStudioApiServerDataTypesExecutionEngineRequirement? FromJson( + string json) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::AI21.LanguageStudioApiServerDataTypesExecutionEngineRequirement; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/AI21/Generated/AI21.Models.LanguageStudioApiServerDataTypesExecutionEngineRequirement.g.cs b/src/libs/AI21/Generated/AI21.Models.LanguageStudioApiServerDataTypesExecutionEngineRequirement.g.cs index 3ee02773..bb00112b 100644 --- a/src/libs/AI21/Generated/AI21.Models.LanguageStudioApiServerDataTypesExecutionEngineRequirement.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.LanguageStudioApiServerDataTypesExecutionEngineRequirement.g.cs @@ -59,5 +59,6 @@ public LanguageStudioApiServerDataTypesExecutionEngineRequirement( public LanguageStudioApiServerDataTypesExecutionEngineRequirement() { } + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.LanguageStudioApiServerDataTypesExecutionEngineToolDefinition.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.LanguageStudioApiServerDataTypesExecutionEngineToolDefinition.Json.g.cs index a7cbcca5..197a7413 100644 --- a/src/libs/AI21/Generated/AI21.Models.LanguageStudioApiServerDataTypesExecutionEngineToolDefinition.Json.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.LanguageStudioApiServerDataTypesExecutionEngineToolDefinition.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::AI21.LanguageStudioApiServerDataTypesExecutionEngineToolDefinition?; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::AI21.LanguageStudioApiServerDataTypesExecutionEngineToolDefinition? FromJson( + string json) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::AI21.LanguageStudioApiServerDataTypesExecutionEngineToolDefinition?; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/AI21/Generated/AI21.Models.LanguageStudioApiServerDataTypesExecutionEngineToolDefinition.g.cs b/src/libs/AI21/Generated/AI21.Models.LanguageStudioApiServerDataTypesExecutionEngineToolDefinition.g.cs index 7dfce32c..c1f775ea 100644 --- a/src/libs/AI21/Generated/AI21.Models.LanguageStudioApiServerDataTypesExecutionEngineToolDefinition.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.LanguageStudioApiServerDataTypesExecutionEngineToolDefinition.g.cs @@ -31,6 +31,26 @@ namespace AI21 #endif public bool IsHttp => Http != null; + /// + /// + /// + public bool TryPickHttp( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::AI21.HTTPToolResource? value) + { + value = Http; + return IsHttp; + } + + /// + /// + /// + public global::AI21.HTTPToolResource PickHttp() => IsHttp + ? Http! + : throw new global::System.InvalidOperationException($"Expected union variant 'Http' but the value was {ToString()}."); + /// /// /// @@ -48,6 +68,26 @@ namespace AI21 #endif public bool IsMcp => Mcp != null; + /// + /// + /// + public bool TryPickMcp( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::AI21.MCPToolResource? value) + { + value = Mcp; + return IsMcp; + } + + /// + /// + /// + public global::AI21.MCPToolResource PickMcp() => IsMcp + ? Mcp! + : throw new global::System.InvalidOperationException($"Expected union variant 'Mcp' but the value was {ToString()}."); + /// /// /// @@ -65,6 +105,26 @@ namespace AI21 #endif public bool IsFileSearch => FileSearch != null; + /// + /// + /// + public bool TryPickFileSearch( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::AI21.FileSearchToolResource? value) + { + value = FileSearch; + return IsFileSearch; + } + + /// + /// + /// + public global::AI21.FileSearchToolResource PickFileSearch() => IsFileSearch + ? FileSearch! + : throw new global::System.InvalidOperationException($"Expected union variant 'FileSearch' but the value was {ToString()}."); + /// /// /// @@ -81,6 +141,26 @@ namespace AI21 [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(WebSearch))] #endif public bool IsWebSearch => WebSearch != null; + + /// + /// + /// + public bool TryPickWebSearch( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::AI21.WebSearchToolResource? value) + { + value = WebSearch; + return IsWebSearch; + } + + /// + /// + /// + public global::AI21.WebSearchToolResource PickWebSearch() => IsWebSearch + ? WebSearch! + : throw new global::System.InvalidOperationException($"Expected union variant 'WebSearch' but the value was {ToString()}."); /// /// /// @@ -99,6 +179,11 @@ public LanguageStudioApiServerDataTypesExecutionEngineToolDefinition(global::AI2 Http = value; } + /// + /// + /// + public static LanguageStudioApiServerDataTypesExecutionEngineToolDefinition FromHttp(global::AI21.HTTPToolResource? value) => new LanguageStudioApiServerDataTypesExecutionEngineToolDefinition(value); + /// /// /// @@ -117,6 +202,11 @@ public LanguageStudioApiServerDataTypesExecutionEngineToolDefinition(global::AI2 Mcp = value; } + /// + /// + /// + public static LanguageStudioApiServerDataTypesExecutionEngineToolDefinition FromMcp(global::AI21.MCPToolResource? value) => new LanguageStudioApiServerDataTypesExecutionEngineToolDefinition(value); + /// /// /// @@ -135,6 +225,11 @@ public LanguageStudioApiServerDataTypesExecutionEngineToolDefinition(global::AI2 FileSearch = value; } + /// + /// + /// + public static LanguageStudioApiServerDataTypesExecutionEngineToolDefinition FromFileSearch(global::AI21.FileSearchToolResource? value) => new LanguageStudioApiServerDataTypesExecutionEngineToolDefinition(value); + /// /// /// @@ -153,6 +248,11 @@ public LanguageStudioApiServerDataTypesExecutionEngineToolDefinition(global::AI2 WebSearch = value; } + /// + /// + /// + public static LanguageStudioApiServerDataTypesExecutionEngineToolDefinition FromWebSearch(global::AI21.WebSearchToolResource? value) => new LanguageStudioApiServerDataTypesExecutionEngineToolDefinition(value); + /// /// /// @@ -204,10 +304,10 @@ public bool Validate() /// /// public TResult? Match( - global::System.Func? http = null, - global::System.Func? mcp = null, - global::System.Func? fileSearch = null, - global::System.Func? webSearch = null, + global::System.Func? http = null, + global::System.Func? mcp = null, + global::System.Func? fileSearch = null, + global::System.Func? webSearch = null, bool validate = true) { if (validate) @@ -239,10 +339,46 @@ public bool Validate() /// /// public void Match( - global::System.Action? http = null, - global::System.Action? mcp = null, - global::System.Action? fileSearch = null, - global::System.Action? webSearch = null, + global::System.Action? http = null, + + global::System.Action? mcp = null, + + global::System.Action? fileSearch = null, + + global::System.Action? webSearch = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsHttp) + { + http?.Invoke(Http!); + } + else if (IsMcp) + { + mcp?.Invoke(Mcp!); + } + else if (IsFileSearch) + { + fileSearch?.Invoke(FileSearch!); + } + else if (IsWebSearch) + { + webSearch?.Invoke(WebSearch!); + } + } + + /// + /// + /// + public void Switch( + global::System.Action? http = null, + global::System.Action? mcp = null, + global::System.Action? fileSearch = null, + global::System.Action? webSearch = null, bool validate = true) { if (validate) diff --git a/src/libs/AI21/Generated/AI21.Models.LanguageStudioApiServerDataTypesExecutionEngineToolDefinitionDiscriminator.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.LanguageStudioApiServerDataTypesExecutionEngineToolDefinitionDiscriminator.Json.g.cs index c86cc10a..5884ed7f 100644 --- a/src/libs/AI21/Generated/AI21.Models.LanguageStudioApiServerDataTypesExecutionEngineToolDefinitionDiscriminator.Json.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.LanguageStudioApiServerDataTypesExecutionEngineToolDefinitionDiscriminator.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::AI21.LanguageStudioApiServerDataTypesExecutionEngineToolDefinitionDiscriminator; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::AI21.LanguageStudioApiServerDataTypesExecutionEngineToolDefinitionDiscriminator? FromJson( + string json) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::AI21.LanguageStudioApiServerDataTypesExecutionEngineToolDefinitionDiscriminator; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/AI21/Generated/AI21.Models.LanguageStudioApiServerDataTypesExecutionEngineToolDefinitionDiscriminator.g.cs b/src/libs/AI21/Generated/AI21.Models.LanguageStudioApiServerDataTypesExecutionEngineToolDefinitionDiscriminator.g.cs index f8fdb45a..149e036b 100644 --- a/src/libs/AI21/Generated/AI21.Models.LanguageStudioApiServerDataTypesExecutionEngineToolDefinitionDiscriminator.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.LanguageStudioApiServerDataTypesExecutionEngineToolDefinitionDiscriminator.g.cs @@ -40,5 +40,6 @@ public LanguageStudioApiServerDataTypesExecutionEngineToolDefinitionDiscriminato public LanguageStudioApiServerDataTypesExecutionEngineToolDefinitionDiscriminator() { } + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.LibrarySearchRequest.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.LibrarySearchRequest.Json.g.cs deleted file mode 100644 index 31e3994d..00000000 --- a/src/libs/AI21/Generated/AI21.Models.LibrarySearchRequest.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace AI21 -{ - public sealed partial class LibrarySearchRequest - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::AI21.LibrarySearchRequest? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::AI21.LibrarySearchRequest), - jsonSerializerContext) as global::AI21.LibrarySearchRequest; - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::AI21.LibrarySearchRequest? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::AI21.LibrarySearchRequest), - jsonSerializerContext).ConfigureAwait(false)) as global::AI21.LibrarySearchRequest; - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/AI21/Generated/AI21.Models.LibrarySearchRequest.g.cs b/src/libs/AI21/Generated/AI21.Models.LibrarySearchRequest.g.cs deleted file mode 100644 index 98241032..00000000 --- a/src/libs/AI21/Generated/AI21.Models.LibrarySearchRequest.g.cs +++ /dev/null @@ -1,143 +0,0 @@ - -#nullable enable - -namespace AI21 -{ - /// - /// This class is to be used as a common class to all Studio API requests payloads - /// - public sealed partial class LibrarySearchRequest - { - /// - /// - /// - [global::System.Text.Json.Serialization.JsonPropertyName("query")] - [global::System.Text.Json.Serialization.JsonRequired] - public required string Query { get; set; } - - /// - /// - /// - [global::System.Text.Json.Serialization.JsonPropertyName("maxSegments")] - public int? MaxSegments { get; set; } - - /// - /// - /// - [global::System.Text.Json.Serialization.JsonPropertyName("path")] - public string? Path { get; set; } - - /// - /// - /// - [global::System.Text.Json.Serialization.JsonPropertyName("labels")] - public global::System.Collections.Generic.IList? Labels { get; set; } - - /// - /// - /// - [global::System.Text.Json.Serialization.JsonPropertyName("labels_filter")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::AI21.JsonConverters.QueryFilterJsonConverter))] - public global::AI21.QueryFilter? LabelsFilter { get; set; } - - /// - /// Default Value: AND - /// - [global::System.Text.Json.Serialization.JsonPropertyName("labels_filter_mode")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::AI21.JsonConverters.LibrarySearchRequestLabelsFilterModeJsonConverter))] - public global::AI21.LibrarySearchRequestLabelsFilterMode? LabelsFilterMode { get; set; } - - /// - /// - /// - [global::System.Text.Json.Serialization.JsonPropertyName("fileIds")] - public global::System.Collections.Generic.IList? FileIds { get; set; } - - /// - /// Default Value: segments - /// - [global::System.Text.Json.Serialization.JsonPropertyName("retrievalStrategy")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::AI21.JsonConverters.RetrievalStrategyJsonConverter))] - public global::AI21.RetrievalStrategy? RetrievalStrategy { get; set; } - - /// - /// Default Value: 1 - /// - [global::System.Text.Json.Serialization.JsonPropertyName("maxNeighbors")] - public int? MaxNeighbors { get; set; } - - /// - /// - /// - [global::System.Text.Json.Serialization.JsonPropertyName("retrievalSimilarityThreshold")] - public double? RetrievalSimilarityThreshold { get; set; } - - /// - /// - /// - [global::System.Text.Json.Serialization.JsonPropertyName("hybridSearchAlpha")] - public double? HybridSearchAlpha { 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: AND - /// - /// - /// - /// Default Value: segments - /// - /// - /// Default Value: 1 - /// - /// - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public LibrarySearchRequest( - string query, - int? maxSegments, - string? path, - global::System.Collections.Generic.IList? labels, - global::AI21.QueryFilter? labelsFilter, - global::AI21.LibrarySearchRequestLabelsFilterMode? labelsFilterMode, - global::System.Collections.Generic.IList? fileIds, - global::AI21.RetrievalStrategy? retrievalStrategy, - int? maxNeighbors, - double? retrievalSimilarityThreshold, - double? hybridSearchAlpha) - { - this.Query = query ?? throw new global::System.ArgumentNullException(nameof(query)); - this.MaxSegments = maxSegments; - this.Path = path; - this.Labels = labels; - this.LabelsFilter = labelsFilter; - this.LabelsFilterMode = labelsFilterMode; - this.FileIds = fileIds; - this.RetrievalStrategy = retrievalStrategy; - this.MaxNeighbors = maxNeighbors; - this.RetrievalSimilarityThreshold = retrievalSimilarityThreshold; - this.HybridSearchAlpha = hybridSearchAlpha; - } - - /// - /// Initializes a new instance of the class. - /// - public LibrarySearchRequest() - { - } - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.LibrarySearchRequestLabelsFilterMode.g.cs b/src/libs/AI21/Generated/AI21.Models.LibrarySearchRequestLabelsFilterMode.g.cs deleted file mode 100644 index 5edd607b..00000000 --- a/src/libs/AI21/Generated/AI21.Models.LibrarySearchRequestLabelsFilterMode.g.cs +++ /dev/null @@ -1,51 +0,0 @@ - -#nullable enable - -namespace AI21 -{ - /// - /// Default Value: AND - /// - public enum LibrarySearchRequestLabelsFilterMode - { - /// - /// - /// - And, - /// - /// - /// - Or, - } - - /// - /// Enum extensions to do fast conversions without the reflection. - /// - public static class LibrarySearchRequestLabelsFilterModeExtensions - { - /// - /// Converts an enum to a string. - /// - public static string ToValueString(this LibrarySearchRequestLabelsFilterMode value) - { - return value switch - { - LibrarySearchRequestLabelsFilterMode.And => "AND", - LibrarySearchRequestLabelsFilterMode.Or => "OR", - _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), - }; - } - /// - /// Converts an string to a enum. - /// - public static LibrarySearchRequestLabelsFilterMode? ToEnum(string value) - { - return value switch - { - "AND" => LibrarySearchRequestLabelsFilterMode.And, - "OR" => LibrarySearchRequestLabelsFilterMode.Or, - _ => null, - }; - } - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.ListAssistantsResponse.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.ListAssistantsResponse.Json.g.cs index 82af2a22..9fabf6ad 100644 --- a/src/libs/AI21/Generated/AI21.Models.ListAssistantsResponse.Json.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.ListAssistantsResponse.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::AI21.ListAssistantsResponse; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::AI21.ListAssistantsResponse? FromJson( + string json) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::AI21.ListAssistantsResponse; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/AI21/Generated/AI21.Models.ListAssistantsResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.ListAssistantsResponse.g.cs index d64ad03a..bd608b83 100644 --- a/src/libs/AI21/Generated/AI21.Models.ListAssistantsResponse.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.ListAssistantsResponse.g.cs @@ -40,5 +40,6 @@ public ListAssistantsResponse( public ListAssistantsResponse() { } + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.ListMCPsStorageResponse.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.ListMCPsStorageResponse.Json.g.cs index 1f4cbf5c..2273ff9e 100644 --- a/src/libs/AI21/Generated/AI21.Models.ListMCPsStorageResponse.Json.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.ListMCPsStorageResponse.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::AI21.ListMCPsStorageResponse; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::AI21.ListMCPsStorageResponse? FromJson( + string json) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::AI21.ListMCPsStorageResponse; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/AI21/Generated/AI21.Models.ListMCPsStorageResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.ListMCPsStorageResponse.g.cs index a46446ca..e2a96b2b 100644 --- a/src/libs/AI21/Generated/AI21.Models.ListMCPsStorageResponse.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.ListMCPsStorageResponse.g.cs @@ -40,5 +40,6 @@ public ListMCPsStorageResponse( public ListMCPsStorageResponse() { } + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.ListPlansResponse.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.ListPlansResponse.Json.g.cs index 7b42ba33..f9fbee83 100644 --- a/src/libs/AI21/Generated/AI21.Models.ListPlansResponse.Json.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.ListPlansResponse.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::AI21.ListPlansResponse; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::AI21.ListPlansResponse? FromJson( + string json) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::AI21.ListPlansResponse; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/AI21/Generated/AI21.Models.ListPlansResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.ListPlansResponse.g.cs index 599d9f82..dace0404 100644 --- a/src/libs/AI21/Generated/AI21.Models.ListPlansResponse.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.ListPlansResponse.g.cs @@ -40,5 +40,6 @@ public ListPlansResponse( public ListPlansResponse() { } + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.ListRoutesResponse.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.ListRoutesResponse.Json.g.cs index 3e75c48e..37c54bac 100644 --- a/src/libs/AI21/Generated/AI21.Models.ListRoutesResponse.Json.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.ListRoutesResponse.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::AI21.ListRoutesResponse; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::AI21.ListRoutesResponse? FromJson( + string json) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::AI21.ListRoutesResponse; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/AI21/Generated/AI21.Models.ListRoutesResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.ListRoutesResponse.g.cs index 5a410b01..bdb79aee 100644 --- a/src/libs/AI21/Generated/AI21.Models.ListRoutesResponse.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.ListRoutesResponse.g.cs @@ -40,5 +40,6 @@ public ListRoutesResponse( public ListRoutesResponse() { } + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.LogicalOperator.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.LogicalOperator.Json.g.cs index 233fc380..bfa677a8 100644 --- a/src/libs/AI21/Generated/AI21.Models.LogicalOperator.Json.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.LogicalOperator.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::AI21.LogicalOperator; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::AI21.LogicalOperator? FromJson( + string json) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::AI21.LogicalOperator; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/AI21/Generated/AI21.Models.LogicalOperator.g.cs b/src/libs/AI21/Generated/AI21.Models.LogicalOperator.g.cs index 1d230ef2..3b317041 100644 --- a/src/libs/AI21/Generated/AI21.Models.LogicalOperator.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.LogicalOperator.g.cs @@ -14,5 +14,6 @@ public sealed partial class LogicalOperator /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.LogicalOperatorItem.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.LogicalOperatorItem.Json.g.cs index 3c3b3631..4767c489 100644 --- a/src/libs/AI21/Generated/AI21.Models.LogicalOperatorItem.Json.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.LogicalOperatorItem.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::AI21.LogicalOperatorItem; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::AI21.LogicalOperatorItem? FromJson( + string json) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::AI21.LogicalOperatorItem; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/AI21/Generated/AI21.Models.LogicalOperatorItem.g.cs b/src/libs/AI21/Generated/AI21.Models.LogicalOperatorItem.g.cs index 62dfcefd..80339491 100644 --- a/src/libs/AI21/Generated/AI21.Models.LogicalOperatorItem.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.LogicalOperatorItem.g.cs @@ -14,5 +14,6 @@ public sealed partial class LogicalOperatorItem /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.Logprobs.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.Logprobs.Json.g.cs index b3d7a1aa..7c7f0cdb 100644 --- a/src/libs/AI21/Generated/AI21.Models.Logprobs.Json.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.Logprobs.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::AI21.Logprobs; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::AI21.Logprobs? FromJson( + string json) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::AI21.Logprobs; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/AI21/Generated/AI21.Models.Logprobs.g.cs b/src/libs/AI21/Generated/AI21.Models.Logprobs.g.cs index 9563f7e9..ffa057dc 100644 --- a/src/libs/AI21/Generated/AI21.Models.Logprobs.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.Logprobs.g.cs @@ -40,5 +40,6 @@ public Logprobs( public Logprobs() { } + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.LogprobsData.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.LogprobsData.Json.g.cs index ea27176d..3c6f40b8 100644 --- a/src/libs/AI21/Generated/AI21.Models.LogprobsData.Json.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.LogprobsData.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::AI21.LogprobsData; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::AI21.LogprobsData? FromJson( + string json) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::AI21.LogprobsData; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/AI21/Generated/AI21.Models.LogprobsData.g.cs b/src/libs/AI21/Generated/AI21.Models.LogprobsData.g.cs index 5f879f83..15a235eb 100644 --- a/src/libs/AI21/Generated/AI21.Models.LogprobsData.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.LogprobsData.g.cs @@ -59,5 +59,6 @@ public LogprobsData( public LogprobsData() { } + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.MCPDefinition.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.MCPDefinition.Json.g.cs deleted file mode 100644 index 3500963d..00000000 --- a/src/libs/AI21/Generated/AI21.Models.MCPDefinition.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace AI21 -{ - public sealed partial class MCPDefinition - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::AI21.MCPDefinition? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::AI21.MCPDefinition), - jsonSerializerContext) as global::AI21.MCPDefinition; - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::AI21.MCPDefinition? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::AI21.MCPDefinition), - jsonSerializerContext).ConfigureAwait(false)) as global::AI21.MCPDefinition; - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/AI21/Generated/AI21.Models.MCPDefinition.g.cs b/src/libs/AI21/Generated/AI21.Models.MCPDefinition.g.cs deleted file mode 100644 index b59b38f9..00000000 --- a/src/libs/AI21/Generated/AI21.Models.MCPDefinition.g.cs +++ /dev/null @@ -1,62 +0,0 @@ - -#nullable enable - -namespace AI21 -{ - /// - /// - /// - public sealed partial class MCPDefinition - { - /// - /// - /// - [global::System.Text.Json.Serialization.JsonPropertyName("server_url")] - [global::System.Text.Json.Serialization.JsonRequired] - public required string ServerUrl { get; set; } - - /// - /// - /// - [global::System.Text.Json.Serialization.JsonPropertyName("server_label")] - public string? ServerLabel { get; set; } - - /// - /// - /// - [global::System.Text.Json.Serialization.JsonPropertyName("headers")] - public object? Headers { 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 MCPDefinition( - string serverUrl, - string? serverLabel, - object? headers) - { - this.ServerUrl = serverUrl ?? throw new global::System.ArgumentNullException(nameof(serverUrl)); - this.ServerLabel = serverLabel; - this.Headers = headers; - } - - /// - /// Initializes a new instance of the class. - /// - public MCPDefinition() - { - } - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.MCPDefinitionHeaders.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.MCPDefinitionHeaders.Json.g.cs deleted file mode 100644 index a5f16de7..00000000 --- a/src/libs/AI21/Generated/AI21.Models.MCPDefinitionHeaders.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace AI21 -{ - public sealed partial class MCPDefinitionHeaders - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::AI21.MCPDefinitionHeaders? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::AI21.MCPDefinitionHeaders), - jsonSerializerContext) as global::AI21.MCPDefinitionHeaders; - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::AI21.MCPDefinitionHeaders? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::AI21.MCPDefinitionHeaders), - jsonSerializerContext).ConfigureAwait(false)) as global::AI21.MCPDefinitionHeaders; - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/AI21/Generated/AI21.Models.MCPDefinitionHeaders.g.cs b/src/libs/AI21/Generated/AI21.Models.MCPDefinitionHeaders.g.cs deleted file mode 100644 index 88817a45..00000000 --- a/src/libs/AI21/Generated/AI21.Models.MCPDefinitionHeaders.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace AI21 -{ - /// - /// - /// - public sealed partial class MCPDefinitionHeaders - { - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.MCPDiscoveryResponse.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.MCPDiscoveryResponse.Json.g.cs deleted file mode 100644 index b8128905..00000000 --- a/src/libs/AI21/Generated/AI21.Models.MCPDiscoveryResponse.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace AI21 -{ - public sealed partial class MCPDiscoveryResponse - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::AI21.MCPDiscoveryResponse? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::AI21.MCPDiscoveryResponse), - jsonSerializerContext) as global::AI21.MCPDiscoveryResponse; - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::AI21.MCPDiscoveryResponse? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::AI21.MCPDiscoveryResponse), - jsonSerializerContext).ConfigureAwait(false)) as global::AI21.MCPDiscoveryResponse; - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/AI21/Generated/AI21.Models.MCPDiscoveryResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.MCPDiscoveryResponse.g.cs deleted file mode 100644 index a8a6ba24..00000000 --- a/src/libs/AI21/Generated/AI21.Models.MCPDiscoveryResponse.g.cs +++ /dev/null @@ -1,54 +0,0 @@ - -#nullable enable - -namespace AI21 -{ - /// - /// - /// - public sealed partial class MCPDiscoveryResponse - { - /// - /// - /// - [global::System.Text.Json.Serialization.JsonPropertyName("mcp_definition")] - [global::System.Text.Json.Serialization.JsonRequired] - public required global::AI21.MCPDefinition McpDefinition { get; set; } - - /// - /// - /// - [global::System.Text.Json.Serialization.JsonPropertyName("tools")] - [global::System.Text.Json.Serialization.JsonRequired] - public required global::System.Collections.Generic.IList Tools { 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 MCPDiscoveryResponse( - global::AI21.MCPDefinition mcpDefinition, - global::System.Collections.Generic.IList tools) - { - this.McpDefinition = mcpDefinition ?? throw new global::System.ArgumentNullException(nameof(mcpDefinition)); - this.Tools = tools ?? throw new global::System.ArgumentNullException(nameof(tools)); - } - - /// - /// Initializes a new instance of the class. - /// - public MCPDiscoveryResponse() - { - } - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.MCPStorageResponse.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.MCPStorageResponse.Json.g.cs index 1a5d39b5..e5b68fde 100644 --- a/src/libs/AI21/Generated/AI21.Models.MCPStorageResponse.Json.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.MCPStorageResponse.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::AI21.MCPStorageResponse; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::AI21.MCPStorageResponse? FromJson( + string json) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::AI21.MCPStorageResponse; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/AI21/Generated/AI21.Models.MCPStorageResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.MCPStorageResponse.g.cs index e400932c..f3f1a43b 100644 --- a/src/libs/AI21/Generated/AI21.Models.MCPStorageResponse.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.MCPStorageResponse.g.cs @@ -134,5 +134,6 @@ public MCPStorageResponse( public MCPStorageResponse() { } + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.MCPTool.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.MCPTool.Json.g.cs deleted file mode 100644 index d7cf1ef3..00000000 --- a/src/libs/AI21/Generated/AI21.Models.MCPTool.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace AI21 -{ - public sealed partial class MCPTool - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::AI21.MCPTool? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::AI21.MCPTool), - jsonSerializerContext) as global::AI21.MCPTool; - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::AI21.MCPTool? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::AI21.MCPTool), - jsonSerializerContext).ConfigureAwait(false)) as global::AI21.MCPTool; - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/AI21/Generated/AI21.Models.MCPTool.g.cs b/src/libs/AI21/Generated/AI21.Models.MCPTool.g.cs deleted file mode 100644 index 2ffcaa21..00000000 --- a/src/libs/AI21/Generated/AI21.Models.MCPTool.g.cs +++ /dev/null @@ -1,63 +0,0 @@ - -#nullable enable - -namespace AI21 -{ - /// - /// - /// - public sealed partial class MCPTool - { - /// - /// - /// - [global::System.Text.Json.Serialization.JsonPropertyName("name")] - [global::System.Text.Json.Serialization.JsonRequired] - public required string Name { get; set; } - - /// - /// - /// - [global::System.Text.Json.Serialization.JsonPropertyName("description")] - public string? Description { get; set; } - - /// - /// - /// - [global::System.Text.Json.Serialization.JsonPropertyName("inputSchema")] - [global::System.Text.Json.Serialization.JsonRequired] - public required object InputSchema { 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 MCPTool( - string name, - object inputSchema, - string? description) - { - this.Name = name ?? throw new global::System.ArgumentNullException(nameof(name)); - this.Description = description; - this.InputSchema = inputSchema ?? throw new global::System.ArgumentNullException(nameof(inputSchema)); - } - - /// - /// Initializes a new instance of the class. - /// - public MCPTool() - { - } - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.MCPToolInputSchema.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.MCPToolInputSchema.Json.g.cs deleted file mode 100644 index f7d6bbdd..00000000 --- a/src/libs/AI21/Generated/AI21.Models.MCPToolInputSchema.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace AI21 -{ - public sealed partial class MCPToolInputSchema - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::AI21.MCPToolInputSchema? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::AI21.MCPToolInputSchema), - jsonSerializerContext) as global::AI21.MCPToolInputSchema; - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::AI21.MCPToolInputSchema? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::AI21.MCPToolInputSchema), - jsonSerializerContext).ConfigureAwait(false)) as global::AI21.MCPToolInputSchema; - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/AI21/Generated/AI21.Models.MCPToolInputSchema.g.cs b/src/libs/AI21/Generated/AI21.Models.MCPToolInputSchema.g.cs deleted file mode 100644 index 7b3813e2..00000000 --- a/src/libs/AI21/Generated/AI21.Models.MCPToolInputSchema.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace AI21 -{ - /// - /// - /// - public sealed partial class MCPToolInputSchema - { - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.MCPToolResource.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.MCPToolResource.Json.g.cs index 1471fb12..cae5298e 100644 --- a/src/libs/AI21/Generated/AI21.Models.MCPToolResource.Json.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.MCPToolResource.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::AI21.MCPToolResource; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::AI21.MCPToolResource? FromJson( + string json) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::AI21.MCPToolResource; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/AI21/Generated/AI21.Models.MCPToolResource.g.cs b/src/libs/AI21/Generated/AI21.Models.MCPToolResource.g.cs index cf7ca151..c5f21123 100644 --- a/src/libs/AI21/Generated/AI21.Models.MCPToolResource.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.MCPToolResource.g.cs @@ -87,5 +87,6 @@ public MCPToolResource( public MCPToolResource() { } + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.MCPToolResourceHeaders.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.MCPToolResourceHeaders.Json.g.cs index f074e49f..6e8d4253 100644 --- a/src/libs/AI21/Generated/AI21.Models.MCPToolResourceHeaders.Json.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.MCPToolResourceHeaders.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::AI21.MCPToolResourceHeaders; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::AI21.MCPToolResourceHeaders? FromJson( + string json) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::AI21.MCPToolResourceHeaders; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/AI21/Generated/AI21.Models.MCPToolResourceHeaders.g.cs b/src/libs/AI21/Generated/AI21.Models.MCPToolResourceHeaders.g.cs index e4054231..59f2fb12 100644 --- a/src/libs/AI21/Generated/AI21.Models.MCPToolResourceHeaders.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.MCPToolResourceHeaders.g.cs @@ -14,5 +14,6 @@ public sealed partial class MCPToolResourceHeaders /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.MaestroRunError.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.MaestroRunError.Json.g.cs index ee8cc5bc..08fe0001 100644 --- a/src/libs/AI21/Generated/AI21.Models.MaestroRunError.Json.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.MaestroRunError.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::AI21.MaestroRunError; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::AI21.MaestroRunError? FromJson( + string json) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::AI21.MaestroRunError; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/AI21/Generated/AI21.Models.MaestroRunError.g.cs b/src/libs/AI21/Generated/AI21.Models.MaestroRunError.g.cs index 38c69bee..370723c1 100644 --- a/src/libs/AI21/Generated/AI21.Models.MaestroRunError.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.MaestroRunError.g.cs @@ -40,5 +40,6 @@ public MaestroRunError( public MaestroRunError() { } + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.MaestroRunResult.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.MaestroRunResult.Json.g.cs index 8d5127ee..f98ddf7d 100644 --- a/src/libs/AI21/Generated/AI21.Models.MaestroRunResult.Json.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.MaestroRunResult.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::AI21.MaestroRunResult; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::AI21.MaestroRunResult? FromJson( + string json) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::AI21.MaestroRunResult; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/AI21/Generated/AI21.Models.MaestroRunResult.g.cs b/src/libs/AI21/Generated/AI21.Models.MaestroRunResult.g.cs index e84d8f97..52929e92 100644 --- a/src/libs/AI21/Generated/AI21.Models.MaestroRunResult.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.MaestroRunResult.g.cs @@ -43,6 +43,12 @@ public sealed partial class MaestroRunResult [global::System.Text.Json.Serialization.JsonPropertyName("requirements_result")] public object? RequirementsResult { get; set; } + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("created_at")] + public global::System.DateTime? CreatedAt { get; set; } + /// /// /// @@ -67,6 +73,7 @@ public sealed partial class MaestroRunResult /// /// /// + /// /// #if NET7_0_OR_GREATER [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] @@ -77,6 +84,7 @@ public MaestroRunResult( object? result, object? dataSources, object? requirementsResult, + global::System.DateTime? createdAt, global::AI21.MaestroRunError? error) { this.Id = id; @@ -84,6 +92,7 @@ public MaestroRunResult( this.Result = result; this.DataSources = dataSources; this.RequirementsResult = requirementsResult; + this.CreatedAt = createdAt; this.Error = error; } @@ -93,5 +102,6 @@ public MaestroRunResult( public MaestroRunResult() { } + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.MaestroRunResultDataSources.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.MaestroRunResultDataSources.Json.g.cs index 9c628b06..a1d4759b 100644 --- a/src/libs/AI21/Generated/AI21.Models.MaestroRunResultDataSources.Json.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.MaestroRunResultDataSources.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::AI21.MaestroRunResultDataSources; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::AI21.MaestroRunResultDataSources? FromJson( + string json) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::AI21.MaestroRunResultDataSources; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/AI21/Generated/AI21.Models.MaestroRunResultDataSources.g.cs b/src/libs/AI21/Generated/AI21.Models.MaestroRunResultDataSources.g.cs index 291430d4..2d08b68b 100644 --- a/src/libs/AI21/Generated/AI21.Models.MaestroRunResultDataSources.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.MaestroRunResultDataSources.g.cs @@ -14,5 +14,6 @@ public sealed partial class MaestroRunResultDataSources /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.MaestroRunResultRequirementsResult.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.MaestroRunResultRequirementsResult.Json.g.cs index 1bad7d47..9d69fb73 100644 --- a/src/libs/AI21/Generated/AI21.Models.MaestroRunResultRequirementsResult.Json.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.MaestroRunResultRequirementsResult.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::AI21.MaestroRunResultRequirementsResult; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::AI21.MaestroRunResultRequirementsResult? FromJson( + string json) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::AI21.MaestroRunResultRequirementsResult; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/AI21/Generated/AI21.Models.MaestroRunResultRequirementsResult.g.cs b/src/libs/AI21/Generated/AI21.Models.MaestroRunResultRequirementsResult.g.cs index dde2a51d..ab211bb3 100644 --- a/src/libs/AI21/Generated/AI21.Models.MaestroRunResultRequirementsResult.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.MaestroRunResultRequirementsResult.g.cs @@ -14,5 +14,6 @@ public sealed partial class MaestroRunResultRequirementsResult /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.MaestroRunResultResult.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.MaestroRunResultResult.Json.g.cs index c0889bcc..77d5ce5c 100644 --- a/src/libs/AI21/Generated/AI21.Models.MaestroRunResultResult.Json.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.MaestroRunResultResult.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::AI21.MaestroRunResultResult; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::AI21.MaestroRunResultResult? FromJson( + string json) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::AI21.MaestroRunResultResult; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/AI21/Generated/AI21.Models.MaestroRunResultResult.g.cs b/src/libs/AI21/Generated/AI21.Models.MaestroRunResultResult.g.cs index c08df558..937e41e0 100644 --- a/src/libs/AI21/Generated/AI21.Models.MaestroRunResultResult.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.MaestroRunResultResult.g.cs @@ -14,5 +14,6 @@ public sealed partial class MaestroRunResultResult /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.MarkdownRequest.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.MarkdownRequest.Json.g.cs index adcf76d5..4915f71f 100644 --- a/src/libs/AI21/Generated/AI21.Models.MarkdownRequest.Json.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.MarkdownRequest.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::AI21.MarkdownRequest; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::AI21.MarkdownRequest? FromJson( + string json) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::AI21.MarkdownRequest; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/AI21/Generated/AI21.Models.MarkdownRequest.g.cs b/src/libs/AI21/Generated/AI21.Models.MarkdownRequest.g.cs index 841b24ff..4816a773 100644 --- a/src/libs/AI21/Generated/AI21.Models.MarkdownRequest.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.MarkdownRequest.g.cs @@ -42,5 +42,6 @@ public MarkdownRequest( public MarkdownRequest() { } + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.Message.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.Message.Json.g.cs index 8ee53a20..1ab87706 100644 --- a/src/libs/AI21/Generated/AI21.Models.Message.Json.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.Message.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::AI21.Message; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::AI21.Message? FromJson( + string json) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::AI21.Message; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/AI21/Generated/AI21.Models.Message.g.cs b/src/libs/AI21/Generated/AI21.Models.Message.g.cs index ad6357c0..81a68d7b 100644 --- a/src/libs/AI21/Generated/AI21.Models.Message.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.Message.g.cs @@ -71,5 +71,6 @@ public Message( public Message() { } + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.MessagesItem.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.MessagesItem.Json.g.cs index 2bb0f083..14685909 100644 --- a/src/libs/AI21/Generated/AI21.Models.MessagesItem.Json.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.MessagesItem.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::AI21.MessagesItem?; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::AI21.MessagesItem? FromJson( + string json) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::AI21.MessagesItem?; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/AI21/Generated/AI21.Models.MessagesItem.g.cs b/src/libs/AI21/Generated/AI21.Models.MessagesItem.g.cs index aeadc8fc..ae0df8d7 100644 --- a/src/libs/AI21/Generated/AI21.Models.MessagesItem.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.MessagesItem.g.cs @@ -31,6 +31,26 @@ namespace AI21 #endif public bool IsUser => User != null; + /// + /// + /// + public bool TryPickUser( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::AI21.UserMessage? value) + { + value = User; + return IsUser; + } + + /// + /// + /// + public global::AI21.UserMessage PickUser() => IsUser + ? User! + : throw new global::System.InvalidOperationException($"Expected union variant 'User' but the value was {ToString()}."); + /// /// /// @@ -48,6 +68,26 @@ namespace AI21 #endif public bool IsAssistant => Assistant != null; + /// + /// + /// + public bool TryPickAssistant( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::AI21.AssistantMessage? value) + { + value = Assistant; + return IsAssistant; + } + + /// + /// + /// + public global::AI21.AssistantMessage PickAssistant() => IsAssistant + ? Assistant! + : throw new global::System.InvalidOperationException($"Expected union variant 'Assistant' but the value was {ToString()}."); + /// /// /// @@ -65,6 +105,26 @@ namespace AI21 #endif public bool IsTool => Tool != null; + /// + /// + /// + public bool TryPickTool( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::AI21.ToolMessage? value) + { + value = Tool; + return IsTool; + } + + /// + /// + /// + public global::AI21.ToolMessage PickTool() => IsTool + ? Tool! + : throw new global::System.InvalidOperationException($"Expected union variant 'Tool' but the value was {ToString()}."); + /// /// /// @@ -81,6 +141,26 @@ namespace AI21 [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(System))] #endif public bool IsSystem => System != null; + + /// + /// + /// + public bool TryPickSystem( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::AI21.SystemMessage? value) + { + value = System; + return IsSystem; + } + + /// + /// + /// + public global::AI21.SystemMessage PickSystem() => IsSystem + ? System! + : throw new global::System.InvalidOperationException($"Expected union variant 'System' but the value was {ToString()}."); /// /// /// @@ -99,6 +179,11 @@ public MessagesItem(global::AI21.UserMessage? value) User = value; } + /// + /// + /// + public static MessagesItem FromUser(global::AI21.UserMessage? value) => new MessagesItem(value); + /// /// /// @@ -117,6 +202,11 @@ public MessagesItem(global::AI21.AssistantMessage? value) Assistant = value; } + /// + /// + /// + public static MessagesItem FromAssistant(global::AI21.AssistantMessage? value) => new MessagesItem(value); + /// /// /// @@ -135,6 +225,11 @@ public MessagesItem(global::AI21.ToolMessage? value) Tool = value; } + /// + /// + /// + public static MessagesItem FromTool(global::AI21.ToolMessage? value) => new MessagesItem(value); + /// /// /// @@ -153,6 +248,11 @@ public MessagesItem(global::AI21.SystemMessage? value) System = value; } + /// + /// + /// + public static MessagesItem FromSystem(global::AI21.SystemMessage? value) => new MessagesItem(value); + /// /// /// @@ -204,10 +304,10 @@ public bool Validate() /// /// public TResult? Match( - global::System.Func? user = null, - global::System.Func? assistant = null, - global::System.Func? tool = null, - global::System.Func? system = null, + global::System.Func? user = null, + global::System.Func? assistant = null, + global::System.Func? tool = null, + global::System.Func? system = null, bool validate = true) { if (validate) @@ -239,10 +339,46 @@ public bool Validate() /// /// public void Match( - global::System.Action? user = null, - global::System.Action? assistant = null, - global::System.Action? tool = null, - global::System.Action? system = null, + global::System.Action? user = null, + + global::System.Action? assistant = null, + + global::System.Action? tool = null, + + global::System.Action? system = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsUser) + { + user?.Invoke(User!); + } + else if (IsAssistant) + { + assistant?.Invoke(Assistant!); + } + else if (IsTool) + { + tool?.Invoke(Tool!); + } + else if (IsSystem) + { + system?.Invoke(System!); + } + } + + /// + /// + /// + public void Switch( + global::System.Action? user = null, + global::System.Action? assistant = null, + global::System.Action? tool = null, + global::System.Action? system = null, bool validate = true) { if (validate) diff --git a/src/libs/AI21/Generated/AI21.Models.MockResponseConfig.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.MockResponseConfig.Json.g.cs index 0e4655ca..42278062 100644 --- a/src/libs/AI21/Generated/AI21.Models.MockResponseConfig.Json.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.MockResponseConfig.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::AI21.MockResponseConfig; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::AI21.MockResponseConfig? FromJson( + string json) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::AI21.MockResponseConfig; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/AI21/Generated/AI21.Models.MockResponseConfig.g.cs b/src/libs/AI21/Generated/AI21.Models.MockResponseConfig.g.cs index 0158c67c..69ae67e4 100644 --- a/src/libs/AI21/Generated/AI21.Models.MockResponseConfig.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.MockResponseConfig.g.cs @@ -52,5 +52,6 @@ public MockResponseConfig( public MockResponseConfig() { } + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.ModelInfo.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.ModelInfo.Json.g.cs index 7d04caf3..a224c448 100644 --- a/src/libs/AI21/Generated/AI21.Models.ModelInfo.Json.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.ModelInfo.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::AI21.ModelInfo; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::AI21.ModelInfo? FromJson( + string json) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::AI21.ModelInfo; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/AI21/Generated/AI21.Models.ModelInfo.g.cs b/src/libs/AI21/Generated/AI21.Models.ModelInfo.g.cs index 20ff99ce..b5e5a740 100644 --- a/src/libs/AI21/Generated/AI21.Models.ModelInfo.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.ModelInfo.g.cs @@ -109,5 +109,6 @@ public ModelInfo( public ModelInfo() { } + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.ModelPricing.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.ModelPricing.Json.g.cs index 615e0ae5..980fa986 100644 --- a/src/libs/AI21/Generated/AI21.Models.ModelPricing.Json.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.ModelPricing.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::AI21.ModelPricing; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::AI21.ModelPricing? FromJson( + string json) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::AI21.ModelPricing; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/AI21/Generated/AI21.Models.ModelPricing.g.cs b/src/libs/AI21/Generated/AI21.Models.ModelPricing.g.cs index 4e71539a..47af72c0 100644 --- a/src/libs/AI21/Generated/AI21.Models.ModelPricing.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.ModelPricing.g.cs @@ -50,5 +50,6 @@ public ModelPricing( public ModelPricing() { } + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.ModelsInfoResponse.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.ModelsInfoResponse.Json.g.cs index 0c07aecd..42af6f1a 100644 --- a/src/libs/AI21/Generated/AI21.Models.ModelsInfoResponse.Json.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.ModelsInfoResponse.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::AI21.ModelsInfoResponse; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::AI21.ModelsInfoResponse? FromJson( + string json) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::AI21.ModelsInfoResponse; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/AI21/Generated/AI21.Models.ModelsInfoResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.ModelsInfoResponse.g.cs index 7f68eee9..b6c58328 100644 --- a/src/libs/AI21/Generated/AI21.Models.ModelsInfoResponse.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.ModelsInfoResponse.g.cs @@ -40,5 +40,6 @@ public ModelsInfoResponse( public ModelsInfoResponse() { } + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.ModifyAssistantRequest.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.ModifyAssistantRequest.Json.g.cs index dfb529c7..100cda5d 100644 --- a/src/libs/AI21/Generated/AI21.Models.ModifyAssistantRequest.Json.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.ModifyAssistantRequest.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::AI21.ModifyAssistantRequest; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::AI21.ModifyAssistantRequest? FromJson( + string json) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::AI21.ModifyAssistantRequest; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/AI21/Generated/AI21.Models.ModifyAssistantRequest.g.cs b/src/libs/AI21/Generated/AI21.Models.ModifyAssistantRequest.g.cs index 8c66d175..1e4fca85 100644 --- a/src/libs/AI21/Generated/AI21.Models.ModifyAssistantRequest.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.ModifyAssistantRequest.g.cs @@ -168,5 +168,6 @@ public ModifyAssistantRequest( public ModifyAssistantRequest() { } + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.ModifyAssistantRequestConfigOverrides.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.ModifyAssistantRequestConfigOverrides.Json.g.cs index faf69d1a..b0b86877 100644 --- a/src/libs/AI21/Generated/AI21.Models.ModifyAssistantRequestConfigOverrides.Json.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.ModifyAssistantRequestConfigOverrides.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::AI21.ModifyAssistantRequestConfigOverrides; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::AI21.ModifyAssistantRequestConfigOverrides? FromJson( + string json) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::AI21.ModifyAssistantRequestConfigOverrides; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/AI21/Generated/AI21.Models.ModifyAssistantRequestConfigOverrides.g.cs b/src/libs/AI21/Generated/AI21.Models.ModifyAssistantRequestConfigOverrides.g.cs index 5bcf0aeb..dddf000b 100644 --- a/src/libs/AI21/Generated/AI21.Models.ModifyAssistantRequestConfigOverrides.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.ModifyAssistantRequestConfigOverrides.g.cs @@ -14,5 +14,6 @@ public sealed partial class ModifyAssistantRequestConfigOverrides /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.OrgSchema.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.OrgSchema.Json.g.cs index adf49f60..da9acc7a 100644 --- a/src/libs/AI21/Generated/AI21.Models.OrgSchema.Json.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.OrgSchema.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::AI21.OrgSchema; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::AI21.OrgSchema? FromJson( + string json) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::AI21.OrgSchema; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/AI21/Generated/AI21.Models.OrgSchema.g.cs b/src/libs/AI21/Generated/AI21.Models.OrgSchema.g.cs index 7f895863..a3933745 100644 --- a/src/libs/AI21/Generated/AI21.Models.OrgSchema.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.OrgSchema.g.cs @@ -70,5 +70,6 @@ public OrgSchema( public OrgSchema() { } + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.OrgSchemaSchemaDefinition.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.OrgSchemaSchemaDefinition.Json.g.cs index bc2e83ef..f8c56fad 100644 --- a/src/libs/AI21/Generated/AI21.Models.OrgSchemaSchemaDefinition.Json.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.OrgSchemaSchemaDefinition.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::AI21.OrgSchemaSchemaDefinition; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::AI21.OrgSchemaSchemaDefinition? FromJson( + string json) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::AI21.OrgSchemaSchemaDefinition; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/AI21/Generated/AI21.Models.OrgSchemaSchemaDefinition.g.cs b/src/libs/AI21/Generated/AI21.Models.OrgSchemaSchemaDefinition.g.cs index 4d32da91..50b8405f 100644 --- a/src/libs/AI21/Generated/AI21.Models.OrgSchemaSchemaDefinition.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.OrgSchemaSchemaDefinition.g.cs @@ -14,5 +14,6 @@ public sealed partial class OrgSchemaSchemaDefinition /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.OrgSchemaTableStats.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.OrgSchemaTableStats.Json.g.cs index 2051731c..15715641 100644 --- a/src/libs/AI21/Generated/AI21.Models.OrgSchemaTableStats.Json.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.OrgSchemaTableStats.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::AI21.OrgSchemaTableStats; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::AI21.OrgSchemaTableStats? FromJson( + string json) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::AI21.OrgSchemaTableStats; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/AI21/Generated/AI21.Models.OrgSchemaTableStats.g.cs b/src/libs/AI21/Generated/AI21.Models.OrgSchemaTableStats.g.cs index 01810a89..c3b12944 100644 --- a/src/libs/AI21/Generated/AI21.Models.OrgSchemaTableStats.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.OrgSchemaTableStats.g.cs @@ -14,5 +14,6 @@ public sealed partial class OrgSchemaTableStats /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.OrgSchemas.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.OrgSchemas.Json.g.cs index c8a4833c..bacbeed7 100644 --- a/src/libs/AI21/Generated/AI21.Models.OrgSchemas.Json.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.OrgSchemas.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::AI21.OrgSchemas; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::AI21.OrgSchemas? FromJson( + string json) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::AI21.OrgSchemas; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/AI21/Generated/AI21.Models.OrgSchemas.g.cs b/src/libs/AI21/Generated/AI21.Models.OrgSchemas.g.cs index eca78e5b..37a8faf7 100644 --- a/src/libs/AI21/Generated/AI21.Models.OrgSchemas.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.OrgSchemas.g.cs @@ -40,5 +40,6 @@ public OrgSchemas( public OrgSchemas() { } + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.ParagonSyncStatus.g.cs b/src/libs/AI21/Generated/AI21.Models.ParagonSyncStatus.g.cs deleted file mode 100644 index 1aa76afe..00000000 --- a/src/libs/AI21/Generated/AI21.Models.ParagonSyncStatus.g.cs +++ /dev/null @@ -1,63 +0,0 @@ - -#nullable enable - -namespace AI21 -{ - /// - /// An enumeration. - /// - public enum ParagonSyncStatus - { - /// - /// - /// - Active, - /// - /// - /// - Errored, - /// - /// - /// - Idle, - /// - /// - /// - Paused, - } - - /// - /// Enum extensions to do fast conversions without the reflection. - /// - public static class ParagonSyncStatusExtensions - { - /// - /// Converts an enum to a string. - /// - public static string ToValueString(this ParagonSyncStatus value) - { - return value switch - { - ParagonSyncStatus.Active => "ACTIVE", - ParagonSyncStatus.Errored => "ERRORED", - ParagonSyncStatus.Idle => "IDLE", - ParagonSyncStatus.Paused => "PAUSED", - _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), - }; - } - /// - /// Converts an string to a enum. - /// - public static ParagonSyncStatus? ToEnum(string value) - { - return value switch - { - "ACTIVE" => ParagonSyncStatus.Active, - "ERRORED" => ParagonSyncStatus.Errored, - "IDLE" => ParagonSyncStatus.Idle, - "PAUSED" => ParagonSyncStatus.Paused, - _ => null, - }; - } - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.ParsePdfStudioV1DemosDocumentModifierParsePdfPostResponse.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.ParsePdfStudioV1DemosDocumentModifierParsePdfPostResponse.Json.g.cs index d200a4be..4c22262f 100644 --- a/src/libs/AI21/Generated/AI21.Models.ParsePdfStudioV1DemosDocumentModifierParsePdfPostResponse.Json.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.ParsePdfStudioV1DemosDocumentModifierParsePdfPostResponse.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::AI21.ParsePdfStudioV1DemosDocumentModifierParsePdfPostResponse; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::AI21.ParsePdfStudioV1DemosDocumentModifierParsePdfPostResponse? FromJson( + string json) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::AI21.ParsePdfStudioV1DemosDocumentModifierParsePdfPostResponse; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/AI21/Generated/AI21.Models.ParsePdfStudioV1DemosDocumentModifierParsePdfPostResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.ParsePdfStudioV1DemosDocumentModifierParsePdfPostResponse.g.cs index adacb312..9cb9e45c 100644 --- a/src/libs/AI21/Generated/AI21.Models.ParsePdfStudioV1DemosDocumentModifierParsePdfPostResponse.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.ParsePdfStudioV1DemosDocumentModifierParsePdfPostResponse.g.cs @@ -14,5 +14,6 @@ public sealed partial class ParsePdfStudioV1DemosDocumentModifierParsePdfPostRes /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.Plan.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.Plan.Json.g.cs index 9f1acb2e..71f1d3c4 100644 --- a/src/libs/AI21/Generated/AI21.Models.Plan.Json.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.Plan.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::AI21.Plan; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::AI21.Plan? FromJson( + string json) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::AI21.Plan; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/AI21/Generated/AI21.Models.Plan.g.cs b/src/libs/AI21/Generated/AI21.Models.Plan.g.cs index b89a2d2f..d63d5ef8 100644 --- a/src/libs/AI21/Generated/AI21.Models.Plan.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.Plan.g.cs @@ -95,5 +95,6 @@ public Plan( public Plan() { } + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.PlanSchema.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.PlanSchema.Json.g.cs index a336a118..630a33ef 100644 --- a/src/libs/AI21/Generated/AI21.Models.PlanSchema.Json.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.PlanSchema.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::AI21.PlanSchema; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::AI21.PlanSchema? FromJson( + string json) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::AI21.PlanSchema; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/AI21/Generated/AI21.Models.PlanSchema.g.cs b/src/libs/AI21/Generated/AI21.Models.PlanSchema.g.cs index bb600681..115afff9 100644 --- a/src/libs/AI21/Generated/AI21.Models.PlanSchema.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.PlanSchema.g.cs @@ -14,5 +14,6 @@ public sealed partial class PlanSchema /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.PostWebsiteConnectorStudioV1ConnectorsWebsitePostResponse.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.PostWebsiteConnectorStudioV1ConnectorsWebsitePostResponse.Json.g.cs deleted file mode 100644 index 7c2a14df..00000000 --- a/src/libs/AI21/Generated/AI21.Models.PostWebsiteConnectorStudioV1ConnectorsWebsitePostResponse.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace AI21 -{ - public sealed partial class PostWebsiteConnectorStudioV1ConnectorsWebsitePostResponse - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::AI21.PostWebsiteConnectorStudioV1ConnectorsWebsitePostResponse? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::AI21.PostWebsiteConnectorStudioV1ConnectorsWebsitePostResponse), - jsonSerializerContext) as global::AI21.PostWebsiteConnectorStudioV1ConnectorsWebsitePostResponse; - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::AI21.PostWebsiteConnectorStudioV1ConnectorsWebsitePostResponse? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::AI21.PostWebsiteConnectorStudioV1ConnectorsWebsitePostResponse), - jsonSerializerContext).ConfigureAwait(false)) as global::AI21.PostWebsiteConnectorStudioV1ConnectorsWebsitePostResponse; - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/AI21/Generated/AI21.Models.PostWebsiteConnectorStudioV1ConnectorsWebsitePostResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.PostWebsiteConnectorStudioV1ConnectorsWebsitePostResponse.g.cs deleted file mode 100644 index bb29767d..00000000 --- a/src/libs/AI21/Generated/AI21.Models.PostWebsiteConnectorStudioV1ConnectorsWebsitePostResponse.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace AI21 -{ - /// - /// - /// - public sealed partial class PostWebsiteConnectorStudioV1ConnectorsWebsitePostResponse - { - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.ProxyOffV1GatewayOffV1PathGetResponse.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.ProxyOffV1GatewayOffV1PathGetResponse.Json.g.cs new file mode 100644 index 00000000..f02b3fdc --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.ProxyOffV1GatewayOffV1PathGetResponse.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace AI21 +{ + public sealed partial class ProxyOffV1GatewayOffV1PathGetResponse + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::AI21.ProxyOffV1GatewayOffV1PathGetResponse? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::AI21.ProxyOffV1GatewayOffV1PathGetResponse), + jsonSerializerContext) as global::AI21.ProxyOffV1GatewayOffV1PathGetResponse; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::AI21.ProxyOffV1GatewayOffV1PathGetResponse? FromJson( + string json) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::AI21.ProxyOffV1GatewayOffV1PathGetResponse? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::AI21.ProxyOffV1GatewayOffV1PathGetResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::AI21.ProxyOffV1GatewayOffV1PathGetResponse; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/AI21/Generated/AI21.Models.ProxyOffV1GatewayOffV1PathGetResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.ProxyOffV1GatewayOffV1PathGetResponse.g.cs new file mode 100644 index 00000000..27db60f5 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.ProxyOffV1GatewayOffV1PathGetResponse.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace AI21 +{ + /// + /// + /// + public sealed partial class ProxyOffV1GatewayOffV1PathGetResponse + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.ProxyOffV1GatewayOffV1PathGetResponse2.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.ProxyOffV1GatewayOffV1PathGetResponse2.Json.g.cs new file mode 100644 index 00000000..950b2eb6 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.ProxyOffV1GatewayOffV1PathGetResponse2.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace AI21 +{ + public sealed partial class ProxyOffV1GatewayOffV1PathGetResponse2 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::AI21.ProxyOffV1GatewayOffV1PathGetResponse2? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::AI21.ProxyOffV1GatewayOffV1PathGetResponse2), + jsonSerializerContext) as global::AI21.ProxyOffV1GatewayOffV1PathGetResponse2; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::AI21.ProxyOffV1GatewayOffV1PathGetResponse2? FromJson( + string json) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::AI21.ProxyOffV1GatewayOffV1PathGetResponse2? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::AI21.ProxyOffV1GatewayOffV1PathGetResponse2), + jsonSerializerContext).ConfigureAwait(false)) as global::AI21.ProxyOffV1GatewayOffV1PathGetResponse2; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/AI21/Generated/AI21.Models.ProxyOffV1GatewayOffV1PathGetResponse2.g.cs b/src/libs/AI21/Generated/AI21.Models.ProxyOffV1GatewayOffV1PathGetResponse2.g.cs new file mode 100644 index 00000000..f9fe8c34 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.ProxyOffV1GatewayOffV1PathGetResponse2.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace AI21 +{ + /// + /// + /// + public sealed partial class ProxyOffV1GatewayOffV1PathGetResponse2 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.ProxyOffV1GatewayOffV1PathGetResponse3.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.ProxyOffV1GatewayOffV1PathGetResponse3.Json.g.cs new file mode 100644 index 00000000..d97ec910 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.ProxyOffV1GatewayOffV1PathGetResponse3.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace AI21 +{ + public sealed partial class ProxyOffV1GatewayOffV1PathGetResponse3 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::AI21.ProxyOffV1GatewayOffV1PathGetResponse3? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::AI21.ProxyOffV1GatewayOffV1PathGetResponse3), + jsonSerializerContext) as global::AI21.ProxyOffV1GatewayOffV1PathGetResponse3; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::AI21.ProxyOffV1GatewayOffV1PathGetResponse3? FromJson( + string json) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::AI21.ProxyOffV1GatewayOffV1PathGetResponse3? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::AI21.ProxyOffV1GatewayOffV1PathGetResponse3), + jsonSerializerContext).ConfigureAwait(false)) as global::AI21.ProxyOffV1GatewayOffV1PathGetResponse3; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/AI21/Generated/AI21.Models.ProxyOffV1GatewayOffV1PathGetResponse3.g.cs b/src/libs/AI21/Generated/AI21.Models.ProxyOffV1GatewayOffV1PathGetResponse3.g.cs new file mode 100644 index 00000000..9d9d08e8 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.ProxyOffV1GatewayOffV1PathGetResponse3.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace AI21 +{ + /// + /// + /// + public sealed partial class ProxyOffV1GatewayOffV1PathGetResponse3 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.ProxyOffV1GatewayOffV1PathGetResponse4.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.ProxyOffV1GatewayOffV1PathGetResponse4.Json.g.cs new file mode 100644 index 00000000..0cce51bd --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.ProxyOffV1GatewayOffV1PathGetResponse4.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace AI21 +{ + public sealed partial class ProxyOffV1GatewayOffV1PathGetResponse4 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::AI21.ProxyOffV1GatewayOffV1PathGetResponse4? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::AI21.ProxyOffV1GatewayOffV1PathGetResponse4), + jsonSerializerContext) as global::AI21.ProxyOffV1GatewayOffV1PathGetResponse4; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::AI21.ProxyOffV1GatewayOffV1PathGetResponse4? FromJson( + string json) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::AI21.ProxyOffV1GatewayOffV1PathGetResponse4? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::AI21.ProxyOffV1GatewayOffV1PathGetResponse4), + jsonSerializerContext).ConfigureAwait(false)) as global::AI21.ProxyOffV1GatewayOffV1PathGetResponse4; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/AI21/Generated/AI21.Models.ProxyOffV1GatewayOffV1PathGetResponse4.g.cs b/src/libs/AI21/Generated/AI21.Models.ProxyOffV1GatewayOffV1PathGetResponse4.g.cs new file mode 100644 index 00000000..559c721b --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.ProxyOffV1GatewayOffV1PathGetResponse4.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace AI21 +{ + /// + /// + /// + public sealed partial class ProxyOffV1GatewayOffV1PathGetResponse4 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.ProxyOffV1GatewayOffV1PathGetResponse5.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.ProxyOffV1GatewayOffV1PathGetResponse5.Json.g.cs new file mode 100644 index 00000000..8d492abd --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.ProxyOffV1GatewayOffV1PathGetResponse5.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace AI21 +{ + public sealed partial class ProxyOffV1GatewayOffV1PathGetResponse5 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::AI21.ProxyOffV1GatewayOffV1PathGetResponse5? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::AI21.ProxyOffV1GatewayOffV1PathGetResponse5), + jsonSerializerContext) as global::AI21.ProxyOffV1GatewayOffV1PathGetResponse5; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::AI21.ProxyOffV1GatewayOffV1PathGetResponse5? FromJson( + string json) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::AI21.ProxyOffV1GatewayOffV1PathGetResponse5? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::AI21.ProxyOffV1GatewayOffV1PathGetResponse5), + jsonSerializerContext).ConfigureAwait(false)) as global::AI21.ProxyOffV1GatewayOffV1PathGetResponse5; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/AI21/Generated/AI21.Models.ProxyOffV1GatewayOffV1PathGetResponse5.g.cs b/src/libs/AI21/Generated/AI21.Models.ProxyOffV1GatewayOffV1PathGetResponse5.g.cs new file mode 100644 index 00000000..7e8cb476 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.ProxyOffV1GatewayOffV1PathGetResponse5.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace AI21 +{ + /// + /// + /// + public sealed partial class ProxyOffV1GatewayOffV1PathGetResponse5 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.ProxyOffV1GatewayOffV1PathGetResponse6.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.ProxyOffV1GatewayOffV1PathGetResponse6.Json.g.cs new file mode 100644 index 00000000..c4efa3d8 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.ProxyOffV1GatewayOffV1PathGetResponse6.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace AI21 +{ + public sealed partial class ProxyOffV1GatewayOffV1PathGetResponse6 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::AI21.ProxyOffV1GatewayOffV1PathGetResponse6? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::AI21.ProxyOffV1GatewayOffV1PathGetResponse6), + jsonSerializerContext) as global::AI21.ProxyOffV1GatewayOffV1PathGetResponse6; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::AI21.ProxyOffV1GatewayOffV1PathGetResponse6? FromJson( + string json) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::AI21.ProxyOffV1GatewayOffV1PathGetResponse6? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::AI21.ProxyOffV1GatewayOffV1PathGetResponse6), + jsonSerializerContext).ConfigureAwait(false)) as global::AI21.ProxyOffV1GatewayOffV1PathGetResponse6; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/AI21/Generated/AI21.Models.ProxyOffV1GatewayOffV1PathGetResponse6.g.cs b/src/libs/AI21/Generated/AI21.Models.ProxyOffV1GatewayOffV1PathGetResponse6.g.cs new file mode 100644 index 00000000..3d184155 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.ProxyOffV1GatewayOffV1PathGetResponse6.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace AI21 +{ + /// + /// + /// + public sealed partial class ProxyOffV1GatewayOffV1PathGetResponse6 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.ProxyOffV1TokenwiseOffV1PathGetResponse.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.ProxyOffV1TokenwiseOffV1PathGetResponse.Json.g.cs new file mode 100644 index 00000000..b22794e9 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.ProxyOffV1TokenwiseOffV1PathGetResponse.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace AI21 +{ + public sealed partial class ProxyOffV1TokenwiseOffV1PathGetResponse + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::AI21.ProxyOffV1TokenwiseOffV1PathGetResponse? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::AI21.ProxyOffV1TokenwiseOffV1PathGetResponse), + jsonSerializerContext) as global::AI21.ProxyOffV1TokenwiseOffV1PathGetResponse; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::AI21.ProxyOffV1TokenwiseOffV1PathGetResponse? FromJson( + string json) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::AI21.ProxyOffV1TokenwiseOffV1PathGetResponse? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::AI21.ProxyOffV1TokenwiseOffV1PathGetResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::AI21.ProxyOffV1TokenwiseOffV1PathGetResponse; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/AI21/Generated/AI21.Models.ProxyOffV1TokenwiseOffV1PathGetResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.ProxyOffV1TokenwiseOffV1PathGetResponse.g.cs new file mode 100644 index 00000000..f0b77115 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.ProxyOffV1TokenwiseOffV1PathGetResponse.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace AI21 +{ + /// + /// + /// + public sealed partial class ProxyOffV1TokenwiseOffV1PathGetResponse + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.ProxyOffV1TokenwiseOffV1PathGetResponse2.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.ProxyOffV1TokenwiseOffV1PathGetResponse2.Json.g.cs new file mode 100644 index 00000000..22d5bdd2 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.ProxyOffV1TokenwiseOffV1PathGetResponse2.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace AI21 +{ + public sealed partial class ProxyOffV1TokenwiseOffV1PathGetResponse2 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::AI21.ProxyOffV1TokenwiseOffV1PathGetResponse2? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::AI21.ProxyOffV1TokenwiseOffV1PathGetResponse2), + jsonSerializerContext) as global::AI21.ProxyOffV1TokenwiseOffV1PathGetResponse2; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::AI21.ProxyOffV1TokenwiseOffV1PathGetResponse2? FromJson( + string json) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::AI21.ProxyOffV1TokenwiseOffV1PathGetResponse2? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::AI21.ProxyOffV1TokenwiseOffV1PathGetResponse2), + jsonSerializerContext).ConfigureAwait(false)) as global::AI21.ProxyOffV1TokenwiseOffV1PathGetResponse2; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/AI21/Generated/AI21.Models.ProxyOffV1TokenwiseOffV1PathGetResponse2.g.cs b/src/libs/AI21/Generated/AI21.Models.ProxyOffV1TokenwiseOffV1PathGetResponse2.g.cs new file mode 100644 index 00000000..8cdc2723 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.ProxyOffV1TokenwiseOffV1PathGetResponse2.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace AI21 +{ + /// + /// + /// + public sealed partial class ProxyOffV1TokenwiseOffV1PathGetResponse2 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.ProxyOffV1TokenwiseOffV1PathGetResponse3.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.ProxyOffV1TokenwiseOffV1PathGetResponse3.Json.g.cs new file mode 100644 index 00000000..7ac4a5d0 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.ProxyOffV1TokenwiseOffV1PathGetResponse3.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace AI21 +{ + public sealed partial class ProxyOffV1TokenwiseOffV1PathGetResponse3 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::AI21.ProxyOffV1TokenwiseOffV1PathGetResponse3? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::AI21.ProxyOffV1TokenwiseOffV1PathGetResponse3), + jsonSerializerContext) as global::AI21.ProxyOffV1TokenwiseOffV1PathGetResponse3; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::AI21.ProxyOffV1TokenwiseOffV1PathGetResponse3? FromJson( + string json) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::AI21.ProxyOffV1TokenwiseOffV1PathGetResponse3? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::AI21.ProxyOffV1TokenwiseOffV1PathGetResponse3), + jsonSerializerContext).ConfigureAwait(false)) as global::AI21.ProxyOffV1TokenwiseOffV1PathGetResponse3; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/AI21/Generated/AI21.Models.ProxyOffV1TokenwiseOffV1PathGetResponse3.g.cs b/src/libs/AI21/Generated/AI21.Models.ProxyOffV1TokenwiseOffV1PathGetResponse3.g.cs new file mode 100644 index 00000000..168e2692 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.ProxyOffV1TokenwiseOffV1PathGetResponse3.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace AI21 +{ + /// + /// + /// + public sealed partial class ProxyOffV1TokenwiseOffV1PathGetResponse3 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.ProxyOffV1TokenwiseOffV1PathGetResponse4.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.ProxyOffV1TokenwiseOffV1PathGetResponse4.Json.g.cs new file mode 100644 index 00000000..83fe5c62 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.ProxyOffV1TokenwiseOffV1PathGetResponse4.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace AI21 +{ + public sealed partial class ProxyOffV1TokenwiseOffV1PathGetResponse4 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::AI21.ProxyOffV1TokenwiseOffV1PathGetResponse4? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::AI21.ProxyOffV1TokenwiseOffV1PathGetResponse4), + jsonSerializerContext) as global::AI21.ProxyOffV1TokenwiseOffV1PathGetResponse4; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::AI21.ProxyOffV1TokenwiseOffV1PathGetResponse4? FromJson( + string json) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::AI21.ProxyOffV1TokenwiseOffV1PathGetResponse4? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::AI21.ProxyOffV1TokenwiseOffV1PathGetResponse4), + jsonSerializerContext).ConfigureAwait(false)) as global::AI21.ProxyOffV1TokenwiseOffV1PathGetResponse4; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/AI21/Generated/AI21.Models.ProxyOffV1TokenwiseOffV1PathGetResponse4.g.cs b/src/libs/AI21/Generated/AI21.Models.ProxyOffV1TokenwiseOffV1PathGetResponse4.g.cs new file mode 100644 index 00000000..0755b001 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.ProxyOffV1TokenwiseOffV1PathGetResponse4.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace AI21 +{ + /// + /// + /// + public sealed partial class ProxyOffV1TokenwiseOffV1PathGetResponse4 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.ProxyOffV1TokenwiseOffV1PathGetResponse5.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.ProxyOffV1TokenwiseOffV1PathGetResponse5.Json.g.cs new file mode 100644 index 00000000..01296e15 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.ProxyOffV1TokenwiseOffV1PathGetResponse5.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace AI21 +{ + public sealed partial class ProxyOffV1TokenwiseOffV1PathGetResponse5 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::AI21.ProxyOffV1TokenwiseOffV1PathGetResponse5? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::AI21.ProxyOffV1TokenwiseOffV1PathGetResponse5), + jsonSerializerContext) as global::AI21.ProxyOffV1TokenwiseOffV1PathGetResponse5; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::AI21.ProxyOffV1TokenwiseOffV1PathGetResponse5? FromJson( + string json) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::AI21.ProxyOffV1TokenwiseOffV1PathGetResponse5? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::AI21.ProxyOffV1TokenwiseOffV1PathGetResponse5), + jsonSerializerContext).ConfigureAwait(false)) as global::AI21.ProxyOffV1TokenwiseOffV1PathGetResponse5; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/AI21/Generated/AI21.Models.ProxyOffV1TokenwiseOffV1PathGetResponse5.g.cs b/src/libs/AI21/Generated/AI21.Models.ProxyOffV1TokenwiseOffV1PathGetResponse5.g.cs new file mode 100644 index 00000000..da2aea5f --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.ProxyOffV1TokenwiseOffV1PathGetResponse5.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace AI21 +{ + /// + /// + /// + public sealed partial class ProxyOffV1TokenwiseOffV1PathGetResponse5 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.ProxyOffV1TokenwiseOffV1PathGetResponse6.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.ProxyOffV1TokenwiseOffV1PathGetResponse6.Json.g.cs new file mode 100644 index 00000000..4c2ed70a --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.ProxyOffV1TokenwiseOffV1PathGetResponse6.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace AI21 +{ + public sealed partial class ProxyOffV1TokenwiseOffV1PathGetResponse6 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::AI21.ProxyOffV1TokenwiseOffV1PathGetResponse6? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::AI21.ProxyOffV1TokenwiseOffV1PathGetResponse6), + jsonSerializerContext) as global::AI21.ProxyOffV1TokenwiseOffV1PathGetResponse6; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::AI21.ProxyOffV1TokenwiseOffV1PathGetResponse6? FromJson( + string json) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::AI21.ProxyOffV1TokenwiseOffV1PathGetResponse6? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::AI21.ProxyOffV1TokenwiseOffV1PathGetResponse6), + jsonSerializerContext).ConfigureAwait(false)) as global::AI21.ProxyOffV1TokenwiseOffV1PathGetResponse6; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/AI21/Generated/AI21.Models.ProxyOffV1TokenwiseOffV1PathGetResponse6.g.cs b/src/libs/AI21/Generated/AI21.Models.ProxyOffV1TokenwiseOffV1PathGetResponse6.g.cs new file mode 100644 index 00000000..e57b17a6 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.ProxyOffV1TokenwiseOffV1PathGetResponse6.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace AI21 +{ + /// + /// + /// + public sealed partial class ProxyOffV1TokenwiseOffV1PathGetResponse6 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.ProxyOnV1GatewayOnV1PathGetResponse.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.ProxyOnV1GatewayOnV1PathGetResponse.Json.g.cs new file mode 100644 index 00000000..e73ee6e5 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.ProxyOnV1GatewayOnV1PathGetResponse.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace AI21 +{ + public sealed partial class ProxyOnV1GatewayOnV1PathGetResponse + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::AI21.ProxyOnV1GatewayOnV1PathGetResponse? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::AI21.ProxyOnV1GatewayOnV1PathGetResponse), + jsonSerializerContext) as global::AI21.ProxyOnV1GatewayOnV1PathGetResponse; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::AI21.ProxyOnV1GatewayOnV1PathGetResponse? FromJson( + string json) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::AI21.ProxyOnV1GatewayOnV1PathGetResponse? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::AI21.ProxyOnV1GatewayOnV1PathGetResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::AI21.ProxyOnV1GatewayOnV1PathGetResponse; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/AI21/Generated/AI21.Models.ProxyOnV1GatewayOnV1PathGetResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.ProxyOnV1GatewayOnV1PathGetResponse.g.cs new file mode 100644 index 00000000..b553b7de --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.ProxyOnV1GatewayOnV1PathGetResponse.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace AI21 +{ + /// + /// + /// + public sealed partial class ProxyOnV1GatewayOnV1PathGetResponse + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.ProxyOnV1GatewayOnV1PathGetResponse2.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.ProxyOnV1GatewayOnV1PathGetResponse2.Json.g.cs new file mode 100644 index 00000000..fdb20b7d --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.ProxyOnV1GatewayOnV1PathGetResponse2.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace AI21 +{ + public sealed partial class ProxyOnV1GatewayOnV1PathGetResponse2 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::AI21.ProxyOnV1GatewayOnV1PathGetResponse2? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::AI21.ProxyOnV1GatewayOnV1PathGetResponse2), + jsonSerializerContext) as global::AI21.ProxyOnV1GatewayOnV1PathGetResponse2; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::AI21.ProxyOnV1GatewayOnV1PathGetResponse2? FromJson( + string json) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::AI21.ProxyOnV1GatewayOnV1PathGetResponse2? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::AI21.ProxyOnV1GatewayOnV1PathGetResponse2), + jsonSerializerContext).ConfigureAwait(false)) as global::AI21.ProxyOnV1GatewayOnV1PathGetResponse2; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/AI21/Generated/AI21.Models.ProxyOnV1GatewayOnV1PathGetResponse2.g.cs b/src/libs/AI21/Generated/AI21.Models.ProxyOnV1GatewayOnV1PathGetResponse2.g.cs new file mode 100644 index 00000000..a35a202f --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.ProxyOnV1GatewayOnV1PathGetResponse2.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace AI21 +{ + /// + /// + /// + public sealed partial class ProxyOnV1GatewayOnV1PathGetResponse2 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.ProxyOnV1GatewayOnV1PathGetResponse3.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.ProxyOnV1GatewayOnV1PathGetResponse3.Json.g.cs new file mode 100644 index 00000000..1cce99e3 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.ProxyOnV1GatewayOnV1PathGetResponse3.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace AI21 +{ + public sealed partial class ProxyOnV1GatewayOnV1PathGetResponse3 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::AI21.ProxyOnV1GatewayOnV1PathGetResponse3? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::AI21.ProxyOnV1GatewayOnV1PathGetResponse3), + jsonSerializerContext) as global::AI21.ProxyOnV1GatewayOnV1PathGetResponse3; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::AI21.ProxyOnV1GatewayOnV1PathGetResponse3? FromJson( + string json) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::AI21.ProxyOnV1GatewayOnV1PathGetResponse3? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::AI21.ProxyOnV1GatewayOnV1PathGetResponse3), + jsonSerializerContext).ConfigureAwait(false)) as global::AI21.ProxyOnV1GatewayOnV1PathGetResponse3; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/AI21/Generated/AI21.Models.ProxyOnV1GatewayOnV1PathGetResponse3.g.cs b/src/libs/AI21/Generated/AI21.Models.ProxyOnV1GatewayOnV1PathGetResponse3.g.cs new file mode 100644 index 00000000..6a91b527 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.ProxyOnV1GatewayOnV1PathGetResponse3.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace AI21 +{ + /// + /// + /// + public sealed partial class ProxyOnV1GatewayOnV1PathGetResponse3 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.ProxyOnV1GatewayOnV1PathGetResponse4.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.ProxyOnV1GatewayOnV1PathGetResponse4.Json.g.cs new file mode 100644 index 00000000..ffab7e28 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.ProxyOnV1GatewayOnV1PathGetResponse4.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace AI21 +{ + public sealed partial class ProxyOnV1GatewayOnV1PathGetResponse4 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::AI21.ProxyOnV1GatewayOnV1PathGetResponse4? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::AI21.ProxyOnV1GatewayOnV1PathGetResponse4), + jsonSerializerContext) as global::AI21.ProxyOnV1GatewayOnV1PathGetResponse4; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::AI21.ProxyOnV1GatewayOnV1PathGetResponse4? FromJson( + string json) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::AI21.ProxyOnV1GatewayOnV1PathGetResponse4? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::AI21.ProxyOnV1GatewayOnV1PathGetResponse4), + jsonSerializerContext).ConfigureAwait(false)) as global::AI21.ProxyOnV1GatewayOnV1PathGetResponse4; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/AI21/Generated/AI21.Models.ProxyOnV1GatewayOnV1PathGetResponse4.g.cs b/src/libs/AI21/Generated/AI21.Models.ProxyOnV1GatewayOnV1PathGetResponse4.g.cs new file mode 100644 index 00000000..d1e8a49b --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.ProxyOnV1GatewayOnV1PathGetResponse4.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace AI21 +{ + /// + /// + /// + public sealed partial class ProxyOnV1GatewayOnV1PathGetResponse4 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.ProxyOnV1GatewayOnV1PathGetResponse5.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.ProxyOnV1GatewayOnV1PathGetResponse5.Json.g.cs new file mode 100644 index 00000000..dbefa4b1 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.ProxyOnV1GatewayOnV1PathGetResponse5.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace AI21 +{ + public sealed partial class ProxyOnV1GatewayOnV1PathGetResponse5 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::AI21.ProxyOnV1GatewayOnV1PathGetResponse5? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::AI21.ProxyOnV1GatewayOnV1PathGetResponse5), + jsonSerializerContext) as global::AI21.ProxyOnV1GatewayOnV1PathGetResponse5; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::AI21.ProxyOnV1GatewayOnV1PathGetResponse5? FromJson( + string json) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::AI21.ProxyOnV1GatewayOnV1PathGetResponse5? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::AI21.ProxyOnV1GatewayOnV1PathGetResponse5), + jsonSerializerContext).ConfigureAwait(false)) as global::AI21.ProxyOnV1GatewayOnV1PathGetResponse5; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/AI21/Generated/AI21.Models.ProxyOnV1GatewayOnV1PathGetResponse5.g.cs b/src/libs/AI21/Generated/AI21.Models.ProxyOnV1GatewayOnV1PathGetResponse5.g.cs new file mode 100644 index 00000000..e14dc7d7 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.ProxyOnV1GatewayOnV1PathGetResponse5.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace AI21 +{ + /// + /// + /// + public sealed partial class ProxyOnV1GatewayOnV1PathGetResponse5 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.ProxyOnV1GatewayOnV1PathGetResponse6.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.ProxyOnV1GatewayOnV1PathGetResponse6.Json.g.cs new file mode 100644 index 00000000..9460b468 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.ProxyOnV1GatewayOnV1PathGetResponse6.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace AI21 +{ + public sealed partial class ProxyOnV1GatewayOnV1PathGetResponse6 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::AI21.ProxyOnV1GatewayOnV1PathGetResponse6? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::AI21.ProxyOnV1GatewayOnV1PathGetResponse6), + jsonSerializerContext) as global::AI21.ProxyOnV1GatewayOnV1PathGetResponse6; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::AI21.ProxyOnV1GatewayOnV1PathGetResponse6? FromJson( + string json) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::AI21.ProxyOnV1GatewayOnV1PathGetResponse6? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::AI21.ProxyOnV1GatewayOnV1PathGetResponse6), + jsonSerializerContext).ConfigureAwait(false)) as global::AI21.ProxyOnV1GatewayOnV1PathGetResponse6; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/AI21/Generated/AI21.Models.ProxyOnV1GatewayOnV1PathGetResponse6.g.cs b/src/libs/AI21/Generated/AI21.Models.ProxyOnV1GatewayOnV1PathGetResponse6.g.cs new file mode 100644 index 00000000..f04ecf7a --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.ProxyOnV1GatewayOnV1PathGetResponse6.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace AI21 +{ + /// + /// + /// + public sealed partial class ProxyOnV1GatewayOnV1PathGetResponse6 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.ProxyOnV1TokenwiseOnV1PathGetResponse.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.ProxyOnV1TokenwiseOnV1PathGetResponse.Json.g.cs new file mode 100644 index 00000000..b9725acc --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.ProxyOnV1TokenwiseOnV1PathGetResponse.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace AI21 +{ + public sealed partial class ProxyOnV1TokenwiseOnV1PathGetResponse + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::AI21.ProxyOnV1TokenwiseOnV1PathGetResponse? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::AI21.ProxyOnV1TokenwiseOnV1PathGetResponse), + jsonSerializerContext) as global::AI21.ProxyOnV1TokenwiseOnV1PathGetResponse; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::AI21.ProxyOnV1TokenwiseOnV1PathGetResponse? FromJson( + string json) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::AI21.ProxyOnV1TokenwiseOnV1PathGetResponse? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::AI21.ProxyOnV1TokenwiseOnV1PathGetResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::AI21.ProxyOnV1TokenwiseOnV1PathGetResponse; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/AI21/Generated/AI21.Models.ProxyOnV1TokenwiseOnV1PathGetResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.ProxyOnV1TokenwiseOnV1PathGetResponse.g.cs new file mode 100644 index 00000000..2a49d6cd --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.ProxyOnV1TokenwiseOnV1PathGetResponse.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace AI21 +{ + /// + /// + /// + public sealed partial class ProxyOnV1TokenwiseOnV1PathGetResponse + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.ProxyOnV1TokenwiseOnV1PathGetResponse2.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.ProxyOnV1TokenwiseOnV1PathGetResponse2.Json.g.cs new file mode 100644 index 00000000..aa1286e3 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.ProxyOnV1TokenwiseOnV1PathGetResponse2.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace AI21 +{ + public sealed partial class ProxyOnV1TokenwiseOnV1PathGetResponse2 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::AI21.ProxyOnV1TokenwiseOnV1PathGetResponse2? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::AI21.ProxyOnV1TokenwiseOnV1PathGetResponse2), + jsonSerializerContext) as global::AI21.ProxyOnV1TokenwiseOnV1PathGetResponse2; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::AI21.ProxyOnV1TokenwiseOnV1PathGetResponse2? FromJson( + string json) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::AI21.ProxyOnV1TokenwiseOnV1PathGetResponse2? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::AI21.ProxyOnV1TokenwiseOnV1PathGetResponse2), + jsonSerializerContext).ConfigureAwait(false)) as global::AI21.ProxyOnV1TokenwiseOnV1PathGetResponse2; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/AI21/Generated/AI21.Models.ProxyOnV1TokenwiseOnV1PathGetResponse2.g.cs b/src/libs/AI21/Generated/AI21.Models.ProxyOnV1TokenwiseOnV1PathGetResponse2.g.cs new file mode 100644 index 00000000..4b3a86f2 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.ProxyOnV1TokenwiseOnV1PathGetResponse2.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace AI21 +{ + /// + /// + /// + public sealed partial class ProxyOnV1TokenwiseOnV1PathGetResponse2 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.ProxyOnV1TokenwiseOnV1PathGetResponse3.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.ProxyOnV1TokenwiseOnV1PathGetResponse3.Json.g.cs new file mode 100644 index 00000000..436292d5 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.ProxyOnV1TokenwiseOnV1PathGetResponse3.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace AI21 +{ + public sealed partial class ProxyOnV1TokenwiseOnV1PathGetResponse3 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::AI21.ProxyOnV1TokenwiseOnV1PathGetResponse3? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::AI21.ProxyOnV1TokenwiseOnV1PathGetResponse3), + jsonSerializerContext) as global::AI21.ProxyOnV1TokenwiseOnV1PathGetResponse3; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::AI21.ProxyOnV1TokenwiseOnV1PathGetResponse3? FromJson( + string json) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::AI21.ProxyOnV1TokenwiseOnV1PathGetResponse3? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::AI21.ProxyOnV1TokenwiseOnV1PathGetResponse3), + jsonSerializerContext).ConfigureAwait(false)) as global::AI21.ProxyOnV1TokenwiseOnV1PathGetResponse3; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/AI21/Generated/AI21.Models.ProxyOnV1TokenwiseOnV1PathGetResponse3.g.cs b/src/libs/AI21/Generated/AI21.Models.ProxyOnV1TokenwiseOnV1PathGetResponse3.g.cs new file mode 100644 index 00000000..698b9ca6 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.ProxyOnV1TokenwiseOnV1PathGetResponse3.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace AI21 +{ + /// + /// + /// + public sealed partial class ProxyOnV1TokenwiseOnV1PathGetResponse3 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.ProxyOnV1TokenwiseOnV1PathGetResponse4.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.ProxyOnV1TokenwiseOnV1PathGetResponse4.Json.g.cs new file mode 100644 index 00000000..a9e2543e --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.ProxyOnV1TokenwiseOnV1PathGetResponse4.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace AI21 +{ + public sealed partial class ProxyOnV1TokenwiseOnV1PathGetResponse4 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::AI21.ProxyOnV1TokenwiseOnV1PathGetResponse4? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::AI21.ProxyOnV1TokenwiseOnV1PathGetResponse4), + jsonSerializerContext) as global::AI21.ProxyOnV1TokenwiseOnV1PathGetResponse4; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::AI21.ProxyOnV1TokenwiseOnV1PathGetResponse4? FromJson( + string json) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::AI21.ProxyOnV1TokenwiseOnV1PathGetResponse4? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::AI21.ProxyOnV1TokenwiseOnV1PathGetResponse4), + jsonSerializerContext).ConfigureAwait(false)) as global::AI21.ProxyOnV1TokenwiseOnV1PathGetResponse4; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/AI21/Generated/AI21.Models.ProxyOnV1TokenwiseOnV1PathGetResponse4.g.cs b/src/libs/AI21/Generated/AI21.Models.ProxyOnV1TokenwiseOnV1PathGetResponse4.g.cs new file mode 100644 index 00000000..da2309ac --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.ProxyOnV1TokenwiseOnV1PathGetResponse4.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace AI21 +{ + /// + /// + /// + public sealed partial class ProxyOnV1TokenwiseOnV1PathGetResponse4 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.ProxyOnV1TokenwiseOnV1PathGetResponse5.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.ProxyOnV1TokenwiseOnV1PathGetResponse5.Json.g.cs new file mode 100644 index 00000000..06859c48 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.ProxyOnV1TokenwiseOnV1PathGetResponse5.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace AI21 +{ + public sealed partial class ProxyOnV1TokenwiseOnV1PathGetResponse5 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::AI21.ProxyOnV1TokenwiseOnV1PathGetResponse5? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::AI21.ProxyOnV1TokenwiseOnV1PathGetResponse5), + jsonSerializerContext) as global::AI21.ProxyOnV1TokenwiseOnV1PathGetResponse5; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::AI21.ProxyOnV1TokenwiseOnV1PathGetResponse5? FromJson( + string json) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::AI21.ProxyOnV1TokenwiseOnV1PathGetResponse5? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::AI21.ProxyOnV1TokenwiseOnV1PathGetResponse5), + jsonSerializerContext).ConfigureAwait(false)) as global::AI21.ProxyOnV1TokenwiseOnV1PathGetResponse5; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/AI21/Generated/AI21.Models.ProxyOnV1TokenwiseOnV1PathGetResponse5.g.cs b/src/libs/AI21/Generated/AI21.Models.ProxyOnV1TokenwiseOnV1PathGetResponse5.g.cs new file mode 100644 index 00000000..a59a5f83 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.ProxyOnV1TokenwiseOnV1PathGetResponse5.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace AI21 +{ + /// + /// + /// + public sealed partial class ProxyOnV1TokenwiseOnV1PathGetResponse5 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.ProxyOnV1TokenwiseOnV1PathGetResponse6.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.ProxyOnV1TokenwiseOnV1PathGetResponse6.Json.g.cs new file mode 100644 index 00000000..4c51c962 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.ProxyOnV1TokenwiseOnV1PathGetResponse6.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace AI21 +{ + public sealed partial class ProxyOnV1TokenwiseOnV1PathGetResponse6 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::AI21.ProxyOnV1TokenwiseOnV1PathGetResponse6? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::AI21.ProxyOnV1TokenwiseOnV1PathGetResponse6), + jsonSerializerContext) as global::AI21.ProxyOnV1TokenwiseOnV1PathGetResponse6; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::AI21.ProxyOnV1TokenwiseOnV1PathGetResponse6? FromJson( + string json) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::AI21.ProxyOnV1TokenwiseOnV1PathGetResponse6? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::AI21.ProxyOnV1TokenwiseOnV1PathGetResponse6), + jsonSerializerContext).ConfigureAwait(false)) as global::AI21.ProxyOnV1TokenwiseOnV1PathGetResponse6; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/AI21/Generated/AI21.Models.ProxyOnV1TokenwiseOnV1PathGetResponse6.g.cs b/src/libs/AI21/Generated/AI21.Models.ProxyOnV1TokenwiseOnV1PathGetResponse6.g.cs new file mode 100644 index 00000000..d089c9c8 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.ProxyOnV1TokenwiseOnV1PathGetResponse6.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace AI21 +{ + /// + /// + /// + public sealed partial class ProxyOnV1TokenwiseOnV1PathGetResponse6 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.ProxyV1GatewayV1PathGetResponse.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.ProxyV1GatewayV1PathGetResponse.Json.g.cs new file mode 100644 index 00000000..b08718c7 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.ProxyV1GatewayV1PathGetResponse.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace AI21 +{ + public sealed partial class ProxyV1GatewayV1PathGetResponse + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::AI21.ProxyV1GatewayV1PathGetResponse? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::AI21.ProxyV1GatewayV1PathGetResponse), + jsonSerializerContext) as global::AI21.ProxyV1GatewayV1PathGetResponse; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::AI21.ProxyV1GatewayV1PathGetResponse? FromJson( + string json) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::AI21.ProxyV1GatewayV1PathGetResponse? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::AI21.ProxyV1GatewayV1PathGetResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::AI21.ProxyV1GatewayV1PathGetResponse; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/AI21/Generated/AI21.Models.ProxyV1GatewayV1PathGetResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.ProxyV1GatewayV1PathGetResponse.g.cs new file mode 100644 index 00000000..fb5e1380 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.ProxyV1GatewayV1PathGetResponse.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace AI21 +{ + /// + /// + /// + public sealed partial class ProxyV1GatewayV1PathGetResponse + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.ProxyV1GatewayV1PathGetResponse2.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.ProxyV1GatewayV1PathGetResponse2.Json.g.cs new file mode 100644 index 00000000..2aaab5ec --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.ProxyV1GatewayV1PathGetResponse2.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace AI21 +{ + public sealed partial class ProxyV1GatewayV1PathGetResponse2 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::AI21.ProxyV1GatewayV1PathGetResponse2? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::AI21.ProxyV1GatewayV1PathGetResponse2), + jsonSerializerContext) as global::AI21.ProxyV1GatewayV1PathGetResponse2; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::AI21.ProxyV1GatewayV1PathGetResponse2? FromJson( + string json) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::AI21.ProxyV1GatewayV1PathGetResponse2? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::AI21.ProxyV1GatewayV1PathGetResponse2), + jsonSerializerContext).ConfigureAwait(false)) as global::AI21.ProxyV1GatewayV1PathGetResponse2; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/AI21/Generated/AI21.Models.ProxyV1GatewayV1PathGetResponse2.g.cs b/src/libs/AI21/Generated/AI21.Models.ProxyV1GatewayV1PathGetResponse2.g.cs new file mode 100644 index 00000000..168e4fc1 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.ProxyV1GatewayV1PathGetResponse2.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace AI21 +{ + /// + /// + /// + public sealed partial class ProxyV1GatewayV1PathGetResponse2 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.ProxyV1GatewayV1PathGetResponse3.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.ProxyV1GatewayV1PathGetResponse3.Json.g.cs new file mode 100644 index 00000000..3e55de1d --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.ProxyV1GatewayV1PathGetResponse3.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace AI21 +{ + public sealed partial class ProxyV1GatewayV1PathGetResponse3 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::AI21.ProxyV1GatewayV1PathGetResponse3? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::AI21.ProxyV1GatewayV1PathGetResponse3), + jsonSerializerContext) as global::AI21.ProxyV1GatewayV1PathGetResponse3; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::AI21.ProxyV1GatewayV1PathGetResponse3? FromJson( + string json) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::AI21.ProxyV1GatewayV1PathGetResponse3? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::AI21.ProxyV1GatewayV1PathGetResponse3), + jsonSerializerContext).ConfigureAwait(false)) as global::AI21.ProxyV1GatewayV1PathGetResponse3; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/AI21/Generated/AI21.Models.ProxyV1GatewayV1PathGetResponse3.g.cs b/src/libs/AI21/Generated/AI21.Models.ProxyV1GatewayV1PathGetResponse3.g.cs new file mode 100644 index 00000000..35f606ba --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.ProxyV1GatewayV1PathGetResponse3.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace AI21 +{ + /// + /// + /// + public sealed partial class ProxyV1GatewayV1PathGetResponse3 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.ProxyV1GatewayV1PathGetResponse4.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.ProxyV1GatewayV1PathGetResponse4.Json.g.cs new file mode 100644 index 00000000..f6003497 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.ProxyV1GatewayV1PathGetResponse4.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace AI21 +{ + public sealed partial class ProxyV1GatewayV1PathGetResponse4 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::AI21.ProxyV1GatewayV1PathGetResponse4? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::AI21.ProxyV1GatewayV1PathGetResponse4), + jsonSerializerContext) as global::AI21.ProxyV1GatewayV1PathGetResponse4; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::AI21.ProxyV1GatewayV1PathGetResponse4? FromJson( + string json) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::AI21.ProxyV1GatewayV1PathGetResponse4? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::AI21.ProxyV1GatewayV1PathGetResponse4), + jsonSerializerContext).ConfigureAwait(false)) as global::AI21.ProxyV1GatewayV1PathGetResponse4; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/AI21/Generated/AI21.Models.ProxyV1GatewayV1PathGetResponse4.g.cs b/src/libs/AI21/Generated/AI21.Models.ProxyV1GatewayV1PathGetResponse4.g.cs new file mode 100644 index 00000000..6babd9c1 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.ProxyV1GatewayV1PathGetResponse4.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace AI21 +{ + /// + /// + /// + public sealed partial class ProxyV1GatewayV1PathGetResponse4 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.ProxyV1GatewayV1PathGetResponse5.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.ProxyV1GatewayV1PathGetResponse5.Json.g.cs new file mode 100644 index 00000000..9160ab09 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.ProxyV1GatewayV1PathGetResponse5.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace AI21 +{ + public sealed partial class ProxyV1GatewayV1PathGetResponse5 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::AI21.ProxyV1GatewayV1PathGetResponse5? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::AI21.ProxyV1GatewayV1PathGetResponse5), + jsonSerializerContext) as global::AI21.ProxyV1GatewayV1PathGetResponse5; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::AI21.ProxyV1GatewayV1PathGetResponse5? FromJson( + string json) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::AI21.ProxyV1GatewayV1PathGetResponse5? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::AI21.ProxyV1GatewayV1PathGetResponse5), + jsonSerializerContext).ConfigureAwait(false)) as global::AI21.ProxyV1GatewayV1PathGetResponse5; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/AI21/Generated/AI21.Models.ProxyV1GatewayV1PathGetResponse5.g.cs b/src/libs/AI21/Generated/AI21.Models.ProxyV1GatewayV1PathGetResponse5.g.cs new file mode 100644 index 00000000..2812702a --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.ProxyV1GatewayV1PathGetResponse5.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace AI21 +{ + /// + /// + /// + public sealed partial class ProxyV1GatewayV1PathGetResponse5 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.ProxyV1GatewayV1PathGetResponse6.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.ProxyV1GatewayV1PathGetResponse6.Json.g.cs new file mode 100644 index 00000000..7667d0e5 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.ProxyV1GatewayV1PathGetResponse6.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace AI21 +{ + public sealed partial class ProxyV1GatewayV1PathGetResponse6 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::AI21.ProxyV1GatewayV1PathGetResponse6? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::AI21.ProxyV1GatewayV1PathGetResponse6), + jsonSerializerContext) as global::AI21.ProxyV1GatewayV1PathGetResponse6; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::AI21.ProxyV1GatewayV1PathGetResponse6? FromJson( + string json) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::AI21.ProxyV1GatewayV1PathGetResponse6? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::AI21.ProxyV1GatewayV1PathGetResponse6), + jsonSerializerContext).ConfigureAwait(false)) as global::AI21.ProxyV1GatewayV1PathGetResponse6; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/AI21/Generated/AI21.Models.ProxyV1GatewayV1PathGetResponse6.g.cs b/src/libs/AI21/Generated/AI21.Models.ProxyV1GatewayV1PathGetResponse6.g.cs new file mode 100644 index 00000000..51e9a9a6 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.ProxyV1GatewayV1PathGetResponse6.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace AI21 +{ + /// + /// + /// + public sealed partial class ProxyV1GatewayV1PathGetResponse6 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.ProxyV1TokenwiseV1PathGetResponse.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.ProxyV1TokenwiseV1PathGetResponse.Json.g.cs new file mode 100644 index 00000000..011ed17a --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.ProxyV1TokenwiseV1PathGetResponse.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace AI21 +{ + public sealed partial class ProxyV1TokenwiseV1PathGetResponse + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::AI21.ProxyV1TokenwiseV1PathGetResponse? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::AI21.ProxyV1TokenwiseV1PathGetResponse), + jsonSerializerContext) as global::AI21.ProxyV1TokenwiseV1PathGetResponse; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::AI21.ProxyV1TokenwiseV1PathGetResponse? FromJson( + string json) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::AI21.ProxyV1TokenwiseV1PathGetResponse? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::AI21.ProxyV1TokenwiseV1PathGetResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::AI21.ProxyV1TokenwiseV1PathGetResponse; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/AI21/Generated/AI21.Models.ProxyV1TokenwiseV1PathGetResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.ProxyV1TokenwiseV1PathGetResponse.g.cs new file mode 100644 index 00000000..2a7ddbff --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.ProxyV1TokenwiseV1PathGetResponse.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace AI21 +{ + /// + /// + /// + public sealed partial class ProxyV1TokenwiseV1PathGetResponse + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.ProxyV1TokenwiseV1PathGetResponse2.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.ProxyV1TokenwiseV1PathGetResponse2.Json.g.cs new file mode 100644 index 00000000..dfbc0b14 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.ProxyV1TokenwiseV1PathGetResponse2.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace AI21 +{ + public sealed partial class ProxyV1TokenwiseV1PathGetResponse2 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::AI21.ProxyV1TokenwiseV1PathGetResponse2? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::AI21.ProxyV1TokenwiseV1PathGetResponse2), + jsonSerializerContext) as global::AI21.ProxyV1TokenwiseV1PathGetResponse2; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::AI21.ProxyV1TokenwiseV1PathGetResponse2? FromJson( + string json) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::AI21.ProxyV1TokenwiseV1PathGetResponse2? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::AI21.ProxyV1TokenwiseV1PathGetResponse2), + jsonSerializerContext).ConfigureAwait(false)) as global::AI21.ProxyV1TokenwiseV1PathGetResponse2; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/AI21/Generated/AI21.Models.ProxyV1TokenwiseV1PathGetResponse2.g.cs b/src/libs/AI21/Generated/AI21.Models.ProxyV1TokenwiseV1PathGetResponse2.g.cs new file mode 100644 index 00000000..29fbb5ae --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.ProxyV1TokenwiseV1PathGetResponse2.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace AI21 +{ + /// + /// + /// + public sealed partial class ProxyV1TokenwiseV1PathGetResponse2 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.ProxyV1TokenwiseV1PathGetResponse3.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.ProxyV1TokenwiseV1PathGetResponse3.Json.g.cs new file mode 100644 index 00000000..088a5110 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.ProxyV1TokenwiseV1PathGetResponse3.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace AI21 +{ + public sealed partial class ProxyV1TokenwiseV1PathGetResponse3 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::AI21.ProxyV1TokenwiseV1PathGetResponse3? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::AI21.ProxyV1TokenwiseV1PathGetResponse3), + jsonSerializerContext) as global::AI21.ProxyV1TokenwiseV1PathGetResponse3; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::AI21.ProxyV1TokenwiseV1PathGetResponse3? FromJson( + string json) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::AI21.ProxyV1TokenwiseV1PathGetResponse3? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::AI21.ProxyV1TokenwiseV1PathGetResponse3), + jsonSerializerContext).ConfigureAwait(false)) as global::AI21.ProxyV1TokenwiseV1PathGetResponse3; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/AI21/Generated/AI21.Models.ProxyV1TokenwiseV1PathGetResponse3.g.cs b/src/libs/AI21/Generated/AI21.Models.ProxyV1TokenwiseV1PathGetResponse3.g.cs new file mode 100644 index 00000000..2f150711 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.ProxyV1TokenwiseV1PathGetResponse3.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace AI21 +{ + /// + /// + /// + public sealed partial class ProxyV1TokenwiseV1PathGetResponse3 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.ProxyV1TokenwiseV1PathGetResponse4.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.ProxyV1TokenwiseV1PathGetResponse4.Json.g.cs new file mode 100644 index 00000000..79b6974d --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.ProxyV1TokenwiseV1PathGetResponse4.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace AI21 +{ + public sealed partial class ProxyV1TokenwiseV1PathGetResponse4 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::AI21.ProxyV1TokenwiseV1PathGetResponse4? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::AI21.ProxyV1TokenwiseV1PathGetResponse4), + jsonSerializerContext) as global::AI21.ProxyV1TokenwiseV1PathGetResponse4; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::AI21.ProxyV1TokenwiseV1PathGetResponse4? FromJson( + string json) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::AI21.ProxyV1TokenwiseV1PathGetResponse4? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::AI21.ProxyV1TokenwiseV1PathGetResponse4), + jsonSerializerContext).ConfigureAwait(false)) as global::AI21.ProxyV1TokenwiseV1PathGetResponse4; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/AI21/Generated/AI21.Models.ProxyV1TokenwiseV1PathGetResponse4.g.cs b/src/libs/AI21/Generated/AI21.Models.ProxyV1TokenwiseV1PathGetResponse4.g.cs new file mode 100644 index 00000000..642b0e41 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.ProxyV1TokenwiseV1PathGetResponse4.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace AI21 +{ + /// + /// + /// + public sealed partial class ProxyV1TokenwiseV1PathGetResponse4 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.ProxyV1TokenwiseV1PathGetResponse5.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.ProxyV1TokenwiseV1PathGetResponse5.Json.g.cs new file mode 100644 index 00000000..25ffd91c --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.ProxyV1TokenwiseV1PathGetResponse5.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace AI21 +{ + public sealed partial class ProxyV1TokenwiseV1PathGetResponse5 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::AI21.ProxyV1TokenwiseV1PathGetResponse5? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::AI21.ProxyV1TokenwiseV1PathGetResponse5), + jsonSerializerContext) as global::AI21.ProxyV1TokenwiseV1PathGetResponse5; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::AI21.ProxyV1TokenwiseV1PathGetResponse5? FromJson( + string json) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::AI21.ProxyV1TokenwiseV1PathGetResponse5? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::AI21.ProxyV1TokenwiseV1PathGetResponse5), + jsonSerializerContext).ConfigureAwait(false)) as global::AI21.ProxyV1TokenwiseV1PathGetResponse5; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/AI21/Generated/AI21.Models.ProxyV1TokenwiseV1PathGetResponse5.g.cs b/src/libs/AI21/Generated/AI21.Models.ProxyV1TokenwiseV1PathGetResponse5.g.cs new file mode 100644 index 00000000..6a802d7e --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.ProxyV1TokenwiseV1PathGetResponse5.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace AI21 +{ + /// + /// + /// + public sealed partial class ProxyV1TokenwiseV1PathGetResponse5 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.ProxyV1TokenwiseV1PathGetResponse6.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.ProxyV1TokenwiseV1PathGetResponse6.Json.g.cs new file mode 100644 index 00000000..b1c93f09 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.ProxyV1TokenwiseV1PathGetResponse6.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace AI21 +{ + public sealed partial class ProxyV1TokenwiseV1PathGetResponse6 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::AI21.ProxyV1TokenwiseV1PathGetResponse6? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::AI21.ProxyV1TokenwiseV1PathGetResponse6), + jsonSerializerContext) as global::AI21.ProxyV1TokenwiseV1PathGetResponse6; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::AI21.ProxyV1TokenwiseV1PathGetResponse6? FromJson( + string json) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::AI21.ProxyV1TokenwiseV1PathGetResponse6? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::AI21.ProxyV1TokenwiseV1PathGetResponse6), + jsonSerializerContext).ConfigureAwait(false)) as global::AI21.ProxyV1TokenwiseV1PathGetResponse6; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/AI21/Generated/AI21.Models.ProxyV1TokenwiseV1PathGetResponse6.g.cs b/src/libs/AI21/Generated/AI21.Models.ProxyV1TokenwiseV1PathGetResponse6.g.cs new file mode 100644 index 00000000..febbce00 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.ProxyV1TokenwiseV1PathGetResponse6.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace AI21 +{ + /// + /// + /// + public sealed partial class ProxyV1TokenwiseV1PathGetResponse6 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.QueryFilter.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.QueryFilter.Json.g.cs index e364e94c..7c532357 100644 --- a/src/libs/AI21/Generated/AI21.Models.QueryFilter.Json.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.QueryFilter.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::AI21.QueryFilter?; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::AI21.QueryFilter? FromJson( + string json) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::AI21.QueryFilter?; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/AI21/Generated/AI21.Models.QueryFilter.g.cs b/src/libs/AI21/Generated/AI21.Models.QueryFilter.g.cs index b92a5ecc..aed57328 100644 --- a/src/libs/AI21/Generated/AI21.Models.QueryFilter.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.QueryFilter.g.cs @@ -26,6 +26,26 @@ namespace AI21 #endif public bool IsComparisonOperator => ComparisonOperator != null; + /// + /// + /// + public bool TryPickComparisonOperator( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::AI21.ComparisonOperator? value) + { + value = ComparisonOperator; + return IsComparisonOperator; + } + + /// + /// + /// + public global::AI21.ComparisonOperator PickComparisonOperator() => IsComparisonOperator + ? ComparisonOperator! + : throw new global::System.InvalidOperationException($"Expected union variant 'ComparisonOperator' but the value was {ToString()}."); + /// /// /// @@ -43,6 +63,26 @@ namespace AI21 #endif public bool IsLogicalOperator => LogicalOperator != null; + /// + /// + /// + public bool TryPickLogicalOperator( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::System.Collections.Generic.Dictionary>? value) + { + value = LogicalOperator; + return IsLogicalOperator; + } + + /// + /// + /// + public global::System.Collections.Generic.Dictionary> PickLogicalOperator() => IsLogicalOperator + ? LogicalOperator! + : throw new global::System.InvalidOperationException($"Expected union variant 'LogicalOperator' but the value was {ToString()}."); + /// /// /// @@ -59,6 +99,26 @@ namespace AI21 [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(QueryFilterVariant3))] #endif public bool IsQueryFilterVariant3 => QueryFilterVariant3 != null; + + /// + /// + /// + public bool TryPickQueryFilterVariant3( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::System.Collections.Generic.Dictionary? value) + { + value = QueryFilterVariant3; + return IsQueryFilterVariant3; + } + + /// + /// + /// + public global::System.Collections.Generic.Dictionary PickQueryFilterVariant3() => IsQueryFilterVariant3 + ? QueryFilterVariant3! + : throw new global::System.InvalidOperationException($"Expected union variant 'QueryFilterVariant3' but the value was {ToString()}."); /// /// /// @@ -77,6 +137,11 @@ public QueryFilter(global::AI21.ComparisonOperator? value) ComparisonOperator = value; } + /// + /// + /// + public static QueryFilter FromComparisonOperator(global::AI21.ComparisonOperator? value) => new QueryFilter(value); + /// /// /// @@ -95,6 +160,11 @@ public QueryFilter(global::System.Collections.Generic.Dictionary + /// + /// + public static QueryFilter FromLogicalOperator(global::System.Collections.Generic.Dictionary>? value) => new QueryFilter(value); + /// /// /// @@ -113,6 +183,11 @@ public QueryFilter(global::System.Collections.Generic.Dictionary + /// + /// + public static QueryFilter FromQueryFilterVariant3(global::System.Collections.Generic.Dictionary? value) => new QueryFilter(value); + /// /// /// @@ -157,9 +232,9 @@ public bool Validate() /// /// public TResult? Match( - global::System.Func? comparisonOperator = null, - global::System.Func>?, TResult>? logicalOperator = null, - global::System.Func?, TResult>? queryFilterVariant3 = null, + global::System.Func? comparisonOperator = null, + global::System.Func>, TResult>? logicalOperator = null, + global::System.Func, TResult>? queryFilterVariant3 = null, bool validate = true) { if (validate) @@ -187,9 +262,39 @@ public bool Validate() /// /// public void Match( - global::System.Action? comparisonOperator = null, - global::System.Action>?>? logicalOperator = null, - global::System.Action?>? queryFilterVariant3 = null, + global::System.Action? comparisonOperator = null, + + global::System.Action>>? logicalOperator = null, + + global::System.Action>? queryFilterVariant3 = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsComparisonOperator) + { + comparisonOperator?.Invoke(ComparisonOperator!); + } + else if (IsLogicalOperator) + { + logicalOperator?.Invoke(LogicalOperator!); + } + else if (IsQueryFilterVariant3) + { + queryFilterVariant3?.Invoke(QueryFilterVariant3!); + } + } + + /// + /// + /// + public void Switch( + global::System.Action? comparisonOperator = null, + global::System.Action>>? logicalOperator = null, + global::System.Action>? queryFilterVariant3 = null, bool validate = true) { if (validate) diff --git a/src/libs/AI21/Generated/AI21.Models.QueryFilterVariant3.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.QueryFilterVariant3.Json.g.cs index 8c9b77c0..1e2843b2 100644 --- a/src/libs/AI21/Generated/AI21.Models.QueryFilterVariant3.Json.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.QueryFilterVariant3.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::AI21.QueryFilterVariant3; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::AI21.QueryFilterVariant3? FromJson( + string json) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::AI21.QueryFilterVariant3; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/AI21/Generated/AI21.Models.QueryFilterVariant3.g.cs b/src/libs/AI21/Generated/AI21.Models.QueryFilterVariant3.g.cs index 57f38c74..4774be4b 100644 --- a/src/libs/AI21/Generated/AI21.Models.QueryFilterVariant3.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.QueryFilterVariant3.g.cs @@ -14,5 +14,6 @@ public sealed partial class QueryFilterVariant3 /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.RFIResponseSection.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.RFIResponseSection.Json.g.cs index 3375de39..80aed576 100644 --- a/src/libs/AI21/Generated/AI21.Models.RFIResponseSection.Json.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.RFIResponseSection.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::AI21.RFIResponseSection; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::AI21.RFIResponseSection? FromJson( + string json) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::AI21.RFIResponseSection; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/AI21/Generated/AI21.Models.RFIResponseSection.g.cs b/src/libs/AI21/Generated/AI21.Models.RFIResponseSection.g.cs index 089b8de3..6679c641 100644 --- a/src/libs/AI21/Generated/AI21.Models.RFIResponseSection.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.RFIResponseSection.g.cs @@ -65,5 +65,6 @@ public RFIResponseSection( public RFIResponseSection() { } + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.RequirementItem.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.RequirementItem.Json.g.cs index a8fab34e..ab9015c0 100644 --- a/src/libs/AI21/Generated/AI21.Models.RequirementItem.Json.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.RequirementItem.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::AI21.RequirementItem; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::AI21.RequirementItem? FromJson( + string json) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::AI21.RequirementItem; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/AI21/Generated/AI21.Models.RequirementItem.g.cs b/src/libs/AI21/Generated/AI21.Models.RequirementItem.g.cs index 7a087b43..81145fcc 100644 --- a/src/libs/AI21/Generated/AI21.Models.RequirementItem.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.RequirementItem.g.cs @@ -50,5 +50,6 @@ public RequirementItem( public RequirementItem() { } + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.RequirementsGenerationRequest.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.RequirementsGenerationRequest.Json.g.cs index 0f32d85b..b32c0765 100644 --- a/src/libs/AI21/Generated/AI21.Models.RequirementsGenerationRequest.Json.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.RequirementsGenerationRequest.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::AI21.RequirementsGenerationRequest; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::AI21.RequirementsGenerationRequest? FromJson( + string json) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::AI21.RequirementsGenerationRequest; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/AI21/Generated/AI21.Models.RequirementsGenerationRequest.g.cs b/src/libs/AI21/Generated/AI21.Models.RequirementsGenerationRequest.g.cs index 7e939090..2b890a77 100644 --- a/src/libs/AI21/Generated/AI21.Models.RequirementsGenerationRequest.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.RequirementsGenerationRequest.g.cs @@ -40,5 +40,6 @@ public RequirementsGenerationRequest( public RequirementsGenerationRequest() { } + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.RequirementsGenerationResponse.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.RequirementsGenerationResponse.Json.g.cs index 1f003ad1..4c07396d 100644 --- a/src/libs/AI21/Generated/AI21.Models.RequirementsGenerationResponse.Json.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.RequirementsGenerationResponse.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::AI21.RequirementsGenerationResponse; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::AI21.RequirementsGenerationResponse? FromJson( + string json) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::AI21.RequirementsGenerationResponse; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/AI21/Generated/AI21.Models.RequirementsGenerationResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.RequirementsGenerationResponse.g.cs index 3e3453b1..357d696d 100644 --- a/src/libs/AI21/Generated/AI21.Models.RequirementsGenerationResponse.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.RequirementsGenerationResponse.g.cs @@ -40,5 +40,6 @@ public RequirementsGenerationResponse( public RequirementsGenerationResponse() { } + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.ResponseFormat.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.ResponseFormat.Json.g.cs index 2e6384d2..c4173234 100644 --- a/src/libs/AI21/Generated/AI21.Models.ResponseFormat.Json.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.ResponseFormat.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::AI21.ResponseFormat; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::AI21.ResponseFormat? FromJson( + string json) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::AI21.ResponseFormat; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/AI21/Generated/AI21.Models.ResponseFormat.g.cs b/src/libs/AI21/Generated/AI21.Models.ResponseFormat.g.cs index 7a9454d7..bbe9bdd9 100644 --- a/src/libs/AI21/Generated/AI21.Models.ResponseFormat.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.ResponseFormat.g.cs @@ -41,5 +41,6 @@ public ResponseFormat( public ResponseFormat() { } + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.RunAssistantRequest.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.RunAssistantRequest.Json.g.cs index 2088535b..305f9fbb 100644 --- a/src/libs/AI21/Generated/AI21.Models.RunAssistantRequest.Json.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.RunAssistantRequest.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::AI21.RunAssistantRequest; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::AI21.RunAssistantRequest? FromJson( + string json) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::AI21.RunAssistantRequest; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/AI21/Generated/AI21.Models.RunAssistantRequest.g.cs b/src/libs/AI21/Generated/AI21.Models.RunAssistantRequest.g.cs index af5ee6a1..5f88af79 100644 --- a/src/libs/AI21/Generated/AI21.Models.RunAssistantRequest.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.RunAssistantRequest.g.cs @@ -114,5 +114,6 @@ public RunAssistantRequest( public RunAssistantRequest() { } + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.RunAssistantRequestOutputType.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.RunAssistantRequestOutputType.Json.g.cs index b53ab190..965e0b45 100644 --- a/src/libs/AI21/Generated/AI21.Models.RunAssistantRequestOutputType.Json.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.RunAssistantRequestOutputType.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::AI21.RunAssistantRequestOutputType; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::AI21.RunAssistantRequestOutputType? FromJson( + string json) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::AI21.RunAssistantRequestOutputType; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/AI21/Generated/AI21.Models.RunAssistantRequestOutputType.g.cs b/src/libs/AI21/Generated/AI21.Models.RunAssistantRequestOutputType.g.cs index daf4d4c5..105a51e4 100644 --- a/src/libs/AI21/Generated/AI21.Models.RunAssistantRequestOutputType.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.RunAssistantRequestOutputType.g.cs @@ -14,5 +14,6 @@ public sealed partial class RunAssistantRequestOutputType /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.RunSyncStudioV1ConnectorsConnectedUsersDataSourcesSyncsPostResponse.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.RunSyncStudioV1ConnectorsConnectedUsersDataSourcesSyncsPostResponse.Json.g.cs deleted file mode 100644 index 5895bfd5..00000000 --- a/src/libs/AI21/Generated/AI21.Models.RunSyncStudioV1ConnectorsConnectedUsersDataSourcesSyncsPostResponse.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace AI21 -{ - public sealed partial class RunSyncStudioV1ConnectorsConnectedUsersDataSourcesSyncsPostResponse - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::AI21.RunSyncStudioV1ConnectorsConnectedUsersDataSourcesSyncsPostResponse? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::AI21.RunSyncStudioV1ConnectorsConnectedUsersDataSourcesSyncsPostResponse), - jsonSerializerContext) as global::AI21.RunSyncStudioV1ConnectorsConnectedUsersDataSourcesSyncsPostResponse; - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::AI21.RunSyncStudioV1ConnectorsConnectedUsersDataSourcesSyncsPostResponse? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::AI21.RunSyncStudioV1ConnectorsConnectedUsersDataSourcesSyncsPostResponse), - jsonSerializerContext).ConfigureAwait(false)) as global::AI21.RunSyncStudioV1ConnectorsConnectedUsersDataSourcesSyncsPostResponse; - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/AI21/Generated/AI21.Models.RunSyncStudioV1ConnectorsConnectedUsersDataSourcesSyncsPostResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.RunSyncStudioV1ConnectorsConnectedUsersDataSourcesSyncsPostResponse.g.cs deleted file mode 100644 index 15d25a61..00000000 --- a/src/libs/AI21/Generated/AI21.Models.RunSyncStudioV1ConnectorsConnectedUsersDataSourcesSyncsPostResponse.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace AI21 -{ - /// - /// - /// - public sealed partial class RunSyncStudioV1ConnectorsConnectedUsersDataSourcesSyncsPostResponse - { - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.RunWorkflowStudioV1ConnectorsConnectedUsersEntityIdDataSourcesDataSourceWorkflowsWorkflowNameRunPostResponse.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.RunWorkflowStudioV1ConnectorsConnectedUsersEntityIdDataSourcesDataSourceWorkflowsWorkflowNameRunPostResponse.Json.g.cs deleted file mode 100644 index 6a6cf6af..00000000 --- a/src/libs/AI21/Generated/AI21.Models.RunWorkflowStudioV1ConnectorsConnectedUsersEntityIdDataSourcesDataSourceWorkflowsWorkflowNameRunPostResponse.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace AI21 -{ - public sealed partial class RunWorkflowStudioV1ConnectorsConnectedUsersEntityIdDataSourcesDataSourceWorkflowsWorkflowNameRunPostResponse - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::AI21.RunWorkflowStudioV1ConnectorsConnectedUsersEntityIdDataSourcesDataSourceWorkflowsWorkflowNameRunPostResponse? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::AI21.RunWorkflowStudioV1ConnectorsConnectedUsersEntityIdDataSourcesDataSourceWorkflowsWorkflowNameRunPostResponse), - jsonSerializerContext) as global::AI21.RunWorkflowStudioV1ConnectorsConnectedUsersEntityIdDataSourcesDataSourceWorkflowsWorkflowNameRunPostResponse; - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::AI21.RunWorkflowStudioV1ConnectorsConnectedUsersEntityIdDataSourcesDataSourceWorkflowsWorkflowNameRunPostResponse? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::AI21.RunWorkflowStudioV1ConnectorsConnectedUsersEntityIdDataSourcesDataSourceWorkflowsWorkflowNameRunPostResponse), - jsonSerializerContext).ConfigureAwait(false)) as global::AI21.RunWorkflowStudioV1ConnectorsConnectedUsersEntityIdDataSourcesDataSourceWorkflowsWorkflowNameRunPostResponse; - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/AI21/Generated/AI21.Models.RunWorkflowStudioV1ConnectorsConnectedUsersEntityIdDataSourcesDataSourceWorkflowsWorkflowNameRunPostResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.RunWorkflowStudioV1ConnectorsConnectedUsersEntityIdDataSourcesDataSourceWorkflowsWorkflowNameRunPostResponse.g.cs deleted file mode 100644 index 72e5c73b..00000000 --- a/src/libs/AI21/Generated/AI21.Models.RunWorkflowStudioV1ConnectorsConnectedUsersEntityIdDataSourcesDataSourceWorkflowsWorkflowNameRunPostResponse.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace AI21 -{ - /// - /// - /// - public sealed partial class RunWorkflowStudioV1ConnectorsConnectedUsersEntityIdDataSourcesDataSourceWorkflowsWorkflowNameRunPostResponse - { - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.SecretResponse.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.SecretResponse.Json.g.cs index 2f9580f4..391b2288 100644 --- a/src/libs/AI21/Generated/AI21.Models.SecretResponse.Json.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.SecretResponse.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::AI21.SecretResponse; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::AI21.SecretResponse? FromJson( + string json) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::AI21.SecretResponse; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/AI21/Generated/AI21.Models.SecretResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.SecretResponse.g.cs index 77f35419..08e10800 100644 --- a/src/libs/AI21/Generated/AI21.Models.SecretResponse.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.SecretResponse.g.cs @@ -50,5 +50,6 @@ public SecretResponse( public SecretResponse() { } + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.StarterQuestion.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.StarterQuestion.Json.g.cs index 80020307..1e0695fd 100644 --- a/src/libs/AI21/Generated/AI21.Models.StarterQuestion.Json.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.StarterQuestion.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::AI21.StarterQuestion; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::AI21.StarterQuestion? FromJson( + string json) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::AI21.StarterQuestion; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/AI21/Generated/AI21.Models.StarterQuestion.g.cs b/src/libs/AI21/Generated/AI21.Models.StarterQuestion.g.cs index 30e98383..45a011da 100644 --- a/src/libs/AI21/Generated/AI21.Models.StarterQuestion.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.StarterQuestion.g.cs @@ -50,5 +50,6 @@ public StarterQuestion( public StarterQuestion() { } + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.SyncWebsiteStudioV1ConnectorsWebsiteConnectorIdSyncPostResponse.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.SyncWebsiteStudioV1ConnectorsWebsiteConnectorIdSyncPostResponse.Json.g.cs deleted file mode 100644 index f97a88a9..00000000 --- a/src/libs/AI21/Generated/AI21.Models.SyncWebsiteStudioV1ConnectorsWebsiteConnectorIdSyncPostResponse.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace AI21 -{ - public sealed partial class SyncWebsiteStudioV1ConnectorsWebsiteConnectorIdSyncPostResponse - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::AI21.SyncWebsiteStudioV1ConnectorsWebsiteConnectorIdSyncPostResponse? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::AI21.SyncWebsiteStudioV1ConnectorsWebsiteConnectorIdSyncPostResponse), - jsonSerializerContext) as global::AI21.SyncWebsiteStudioV1ConnectorsWebsiteConnectorIdSyncPostResponse; - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::AI21.SyncWebsiteStudioV1ConnectorsWebsiteConnectorIdSyncPostResponse? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::AI21.SyncWebsiteStudioV1ConnectorsWebsiteConnectorIdSyncPostResponse), - jsonSerializerContext).ConfigureAwait(false)) as global::AI21.SyncWebsiteStudioV1ConnectorsWebsiteConnectorIdSyncPostResponse; - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/AI21/Generated/AI21.Models.SyncWebsiteStudioV1ConnectorsWebsiteConnectorIdSyncPostResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.SyncWebsiteStudioV1ConnectorsWebsiteConnectorIdSyncPostResponse.g.cs deleted file mode 100644 index be803e64..00000000 --- a/src/libs/AI21/Generated/AI21.Models.SyncWebsiteStudioV1ConnectorsWebsiteConnectorIdSyncPostResponse.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace AI21 -{ - /// - /// - /// - public sealed partial class SyncWebsiteStudioV1ConnectorsWebsiteConnectorIdSyncPostResponse - { - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.SystemMessage.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.SystemMessage.Json.g.cs index f4132268..f78b467a 100644 --- a/src/libs/AI21/Generated/AI21.Models.SystemMessage.Json.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.SystemMessage.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::AI21.SystemMessage; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::AI21.SystemMessage? FromJson( + string json) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::AI21.SystemMessage; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/AI21/Generated/AI21.Models.SystemMessage.g.cs b/src/libs/AI21/Generated/AI21.Models.SystemMessage.g.cs index bdb3985c..bb7b7eae 100644 --- a/src/libs/AI21/Generated/AI21.Models.SystemMessage.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.SystemMessage.g.cs @@ -72,5 +72,6 @@ public SystemMessage( public SystemMessage() { } + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.ThreadNameGenerationRequest.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.ThreadNameGenerationRequest.Json.g.cs deleted file mode 100644 index ef49a527..00000000 --- a/src/libs/AI21/Generated/AI21.Models.ThreadNameGenerationRequest.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace AI21 -{ - public sealed partial class ThreadNameGenerationRequest - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::AI21.ThreadNameGenerationRequest? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::AI21.ThreadNameGenerationRequest), - jsonSerializerContext) as global::AI21.ThreadNameGenerationRequest; - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::AI21.ThreadNameGenerationRequest? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::AI21.ThreadNameGenerationRequest), - jsonSerializerContext).ConfigureAwait(false)) as global::AI21.ThreadNameGenerationRequest; - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/AI21/Generated/AI21.Models.ThreadNameGenerationRequest.g.cs b/src/libs/AI21/Generated/AI21.Models.ThreadNameGenerationRequest.g.cs deleted file mode 100644 index 52b5208d..00000000 --- a/src/libs/AI21/Generated/AI21.Models.ThreadNameGenerationRequest.g.cs +++ /dev/null @@ -1,44 +0,0 @@ - -#nullable enable - -namespace AI21 -{ - /// - /// - /// - public sealed partial class ThreadNameGenerationRequest - { - /// - /// - /// - [global::System.Text.Json.Serialization.JsonPropertyName("query")] - [global::System.Text.Json.Serialization.JsonRequired] - public required string Query { 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 ThreadNameGenerationRequest( - string query) - { - this.Query = query ?? throw new global::System.ArgumentNullException(nameof(query)); - } - - /// - /// Initializes a new instance of the class. - /// - public ThreadNameGenerationRequest() - { - } - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.ThreadNameGenerationResponse.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.ThreadNameGenerationResponse.Json.g.cs deleted file mode 100644 index 087f1984..00000000 --- a/src/libs/AI21/Generated/AI21.Models.ThreadNameGenerationResponse.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace AI21 -{ - public sealed partial class ThreadNameGenerationResponse - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::AI21.ThreadNameGenerationResponse? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::AI21.ThreadNameGenerationResponse), - jsonSerializerContext) as global::AI21.ThreadNameGenerationResponse; - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::AI21.ThreadNameGenerationResponse? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::AI21.ThreadNameGenerationResponse), - jsonSerializerContext).ConfigureAwait(false)) as global::AI21.ThreadNameGenerationResponse; - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/AI21/Generated/AI21.Models.ThreadNameGenerationResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.ThreadNameGenerationResponse.g.cs deleted file mode 100644 index c1b33850..00000000 --- a/src/libs/AI21/Generated/AI21.Models.ThreadNameGenerationResponse.g.cs +++ /dev/null @@ -1,44 +0,0 @@ - -#nullable enable - -namespace AI21 -{ - /// - /// - /// - public sealed partial class ThreadNameGenerationResponse - { - /// - /// - /// - [global::System.Text.Json.Serialization.JsonPropertyName("thread_name")] - [global::System.Text.Json.Serialization.JsonRequired] - public required string ThreadName { 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 ThreadNameGenerationResponse( - string threadName) - { - this.ThreadName = threadName ?? throw new global::System.ArgumentNullException(nameof(threadName)); - } - - /// - /// Initializes a new instance of the class. - /// - public ThreadNameGenerationResponse() - { - } - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.TlvConvragPrefixPreviewSolutionsPreviewTlvMunicipalityConvragPostResponse.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.TlvConvragPrefixPreviewSolutionsPreviewTlvMunicipalityConvragPostResponse.Json.g.cs deleted file mode 100644 index 55e40dc8..00000000 --- a/src/libs/AI21/Generated/AI21.Models.TlvConvragPrefixPreviewSolutionsPreviewTlvMunicipalityConvragPostResponse.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace AI21 -{ - public sealed partial class TlvConvragPrefixPreviewSolutionsPreviewTlvMunicipalityConvragPostResponse - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::AI21.TlvConvragPrefixPreviewSolutionsPreviewTlvMunicipalityConvragPostResponse? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::AI21.TlvConvragPrefixPreviewSolutionsPreviewTlvMunicipalityConvragPostResponse), - jsonSerializerContext) as global::AI21.TlvConvragPrefixPreviewSolutionsPreviewTlvMunicipalityConvragPostResponse; - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::AI21.TlvConvragPrefixPreviewSolutionsPreviewTlvMunicipalityConvragPostResponse? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::AI21.TlvConvragPrefixPreviewSolutionsPreviewTlvMunicipalityConvragPostResponse), - jsonSerializerContext).ConfigureAwait(false)) as global::AI21.TlvConvragPrefixPreviewSolutionsPreviewTlvMunicipalityConvragPostResponse; - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/AI21/Generated/AI21.Models.TlvConvragPrefixPreviewSolutionsPreviewTlvMunicipalityConvragPostResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.TlvConvragPrefixPreviewSolutionsPreviewTlvMunicipalityConvragPostResponse.g.cs deleted file mode 100644 index 030fe94c..00000000 --- a/src/libs/AI21/Generated/AI21.Models.TlvConvragPrefixPreviewSolutionsPreviewTlvMunicipalityConvragPostResponse.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace AI21 -{ - /// - /// - /// - public sealed partial class TlvConvragPrefixPreviewSolutionsPreviewTlvMunicipalityConvragPostResponse - { - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.TlvConvragSolutionsTlvMunicipalityConvragPostResponse.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.TlvConvragSolutionsTlvMunicipalityConvragPostResponse.Json.g.cs deleted file mode 100644 index caa4ba89..00000000 --- a/src/libs/AI21/Generated/AI21.Models.TlvConvragSolutionsTlvMunicipalityConvragPostResponse.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace AI21 -{ - public sealed partial class TlvConvragSolutionsTlvMunicipalityConvragPostResponse - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::AI21.TlvConvragSolutionsTlvMunicipalityConvragPostResponse? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::AI21.TlvConvragSolutionsTlvMunicipalityConvragPostResponse), - jsonSerializerContext) as global::AI21.TlvConvragSolutionsTlvMunicipalityConvragPostResponse; - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::AI21.TlvConvragSolutionsTlvMunicipalityConvragPostResponse? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::AI21.TlvConvragSolutionsTlvMunicipalityConvragPostResponse), - jsonSerializerContext).ConfigureAwait(false)) as global::AI21.TlvConvragSolutionsTlvMunicipalityConvragPostResponse; - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/AI21/Generated/AI21.Models.TlvConvragSolutionsTlvMunicipalityConvragPostResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.TlvConvragSolutionsTlvMunicipalityConvragPostResponse.g.cs deleted file mode 100644 index cbc6d9bf..00000000 --- a/src/libs/AI21/Generated/AI21.Models.TlvConvragSolutionsTlvMunicipalityConvragPostResponse.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace AI21 -{ - /// - /// - /// - public sealed partial class TlvConvragSolutionsTlvMunicipalityConvragPostResponse - { - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.ToolCall.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.ToolCall.Json.g.cs index 24af3fd9..8715619d 100644 --- a/src/libs/AI21/Generated/AI21.Models.ToolCall.Json.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.ToolCall.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::AI21.ToolCall; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::AI21.ToolCall? FromJson( + string json) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::AI21.ToolCall; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/AI21/Generated/AI21.Models.ToolCall.g.cs b/src/libs/AI21/Generated/AI21.Models.ToolCall.g.cs index 44bf3bc9..778932cc 100644 --- a/src/libs/AI21/Generated/AI21.Models.ToolCall.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.ToolCall.g.cs @@ -68,5 +68,6 @@ public ToolCall( public ToolCall() { } + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.ToolCallDelta.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.ToolCallDelta.Json.g.cs index 259d359e..ba0981b2 100644 --- a/src/libs/AI21/Generated/AI21.Models.ToolCallDelta.Json.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.ToolCallDelta.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::AI21.ToolCallDelta; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::AI21.ToolCallDelta? FromJson( + string json) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::AI21.ToolCallDelta; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/AI21/Generated/AI21.Models.ToolCallDelta.g.cs b/src/libs/AI21/Generated/AI21.Models.ToolCallDelta.g.cs index 9acdb18c..523be694 100644 --- a/src/libs/AI21/Generated/AI21.Models.ToolCallDelta.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.ToolCallDelta.g.cs @@ -50,5 +50,6 @@ public ToolCallDelta( public ToolCallDelta() { } + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.ToolCallDeltaStart.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.ToolCallDeltaStart.Json.g.cs index c1e72261..465a5445 100644 --- a/src/libs/AI21/Generated/AI21.Models.ToolCallDeltaStart.Json.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.ToolCallDeltaStart.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::AI21.ToolCallDeltaStart; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::AI21.ToolCallDeltaStart? FromJson( + string json) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::AI21.ToolCallDeltaStart; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/AI21/Generated/AI21.Models.ToolCallDeltaStart.g.cs b/src/libs/AI21/Generated/AI21.Models.ToolCallDeltaStart.g.cs index 65a508b6..e4cbc4d0 100644 --- a/src/libs/AI21/Generated/AI21.Models.ToolCallDeltaStart.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.ToolCallDeltaStart.g.cs @@ -76,5 +76,6 @@ public ToolCallDeltaStart( public ToolCallDeltaStart() { } + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.ToolFunction.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.ToolFunction.Json.g.cs index a1b9fa96..26199d17 100644 --- a/src/libs/AI21/Generated/AI21.Models.ToolFunction.Json.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.ToolFunction.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::AI21.ToolFunction; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::AI21.ToolFunction? FromJson( + string json) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::AI21.ToolFunction; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/AI21/Generated/AI21.Models.ToolFunction.g.cs b/src/libs/AI21/Generated/AI21.Models.ToolFunction.g.cs index afffd7d0..f5a88410 100644 --- a/src/libs/AI21/Generated/AI21.Models.ToolFunction.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.ToolFunction.g.cs @@ -50,5 +50,6 @@ public ToolFunction( public ToolFunction() { } + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.ToolFunctionDelta.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.ToolFunctionDelta.Json.g.cs index 3d5f6956..72fe61a5 100644 --- a/src/libs/AI21/Generated/AI21.Models.ToolFunctionDelta.Json.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.ToolFunctionDelta.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::AI21.ToolFunctionDelta; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::AI21.ToolFunctionDelta? FromJson( + string json) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::AI21.ToolFunctionDelta; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/AI21/Generated/AI21.Models.ToolFunctionDelta.g.cs b/src/libs/AI21/Generated/AI21.Models.ToolFunctionDelta.g.cs index b008c415..746cc7f2 100644 --- a/src/libs/AI21/Generated/AI21.Models.ToolFunctionDelta.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.ToolFunctionDelta.g.cs @@ -40,5 +40,6 @@ public ToolFunctionDelta( public ToolFunctionDelta() { } + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.ToolFunctionDeltaStart.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.ToolFunctionDeltaStart.Json.g.cs index 6c161192..b24f8fbb 100644 --- a/src/libs/AI21/Generated/AI21.Models.ToolFunctionDeltaStart.Json.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.ToolFunctionDeltaStart.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::AI21.ToolFunctionDeltaStart; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::AI21.ToolFunctionDeltaStart? FromJson( + string json) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::AI21.ToolFunctionDeltaStart; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/AI21/Generated/AI21.Models.ToolFunctionDeltaStart.g.cs b/src/libs/AI21/Generated/AI21.Models.ToolFunctionDeltaStart.g.cs index 3cfb2e3a..2c5275bd 100644 --- a/src/libs/AI21/Generated/AI21.Models.ToolFunctionDeltaStart.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.ToolFunctionDeltaStart.g.cs @@ -40,5 +40,6 @@ public ToolFunctionDeltaStart( public ToolFunctionDeltaStart() { } + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.ToolMessage.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.ToolMessage.Json.g.cs index 47a54032..ce4eb08c 100644 --- a/src/libs/AI21/Generated/AI21.Models.ToolMessage.Json.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.ToolMessage.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::AI21.ToolMessage; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::AI21.ToolMessage? FromJson( + string json) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::AI21.ToolMessage; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/AI21/Generated/AI21.Models.ToolMessage.g.cs b/src/libs/AI21/Generated/AI21.Models.ToolMessage.g.cs index ed8d4674..8dad1229 100644 --- a/src/libs/AI21/Generated/AI21.Models.ToolMessage.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.ToolMessage.g.cs @@ -82,5 +82,6 @@ public ToolMessage( public ToolMessage() { } + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.ToolParameters.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.ToolParameters.Json.g.cs index f63f9ec6..a4783b29 100644 --- a/src/libs/AI21/Generated/AI21.Models.ToolParameters.Json.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.ToolParameters.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::AI21.ToolParameters; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::AI21.ToolParameters? FromJson( + string json) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::AI21.ToolParameters; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/AI21/Generated/AI21.Models.ToolParameters.g.cs b/src/libs/AI21/Generated/AI21.Models.ToolParameters.g.cs index 1b7ceb65..137b6ef1 100644 --- a/src/libs/AI21/Generated/AI21.Models.ToolParameters.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.ToolParameters.g.cs @@ -65,5 +65,6 @@ public ToolParameters( public ToolParameters() { } + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.ToolParametersProperties.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.ToolParametersProperties.Json.g.cs index 8123245f..c205dda8 100644 --- a/src/libs/AI21/Generated/AI21.Models.ToolParametersProperties.Json.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.ToolParametersProperties.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::AI21.ToolParametersProperties; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::AI21.ToolParametersProperties? FromJson( + string json) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::AI21.ToolParametersProperties; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/AI21/Generated/AI21.Models.ToolParametersProperties.g.cs b/src/libs/AI21/Generated/AI21.Models.ToolParametersProperties.g.cs index f54f4a8b..846ba28a 100644 --- a/src/libs/AI21/Generated/AI21.Models.ToolParametersProperties.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.ToolParametersProperties.g.cs @@ -14,5 +14,6 @@ public sealed partial class ToolParametersProperties /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.TopLogprobsData.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.TopLogprobsData.Json.g.cs index 6b2f8988..f1921168 100644 --- a/src/libs/AI21/Generated/AI21.Models.TopLogprobsData.Json.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.TopLogprobsData.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::AI21.TopLogprobsData; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::AI21.TopLogprobsData? FromJson( + string json) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::AI21.TopLogprobsData; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/AI21/Generated/AI21.Models.TopLogprobsData.g.cs b/src/libs/AI21/Generated/AI21.Models.TopLogprobsData.g.cs index d0fcc7b7..94eabc97 100644 --- a/src/libs/AI21/Generated/AI21.Models.TopLogprobsData.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.TopLogprobsData.g.cs @@ -50,5 +50,6 @@ public TopLogprobsData( public TopLogprobsData() { } + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.UpdateMCPStorageRequest.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.UpdateMCPStorageRequest.Json.g.cs index 69e0cd2b..564d8056 100644 --- a/src/libs/AI21/Generated/AI21.Models.UpdateMCPStorageRequest.Json.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.UpdateMCPStorageRequest.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::AI21.UpdateMCPStorageRequest; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::AI21.UpdateMCPStorageRequest? FromJson( + string json) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::AI21.UpdateMCPStorageRequest; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/AI21/Generated/AI21.Models.UpdateMCPStorageRequest.g.cs b/src/libs/AI21/Generated/AI21.Models.UpdateMCPStorageRequest.g.cs index fd3ce16e..1e5ce2a9 100644 --- a/src/libs/AI21/Generated/AI21.Models.UpdateMCPStorageRequest.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.UpdateMCPStorageRequest.g.cs @@ -40,5 +40,6 @@ public UpdateMCPStorageRequest( public UpdateMCPStorageRequest() { } + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.UpdateRoutePayload.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.UpdateRoutePayload.Json.g.cs index e302fb79..9a45cf02 100644 --- a/src/libs/AI21/Generated/AI21.Models.UpdateRoutePayload.Json.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.UpdateRoutePayload.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::AI21.UpdateRoutePayload; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::AI21.UpdateRoutePayload? FromJson( + string json) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::AI21.UpdateRoutePayload; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/AI21/Generated/AI21.Models.UpdateRoutePayload.g.cs b/src/libs/AI21/Generated/AI21.Models.UpdateRoutePayload.g.cs index 7236cd81..6228016b 100644 --- a/src/libs/AI21/Generated/AI21.Models.UpdateRoutePayload.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.UpdateRoutePayload.g.cs @@ -49,5 +49,6 @@ public UpdateRoutePayload( public UpdateRoutePayload() { } + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.UpdateSecretPayload.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.UpdateSecretPayload.Json.g.cs index bf4c439b..d85b67c7 100644 --- a/src/libs/AI21/Generated/AI21.Models.UpdateSecretPayload.Json.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.UpdateSecretPayload.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::AI21.UpdateSecretPayload; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::AI21.UpdateSecretPayload? FromJson( + string json) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::AI21.UpdateSecretPayload; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/AI21/Generated/AI21.Models.UpdateSecretPayload.g.cs b/src/libs/AI21/Generated/AI21.Models.UpdateSecretPayload.g.cs index 8ef2aa9a..0d1eb016 100644 --- a/src/libs/AI21/Generated/AI21.Models.UpdateSecretPayload.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.UpdateSecretPayload.g.cs @@ -48,5 +48,6 @@ public UpdateSecretPayload( public UpdateSecretPayload() { } + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.UploadCheckComplianceStudioV1DemosRegulationsUploadCheckCompliancePostResponse.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.UploadCheckComplianceStudioV1DemosRegulationsUploadCheckCompliancePostResponse.Json.g.cs index b2a01b59..f75de943 100644 --- a/src/libs/AI21/Generated/AI21.Models.UploadCheckComplianceStudioV1DemosRegulationsUploadCheckCompliancePostResponse.Json.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.UploadCheckComplianceStudioV1DemosRegulationsUploadCheckCompliancePostResponse.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::AI21.UploadCheckComplianceStudioV1DemosRegulationsUploadCheckCompliancePostResponse; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::AI21.UploadCheckComplianceStudioV1DemosRegulationsUploadCheckCompliancePostResponse? FromJson( + string json) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::AI21.UploadCheckComplianceStudioV1DemosRegulationsUploadCheckCompliancePostResponse; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/AI21/Generated/AI21.Models.UploadCheckComplianceStudioV1DemosRegulationsUploadCheckCompliancePostResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.UploadCheckComplianceStudioV1DemosRegulationsUploadCheckCompliancePostResponse.g.cs index 6d1f4406..a86288e8 100644 --- a/src/libs/AI21/Generated/AI21.Models.UploadCheckComplianceStudioV1DemosRegulationsUploadCheckCompliancePostResponse.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.UploadCheckComplianceStudioV1DemosRegulationsUploadCheckCompliancePostResponse.g.cs @@ -14,5 +14,6 @@ public sealed partial class UploadCheckComplianceStudioV1DemosRegulationsUploadC /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.UsageInfo.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.UsageInfo.Json.g.cs index fe6cecbc..b8d0cfa8 100644 --- a/src/libs/AI21/Generated/AI21.Models.UsageInfo.Json.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.UsageInfo.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::AI21.UsageInfo; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::AI21.UsageInfo? FromJson( + string json) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::AI21.UsageInfo; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/AI21/Generated/AI21.Models.UsageInfo.g.cs b/src/libs/AI21/Generated/AI21.Models.UsageInfo.g.cs index 9564ff2a..2519b267 100644 --- a/src/libs/AI21/Generated/AI21.Models.UsageInfo.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.UsageInfo.g.cs @@ -74,5 +74,6 @@ public UsageInfo( public UsageInfo() { } + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.UserMessage.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.UserMessage.Json.g.cs index e679fe1f..8a6eab67 100644 --- a/src/libs/AI21/Generated/AI21.Models.UserMessage.Json.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.UserMessage.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::AI21.UserMessage; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::AI21.UserMessage? FromJson( + string json) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::AI21.UserMessage; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/AI21/Generated/AI21.Models.UserMessage.g.cs b/src/libs/AI21/Generated/AI21.Models.UserMessage.g.cs index 757a6fb3..05bd0669 100644 --- a/src/libs/AI21/Generated/AI21.Models.UserMessage.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.UserMessage.g.cs @@ -72,5 +72,6 @@ public UserMessage( public UserMessage() { } + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.V1DeleteRouteResponse.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.V1DeleteRouteResponse.Json.g.cs index 28ece31e..88b9e11e 100644 --- a/src/libs/AI21/Generated/AI21.Models.V1DeleteRouteResponse.Json.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.V1DeleteRouteResponse.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::AI21.V1DeleteRouteResponse; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::AI21.V1DeleteRouteResponse? FromJson( + string json) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::AI21.V1DeleteRouteResponse; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/AI21/Generated/AI21.Models.V1DeleteRouteResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.V1DeleteRouteResponse.g.cs index 5122ed8e..4d42121f 100644 --- a/src/libs/AI21/Generated/AI21.Models.V1DeleteRouteResponse.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.V1DeleteRouteResponse.g.cs @@ -14,5 +14,6 @@ public sealed partial class V1DeleteRouteResponse /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.V1LibraryDeleteResponse.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.V1LibraryDeleteResponse.Json.g.cs index d1f27e3c..71b06ce2 100644 --- a/src/libs/AI21/Generated/AI21.Models.V1LibraryDeleteResponse.Json.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.V1LibraryDeleteResponse.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::AI21.V1LibraryDeleteResponse; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::AI21.V1LibraryDeleteResponse? FromJson( + string json) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::AI21.V1LibraryDeleteResponse; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/AI21/Generated/AI21.Models.V1LibraryDeleteResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.V1LibraryDeleteResponse.g.cs index cbb3266d..b6db2e95 100644 --- a/src/libs/AI21/Generated/AI21.Models.V1LibraryDeleteResponse.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.V1LibraryDeleteResponse.g.cs @@ -14,5 +14,6 @@ public sealed partial class V1LibraryDeleteResponse /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.V1LibraryManagementResponse.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.V1LibraryManagementResponse.Json.g.cs index 163c9113..6a3a1b4b 100644 --- a/src/libs/AI21/Generated/AI21.Models.V1LibraryManagementResponse.Json.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.V1LibraryManagementResponse.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::AI21.V1LibraryManagementResponse; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::AI21.V1LibraryManagementResponse? FromJson( + string json) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::AI21.V1LibraryManagementResponse; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/AI21/Generated/AI21.Models.V1LibraryManagementResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.V1LibraryManagementResponse.g.cs index d72131cb..8f7c517c 100644 --- a/src/libs/AI21/Generated/AI21.Models.V1LibraryManagementResponse.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.V1LibraryManagementResponse.g.cs @@ -14,5 +14,6 @@ public sealed partial class V1LibraryManagementResponse /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.V1LibraryManagementResponse2.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.V1LibraryManagementResponse2.Json.g.cs index 8c627f15..daea04be 100644 --- a/src/libs/AI21/Generated/AI21.Models.V1LibraryManagementResponse2.Json.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.V1LibraryManagementResponse2.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::AI21.V1LibraryManagementResponse2; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::AI21.V1LibraryManagementResponse2? FromJson( + string json) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::AI21.V1LibraryManagementResponse2; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/AI21/Generated/AI21.Models.V1LibraryManagementResponse2.g.cs b/src/libs/AI21/Generated/AI21.Models.V1LibraryManagementResponse2.g.cs index 9b410ac6..f8d5fb07 100644 --- a/src/libs/AI21/Generated/AI21.Models.V1LibraryManagementResponse2.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.V1LibraryManagementResponse2.g.cs @@ -14,5 +14,6 @@ public sealed partial class V1LibraryManagementResponse2 /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.V1LibraryManagementResponse3.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.V1LibraryManagementResponse3.Json.g.cs index 21f5e6e1..970d4447 100644 --- a/src/libs/AI21/Generated/AI21.Models.V1LibraryManagementResponse3.Json.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.V1LibraryManagementResponse3.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::AI21.V1LibraryManagementResponse3; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::AI21.V1LibraryManagementResponse3? FromJson( + string json) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::AI21.V1LibraryManagementResponse3; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/AI21/Generated/AI21.Models.V1LibraryManagementResponse3.g.cs b/src/libs/AI21/Generated/AI21.Models.V1LibraryManagementResponse3.g.cs index 0e52df15..bf7f2a3b 100644 --- a/src/libs/AI21/Generated/AI21.Models.V1LibraryManagementResponse3.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.V1LibraryManagementResponse3.g.cs @@ -14,5 +14,6 @@ public sealed partial class V1LibraryManagementResponse3 /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.V1LibrarySearchResponse.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.V1LibrarySearchResponse.Json.g.cs deleted file mode 100644 index 1940b8e9..00000000 --- a/src/libs/AI21/Generated/AI21.Models.V1LibrarySearchResponse.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace AI21 -{ - public sealed partial class V1LibrarySearchResponse - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::AI21.V1LibrarySearchResponse? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::AI21.V1LibrarySearchResponse), - jsonSerializerContext) as global::AI21.V1LibrarySearchResponse; - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::AI21.V1LibrarySearchResponse? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::AI21.V1LibrarySearchResponse), - jsonSerializerContext).ConfigureAwait(false)) as global::AI21.V1LibrarySearchResponse; - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/AI21/Generated/AI21.Models.V1LibrarySearchResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.V1LibrarySearchResponse.g.cs deleted file mode 100644 index efe60bb3..00000000 --- a/src/libs/AI21/Generated/AI21.Models.V1LibrarySearchResponse.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace AI21 -{ - /// - /// - /// - public sealed partial class V1LibrarySearchResponse - { - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.V1LibraryUploadResponse.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.V1LibraryUploadResponse.Json.g.cs index 88238c32..8ad377cf 100644 --- a/src/libs/AI21/Generated/AI21.Models.V1LibraryUploadResponse.Json.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.V1LibraryUploadResponse.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::AI21.V1LibraryUploadResponse; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::AI21.V1LibraryUploadResponse? FromJson( + string json) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::AI21.V1LibraryUploadResponse; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/AI21/Generated/AI21.Models.V1LibraryUploadResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.V1LibraryUploadResponse.g.cs index bdf07feb..bd313897 100644 --- a/src/libs/AI21/Generated/AI21.Models.V1LibraryUploadResponse.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.V1LibraryUploadResponse.g.cs @@ -14,5 +14,6 @@ public sealed partial class V1LibraryUploadResponse /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.V1SecretStorageResponse.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.V1SecretStorageResponse.Json.g.cs index 78930834..c2c19b4e 100644 --- a/src/libs/AI21/Generated/AI21.Models.V1SecretStorageResponse.Json.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.V1SecretStorageResponse.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::AI21.V1SecretStorageResponse; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::AI21.V1SecretStorageResponse? FromJson( + string json) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::AI21.V1SecretStorageResponse; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/AI21/Generated/AI21.Models.V1SecretStorageResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.V1SecretStorageResponse.g.cs index 09de51fa..1aedc71a 100644 --- a/src/libs/AI21/Generated/AI21.Models.V1SecretStorageResponse.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.V1SecretStorageResponse.g.cs @@ -14,5 +14,6 @@ public sealed partial class V1SecretStorageResponse /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.V1SecretStorageResponse2.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.V1SecretStorageResponse2.Json.g.cs index dbf87f21..4e706307 100644 --- a/src/libs/AI21/Generated/AI21.Models.V1SecretStorageResponse2.Json.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.V1SecretStorageResponse2.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::AI21.V1SecretStorageResponse2; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::AI21.V1SecretStorageResponse2? FromJson( + string json) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::AI21.V1SecretStorageResponse2; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/AI21/Generated/AI21.Models.V1SecretStorageResponse2.g.cs b/src/libs/AI21/Generated/AI21.Models.V1SecretStorageResponse2.g.cs index ea33992a..112cb2f5 100644 --- a/src/libs/AI21/Generated/AI21.Models.V1SecretStorageResponse2.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.V1SecretStorageResponse2.g.cs @@ -14,5 +14,6 @@ public sealed partial class V1SecretStorageResponse2 /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.V1SecretStorageResponse3.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.V1SecretStorageResponse3.Json.g.cs index bdb363c7..0a166fc0 100644 --- a/src/libs/AI21/Generated/AI21.Models.V1SecretStorageResponse3.Json.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.V1SecretStorageResponse3.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::AI21.V1SecretStorageResponse3; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::AI21.V1SecretStorageResponse3? FromJson( + string json) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::AI21.V1SecretStorageResponse3; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/AI21/Generated/AI21.Models.V1SecretStorageResponse3.g.cs b/src/libs/AI21/Generated/AI21.Models.V1SecretStorageResponse3.g.cs index 22edf9be..7fbda9c9 100644 --- a/src/libs/AI21/Generated/AI21.Models.V1SecretStorageResponse3.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.V1SecretStorageResponse3.g.cs @@ -14,5 +14,6 @@ public sealed partial class V1SecretStorageResponse3 /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.V1SecretStorageResponse4.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.V1SecretStorageResponse4.Json.g.cs index 6792bf78..f4433202 100644 --- a/src/libs/AI21/Generated/AI21.Models.V1SecretStorageResponse4.Json.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.V1SecretStorageResponse4.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::AI21.V1SecretStorageResponse4; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::AI21.V1SecretStorageResponse4? FromJson( + string json) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::AI21.V1SecretStorageResponse4; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/AI21/Generated/AI21.Models.V1SecretStorageResponse4.g.cs b/src/libs/AI21/Generated/AI21.Models.V1SecretStorageResponse4.g.cs index 04e05912..bc52ebc6 100644 --- a/src/libs/AI21/Generated/AI21.Models.V1SecretStorageResponse4.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.V1SecretStorageResponse4.g.cs @@ -14,5 +14,6 @@ public sealed partial class V1SecretStorageResponse4 /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.V1SolutionsFdBatchesV1ClassificationsResponse.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.V1SolutionsFdBatchesV1ClassificationsResponse.Json.g.cs new file mode 100644 index 00000000..840858dc --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.V1SolutionsFdBatchesV1ClassificationsResponse.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace AI21 +{ + public sealed partial class V1SolutionsFdBatchesV1ClassificationsResponse + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::AI21.V1SolutionsFdBatchesV1ClassificationsResponse? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::AI21.V1SolutionsFdBatchesV1ClassificationsResponse), + jsonSerializerContext) as global::AI21.V1SolutionsFdBatchesV1ClassificationsResponse; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::AI21.V1SolutionsFdBatchesV1ClassificationsResponse? FromJson( + string json) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::AI21.V1SolutionsFdBatchesV1ClassificationsResponse? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::AI21.V1SolutionsFdBatchesV1ClassificationsResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::AI21.V1SolutionsFdBatchesV1ClassificationsResponse; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/AI21/Generated/AI21.Models.V1SolutionsFdBatchesV1ClassificationsResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.V1SolutionsFdBatchesV1ClassificationsResponse.g.cs new file mode 100644 index 00000000..66b7a803 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.V1SolutionsFdBatchesV1ClassificationsResponse.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace AI21 +{ + /// + /// + /// + public sealed partial class V1SolutionsFdBatchesV1ClassificationsResponse + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.V1SolutionsFdBatchesV1ClassificationsResultsResponse.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.V1SolutionsFdBatchesV1ClassificationsResultsResponse.Json.g.cs new file mode 100644 index 00000000..5bcc76c3 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.V1SolutionsFdBatchesV1ClassificationsResultsResponse.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace AI21 +{ + public sealed partial class V1SolutionsFdBatchesV1ClassificationsResultsResponse + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::AI21.V1SolutionsFdBatchesV1ClassificationsResultsResponse? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::AI21.V1SolutionsFdBatchesV1ClassificationsResultsResponse), + jsonSerializerContext) as global::AI21.V1SolutionsFdBatchesV1ClassificationsResultsResponse; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::AI21.V1SolutionsFdBatchesV1ClassificationsResultsResponse? FromJson( + string json) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::AI21.V1SolutionsFdBatchesV1ClassificationsResultsResponse? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::AI21.V1SolutionsFdBatchesV1ClassificationsResultsResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::AI21.V1SolutionsFdBatchesV1ClassificationsResultsResponse; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/AI21/Generated/AI21.Models.V1SolutionsFdBatchesV1ClassificationsResultsResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.V1SolutionsFdBatchesV1ClassificationsResultsResponse.g.cs new file mode 100644 index 00000000..47413b66 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.V1SolutionsFdBatchesV1ClassificationsResultsResponse.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace AI21 +{ + /// + /// + /// + public sealed partial class V1SolutionsFdBatchesV1ClassificationsResultsResponse + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.V1SolutionsFdBatchesV1ClassificationsStatusResponse.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.V1SolutionsFdBatchesV1ClassificationsStatusResponse.Json.g.cs new file mode 100644 index 00000000..3e9404d5 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.V1SolutionsFdBatchesV1ClassificationsStatusResponse.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace AI21 +{ + public sealed partial class V1SolutionsFdBatchesV1ClassificationsStatusResponse + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::AI21.V1SolutionsFdBatchesV1ClassificationsStatusResponse? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::AI21.V1SolutionsFdBatchesV1ClassificationsStatusResponse), + jsonSerializerContext) as global::AI21.V1SolutionsFdBatchesV1ClassificationsStatusResponse; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::AI21.V1SolutionsFdBatchesV1ClassificationsStatusResponse? FromJson( + string json) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::AI21.V1SolutionsFdBatchesV1ClassificationsStatusResponse? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::AI21.V1SolutionsFdBatchesV1ClassificationsStatusResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::AI21.V1SolutionsFdBatchesV1ClassificationsStatusResponse; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/AI21/Generated/AI21.Models.V1SolutionsFdBatchesV1ClassificationsStatusResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.V1SolutionsFdBatchesV1ClassificationsStatusResponse.g.cs new file mode 100644 index 00000000..ed3c6e3e --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.V1SolutionsFdBatchesV1ClassificationsStatusResponse.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace AI21 +{ + /// + /// + /// + public sealed partial class V1SolutionsFdBatchesV1ClassificationsStatusResponse + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.V1SolutionsFdBatchesV1DescriptionsResponse.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.V1SolutionsFdBatchesV1DescriptionsResponse.Json.g.cs new file mode 100644 index 00000000..9c5fa964 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.V1SolutionsFdBatchesV1DescriptionsResponse.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace AI21 +{ + public sealed partial class V1SolutionsFdBatchesV1DescriptionsResponse + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::AI21.V1SolutionsFdBatchesV1DescriptionsResponse? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::AI21.V1SolutionsFdBatchesV1DescriptionsResponse), + jsonSerializerContext) as global::AI21.V1SolutionsFdBatchesV1DescriptionsResponse; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::AI21.V1SolutionsFdBatchesV1DescriptionsResponse? FromJson( + string json) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::AI21.V1SolutionsFdBatchesV1DescriptionsResponse? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::AI21.V1SolutionsFdBatchesV1DescriptionsResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::AI21.V1SolutionsFdBatchesV1DescriptionsResponse; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/AI21/Generated/AI21.Models.V1SolutionsFdBatchesV1DescriptionsResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.V1SolutionsFdBatchesV1DescriptionsResponse.g.cs new file mode 100644 index 00000000..6bc28396 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.V1SolutionsFdBatchesV1DescriptionsResponse.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace AI21 +{ + /// + /// + /// + public sealed partial class V1SolutionsFdBatchesV1DescriptionsResponse + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.V1SolutionsFdBatchesV1DescriptionsResultsResponse.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.V1SolutionsFdBatchesV1DescriptionsResultsResponse.Json.g.cs new file mode 100644 index 00000000..b819725c --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.V1SolutionsFdBatchesV1DescriptionsResultsResponse.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace AI21 +{ + public sealed partial class V1SolutionsFdBatchesV1DescriptionsResultsResponse + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::AI21.V1SolutionsFdBatchesV1DescriptionsResultsResponse? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::AI21.V1SolutionsFdBatchesV1DescriptionsResultsResponse), + jsonSerializerContext) as global::AI21.V1SolutionsFdBatchesV1DescriptionsResultsResponse; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::AI21.V1SolutionsFdBatchesV1DescriptionsResultsResponse? FromJson( + string json) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::AI21.V1SolutionsFdBatchesV1DescriptionsResultsResponse? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::AI21.V1SolutionsFdBatchesV1DescriptionsResultsResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::AI21.V1SolutionsFdBatchesV1DescriptionsResultsResponse; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/AI21/Generated/AI21.Models.V1SolutionsFdBatchesV1DescriptionsResultsResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.V1SolutionsFdBatchesV1DescriptionsResultsResponse.g.cs new file mode 100644 index 00000000..6d0252c7 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.V1SolutionsFdBatchesV1DescriptionsResultsResponse.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace AI21 +{ + /// + /// + /// + public sealed partial class V1SolutionsFdBatchesV1DescriptionsResultsResponse + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.V1SolutionsFdBatchesV1DescriptionsStatusResponse.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.V1SolutionsFdBatchesV1DescriptionsStatusResponse.Json.g.cs new file mode 100644 index 00000000..40ecd304 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.V1SolutionsFdBatchesV1DescriptionsStatusResponse.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace AI21 +{ + public sealed partial class V1SolutionsFdBatchesV1DescriptionsStatusResponse + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::AI21.V1SolutionsFdBatchesV1DescriptionsStatusResponse? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::AI21.V1SolutionsFdBatchesV1DescriptionsStatusResponse), + jsonSerializerContext) as global::AI21.V1SolutionsFdBatchesV1DescriptionsStatusResponse; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::AI21.V1SolutionsFdBatchesV1DescriptionsStatusResponse? FromJson( + string json) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::AI21.V1SolutionsFdBatchesV1DescriptionsStatusResponse? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::AI21.V1SolutionsFdBatchesV1DescriptionsStatusResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::AI21.V1SolutionsFdBatchesV1DescriptionsStatusResponse; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/AI21/Generated/AI21.Models.V1SolutionsFdBatchesV1DescriptionsStatusResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.V1SolutionsFdBatchesV1DescriptionsStatusResponse.g.cs new file mode 100644 index 00000000..dceb7d9e --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.V1SolutionsFdBatchesV1DescriptionsStatusResponse.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace AI21 +{ + /// + /// + /// + public sealed partial class V1SolutionsFdBatchesV1DescriptionsStatusResponse + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.V1SolutionsFdPreviewBatchesV1ClassificationsResponse.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.V1SolutionsFdPreviewBatchesV1ClassificationsResponse.Json.g.cs new file mode 100644 index 00000000..d520485b --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.V1SolutionsFdPreviewBatchesV1ClassificationsResponse.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace AI21 +{ + public sealed partial class V1SolutionsFdPreviewBatchesV1ClassificationsResponse + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::AI21.V1SolutionsFdPreviewBatchesV1ClassificationsResponse? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::AI21.V1SolutionsFdPreviewBatchesV1ClassificationsResponse), + jsonSerializerContext) as global::AI21.V1SolutionsFdPreviewBatchesV1ClassificationsResponse; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::AI21.V1SolutionsFdPreviewBatchesV1ClassificationsResponse? FromJson( + string json) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::AI21.V1SolutionsFdPreviewBatchesV1ClassificationsResponse? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::AI21.V1SolutionsFdPreviewBatchesV1ClassificationsResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::AI21.V1SolutionsFdPreviewBatchesV1ClassificationsResponse; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/AI21/Generated/AI21.Models.V1SolutionsFdPreviewBatchesV1ClassificationsResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.V1SolutionsFdPreviewBatchesV1ClassificationsResponse.g.cs new file mode 100644 index 00000000..13e4075b --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.V1SolutionsFdPreviewBatchesV1ClassificationsResponse.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace AI21 +{ + /// + /// + /// + public sealed partial class V1SolutionsFdPreviewBatchesV1ClassificationsResponse + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.V1SolutionsFdPreviewBatchesV1ClassificationsResultsResponse.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.V1SolutionsFdPreviewBatchesV1ClassificationsResultsResponse.Json.g.cs new file mode 100644 index 00000000..2951558e --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.V1SolutionsFdPreviewBatchesV1ClassificationsResultsResponse.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace AI21 +{ + public sealed partial class V1SolutionsFdPreviewBatchesV1ClassificationsResultsResponse + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::AI21.V1SolutionsFdPreviewBatchesV1ClassificationsResultsResponse? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::AI21.V1SolutionsFdPreviewBatchesV1ClassificationsResultsResponse), + jsonSerializerContext) as global::AI21.V1SolutionsFdPreviewBatchesV1ClassificationsResultsResponse; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::AI21.V1SolutionsFdPreviewBatchesV1ClassificationsResultsResponse? FromJson( + string json) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::AI21.V1SolutionsFdPreviewBatchesV1ClassificationsResultsResponse? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::AI21.V1SolutionsFdPreviewBatchesV1ClassificationsResultsResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::AI21.V1SolutionsFdPreviewBatchesV1ClassificationsResultsResponse; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/AI21/Generated/AI21.Models.V1SolutionsFdPreviewBatchesV1ClassificationsResultsResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.V1SolutionsFdPreviewBatchesV1ClassificationsResultsResponse.g.cs new file mode 100644 index 00000000..3e2ca3f0 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.V1SolutionsFdPreviewBatchesV1ClassificationsResultsResponse.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace AI21 +{ + /// + /// + /// + public sealed partial class V1SolutionsFdPreviewBatchesV1ClassificationsResultsResponse + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.V1SolutionsFdPreviewBatchesV1ClassificationsStatusResponse.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.V1SolutionsFdPreviewBatchesV1ClassificationsStatusResponse.Json.g.cs new file mode 100644 index 00000000..98649f9c --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.V1SolutionsFdPreviewBatchesV1ClassificationsStatusResponse.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace AI21 +{ + public sealed partial class V1SolutionsFdPreviewBatchesV1ClassificationsStatusResponse + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::AI21.V1SolutionsFdPreviewBatchesV1ClassificationsStatusResponse? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::AI21.V1SolutionsFdPreviewBatchesV1ClassificationsStatusResponse), + jsonSerializerContext) as global::AI21.V1SolutionsFdPreviewBatchesV1ClassificationsStatusResponse; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::AI21.V1SolutionsFdPreviewBatchesV1ClassificationsStatusResponse? FromJson( + string json) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::AI21.V1SolutionsFdPreviewBatchesV1ClassificationsStatusResponse? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::AI21.V1SolutionsFdPreviewBatchesV1ClassificationsStatusResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::AI21.V1SolutionsFdPreviewBatchesV1ClassificationsStatusResponse; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/AI21/Generated/AI21.Models.V1SolutionsFdPreviewBatchesV1ClassificationsStatusResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.V1SolutionsFdPreviewBatchesV1ClassificationsStatusResponse.g.cs new file mode 100644 index 00000000..895cb0b9 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.V1SolutionsFdPreviewBatchesV1ClassificationsStatusResponse.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace AI21 +{ + /// + /// + /// + public sealed partial class V1SolutionsFdPreviewBatchesV1ClassificationsStatusResponse + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.V1SolutionsFdPreviewBatchesV1DescriptionsResponse.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.V1SolutionsFdPreviewBatchesV1DescriptionsResponse.Json.g.cs new file mode 100644 index 00000000..7698ef92 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.V1SolutionsFdPreviewBatchesV1DescriptionsResponse.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace AI21 +{ + public sealed partial class V1SolutionsFdPreviewBatchesV1DescriptionsResponse + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::AI21.V1SolutionsFdPreviewBatchesV1DescriptionsResponse? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::AI21.V1SolutionsFdPreviewBatchesV1DescriptionsResponse), + jsonSerializerContext) as global::AI21.V1SolutionsFdPreviewBatchesV1DescriptionsResponse; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::AI21.V1SolutionsFdPreviewBatchesV1DescriptionsResponse? FromJson( + string json) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::AI21.V1SolutionsFdPreviewBatchesV1DescriptionsResponse? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::AI21.V1SolutionsFdPreviewBatchesV1DescriptionsResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::AI21.V1SolutionsFdPreviewBatchesV1DescriptionsResponse; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/AI21/Generated/AI21.Models.V1SolutionsFdPreviewBatchesV1DescriptionsResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.V1SolutionsFdPreviewBatchesV1DescriptionsResponse.g.cs new file mode 100644 index 00000000..f6ae248d --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.V1SolutionsFdPreviewBatchesV1DescriptionsResponse.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace AI21 +{ + /// + /// + /// + public sealed partial class V1SolutionsFdPreviewBatchesV1DescriptionsResponse + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.V1SolutionsFdPreviewBatchesV1DescriptionsResultsResponse.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.V1SolutionsFdPreviewBatchesV1DescriptionsResultsResponse.Json.g.cs new file mode 100644 index 00000000..c66ba30f --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.V1SolutionsFdPreviewBatchesV1DescriptionsResultsResponse.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace AI21 +{ + public sealed partial class V1SolutionsFdPreviewBatchesV1DescriptionsResultsResponse + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::AI21.V1SolutionsFdPreviewBatchesV1DescriptionsResultsResponse? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::AI21.V1SolutionsFdPreviewBatchesV1DescriptionsResultsResponse), + jsonSerializerContext) as global::AI21.V1SolutionsFdPreviewBatchesV1DescriptionsResultsResponse; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::AI21.V1SolutionsFdPreviewBatchesV1DescriptionsResultsResponse? FromJson( + string json) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::AI21.V1SolutionsFdPreviewBatchesV1DescriptionsResultsResponse? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::AI21.V1SolutionsFdPreviewBatchesV1DescriptionsResultsResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::AI21.V1SolutionsFdPreviewBatchesV1DescriptionsResultsResponse; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/AI21/Generated/AI21.Models.V1SolutionsFdPreviewBatchesV1DescriptionsResultsResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.V1SolutionsFdPreviewBatchesV1DescriptionsResultsResponse.g.cs new file mode 100644 index 00000000..443992d4 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.V1SolutionsFdPreviewBatchesV1DescriptionsResultsResponse.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace AI21 +{ + /// + /// + /// + public sealed partial class V1SolutionsFdPreviewBatchesV1DescriptionsResultsResponse + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.V1SolutionsFdPreviewBatchesV1DescriptionsStatusResponse.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.V1SolutionsFdPreviewBatchesV1DescriptionsStatusResponse.Json.g.cs new file mode 100644 index 00000000..2357b754 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.V1SolutionsFdPreviewBatchesV1DescriptionsStatusResponse.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace AI21 +{ + public sealed partial class V1SolutionsFdPreviewBatchesV1DescriptionsStatusResponse + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::AI21.V1SolutionsFdPreviewBatchesV1DescriptionsStatusResponse? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::AI21.V1SolutionsFdPreviewBatchesV1DescriptionsStatusResponse), + jsonSerializerContext) as global::AI21.V1SolutionsFdPreviewBatchesV1DescriptionsStatusResponse; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::AI21.V1SolutionsFdPreviewBatchesV1DescriptionsStatusResponse? FromJson( + string json) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::AI21.V1SolutionsFdPreviewBatchesV1DescriptionsStatusResponse? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::AI21.V1SolutionsFdPreviewBatchesV1DescriptionsStatusResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::AI21.V1SolutionsFdPreviewBatchesV1DescriptionsStatusResponse; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/AI21/Generated/AI21.Models.V1SolutionsFdPreviewBatchesV1DescriptionsStatusResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.V1SolutionsFdPreviewBatchesV1DescriptionsStatusResponse.g.cs new file mode 100644 index 00000000..dcbcbd33 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.V1SolutionsFdPreviewBatchesV1DescriptionsStatusResponse.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace AI21 +{ + /// + /// + /// + public sealed partial class V1SolutionsFdPreviewBatchesV1DescriptionsStatusResponse + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.V1SolutionsFnacAftersalesBatchPredictResponse.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.V1SolutionsFnacAftersalesBatchPredictResponse.Json.g.cs new file mode 100644 index 00000000..3242bb57 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.V1SolutionsFnacAftersalesBatchPredictResponse.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace AI21 +{ + public sealed partial class V1SolutionsFnacAftersalesBatchPredictResponse + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::AI21.V1SolutionsFnacAftersalesBatchPredictResponse? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::AI21.V1SolutionsFnacAftersalesBatchPredictResponse), + jsonSerializerContext) as global::AI21.V1SolutionsFnacAftersalesBatchPredictResponse; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::AI21.V1SolutionsFnacAftersalesBatchPredictResponse? FromJson( + string json) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::AI21.V1SolutionsFnacAftersalesBatchPredictResponse? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::AI21.V1SolutionsFnacAftersalesBatchPredictResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::AI21.V1SolutionsFnacAftersalesBatchPredictResponse; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/AI21/Generated/AI21.Models.V1SolutionsFnacAftersalesBatchPredictResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.V1SolutionsFnacAftersalesBatchPredictResponse.g.cs new file mode 100644 index 00000000..a93ff3ef --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.V1SolutionsFnacAftersalesBatchPredictResponse.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace AI21 +{ + /// + /// + /// + public sealed partial class V1SolutionsFnacAftersalesBatchPredictResponse + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.V1SolutionsFnacAftersalesBatchPredictStatusResponse.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.V1SolutionsFnacAftersalesBatchPredictStatusResponse.Json.g.cs new file mode 100644 index 00000000..30c7cd9b --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.V1SolutionsFnacAftersalesBatchPredictStatusResponse.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace AI21 +{ + public sealed partial class V1SolutionsFnacAftersalesBatchPredictStatusResponse + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::AI21.V1SolutionsFnacAftersalesBatchPredictStatusResponse? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::AI21.V1SolutionsFnacAftersalesBatchPredictStatusResponse), + jsonSerializerContext) as global::AI21.V1SolutionsFnacAftersalesBatchPredictStatusResponse; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::AI21.V1SolutionsFnacAftersalesBatchPredictStatusResponse? FromJson( + string json) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::AI21.V1SolutionsFnacAftersalesBatchPredictStatusResponse? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::AI21.V1SolutionsFnacAftersalesBatchPredictStatusResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::AI21.V1SolutionsFnacAftersalesBatchPredictStatusResponse; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/AI21/Generated/AI21.Models.V1SolutionsFnacAftersalesBatchPredictStatusResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.V1SolutionsFnacAftersalesBatchPredictStatusResponse.g.cs new file mode 100644 index 00000000..2150af47 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.V1SolutionsFnacAftersalesBatchPredictStatusResponse.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace AI21 +{ + /// + /// + /// + public sealed partial class V1SolutionsFnacAftersalesBatchPredictStatusResponse + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.V1SolutionsFnacAftersalesPreviewBatchPredictResponse.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.V1SolutionsFnacAftersalesPreviewBatchPredictResponse.Json.g.cs new file mode 100644 index 00000000..2c6e4c02 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.V1SolutionsFnacAftersalesPreviewBatchPredictResponse.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace AI21 +{ + public sealed partial class V1SolutionsFnacAftersalesPreviewBatchPredictResponse + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::AI21.V1SolutionsFnacAftersalesPreviewBatchPredictResponse? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::AI21.V1SolutionsFnacAftersalesPreviewBatchPredictResponse), + jsonSerializerContext) as global::AI21.V1SolutionsFnacAftersalesPreviewBatchPredictResponse; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::AI21.V1SolutionsFnacAftersalesPreviewBatchPredictResponse? FromJson( + string json) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::AI21.V1SolutionsFnacAftersalesPreviewBatchPredictResponse? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::AI21.V1SolutionsFnacAftersalesPreviewBatchPredictResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::AI21.V1SolutionsFnacAftersalesPreviewBatchPredictResponse; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/AI21/Generated/AI21.Models.V1SolutionsFnacAftersalesPreviewBatchPredictResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.V1SolutionsFnacAftersalesPreviewBatchPredictResponse.g.cs new file mode 100644 index 00000000..5be7243a --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.V1SolutionsFnacAftersalesPreviewBatchPredictResponse.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace AI21 +{ + /// + /// + /// + public sealed partial class V1SolutionsFnacAftersalesPreviewBatchPredictResponse + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.V1SolutionsFnacAftersalesPreviewBatchPredictStatusResponse.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.V1SolutionsFnacAftersalesPreviewBatchPredictStatusResponse.Json.g.cs new file mode 100644 index 00000000..c293779e --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.V1SolutionsFnacAftersalesPreviewBatchPredictStatusResponse.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace AI21 +{ + public sealed partial class V1SolutionsFnacAftersalesPreviewBatchPredictStatusResponse + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::AI21.V1SolutionsFnacAftersalesPreviewBatchPredictStatusResponse? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::AI21.V1SolutionsFnacAftersalesPreviewBatchPredictStatusResponse), + jsonSerializerContext) as global::AI21.V1SolutionsFnacAftersalesPreviewBatchPredictStatusResponse; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::AI21.V1SolutionsFnacAftersalesPreviewBatchPredictStatusResponse? FromJson( + string json) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::AI21.V1SolutionsFnacAftersalesPreviewBatchPredictStatusResponse? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::AI21.V1SolutionsFnacAftersalesPreviewBatchPredictStatusResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::AI21.V1SolutionsFnacAftersalesPreviewBatchPredictStatusResponse; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/AI21/Generated/AI21.Models.V1SolutionsFnacAftersalesPreviewBatchPredictStatusResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.V1SolutionsFnacAftersalesPreviewBatchPredictStatusResponse.g.cs new file mode 100644 index 00000000..b169cdde --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.V1SolutionsFnacAftersalesPreviewBatchPredictStatusResponse.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace AI21 +{ + /// + /// + /// + public sealed partial class V1SolutionsFnacAftersalesPreviewBatchPredictStatusResponse + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.V1SolutionsFnacPreviewV1ClassificationsResponse.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.V1SolutionsFnacPreviewV1ClassificationsResponse.Json.g.cs new file mode 100644 index 00000000..87561352 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.V1SolutionsFnacPreviewV1ClassificationsResponse.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace AI21 +{ + public sealed partial class V1SolutionsFnacPreviewV1ClassificationsResponse + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::AI21.V1SolutionsFnacPreviewV1ClassificationsResponse? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::AI21.V1SolutionsFnacPreviewV1ClassificationsResponse), + jsonSerializerContext) as global::AI21.V1SolutionsFnacPreviewV1ClassificationsResponse; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::AI21.V1SolutionsFnacPreviewV1ClassificationsResponse? FromJson( + string json) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::AI21.V1SolutionsFnacPreviewV1ClassificationsResponse? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::AI21.V1SolutionsFnacPreviewV1ClassificationsResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::AI21.V1SolutionsFnacPreviewV1ClassificationsResponse; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/AI21/Generated/AI21.Models.V1SolutionsFnacPreviewV1ClassificationsResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.V1SolutionsFnacPreviewV1ClassificationsResponse.g.cs new file mode 100644 index 00000000..70b0b2e8 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.V1SolutionsFnacPreviewV1ClassificationsResponse.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace AI21 +{ + /// + /// + /// + public sealed partial class V1SolutionsFnacPreviewV1ClassificationsResponse + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.V1SolutionsFnacPreviewV1DeprecatedClassificationsResponse.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.V1SolutionsFnacPreviewV1DeprecatedClassificationsResponse.Json.g.cs new file mode 100644 index 00000000..2fccfdb0 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.V1SolutionsFnacPreviewV1DeprecatedClassificationsResponse.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace AI21 +{ + public sealed partial class V1SolutionsFnacPreviewV1DeprecatedClassificationsResponse + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::AI21.V1SolutionsFnacPreviewV1DeprecatedClassificationsResponse? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::AI21.V1SolutionsFnacPreviewV1DeprecatedClassificationsResponse), + jsonSerializerContext) as global::AI21.V1SolutionsFnacPreviewV1DeprecatedClassificationsResponse; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::AI21.V1SolutionsFnacPreviewV1DeprecatedClassificationsResponse? FromJson( + string json) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::AI21.V1SolutionsFnacPreviewV1DeprecatedClassificationsResponse? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::AI21.V1SolutionsFnacPreviewV1DeprecatedClassificationsResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::AI21.V1SolutionsFnacPreviewV1DeprecatedClassificationsResponse; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/AI21/Generated/AI21.Models.V1SolutionsFnacPreviewV1DeprecatedClassificationsResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.V1SolutionsFnacPreviewV1DeprecatedClassificationsResponse.g.cs new file mode 100644 index 00000000..224273ff --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.V1SolutionsFnacPreviewV1DeprecatedClassificationsResponse.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace AI21 +{ + /// + /// + /// + public sealed partial class V1SolutionsFnacPreviewV1DeprecatedClassificationsResponse + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.V1SolutionsFnacPreviewV1DeprecatedDescriptionsResponse.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.V1SolutionsFnacPreviewV1DeprecatedDescriptionsResponse.Json.g.cs new file mode 100644 index 00000000..fa82aa20 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.V1SolutionsFnacPreviewV1DeprecatedDescriptionsResponse.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace AI21 +{ + public sealed partial class V1SolutionsFnacPreviewV1DeprecatedDescriptionsResponse + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::AI21.V1SolutionsFnacPreviewV1DeprecatedDescriptionsResponse? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::AI21.V1SolutionsFnacPreviewV1DeprecatedDescriptionsResponse), + jsonSerializerContext) as global::AI21.V1SolutionsFnacPreviewV1DeprecatedDescriptionsResponse; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::AI21.V1SolutionsFnacPreviewV1DeprecatedDescriptionsResponse? FromJson( + string json) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::AI21.V1SolutionsFnacPreviewV1DeprecatedDescriptionsResponse? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::AI21.V1SolutionsFnacPreviewV1DeprecatedDescriptionsResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::AI21.V1SolutionsFnacPreviewV1DeprecatedDescriptionsResponse; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/AI21/Generated/AI21.Models.V1SolutionsFnacPreviewV1DeprecatedDescriptionsResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.V1SolutionsFnacPreviewV1DeprecatedDescriptionsResponse.g.cs new file mode 100644 index 00000000..90cc82b5 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.V1SolutionsFnacPreviewV1DeprecatedDescriptionsResponse.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace AI21 +{ + /// + /// + /// + public sealed partial class V1SolutionsFnacPreviewV1DeprecatedDescriptionsResponse + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.V1SolutionsFnacPreviewV1DescriptionsResponse.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.V1SolutionsFnacPreviewV1DescriptionsResponse.Json.g.cs new file mode 100644 index 00000000..838c14e4 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.V1SolutionsFnacPreviewV1DescriptionsResponse.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace AI21 +{ + public sealed partial class V1SolutionsFnacPreviewV1DescriptionsResponse + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::AI21.V1SolutionsFnacPreviewV1DescriptionsResponse? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::AI21.V1SolutionsFnacPreviewV1DescriptionsResponse), + jsonSerializerContext) as global::AI21.V1SolutionsFnacPreviewV1DescriptionsResponse; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::AI21.V1SolutionsFnacPreviewV1DescriptionsResponse? FromJson( + string json) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::AI21.V1SolutionsFnacPreviewV1DescriptionsResponse? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::AI21.V1SolutionsFnacPreviewV1DescriptionsResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::AI21.V1SolutionsFnacPreviewV1DescriptionsResponse; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/AI21/Generated/AI21.Models.V1SolutionsFnacPreviewV1DescriptionsResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.V1SolutionsFnacPreviewV1DescriptionsResponse.g.cs new file mode 100644 index 00000000..e42d912a --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.V1SolutionsFnacPreviewV1DescriptionsResponse.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace AI21 +{ + /// + /// + /// + public sealed partial class V1SolutionsFnacPreviewV1DescriptionsResponse + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.V1SolutionsFnacV1ClassificationsResponse.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.V1SolutionsFnacV1ClassificationsResponse.Json.g.cs new file mode 100644 index 00000000..d3e0171f --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.V1SolutionsFnacV1ClassificationsResponse.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace AI21 +{ + public sealed partial class V1SolutionsFnacV1ClassificationsResponse + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::AI21.V1SolutionsFnacV1ClassificationsResponse? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::AI21.V1SolutionsFnacV1ClassificationsResponse), + jsonSerializerContext) as global::AI21.V1SolutionsFnacV1ClassificationsResponse; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::AI21.V1SolutionsFnacV1ClassificationsResponse? FromJson( + string json) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::AI21.V1SolutionsFnacV1ClassificationsResponse? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::AI21.V1SolutionsFnacV1ClassificationsResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::AI21.V1SolutionsFnacV1ClassificationsResponse; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/AI21/Generated/AI21.Models.V1SolutionsFnacV1ClassificationsResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.V1SolutionsFnacV1ClassificationsResponse.g.cs new file mode 100644 index 00000000..3d102467 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.V1SolutionsFnacV1ClassificationsResponse.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace AI21 +{ + /// + /// + /// + public sealed partial class V1SolutionsFnacV1ClassificationsResponse + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.V1SolutionsFnacV1DeprecatedClassificationsResponse.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.V1SolutionsFnacV1DeprecatedClassificationsResponse.Json.g.cs new file mode 100644 index 00000000..cc5b1261 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.V1SolutionsFnacV1DeprecatedClassificationsResponse.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace AI21 +{ + public sealed partial class V1SolutionsFnacV1DeprecatedClassificationsResponse + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::AI21.V1SolutionsFnacV1DeprecatedClassificationsResponse? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::AI21.V1SolutionsFnacV1DeprecatedClassificationsResponse), + jsonSerializerContext) as global::AI21.V1SolutionsFnacV1DeprecatedClassificationsResponse; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::AI21.V1SolutionsFnacV1DeprecatedClassificationsResponse? FromJson( + string json) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::AI21.V1SolutionsFnacV1DeprecatedClassificationsResponse? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::AI21.V1SolutionsFnacV1DeprecatedClassificationsResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::AI21.V1SolutionsFnacV1DeprecatedClassificationsResponse; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/AI21/Generated/AI21.Models.V1SolutionsFnacV1DeprecatedClassificationsResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.V1SolutionsFnacV1DeprecatedClassificationsResponse.g.cs new file mode 100644 index 00000000..949ca610 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.V1SolutionsFnacV1DeprecatedClassificationsResponse.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace AI21 +{ + /// + /// + /// + public sealed partial class V1SolutionsFnacV1DeprecatedClassificationsResponse + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.V1SolutionsFnacV1DeprecatedDescriptionsResponse.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.V1SolutionsFnacV1DeprecatedDescriptionsResponse.Json.g.cs new file mode 100644 index 00000000..8ab182c0 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.V1SolutionsFnacV1DeprecatedDescriptionsResponse.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace AI21 +{ + public sealed partial class V1SolutionsFnacV1DeprecatedDescriptionsResponse + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::AI21.V1SolutionsFnacV1DeprecatedDescriptionsResponse? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::AI21.V1SolutionsFnacV1DeprecatedDescriptionsResponse), + jsonSerializerContext) as global::AI21.V1SolutionsFnacV1DeprecatedDescriptionsResponse; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::AI21.V1SolutionsFnacV1DeprecatedDescriptionsResponse? FromJson( + string json) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::AI21.V1SolutionsFnacV1DeprecatedDescriptionsResponse? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::AI21.V1SolutionsFnacV1DeprecatedDescriptionsResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::AI21.V1SolutionsFnacV1DeprecatedDescriptionsResponse; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/AI21/Generated/AI21.Models.V1SolutionsFnacV1DeprecatedDescriptionsResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.V1SolutionsFnacV1DeprecatedDescriptionsResponse.g.cs new file mode 100644 index 00000000..4cdf9130 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.V1SolutionsFnacV1DeprecatedDescriptionsResponse.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace AI21 +{ + /// + /// + /// + public sealed partial class V1SolutionsFnacV1DeprecatedDescriptionsResponse + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.V1SolutionsFnacV1DescriptionsResponse.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.V1SolutionsFnacV1DescriptionsResponse.Json.g.cs new file mode 100644 index 00000000..717e3a0d --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.V1SolutionsFnacV1DescriptionsResponse.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace AI21 +{ + public sealed partial class V1SolutionsFnacV1DescriptionsResponse + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::AI21.V1SolutionsFnacV1DescriptionsResponse? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::AI21.V1SolutionsFnacV1DescriptionsResponse), + jsonSerializerContext) as global::AI21.V1SolutionsFnacV1DescriptionsResponse; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::AI21.V1SolutionsFnacV1DescriptionsResponse? FromJson( + string json) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::AI21.V1SolutionsFnacV1DescriptionsResponse? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::AI21.V1SolutionsFnacV1DescriptionsResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::AI21.V1SolutionsFnacV1DescriptionsResponse; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/AI21/Generated/AI21.Models.V1SolutionsFnacV1DescriptionsResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.V1SolutionsFnacV1DescriptionsResponse.g.cs new file mode 100644 index 00000000..aeae35c9 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.V1SolutionsFnacV1DescriptionsResponse.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace AI21 +{ + /// + /// + /// + public sealed partial class V1SolutionsFnacV1DescriptionsResponse + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.V1SolutionsTlvMunicipalityConvragResponse.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.V1SolutionsTlvMunicipalityConvragResponse.Json.g.cs new file mode 100644 index 00000000..5b8d112e --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.V1SolutionsTlvMunicipalityConvragResponse.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace AI21 +{ + public sealed partial class V1SolutionsTlvMunicipalityConvragResponse + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::AI21.V1SolutionsTlvMunicipalityConvragResponse? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::AI21.V1SolutionsTlvMunicipalityConvragResponse), + jsonSerializerContext) as global::AI21.V1SolutionsTlvMunicipalityConvragResponse; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::AI21.V1SolutionsTlvMunicipalityConvragResponse? FromJson( + string json) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::AI21.V1SolutionsTlvMunicipalityConvragResponse? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::AI21.V1SolutionsTlvMunicipalityConvragResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::AI21.V1SolutionsTlvMunicipalityConvragResponse; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/AI21/Generated/AI21.Models.V1SolutionsTlvMunicipalityConvragResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.V1SolutionsTlvMunicipalityConvragResponse.g.cs new file mode 100644 index 00000000..5a09bcde --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.V1SolutionsTlvMunicipalityConvragResponse.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace AI21 +{ + /// + /// + /// + public sealed partial class V1SolutionsTlvMunicipalityConvragResponse + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.V1SolutionsTlvMunicipalityPreviewConvragResponse.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.V1SolutionsTlvMunicipalityPreviewConvragResponse.Json.g.cs new file mode 100644 index 00000000..240e95a0 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.V1SolutionsTlvMunicipalityPreviewConvragResponse.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace AI21 +{ + public sealed partial class V1SolutionsTlvMunicipalityPreviewConvragResponse + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::AI21.V1SolutionsTlvMunicipalityPreviewConvragResponse? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::AI21.V1SolutionsTlvMunicipalityPreviewConvragResponse), + jsonSerializerContext) as global::AI21.V1SolutionsTlvMunicipalityPreviewConvragResponse; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::AI21.V1SolutionsTlvMunicipalityPreviewConvragResponse? FromJson( + string json) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::AI21.V1SolutionsTlvMunicipalityPreviewConvragResponse? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::AI21.V1SolutionsTlvMunicipalityPreviewConvragResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::AI21.V1SolutionsTlvMunicipalityPreviewConvragResponse; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/AI21/Generated/AI21.Models.V1SolutionsTlvMunicipalityPreviewConvragResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.V1SolutionsTlvMunicipalityPreviewConvragResponse.g.cs new file mode 100644 index 00000000..45ea9ef6 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.V1SolutionsTlvMunicipalityPreviewConvragResponse.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace AI21 +{ + /// + /// + /// + public sealed partial class V1SolutionsTlvMunicipalityPreviewConvragResponse + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.V1WebsiteConnectorCreateConfigResponse.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.V1WebsiteConnectorCreateConfigResponse.Json.g.cs index 0d55ec5e..9d4eefd7 100644 --- a/src/libs/AI21/Generated/AI21.Models.V1WebsiteConnectorCreateConfigResponse.Json.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.V1WebsiteConnectorCreateConfigResponse.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::AI21.V1WebsiteConnectorCreateConfigResponse; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::AI21.V1WebsiteConnectorCreateConfigResponse? FromJson( + string json) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::AI21.V1WebsiteConnectorCreateConfigResponse; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/AI21/Generated/AI21.Models.V1WebsiteConnectorCreateConfigResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.V1WebsiteConnectorCreateConfigResponse.g.cs index d91072c2..c9555416 100644 --- a/src/libs/AI21/Generated/AI21.Models.V1WebsiteConnectorCreateConfigResponse.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.V1WebsiteConnectorCreateConfigResponse.g.cs @@ -14,5 +14,6 @@ public sealed partial class V1WebsiteConnectorCreateConfigResponse /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.V1WebsiteConnectorGetConfigResponse.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.V1WebsiteConnectorGetConfigResponse.Json.g.cs index 067682af..469a30c9 100644 --- a/src/libs/AI21/Generated/AI21.Models.V1WebsiteConnectorGetConfigResponse.Json.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.V1WebsiteConnectorGetConfigResponse.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::AI21.V1WebsiteConnectorGetConfigResponse; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::AI21.V1WebsiteConnectorGetConfigResponse? FromJson( + string json) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::AI21.V1WebsiteConnectorGetConfigResponse; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/AI21/Generated/AI21.Models.V1WebsiteConnectorGetConfigResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.V1WebsiteConnectorGetConfigResponse.g.cs index 444637ca..78f48e1d 100644 --- a/src/libs/AI21/Generated/AI21.Models.V1WebsiteConnectorGetConfigResponse.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.V1WebsiteConnectorGetConfigResponse.g.cs @@ -14,5 +14,6 @@ public sealed partial class V1WebsiteConnectorGetConfigResponse /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.V1WebsiteConnectorGetUrlStatusResponse.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.V1WebsiteConnectorGetUrlStatusResponse.Json.g.cs index ed46871c..ad099e41 100644 --- a/src/libs/AI21/Generated/AI21.Models.V1WebsiteConnectorGetUrlStatusResponse.Json.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.V1WebsiteConnectorGetUrlStatusResponse.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::AI21.V1WebsiteConnectorGetUrlStatusResponse; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::AI21.V1WebsiteConnectorGetUrlStatusResponse? FromJson( + string json) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::AI21.V1WebsiteConnectorGetUrlStatusResponse; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/AI21/Generated/AI21.Models.V1WebsiteConnectorGetUrlStatusResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.V1WebsiteConnectorGetUrlStatusResponse.g.cs index 21407efc..b21a3712 100644 --- a/src/libs/AI21/Generated/AI21.Models.V1WebsiteConnectorGetUrlStatusResponse.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.V1WebsiteConnectorGetUrlStatusResponse.g.cs @@ -14,5 +14,6 @@ public sealed partial class V1WebsiteConnectorGetUrlStatusResponse /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.V1WebsiteConnectorGetWebsiteStatusResponse.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.V1WebsiteConnectorGetWebsiteStatusResponse.Json.g.cs index 1ccd2856..1a194fda 100644 --- a/src/libs/AI21/Generated/AI21.Models.V1WebsiteConnectorGetWebsiteStatusResponse.Json.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.V1WebsiteConnectorGetWebsiteStatusResponse.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::AI21.V1WebsiteConnectorGetWebsiteStatusResponse; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::AI21.V1WebsiteConnectorGetWebsiteStatusResponse? FromJson( + string json) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::AI21.V1WebsiteConnectorGetWebsiteStatusResponse; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/AI21/Generated/AI21.Models.V1WebsiteConnectorGetWebsiteStatusResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.V1WebsiteConnectorGetWebsiteStatusResponse.g.cs index 4f270331..d2a58c40 100644 --- a/src/libs/AI21/Generated/AI21.Models.V1WebsiteConnectorGetWebsiteStatusResponse.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.V1WebsiteConnectorGetWebsiteStatusResponse.g.cs @@ -14,5 +14,6 @@ public sealed partial class V1WebsiteConnectorGetWebsiteStatusResponse /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.V1WebsiteConnectorIngestUrlResponse.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.V1WebsiteConnectorIngestUrlResponse.Json.g.cs index b35458fd..b4210cef 100644 --- a/src/libs/AI21/Generated/AI21.Models.V1WebsiteConnectorIngestUrlResponse.Json.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.V1WebsiteConnectorIngestUrlResponse.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::AI21.V1WebsiteConnectorIngestUrlResponse; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::AI21.V1WebsiteConnectorIngestUrlResponse? FromJson( + string json) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::AI21.V1WebsiteConnectorIngestUrlResponse; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/AI21/Generated/AI21.Models.V1WebsiteConnectorIngestUrlResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.V1WebsiteConnectorIngestUrlResponse.g.cs index 33eab8d9..41362f0e 100644 --- a/src/libs/AI21/Generated/AI21.Models.V1WebsiteConnectorIngestUrlResponse.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.V1WebsiteConnectorIngestUrlResponse.g.cs @@ -14,5 +14,6 @@ public sealed partial class V1WebsiteConnectorIngestUrlResponse /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.V1WebsiteConnectorIngestWebsiteResponse.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.V1WebsiteConnectorIngestWebsiteResponse.Json.g.cs index c2e0591b..4d71c47b 100644 --- a/src/libs/AI21/Generated/AI21.Models.V1WebsiteConnectorIngestWebsiteResponse.Json.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.V1WebsiteConnectorIngestWebsiteResponse.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::AI21.V1WebsiteConnectorIngestWebsiteResponse; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::AI21.V1WebsiteConnectorIngestWebsiteResponse? FromJson( + string json) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::AI21.V1WebsiteConnectorIngestWebsiteResponse; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/AI21/Generated/AI21.Models.V1WebsiteConnectorIngestWebsiteResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.V1WebsiteConnectorIngestWebsiteResponse.g.cs index eb568daa..7d41b843 100644 --- a/src/libs/AI21/Generated/AI21.Models.V1WebsiteConnectorIngestWebsiteResponse.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.V1WebsiteConnectorIngestWebsiteResponse.g.cs @@ -14,5 +14,6 @@ public sealed partial class V1WebsiteConnectorIngestWebsiteResponse /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.V1WebsiteConnectorRetryIngestWebsiteResponse.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.V1WebsiteConnectorRetryIngestWebsiteResponse.Json.g.cs index 0082c1b4..2b02b99c 100644 --- a/src/libs/AI21/Generated/AI21.Models.V1WebsiteConnectorRetryIngestWebsiteResponse.Json.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.V1WebsiteConnectorRetryIngestWebsiteResponse.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::AI21.V1WebsiteConnectorRetryIngestWebsiteResponse; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::AI21.V1WebsiteConnectorRetryIngestWebsiteResponse? FromJson( + string json) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::AI21.V1WebsiteConnectorRetryIngestWebsiteResponse; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/AI21/Generated/AI21.Models.V1WebsiteConnectorRetryIngestWebsiteResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.V1WebsiteConnectorRetryIngestWebsiteResponse.g.cs index 75a965b5..8b25a97a 100644 --- a/src/libs/AI21/Generated/AI21.Models.V1WebsiteConnectorRetryIngestWebsiteResponse.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.V1WebsiteConnectorRetryIngestWebsiteResponse.g.cs @@ -14,5 +14,6 @@ public sealed partial class V1WebsiteConnectorRetryIngestWebsiteResponse /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.ValidationError.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.ValidationError.Json.g.cs index b42e58d6..32526a19 100644 --- a/src/libs/AI21/Generated/AI21.Models.ValidationError.Json.g.cs +++ b/src/libs/AI21/Generated/AI21.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::AI21.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::AI21.ValidationError; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::AI21.ValidationError? FromJson( + string json) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::AI21.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::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/AI21/Generated/AI21.Models.ValidationError.g.cs b/src/libs/AI21/Generated/AI21.Models.ValidationError.g.cs index b3a10b2f..47bb0a89 100644 --- a/src/libs/AI21/Generated/AI21.Models.ValidationError.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.ValidationError.g.cs @@ -60,5 +60,6 @@ public ValidationError( public ValidationError() { } + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.ValidationResult.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.ValidationResult.Json.g.cs index f5486850..e54a5403 100644 --- a/src/libs/AI21/Generated/AI21.Models.ValidationResult.Json.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.ValidationResult.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::AI21.ValidationResult; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::AI21.ValidationResult? FromJson( + string json) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::AI21.ValidationResult; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/AI21/Generated/AI21.Models.ValidationResult.g.cs b/src/libs/AI21/Generated/AI21.Models.ValidationResult.g.cs index f1b7f792..57d4b602 100644 --- a/src/libs/AI21/Generated/AI21.Models.ValidationResult.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.ValidationResult.g.cs @@ -58,5 +58,6 @@ public ValidationResult( public ValidationResult() { } + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.VidaaActionItemsPreviewSolutionsPreviewVidaaActionItemsPostResponse.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.VidaaActionItemsPreviewSolutionsPreviewVidaaActionItemsPostResponse.Json.g.cs deleted file mode 100644 index 02e81116..00000000 --- a/src/libs/AI21/Generated/AI21.Models.VidaaActionItemsPreviewSolutionsPreviewVidaaActionItemsPostResponse.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace AI21 -{ - public sealed partial class VidaaActionItemsPreviewSolutionsPreviewVidaaActionItemsPostResponse - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::AI21.VidaaActionItemsPreviewSolutionsPreviewVidaaActionItemsPostResponse? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::AI21.VidaaActionItemsPreviewSolutionsPreviewVidaaActionItemsPostResponse), - jsonSerializerContext) as global::AI21.VidaaActionItemsPreviewSolutionsPreviewVidaaActionItemsPostResponse; - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::AI21.VidaaActionItemsPreviewSolutionsPreviewVidaaActionItemsPostResponse? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::AI21.VidaaActionItemsPreviewSolutionsPreviewVidaaActionItemsPostResponse), - jsonSerializerContext).ConfigureAwait(false)) as global::AI21.VidaaActionItemsPreviewSolutionsPreviewVidaaActionItemsPostResponse; - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/AI21/Generated/AI21.Models.VidaaActionItemsPreviewSolutionsPreviewVidaaActionItemsPostResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.VidaaActionItemsPreviewSolutionsPreviewVidaaActionItemsPostResponse.g.cs deleted file mode 100644 index 4d4dd41f..00000000 --- a/src/libs/AI21/Generated/AI21.Models.VidaaActionItemsPreviewSolutionsPreviewVidaaActionItemsPostResponse.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace AI21 -{ - /// - /// - /// - public sealed partial class VidaaActionItemsPreviewSolutionsPreviewVidaaActionItemsPostResponse - { - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.VidaaActionItemsSolutionsVidaaActionItemsPostResponse.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.VidaaActionItemsSolutionsVidaaActionItemsPostResponse.Json.g.cs deleted file mode 100644 index a1099391..00000000 --- a/src/libs/AI21/Generated/AI21.Models.VidaaActionItemsSolutionsVidaaActionItemsPostResponse.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace AI21 -{ - public sealed partial class VidaaActionItemsSolutionsVidaaActionItemsPostResponse - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::AI21.VidaaActionItemsSolutionsVidaaActionItemsPostResponse? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::AI21.VidaaActionItemsSolutionsVidaaActionItemsPostResponse), - jsonSerializerContext) as global::AI21.VidaaActionItemsSolutionsVidaaActionItemsPostResponse; - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::AI21.VidaaActionItemsSolutionsVidaaActionItemsPostResponse? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::AI21.VidaaActionItemsSolutionsVidaaActionItemsPostResponse), - jsonSerializerContext).ConfigureAwait(false)) as global::AI21.VidaaActionItemsSolutionsVidaaActionItemsPostResponse; - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/AI21/Generated/AI21.Models.VidaaActionItemsSolutionsVidaaActionItemsPostResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.VidaaActionItemsSolutionsVidaaActionItemsPostResponse.g.cs deleted file mode 100644 index 70f13984..00000000 --- a/src/libs/AI21/Generated/AI21.Models.VidaaActionItemsSolutionsVidaaActionItemsPostResponse.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace AI21 -{ - /// - /// - /// - public sealed partial class VidaaActionItemsSolutionsVidaaActionItemsPostResponse - { - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.VidaaFeedItemsPreviewSolutionsPreviewVidaaFeedItemsGetResponse.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.VidaaFeedItemsPreviewSolutionsPreviewVidaaFeedItemsGetResponse.Json.g.cs deleted file mode 100644 index 57dba20f..00000000 --- a/src/libs/AI21/Generated/AI21.Models.VidaaFeedItemsPreviewSolutionsPreviewVidaaFeedItemsGetResponse.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace AI21 -{ - public sealed partial class VidaaFeedItemsPreviewSolutionsPreviewVidaaFeedItemsGetResponse - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::AI21.VidaaFeedItemsPreviewSolutionsPreviewVidaaFeedItemsGetResponse? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::AI21.VidaaFeedItemsPreviewSolutionsPreviewVidaaFeedItemsGetResponse), - jsonSerializerContext) as global::AI21.VidaaFeedItemsPreviewSolutionsPreviewVidaaFeedItemsGetResponse; - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::AI21.VidaaFeedItemsPreviewSolutionsPreviewVidaaFeedItemsGetResponse? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::AI21.VidaaFeedItemsPreviewSolutionsPreviewVidaaFeedItemsGetResponse), - jsonSerializerContext).ConfigureAwait(false)) as global::AI21.VidaaFeedItemsPreviewSolutionsPreviewVidaaFeedItemsGetResponse; - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/AI21/Generated/AI21.Models.VidaaFeedItemsPreviewSolutionsPreviewVidaaFeedItemsGetResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.VidaaFeedItemsPreviewSolutionsPreviewVidaaFeedItemsGetResponse.g.cs deleted file mode 100644 index b95737c7..00000000 --- a/src/libs/AI21/Generated/AI21.Models.VidaaFeedItemsPreviewSolutionsPreviewVidaaFeedItemsGetResponse.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace AI21 -{ - /// - /// - /// - public sealed partial class VidaaFeedItemsPreviewSolutionsPreviewVidaaFeedItemsGetResponse - { - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.VidaaFeedItemsSolutionsVidaaFeedItemsGetResponse.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.VidaaFeedItemsSolutionsVidaaFeedItemsGetResponse.Json.g.cs deleted file mode 100644 index 53977f30..00000000 --- a/src/libs/AI21/Generated/AI21.Models.VidaaFeedItemsSolutionsVidaaFeedItemsGetResponse.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace AI21 -{ - public sealed partial class VidaaFeedItemsSolutionsVidaaFeedItemsGetResponse - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::AI21.VidaaFeedItemsSolutionsVidaaFeedItemsGetResponse? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::AI21.VidaaFeedItemsSolutionsVidaaFeedItemsGetResponse), - jsonSerializerContext) as global::AI21.VidaaFeedItemsSolutionsVidaaFeedItemsGetResponse; - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::AI21.VidaaFeedItemsSolutionsVidaaFeedItemsGetResponse? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::AI21.VidaaFeedItemsSolutionsVidaaFeedItemsGetResponse), - jsonSerializerContext).ConfigureAwait(false)) as global::AI21.VidaaFeedItemsSolutionsVidaaFeedItemsGetResponse; - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/AI21/Generated/AI21.Models.VidaaFeedItemsSolutionsVidaaFeedItemsGetResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.VidaaFeedItemsSolutionsVidaaFeedItemsGetResponse.g.cs deleted file mode 100644 index 1642222c..00000000 --- a/src/libs/AI21/Generated/AI21.Models.VidaaFeedItemsSolutionsVidaaFeedItemsGetResponse.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace AI21 -{ - /// - /// - /// - public sealed partial class VidaaFeedItemsSolutionsVidaaFeedItemsGetResponse - { - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.VidaaMessagesPreviewSolutionsPreviewVidaaApiMessagesPostResponse.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.VidaaMessagesPreviewSolutionsPreviewVidaaApiMessagesPostResponse.Json.g.cs deleted file mode 100644 index a54e8b07..00000000 --- a/src/libs/AI21/Generated/AI21.Models.VidaaMessagesPreviewSolutionsPreviewVidaaApiMessagesPostResponse.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace AI21 -{ - public sealed partial class VidaaMessagesPreviewSolutionsPreviewVidaaApiMessagesPostResponse - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::AI21.VidaaMessagesPreviewSolutionsPreviewVidaaApiMessagesPostResponse? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::AI21.VidaaMessagesPreviewSolutionsPreviewVidaaApiMessagesPostResponse), - jsonSerializerContext) as global::AI21.VidaaMessagesPreviewSolutionsPreviewVidaaApiMessagesPostResponse; - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::AI21.VidaaMessagesPreviewSolutionsPreviewVidaaApiMessagesPostResponse? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::AI21.VidaaMessagesPreviewSolutionsPreviewVidaaApiMessagesPostResponse), - jsonSerializerContext).ConfigureAwait(false)) as global::AI21.VidaaMessagesPreviewSolutionsPreviewVidaaApiMessagesPostResponse; - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/AI21/Generated/AI21.Models.VidaaMessagesPreviewSolutionsPreviewVidaaApiMessagesPostResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.VidaaMessagesPreviewSolutionsPreviewVidaaApiMessagesPostResponse.g.cs deleted file mode 100644 index 635f9ae1..00000000 --- a/src/libs/AI21/Generated/AI21.Models.VidaaMessagesPreviewSolutionsPreviewVidaaApiMessagesPostResponse.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace AI21 -{ - /// - /// - /// - public sealed partial class VidaaMessagesPreviewSolutionsPreviewVidaaApiMessagesPostResponse - { - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.VidaaMessagesSolutionsVidaaApiMessagesPostResponse.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.VidaaMessagesSolutionsVidaaApiMessagesPostResponse.Json.g.cs deleted file mode 100644 index 6e68a58d..00000000 --- a/src/libs/AI21/Generated/AI21.Models.VidaaMessagesSolutionsVidaaApiMessagesPostResponse.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace AI21 -{ - public sealed partial class VidaaMessagesSolutionsVidaaApiMessagesPostResponse - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::AI21.VidaaMessagesSolutionsVidaaApiMessagesPostResponse? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::AI21.VidaaMessagesSolutionsVidaaApiMessagesPostResponse), - jsonSerializerContext) as global::AI21.VidaaMessagesSolutionsVidaaApiMessagesPostResponse; - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::AI21.VidaaMessagesSolutionsVidaaApiMessagesPostResponse? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::AI21.VidaaMessagesSolutionsVidaaApiMessagesPostResponse), - jsonSerializerContext).ConfigureAwait(false)) as global::AI21.VidaaMessagesSolutionsVidaaApiMessagesPostResponse; - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/AI21/Generated/AI21.Models.VidaaMessagesSolutionsVidaaApiMessagesPostResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.VidaaMessagesSolutionsVidaaApiMessagesPostResponse.g.cs deleted file mode 100644 index d5e69cc1..00000000 --- a/src/libs/AI21/Generated/AI21.Models.VidaaMessagesSolutionsVidaaApiMessagesPostResponse.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace AI21 -{ - /// - /// - /// - public sealed partial class VidaaMessagesSolutionsVidaaApiMessagesPostResponse - { - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.VidaaSchedulerStatsPreviewSolutionsPreviewVidaaSchedulerStatsGetResponse.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.VidaaSchedulerStatsPreviewSolutionsPreviewVidaaSchedulerStatsGetResponse.Json.g.cs deleted file mode 100644 index 9e1eddf4..00000000 --- a/src/libs/AI21/Generated/AI21.Models.VidaaSchedulerStatsPreviewSolutionsPreviewVidaaSchedulerStatsGetResponse.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace AI21 -{ - public sealed partial class VidaaSchedulerStatsPreviewSolutionsPreviewVidaaSchedulerStatsGetResponse - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::AI21.VidaaSchedulerStatsPreviewSolutionsPreviewVidaaSchedulerStatsGetResponse? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::AI21.VidaaSchedulerStatsPreviewSolutionsPreviewVidaaSchedulerStatsGetResponse), - jsonSerializerContext) as global::AI21.VidaaSchedulerStatsPreviewSolutionsPreviewVidaaSchedulerStatsGetResponse; - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::AI21.VidaaSchedulerStatsPreviewSolutionsPreviewVidaaSchedulerStatsGetResponse? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::AI21.VidaaSchedulerStatsPreviewSolutionsPreviewVidaaSchedulerStatsGetResponse), - jsonSerializerContext).ConfigureAwait(false)) as global::AI21.VidaaSchedulerStatsPreviewSolutionsPreviewVidaaSchedulerStatsGetResponse; - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/AI21/Generated/AI21.Models.VidaaSchedulerStatsPreviewSolutionsPreviewVidaaSchedulerStatsGetResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.VidaaSchedulerStatsPreviewSolutionsPreviewVidaaSchedulerStatsGetResponse.g.cs deleted file mode 100644 index 269e23a2..00000000 --- a/src/libs/AI21/Generated/AI21.Models.VidaaSchedulerStatsPreviewSolutionsPreviewVidaaSchedulerStatsGetResponse.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace AI21 -{ - /// - /// - /// - public sealed partial class VidaaSchedulerStatsPreviewSolutionsPreviewVidaaSchedulerStatsGetResponse - { - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.VidaaSchedulerStatsSolutionsVidaaSchedulerStatsGetResponse.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.VidaaSchedulerStatsSolutionsVidaaSchedulerStatsGetResponse.Json.g.cs deleted file mode 100644 index f1e7db42..00000000 --- a/src/libs/AI21/Generated/AI21.Models.VidaaSchedulerStatsSolutionsVidaaSchedulerStatsGetResponse.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace AI21 -{ - public sealed partial class VidaaSchedulerStatsSolutionsVidaaSchedulerStatsGetResponse - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::AI21.VidaaSchedulerStatsSolutionsVidaaSchedulerStatsGetResponse? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::AI21.VidaaSchedulerStatsSolutionsVidaaSchedulerStatsGetResponse), - jsonSerializerContext) as global::AI21.VidaaSchedulerStatsSolutionsVidaaSchedulerStatsGetResponse; - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::AI21.VidaaSchedulerStatsSolutionsVidaaSchedulerStatsGetResponse? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::AI21.VidaaSchedulerStatsSolutionsVidaaSchedulerStatsGetResponse), - jsonSerializerContext).ConfigureAwait(false)) as global::AI21.VidaaSchedulerStatsSolutionsVidaaSchedulerStatsGetResponse; - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/AI21/Generated/AI21.Models.VidaaSchedulerStatsSolutionsVidaaSchedulerStatsGetResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.VidaaSchedulerStatsSolutionsVidaaSchedulerStatsGetResponse.g.cs deleted file mode 100644 index 093d4f86..00000000 --- a/src/libs/AI21/Generated/AI21.Models.VidaaSchedulerStatsSolutionsVidaaSchedulerStatsGetResponse.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace AI21 -{ - /// - /// - /// - public sealed partial class VidaaSchedulerStatsSolutionsVidaaSchedulerStatsGetResponse - { - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.VidaaSourcesPreviewSolutionsPreviewVidaaSourcesGetResponse.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.VidaaSourcesPreviewSolutionsPreviewVidaaSourcesGetResponse.Json.g.cs deleted file mode 100644 index ea3a6824..00000000 --- a/src/libs/AI21/Generated/AI21.Models.VidaaSourcesPreviewSolutionsPreviewVidaaSourcesGetResponse.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace AI21 -{ - public sealed partial class VidaaSourcesPreviewSolutionsPreviewVidaaSourcesGetResponse - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::AI21.VidaaSourcesPreviewSolutionsPreviewVidaaSourcesGetResponse? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::AI21.VidaaSourcesPreviewSolutionsPreviewVidaaSourcesGetResponse), - jsonSerializerContext) as global::AI21.VidaaSourcesPreviewSolutionsPreviewVidaaSourcesGetResponse; - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::AI21.VidaaSourcesPreviewSolutionsPreviewVidaaSourcesGetResponse? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::AI21.VidaaSourcesPreviewSolutionsPreviewVidaaSourcesGetResponse), - jsonSerializerContext).ConfigureAwait(false)) as global::AI21.VidaaSourcesPreviewSolutionsPreviewVidaaSourcesGetResponse; - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/AI21/Generated/AI21.Models.VidaaSourcesPreviewSolutionsPreviewVidaaSourcesGetResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.VidaaSourcesPreviewSolutionsPreviewVidaaSourcesGetResponse.g.cs deleted file mode 100644 index e19550d4..00000000 --- a/src/libs/AI21/Generated/AI21.Models.VidaaSourcesPreviewSolutionsPreviewVidaaSourcesGetResponse.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace AI21 -{ - /// - /// - /// - public sealed partial class VidaaSourcesPreviewSolutionsPreviewVidaaSourcesGetResponse - { - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.VidaaSourcesSolutionsVidaaSourcesGetResponse.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.VidaaSourcesSolutionsVidaaSourcesGetResponse.Json.g.cs deleted file mode 100644 index c2ada3e0..00000000 --- a/src/libs/AI21/Generated/AI21.Models.VidaaSourcesSolutionsVidaaSourcesGetResponse.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace AI21 -{ - public sealed partial class VidaaSourcesSolutionsVidaaSourcesGetResponse - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::AI21.VidaaSourcesSolutionsVidaaSourcesGetResponse? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::AI21.VidaaSourcesSolutionsVidaaSourcesGetResponse), - jsonSerializerContext) as global::AI21.VidaaSourcesSolutionsVidaaSourcesGetResponse; - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::AI21.VidaaSourcesSolutionsVidaaSourcesGetResponse? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::AI21.VidaaSourcesSolutionsVidaaSourcesGetResponse), - jsonSerializerContext).ConfigureAwait(false)) as global::AI21.VidaaSourcesSolutionsVidaaSourcesGetResponse; - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/AI21/Generated/AI21.Models.VidaaSourcesSolutionsVidaaSourcesGetResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.VidaaSourcesSolutionsVidaaSourcesGetResponse.g.cs deleted file mode 100644 index e0251fe7..00000000 --- a/src/libs/AI21/Generated/AI21.Models.VidaaSourcesSolutionsVidaaSourcesGetResponse.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace AI21 -{ - /// - /// - /// - public sealed partial class VidaaSourcesSolutionsVidaaSourcesGetResponse - { - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.VidaaSubscribePreviewSolutionsPreviewVidaaSubscribePostResponse.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.VidaaSubscribePreviewSolutionsPreviewVidaaSubscribePostResponse.Json.g.cs deleted file mode 100644 index 849dbb9e..00000000 --- a/src/libs/AI21/Generated/AI21.Models.VidaaSubscribePreviewSolutionsPreviewVidaaSubscribePostResponse.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace AI21 -{ - public sealed partial class VidaaSubscribePreviewSolutionsPreviewVidaaSubscribePostResponse - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::AI21.VidaaSubscribePreviewSolutionsPreviewVidaaSubscribePostResponse? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::AI21.VidaaSubscribePreviewSolutionsPreviewVidaaSubscribePostResponse), - jsonSerializerContext) as global::AI21.VidaaSubscribePreviewSolutionsPreviewVidaaSubscribePostResponse; - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::AI21.VidaaSubscribePreviewSolutionsPreviewVidaaSubscribePostResponse? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::AI21.VidaaSubscribePreviewSolutionsPreviewVidaaSubscribePostResponse), - jsonSerializerContext).ConfigureAwait(false)) as global::AI21.VidaaSubscribePreviewSolutionsPreviewVidaaSubscribePostResponse; - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/AI21/Generated/AI21.Models.VidaaSubscribePreviewSolutionsPreviewVidaaSubscribePostResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.VidaaSubscribePreviewSolutionsPreviewVidaaSubscribePostResponse.g.cs deleted file mode 100644 index 85645ec6..00000000 --- a/src/libs/AI21/Generated/AI21.Models.VidaaSubscribePreviewSolutionsPreviewVidaaSubscribePostResponse.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace AI21 -{ - /// - /// - /// - public sealed partial class VidaaSubscribePreviewSolutionsPreviewVidaaSubscribePostResponse - { - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.VidaaSubscribeSolutionsVidaaSubscribePostResponse.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.VidaaSubscribeSolutionsVidaaSubscribePostResponse.Json.g.cs deleted file mode 100644 index 4032fcab..00000000 --- a/src/libs/AI21/Generated/AI21.Models.VidaaSubscribeSolutionsVidaaSubscribePostResponse.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace AI21 -{ - public sealed partial class VidaaSubscribeSolutionsVidaaSubscribePostResponse - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::AI21.VidaaSubscribeSolutionsVidaaSubscribePostResponse? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::AI21.VidaaSubscribeSolutionsVidaaSubscribePostResponse), - jsonSerializerContext) as global::AI21.VidaaSubscribeSolutionsVidaaSubscribePostResponse; - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::AI21.VidaaSubscribeSolutionsVidaaSubscribePostResponse? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::AI21.VidaaSubscribeSolutionsVidaaSubscribePostResponse), - jsonSerializerContext).ConfigureAwait(false)) as global::AI21.VidaaSubscribeSolutionsVidaaSubscribePostResponse; - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/AI21/Generated/AI21.Models.VidaaSubscribeSolutionsVidaaSubscribePostResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.VidaaSubscribeSolutionsVidaaSubscribePostResponse.g.cs deleted file mode 100644 index 1972ba86..00000000 --- a/src/libs/AI21/Generated/AI21.Models.VidaaSubscribeSolutionsVidaaSubscribePostResponse.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace AI21 -{ - /// - /// - /// - public sealed partial class VidaaSubscribeSolutionsVidaaSubscribePostResponse - { - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.VidaaSubscriptionsPreviewSolutionsPreviewVidaaSubscriptionsGetResponse.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.VidaaSubscriptionsPreviewSolutionsPreviewVidaaSubscriptionsGetResponse.Json.g.cs deleted file mode 100644 index 3defca0e..00000000 --- a/src/libs/AI21/Generated/AI21.Models.VidaaSubscriptionsPreviewSolutionsPreviewVidaaSubscriptionsGetResponse.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace AI21 -{ - public sealed partial class VidaaSubscriptionsPreviewSolutionsPreviewVidaaSubscriptionsGetResponse - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::AI21.VidaaSubscriptionsPreviewSolutionsPreviewVidaaSubscriptionsGetResponse? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::AI21.VidaaSubscriptionsPreviewSolutionsPreviewVidaaSubscriptionsGetResponse), - jsonSerializerContext) as global::AI21.VidaaSubscriptionsPreviewSolutionsPreviewVidaaSubscriptionsGetResponse; - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::AI21.VidaaSubscriptionsPreviewSolutionsPreviewVidaaSubscriptionsGetResponse? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::AI21.VidaaSubscriptionsPreviewSolutionsPreviewVidaaSubscriptionsGetResponse), - jsonSerializerContext).ConfigureAwait(false)) as global::AI21.VidaaSubscriptionsPreviewSolutionsPreviewVidaaSubscriptionsGetResponse; - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/AI21/Generated/AI21.Models.VidaaSubscriptionsPreviewSolutionsPreviewVidaaSubscriptionsGetResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.VidaaSubscriptionsPreviewSolutionsPreviewVidaaSubscriptionsGetResponse.g.cs deleted file mode 100644 index 0fb2faa7..00000000 --- a/src/libs/AI21/Generated/AI21.Models.VidaaSubscriptionsPreviewSolutionsPreviewVidaaSubscriptionsGetResponse.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace AI21 -{ - /// - /// - /// - public sealed partial class VidaaSubscriptionsPreviewSolutionsPreviewVidaaSubscriptionsGetResponse - { - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.VidaaSubscriptionsSolutionsVidaaSubscriptionsGetResponse.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.VidaaSubscriptionsSolutionsVidaaSubscriptionsGetResponse.Json.g.cs deleted file mode 100644 index 8bd27f7c..00000000 --- a/src/libs/AI21/Generated/AI21.Models.VidaaSubscriptionsSolutionsVidaaSubscriptionsGetResponse.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace AI21 -{ - public sealed partial class VidaaSubscriptionsSolutionsVidaaSubscriptionsGetResponse - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::AI21.VidaaSubscriptionsSolutionsVidaaSubscriptionsGetResponse? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::AI21.VidaaSubscriptionsSolutionsVidaaSubscriptionsGetResponse), - jsonSerializerContext) as global::AI21.VidaaSubscriptionsSolutionsVidaaSubscriptionsGetResponse; - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::AI21.VidaaSubscriptionsSolutionsVidaaSubscriptionsGetResponse? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::AI21.VidaaSubscriptionsSolutionsVidaaSubscriptionsGetResponse), - jsonSerializerContext).ConfigureAwait(false)) as global::AI21.VidaaSubscriptionsSolutionsVidaaSubscriptionsGetResponse; - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/AI21/Generated/AI21.Models.VidaaSubscriptionsSolutionsVidaaSubscriptionsGetResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.VidaaSubscriptionsSolutionsVidaaSubscriptionsGetResponse.g.cs deleted file mode 100644 index 86ddccc3..00000000 --- a/src/libs/AI21/Generated/AI21.Models.VidaaSubscriptionsSolutionsVidaaSubscriptionsGetResponse.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace AI21 -{ - /// - /// - /// - public sealed partial class VidaaSubscriptionsSolutionsVidaaSubscriptionsGetResponse - { - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.VidaaSummarizePreviewSolutionsPreviewVidaaSummarizePostResponse.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.VidaaSummarizePreviewSolutionsPreviewVidaaSummarizePostResponse.Json.g.cs deleted file mode 100644 index 0ff2fcfd..00000000 --- a/src/libs/AI21/Generated/AI21.Models.VidaaSummarizePreviewSolutionsPreviewVidaaSummarizePostResponse.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace AI21 -{ - public sealed partial class VidaaSummarizePreviewSolutionsPreviewVidaaSummarizePostResponse - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::AI21.VidaaSummarizePreviewSolutionsPreviewVidaaSummarizePostResponse? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::AI21.VidaaSummarizePreviewSolutionsPreviewVidaaSummarizePostResponse), - jsonSerializerContext) as global::AI21.VidaaSummarizePreviewSolutionsPreviewVidaaSummarizePostResponse; - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::AI21.VidaaSummarizePreviewSolutionsPreviewVidaaSummarizePostResponse? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::AI21.VidaaSummarizePreviewSolutionsPreviewVidaaSummarizePostResponse), - jsonSerializerContext).ConfigureAwait(false)) as global::AI21.VidaaSummarizePreviewSolutionsPreviewVidaaSummarizePostResponse; - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/AI21/Generated/AI21.Models.VidaaSummarizePreviewSolutionsPreviewVidaaSummarizePostResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.VidaaSummarizePreviewSolutionsPreviewVidaaSummarizePostResponse.g.cs deleted file mode 100644 index 21fbf236..00000000 --- a/src/libs/AI21/Generated/AI21.Models.VidaaSummarizePreviewSolutionsPreviewVidaaSummarizePostResponse.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace AI21 -{ - /// - /// - /// - public sealed partial class VidaaSummarizePreviewSolutionsPreviewVidaaSummarizePostResponse - { - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.VidaaSummarizeSolutionsVidaaSummarizePostResponse.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.VidaaSummarizeSolutionsVidaaSummarizePostResponse.Json.g.cs deleted file mode 100644 index a0602328..00000000 --- a/src/libs/AI21/Generated/AI21.Models.VidaaSummarizeSolutionsVidaaSummarizePostResponse.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace AI21 -{ - public sealed partial class VidaaSummarizeSolutionsVidaaSummarizePostResponse - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::AI21.VidaaSummarizeSolutionsVidaaSummarizePostResponse? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::AI21.VidaaSummarizeSolutionsVidaaSummarizePostResponse), - jsonSerializerContext) as global::AI21.VidaaSummarizeSolutionsVidaaSummarizePostResponse; - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::AI21.VidaaSummarizeSolutionsVidaaSummarizePostResponse? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::AI21.VidaaSummarizeSolutionsVidaaSummarizePostResponse), - jsonSerializerContext).ConfigureAwait(false)) as global::AI21.VidaaSummarizeSolutionsVidaaSummarizePostResponse; - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/AI21/Generated/AI21.Models.VidaaSummarizeSolutionsVidaaSummarizePostResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.VidaaSummarizeSolutionsVidaaSummarizePostResponse.g.cs deleted file mode 100644 index 842d6404..00000000 --- a/src/libs/AI21/Generated/AI21.Models.VidaaSummarizeSolutionsVidaaSummarizePostResponse.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace AI21 -{ - /// - /// - /// - public sealed partial class VidaaSummarizeSolutionsVidaaSummarizePostResponse - { - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.VidaaTriggerPollPreviewSolutionsPreviewVidaaTriggerPollPostResponse.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.VidaaTriggerPollPreviewSolutionsPreviewVidaaTriggerPollPostResponse.Json.g.cs deleted file mode 100644 index 6380dfef..00000000 --- a/src/libs/AI21/Generated/AI21.Models.VidaaTriggerPollPreviewSolutionsPreviewVidaaTriggerPollPostResponse.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace AI21 -{ - public sealed partial class VidaaTriggerPollPreviewSolutionsPreviewVidaaTriggerPollPostResponse - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::AI21.VidaaTriggerPollPreviewSolutionsPreviewVidaaTriggerPollPostResponse? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::AI21.VidaaTriggerPollPreviewSolutionsPreviewVidaaTriggerPollPostResponse), - jsonSerializerContext) as global::AI21.VidaaTriggerPollPreviewSolutionsPreviewVidaaTriggerPollPostResponse; - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::AI21.VidaaTriggerPollPreviewSolutionsPreviewVidaaTriggerPollPostResponse? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::AI21.VidaaTriggerPollPreviewSolutionsPreviewVidaaTriggerPollPostResponse), - jsonSerializerContext).ConfigureAwait(false)) as global::AI21.VidaaTriggerPollPreviewSolutionsPreviewVidaaTriggerPollPostResponse; - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/AI21/Generated/AI21.Models.VidaaTriggerPollPreviewSolutionsPreviewVidaaTriggerPollPostResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.VidaaTriggerPollPreviewSolutionsPreviewVidaaTriggerPollPostResponse.g.cs deleted file mode 100644 index 4f530dda..00000000 --- a/src/libs/AI21/Generated/AI21.Models.VidaaTriggerPollPreviewSolutionsPreviewVidaaTriggerPollPostResponse.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace AI21 -{ - /// - /// - /// - public sealed partial class VidaaTriggerPollPreviewSolutionsPreviewVidaaTriggerPollPostResponse - { - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.VidaaTriggerPollSolutionsVidaaTriggerPollPostResponse.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.VidaaTriggerPollSolutionsVidaaTriggerPollPostResponse.Json.g.cs deleted file mode 100644 index e21c0058..00000000 --- a/src/libs/AI21/Generated/AI21.Models.VidaaTriggerPollSolutionsVidaaTriggerPollPostResponse.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace AI21 -{ - public sealed partial class VidaaTriggerPollSolutionsVidaaTriggerPollPostResponse - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::AI21.VidaaTriggerPollSolutionsVidaaTriggerPollPostResponse? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::AI21.VidaaTriggerPollSolutionsVidaaTriggerPollPostResponse), - jsonSerializerContext) as global::AI21.VidaaTriggerPollSolutionsVidaaTriggerPollPostResponse; - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::AI21.VidaaTriggerPollSolutionsVidaaTriggerPollPostResponse? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::AI21.VidaaTriggerPollSolutionsVidaaTriggerPollPostResponse), - jsonSerializerContext).ConfigureAwait(false)) as global::AI21.VidaaTriggerPollSolutionsVidaaTriggerPollPostResponse; - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/AI21/Generated/AI21.Models.VidaaTriggerPollSolutionsVidaaTriggerPollPostResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.VidaaTriggerPollSolutionsVidaaTriggerPollPostResponse.g.cs deleted file mode 100644 index 328936b4..00000000 --- a/src/libs/AI21/Generated/AI21.Models.VidaaTriggerPollSolutionsVidaaTriggerPollPostResponse.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace AI21 -{ - /// - /// - /// - public sealed partial class VidaaTriggerPollSolutionsVidaaTriggerPollPostResponse - { - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.VidaaUnsubscribePreviewSolutionsPreviewVidaaUnsubscribePostResponse.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.VidaaUnsubscribePreviewSolutionsPreviewVidaaUnsubscribePostResponse.Json.g.cs deleted file mode 100644 index f8521a70..00000000 --- a/src/libs/AI21/Generated/AI21.Models.VidaaUnsubscribePreviewSolutionsPreviewVidaaUnsubscribePostResponse.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace AI21 -{ - public sealed partial class VidaaUnsubscribePreviewSolutionsPreviewVidaaUnsubscribePostResponse - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::AI21.VidaaUnsubscribePreviewSolutionsPreviewVidaaUnsubscribePostResponse? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::AI21.VidaaUnsubscribePreviewSolutionsPreviewVidaaUnsubscribePostResponse), - jsonSerializerContext) as global::AI21.VidaaUnsubscribePreviewSolutionsPreviewVidaaUnsubscribePostResponse; - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::AI21.VidaaUnsubscribePreviewSolutionsPreviewVidaaUnsubscribePostResponse? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::AI21.VidaaUnsubscribePreviewSolutionsPreviewVidaaUnsubscribePostResponse), - jsonSerializerContext).ConfigureAwait(false)) as global::AI21.VidaaUnsubscribePreviewSolutionsPreviewVidaaUnsubscribePostResponse; - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/AI21/Generated/AI21.Models.VidaaUnsubscribePreviewSolutionsPreviewVidaaUnsubscribePostResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.VidaaUnsubscribePreviewSolutionsPreviewVidaaUnsubscribePostResponse.g.cs deleted file mode 100644 index ac570269..00000000 --- a/src/libs/AI21/Generated/AI21.Models.VidaaUnsubscribePreviewSolutionsPreviewVidaaUnsubscribePostResponse.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace AI21 -{ - /// - /// - /// - public sealed partial class VidaaUnsubscribePreviewSolutionsPreviewVidaaUnsubscribePostResponse - { - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.VidaaUnsubscribeSolutionsVidaaUnsubscribePostResponse.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.VidaaUnsubscribeSolutionsVidaaUnsubscribePostResponse.Json.g.cs deleted file mode 100644 index 742a47db..00000000 --- a/src/libs/AI21/Generated/AI21.Models.VidaaUnsubscribeSolutionsVidaaUnsubscribePostResponse.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace AI21 -{ - public sealed partial class VidaaUnsubscribeSolutionsVidaaUnsubscribePostResponse - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::AI21.VidaaUnsubscribeSolutionsVidaaUnsubscribePostResponse? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::AI21.VidaaUnsubscribeSolutionsVidaaUnsubscribePostResponse), - jsonSerializerContext) as global::AI21.VidaaUnsubscribeSolutionsVidaaUnsubscribePostResponse; - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::AI21.VidaaUnsubscribeSolutionsVidaaUnsubscribePostResponse? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::AI21.VidaaUnsubscribeSolutionsVidaaUnsubscribePostResponse), - jsonSerializerContext).ConfigureAwait(false)) as global::AI21.VidaaUnsubscribeSolutionsVidaaUnsubscribePostResponse; - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/AI21/Generated/AI21.Models.VidaaUnsubscribeSolutionsVidaaUnsubscribePostResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.VidaaUnsubscribeSolutionsVidaaUnsubscribePostResponse.g.cs deleted file mode 100644 index 0d8f1955..00000000 --- a/src/libs/AI21/Generated/AI21.Models.VidaaUnsubscribeSolutionsVidaaUnsubscribePostResponse.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace AI21 -{ - /// - /// - /// - public sealed partial class VidaaUnsubscribeSolutionsVidaaUnsubscribePostResponse - { - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.WebSearchToolResource.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.WebSearchToolResource.Json.g.cs index b93e4b00..2a5a4c00 100644 --- a/src/libs/AI21/Generated/AI21.Models.WebSearchToolResource.Json.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.WebSearchToolResource.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::AI21.WebSearchToolResource; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::AI21.WebSearchToolResource? FromJson( + string json) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::AI21.WebSearchToolResource; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/AI21/Generated/AI21.Models.WebSearchToolResource.g.cs b/src/libs/AI21/Generated/AI21.Models.WebSearchToolResource.g.cs index 3ccfbbc2..f816e6bf 100644 --- a/src/libs/AI21/Generated/AI21.Models.WebSearchToolResource.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.WebSearchToolResource.g.cs @@ -89,5 +89,6 @@ public WebSearchToolResource( public WebSearchToolResource() { } + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.WebsiteConnectorCreateConfigPayload.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.WebsiteConnectorCreateConfigPayload.Json.g.cs index abd92a3f..3ea5bb1c 100644 --- a/src/libs/AI21/Generated/AI21.Models.WebsiteConnectorCreateConfigPayload.Json.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.WebsiteConnectorCreateConfigPayload.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::AI21.WebsiteConnectorCreateConfigPayload; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::AI21.WebsiteConnectorCreateConfigPayload? FromJson( + string json) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::AI21.WebsiteConnectorCreateConfigPayload; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/AI21/Generated/AI21.Models.WebsiteConnectorCreateConfigPayload.g.cs b/src/libs/AI21/Generated/AI21.Models.WebsiteConnectorCreateConfigPayload.g.cs index 23ba6c18..76370a14 100644 --- a/src/libs/AI21/Generated/AI21.Models.WebsiteConnectorCreateConfigPayload.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.WebsiteConnectorCreateConfigPayload.g.cs @@ -91,5 +91,6 @@ public WebsiteConnectorCreateConfigPayload( public WebsiteConnectorCreateConfigPayload() { } + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.WebsiteConnectorIngestUrlPayload.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.WebsiteConnectorIngestUrlPayload.Json.g.cs index 0cf523ca..af1524db 100644 --- a/src/libs/AI21/Generated/AI21.Models.WebsiteConnectorIngestUrlPayload.Json.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.WebsiteConnectorIngestUrlPayload.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::AI21.WebsiteConnectorIngestUrlPayload; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::AI21.WebsiteConnectorIngestUrlPayload? FromJson( + string json) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::AI21.WebsiteConnectorIngestUrlPayload; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/AI21/Generated/AI21.Models.WebsiteConnectorIngestUrlPayload.g.cs b/src/libs/AI21/Generated/AI21.Models.WebsiteConnectorIngestUrlPayload.g.cs index 143e232b..26519c24 100644 --- a/src/libs/AI21/Generated/AI21.Models.WebsiteConnectorIngestUrlPayload.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.WebsiteConnectorIngestUrlPayload.g.cs @@ -40,5 +40,6 @@ public WebsiteConnectorIngestUrlPayload( public WebsiteConnectorIngestUrlPayload() { } + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.WebsiteConnectorIngestWebsitePayload.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.WebsiteConnectorIngestWebsitePayload.Json.g.cs index a56e5a9f..c4b6ac69 100644 --- a/src/libs/AI21/Generated/AI21.Models.WebsiteConnectorIngestWebsitePayload.Json.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.WebsiteConnectorIngestWebsitePayload.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::AI21.WebsiteConnectorIngestWebsitePayload; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::AI21.WebsiteConnectorIngestWebsitePayload? FromJson( + string json) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::AI21.WebsiteConnectorIngestWebsitePayload; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/AI21/Generated/AI21.Models.WebsiteConnectorIngestWebsitePayload.g.cs b/src/libs/AI21/Generated/AI21.Models.WebsiteConnectorIngestWebsitePayload.g.cs index 0d9ae054..8f3a6272 100644 --- a/src/libs/AI21/Generated/AI21.Models.WebsiteConnectorIngestWebsitePayload.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.WebsiteConnectorIngestWebsitePayload.g.cs @@ -58,5 +58,6 @@ public WebsiteConnectorIngestWebsitePayload( public WebsiteConnectorIngestWebsitePayload() { } + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.WebsiteConnectorPayload.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.WebsiteConnectorPayload.Json.g.cs deleted file mode 100644 index ebcdcfeb..00000000 --- a/src/libs/AI21/Generated/AI21.Models.WebsiteConnectorPayload.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace AI21 -{ - public sealed partial class WebsiteConnectorPayload - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::AI21.WebsiteConnectorPayload? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::AI21.WebsiteConnectorPayload), - jsonSerializerContext) as global::AI21.WebsiteConnectorPayload; - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::AI21.WebsiteConnectorPayload? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::AI21.WebsiteConnectorPayload), - jsonSerializerContext).ConfigureAwait(false)) as global::AI21.WebsiteConnectorPayload; - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/AI21/Generated/AI21.Models.WebsiteConnectorPayload.g.cs b/src/libs/AI21/Generated/AI21.Models.WebsiteConnectorPayload.g.cs deleted file mode 100644 index b5b09b47..00000000 --- a/src/libs/AI21/Generated/AI21.Models.WebsiteConnectorPayload.g.cs +++ /dev/null @@ -1,56 +0,0 @@ - -#nullable enable - -namespace AI21 -{ - /// - /// - /// - public sealed partial class WebsiteConnectorPayload - { - /// - /// - /// - [global::System.Text.Json.Serialization.JsonPropertyName("type")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::AI21.JsonConverters.WebsiteConnectorPayloadTypeJsonConverter))] - [global::System.Text.Json.Serialization.JsonRequired] - public required global::AI21.WebsiteConnectorPayloadType Type { get; set; } - - /// - /// - /// - [global::System.Text.Json.Serialization.JsonPropertyName("value")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::AI21.JsonConverters.AnyOfJsonConverter>))] - [global::System.Text.Json.Serialization.JsonRequired] - public required global::AI21.AnyOf> Value { 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 WebsiteConnectorPayload( - global::AI21.WebsiteConnectorPayloadType type, - global::AI21.AnyOf> value) - { - this.Type = type; - this.Value = value; - } - - /// - /// Initializes a new instance of the class. - /// - public WebsiteConnectorPayload() - { - } - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.WebsiteConnectorPayloadType.g.cs b/src/libs/AI21/Generated/AI21.Models.WebsiteConnectorPayloadType.g.cs deleted file mode 100644 index 74f6ee46..00000000 --- a/src/libs/AI21/Generated/AI21.Models.WebsiteConnectorPayloadType.g.cs +++ /dev/null @@ -1,51 +0,0 @@ - -#nullable enable - -namespace AI21 -{ - /// - /// - /// - public enum WebsiteConnectorPayloadType - { - /// - /// - /// - Sitemap, - /// - /// - /// - Urls, - } - - /// - /// Enum extensions to do fast conversions without the reflection. - /// - public static class WebsiteConnectorPayloadTypeExtensions - { - /// - /// Converts an enum to a string. - /// - public static string ToValueString(this WebsiteConnectorPayloadType value) - { - return value switch - { - WebsiteConnectorPayloadType.Sitemap => "sitemap", - WebsiteConnectorPayloadType.Urls => "urls", - _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), - }; - } - /// - /// Converts an string to a enum. - /// - public static WebsiteConnectorPayloadType? ToEnum(string value) - { - return value switch - { - "sitemap" => WebsiteConnectorPayloadType.Sitemap, - "urls" => WebsiteConnectorPayloadType.Urls, - _ => null, - }; - } - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.WebsiteConnectorRetryIngestWebsitePayload.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.WebsiteConnectorRetryIngestWebsitePayload.Json.g.cs index 38ed0dc3..b3af51db 100644 --- a/src/libs/AI21/Generated/AI21.Models.WebsiteConnectorRetryIngestWebsitePayload.Json.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.WebsiteConnectorRetryIngestWebsitePayload.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::AI21.WebsiteConnectorRetryIngestWebsitePayload; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::AI21.WebsiteConnectorRetryIngestWebsitePayload? FromJson( + string json) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::AI21.WebsiteConnectorRetryIngestWebsitePayload; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/AI21/Generated/AI21.Models.WebsiteConnectorRetryIngestWebsitePayload.g.cs b/src/libs/AI21/Generated/AI21.Models.WebsiteConnectorRetryIngestWebsitePayload.g.cs index 2bf2e81a..02398088 100644 --- a/src/libs/AI21/Generated/AI21.Models.WebsiteConnectorRetryIngestWebsitePayload.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.WebsiteConnectorRetryIngestWebsitePayload.g.cs @@ -40,5 +40,6 @@ public WebsiteConnectorRetryIngestWebsitePayload( public WebsiteConnectorRetryIngestWebsitePayload() { } + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.WorkflowConfig.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.WorkflowConfig.Json.g.cs index 9a0ad3a5..66db6137 100644 --- a/src/libs/AI21/Generated/AI21.Models.WorkflowConfig.Json.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.WorkflowConfig.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::AI21.WorkflowConfig; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::AI21.WorkflowConfig? FromJson( + string json) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::AI21.WorkflowConfig; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/AI21/Generated/AI21.Models.WorkflowConfig.g.cs b/src/libs/AI21/Generated/AI21.Models.WorkflowConfig.g.cs index faf3567e..cc63461a 100644 --- a/src/libs/AI21/Generated/AI21.Models.WorkflowConfig.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.WorkflowConfig.g.cs @@ -58,5 +58,6 @@ public WorkflowConfig( public WorkflowConfig() { } + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.WorkflowConfigAdditionalParams.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.WorkflowConfigAdditionalParams.Json.g.cs index f1dff99a..9a3c0a15 100644 --- a/src/libs/AI21/Generated/AI21.Models.WorkflowConfigAdditionalParams.Json.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.WorkflowConfigAdditionalParams.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::AI21.WorkflowConfigAdditionalParams; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::AI21.WorkflowConfigAdditionalParams? FromJson( + string json) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::AI21.WorkflowConfigAdditionalParams; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/AI21/Generated/AI21.Models.WorkflowConfigAdditionalParams.g.cs b/src/libs/AI21/Generated/AI21.Models.WorkflowConfigAdditionalParams.g.cs index e6f253a8..9b3865f5 100644 --- a/src/libs/AI21/Generated/AI21.Models.WorkflowConfigAdditionalParams.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.WorkflowConfigAdditionalParams.g.cs @@ -14,5 +14,6 @@ public sealed partial class WorkflowConfigAdditionalParams /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.WorkflowConfigHeaders.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.WorkflowConfigHeaders.Json.g.cs index bae0a7f5..aaec64c9 100644 --- a/src/libs/AI21/Generated/AI21.Models.WorkflowConfigHeaders.Json.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.WorkflowConfigHeaders.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::AI21.WorkflowConfigHeaders; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::AI21.WorkflowConfigHeaders? FromJson( + string json) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::AI21.WorkflowConfigHeaders; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/AI21/Generated/AI21.Models.WorkflowConfigHeaders.g.cs b/src/libs/AI21/Generated/AI21.Models.WorkflowConfigHeaders.g.cs index cc242094..0180bcb5 100644 --- a/src/libs/AI21/Generated/AI21.Models.WorkflowConfigHeaders.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.WorkflowConfigHeaders.g.cs @@ -14,5 +14,6 @@ public sealed partial class WorkflowConfigHeaders /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.WorkspaceModelResponse.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.WorkspaceModelResponse.Json.g.cs index 2095d352..096d8e0e 100644 --- a/src/libs/AI21/Generated/AI21.Models.WorkspaceModelResponse.Json.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.WorkspaceModelResponse.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::AI21.WorkspaceModelResponse; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::AI21.WorkspaceModelResponse? FromJson( + string json) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::AI21.WorkspaceModelResponse; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/AI21/Generated/AI21.Models.WorkspaceModelResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.WorkspaceModelResponse.g.cs index a876cff5..1edc1c35 100644 --- a/src/libs/AI21/Generated/AI21.Models.WorkspaceModelResponse.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.WorkspaceModelResponse.g.cs @@ -97,5 +97,6 @@ public WorkspaceModelResponse( public WorkspaceModelResponse() { } + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.WorkspaceModelUpdate.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.WorkspaceModelUpdate.Json.g.cs index 407e05a9..2dc5f248 100644 --- a/src/libs/AI21/Generated/AI21.Models.WorkspaceModelUpdate.Json.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.WorkspaceModelUpdate.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::AI21.WorkspaceModelUpdate; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::AI21.WorkspaceModelUpdate? FromJson( + string json) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::AI21.WorkspaceModelUpdate; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/AI21/Generated/AI21.Models.WorkspaceModelUpdate.g.cs b/src/libs/AI21/Generated/AI21.Models.WorkspaceModelUpdate.g.cs index 5eaa9a9e..8cdcdbca 100644 --- a/src/libs/AI21/Generated/AI21.Models.WorkspaceModelUpdate.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.WorkspaceModelUpdate.g.cs @@ -57,5 +57,6 @@ public WorkspaceModelUpdate( public WorkspaceModelUpdate() { } + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.WorkspaceModelsResponse.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.WorkspaceModelsResponse.Json.g.cs index 14d4d72e..5e591270 100644 --- a/src/libs/AI21/Generated/AI21.Models.WorkspaceModelsResponse.Json.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.WorkspaceModelsResponse.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::AI21.WorkspaceModelsResponse; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::AI21.WorkspaceModelsResponse? FromJson( + string json) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::AI21.WorkspaceModelsResponse; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::AI21.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/AI21/Generated/AI21.Models.WorkspaceModelsResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.WorkspaceModelsResponse.g.cs index 6b57dd64..d41946e7 100644 --- a/src/libs/AI21/Generated/AI21.Models.WorkspaceModelsResponse.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.WorkspaceModelsResponse.g.cs @@ -40,5 +40,6 @@ public WorkspaceModelsResponse( public WorkspaceModelsResponse() { } + } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.WppFeedbackPrefixPreviewSolutionsPreviewWppFeedbackPostResponse.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.WppFeedbackPrefixPreviewSolutionsPreviewWppFeedbackPostResponse.Json.g.cs deleted file mode 100644 index 5bd639c7..00000000 --- a/src/libs/AI21/Generated/AI21.Models.WppFeedbackPrefixPreviewSolutionsPreviewWppFeedbackPostResponse.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace AI21 -{ - public sealed partial class WppFeedbackPrefixPreviewSolutionsPreviewWppFeedbackPostResponse - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::AI21.WppFeedbackPrefixPreviewSolutionsPreviewWppFeedbackPostResponse? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::AI21.WppFeedbackPrefixPreviewSolutionsPreviewWppFeedbackPostResponse), - jsonSerializerContext) as global::AI21.WppFeedbackPrefixPreviewSolutionsPreviewWppFeedbackPostResponse; - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::AI21.WppFeedbackPrefixPreviewSolutionsPreviewWppFeedbackPostResponse? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::AI21.WppFeedbackPrefixPreviewSolutionsPreviewWppFeedbackPostResponse), - jsonSerializerContext).ConfigureAwait(false)) as global::AI21.WppFeedbackPrefixPreviewSolutionsPreviewWppFeedbackPostResponse; - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/AI21/Generated/AI21.Models.WppFeedbackPrefixPreviewSolutionsPreviewWppFeedbackPostResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.WppFeedbackPrefixPreviewSolutionsPreviewWppFeedbackPostResponse.g.cs deleted file mode 100644 index 3f8cb5f6..00000000 --- a/src/libs/AI21/Generated/AI21.Models.WppFeedbackPrefixPreviewSolutionsPreviewWppFeedbackPostResponse.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace AI21 -{ - /// - /// - /// - public sealed partial class WppFeedbackPrefixPreviewSolutionsPreviewWppFeedbackPostResponse - { - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.WppFeedbackSolutionsWppFeedbackPostResponse.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.WppFeedbackSolutionsWppFeedbackPostResponse.Json.g.cs deleted file mode 100644 index c6afe9d4..00000000 --- a/src/libs/AI21/Generated/AI21.Models.WppFeedbackSolutionsWppFeedbackPostResponse.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace AI21 -{ - public sealed partial class WppFeedbackSolutionsWppFeedbackPostResponse - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::AI21.WppFeedbackSolutionsWppFeedbackPostResponse? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::AI21.WppFeedbackSolutionsWppFeedbackPostResponse), - jsonSerializerContext) as global::AI21.WppFeedbackSolutionsWppFeedbackPostResponse; - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::AI21.WppFeedbackSolutionsWppFeedbackPostResponse? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::AI21.WppFeedbackSolutionsWppFeedbackPostResponse), - jsonSerializerContext).ConfigureAwait(false)) as global::AI21.WppFeedbackSolutionsWppFeedbackPostResponse; - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/AI21/Generated/AI21.Models.WppFeedbackSolutionsWppFeedbackPostResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.WppFeedbackSolutionsWppFeedbackPostResponse.g.cs deleted file mode 100644 index a78920d4..00000000 --- a/src/libs/AI21/Generated/AI21.Models.WppFeedbackSolutionsWppFeedbackPostResponse.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace AI21 -{ - /// - /// - /// - public sealed partial class WppFeedbackSolutionsWppFeedbackPostResponse - { - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.WppQueryPrefixPreviewSolutionsPreviewWppQueryPostResponse.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.WppQueryPrefixPreviewSolutionsPreviewWppQueryPostResponse.Json.g.cs deleted file mode 100644 index c1f3f1ea..00000000 --- a/src/libs/AI21/Generated/AI21.Models.WppQueryPrefixPreviewSolutionsPreviewWppQueryPostResponse.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace AI21 -{ - public sealed partial class WppQueryPrefixPreviewSolutionsPreviewWppQueryPostResponse - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::AI21.WppQueryPrefixPreviewSolutionsPreviewWppQueryPostResponse? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::AI21.WppQueryPrefixPreviewSolutionsPreviewWppQueryPostResponse), - jsonSerializerContext) as global::AI21.WppQueryPrefixPreviewSolutionsPreviewWppQueryPostResponse; - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::AI21.WppQueryPrefixPreviewSolutionsPreviewWppQueryPostResponse? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::AI21.WppQueryPrefixPreviewSolutionsPreviewWppQueryPostResponse), - jsonSerializerContext).ConfigureAwait(false)) as global::AI21.WppQueryPrefixPreviewSolutionsPreviewWppQueryPostResponse; - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/AI21/Generated/AI21.Models.WppQueryPrefixPreviewSolutionsPreviewWppQueryPostResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.WppQueryPrefixPreviewSolutionsPreviewWppQueryPostResponse.g.cs deleted file mode 100644 index f5bb126f..00000000 --- a/src/libs/AI21/Generated/AI21.Models.WppQueryPrefixPreviewSolutionsPreviewWppQueryPostResponse.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace AI21 -{ - /// - /// - /// - public sealed partial class WppQueryPrefixPreviewSolutionsPreviewWppQueryPostResponse - { - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.WppQuerySolutionsWppQueryPostResponse.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.WppQuerySolutionsWppQueryPostResponse.Json.g.cs deleted file mode 100644 index c2aa8675..00000000 --- a/src/libs/AI21/Generated/AI21.Models.WppQuerySolutionsWppQueryPostResponse.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace AI21 -{ - public sealed partial class WppQuerySolutionsWppQueryPostResponse - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::AI21.WppQuerySolutionsWppQueryPostResponse? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::AI21.WppQuerySolutionsWppQueryPostResponse), - jsonSerializerContext) as global::AI21.WppQuerySolutionsWppQueryPostResponse; - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::AI21.WppQuerySolutionsWppQueryPostResponse? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::AI21.WppQuerySolutionsWppQueryPostResponse), - jsonSerializerContext).ConfigureAwait(false)) as global::AI21.WppQuerySolutionsWppQueryPostResponse; - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/AI21/Generated/AI21.Models.WppQuerySolutionsWppQueryPostResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.WppQuerySolutionsWppQueryPostResponse.g.cs deleted file mode 100644 index 242d3673..00000000 --- a/src/libs/AI21/Generated/AI21.Models.WppQuerySolutionsWppQueryPostResponse.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace AI21 -{ - /// - /// - /// - public sealed partial class WppQuerySolutionsWppQueryPostResponse - { - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.OptionsSupport.g.cs b/src/libs/AI21/Generated/AI21.OptionsSupport.g.cs new file mode 100644 index 00000000..30dcc959 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.OptionsSupport.g.cs @@ -0,0 +1,937 @@ + +#nullable enable + +namespace AI21 +{ + /// + /// 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::AI21.AutoSDKRetryOptions Retry { get; set; } = new global::AI21.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::AI21.AutoSDKClientOptions AddHook( + global::AI21.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::AI21.IAutoSDKAuthorizationProvider? AuthorizationProvider { get; set; } + + /// + /// Convenience helper that registers + /// using so request-level auth is resolved without + /// touching shared client state. + /// + /// + public global::AI21.AutoSDKClientOptions UseAuthorizationProvider( + global::AI21.IAutoSDKAuthorizationProvider provider) + { + AuthorizationProvider = provider ?? throw new global::System.ArgumentNullException(nameof(provider)); + if (Hooks.Find(static x => x is global::AI21.AutoSDKAuthorizationProviderHook) == null) + { + Hooks.Add(new global::AI21.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::AI21.AutoSDKAuthorizationValue Bearer(string token) => new(value: token, scheme: "Bearer"); + + /// Convenience factory for an API-key header. + public static global::AI21.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::AI21.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::AI21.AutoSDKHook + { + /// + public override async global::System.Threading.Tasks.Task OnBeforeRequestAsync( + global::AI21.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::AI21.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::AI21.AutoSDKHttpRequestOptions.StampAuthorizationOverride(context.Request); + } + + private static void ApplyAuthorization( + global::System.Net.Http.HttpRequestMessage request, + global::AI21.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::AI21.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::AI21.AutoSDKHookContext context); + + /// + /// Runs after a successful HTTP response is received. + /// + /// + global::System.Threading.Tasks.Task OnAfterSuccessAsync( + global::AI21.AutoSDKHookContext context); + + /// + /// Runs after an error response or transport failure is observed. + /// + /// + global::System.Threading.Tasks.Task OnAfterErrorAsync( + global::AI21.AutoSDKHookContext context); + } + + /// + /// Convenience base type for request hooks with no-op defaults. + /// + public abstract class AutoSDKHook : global::AI21.IAutoSDKHook + { + /// + public virtual global::System.Threading.Tasks.Task OnBeforeRequestAsync( + global::AI21.AutoSDKHookContext context) + { + return global::System.Threading.Tasks.Task.CompletedTask; + } + + /// + public virtual global::System.Threading.Tasks.Task OnAfterSuccessAsync( + global::AI21.AutoSDKHookContext context) + { + return global::System.Threading.Tasks.Task.CompletedTask; + } + + /// + public virtual global::System.Threading.Tasks.Task OnAfterErrorAsync( + global::AI21.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::AI21.AutoSDKClientOptions ClientOptions { get; set; } = null!; + + /// + /// The per-request runtime options. + /// + public global::AI21.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::AI21.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::AI21.AutoSDKClientOptions clientOptions, + global::AI21.AutoSDKRequestOptions? requestOptions, + int attempt, + int maxAttempts, + bool willRetry, + global::System.TimeSpan? retryDelay, + string retryReason, + global::System.Threading.CancellationToken cancellationToken) + { + return new global::AI21.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::AI21.AutoSDKClientOptions clientOptions, + global::AI21.AutoSDKHookContext context) + { + return InvokeHooksAsync(clientOptions, static (hook, hookContext) => hook.OnBeforeRequestAsync(hookContext), context); + } + + internal static global::System.Threading.Tasks.Task OnAfterSuccessAsync( + global::AI21.AutoSDKClientOptions clientOptions, + global::AI21.AutoSDKHookContext context) + { + return InvokeHooksAsync(clientOptions, static (hook, hookContext) => hook.OnAfterSuccessAsync(hookContext), context); + } + + internal static global::System.Threading.Tasks.Task OnAfterErrorAsync( + global::AI21.AutoSDKClientOptions clientOptions, + global::AI21.AutoSDKHookContext context) + { + return InvokeHooksAsync(clientOptions, static (hook, hookContext) => hook.OnAfterErrorAsync(hookContext), context); + } + + internal static bool GetReadResponseAsString( + global::AI21.AutoSDKClientOptions clientOptions, + global::AI21.AutoSDKRequestOptions? requestOptions, + bool fallbackValue) + { + return requestOptions?.ReadResponseAsString ?? + clientOptions.ReadResponseAsString ?? + fallbackValue; + } + + internal static global::System.Threading.CancellationTokenSource? CreateTimeoutCancellationTokenSource( + global::AI21.AutoSDKClientOptions clientOptions, + global::AI21.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::AI21.AutoSDKClientOptions clientOptions, + global::AI21.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::AI21.AutoSDKClientOptions clientOptions, + global::AI21.AutoSDKRequestOptions? requestOptions, + global::System.Net.Http.HttpResponseMessage? response, + int attempt) + { + var retryOptions = requestOptions?.Retry ?? clientOptions.Retry ?? new global::AI21.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::AI21.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::AI21.AutoSDKClientOptions clientOptions, + global::System.Func callback, + global::AI21.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/AI21/Generated/AI21.PathBuilder.g.cs b/src/libs/AI21/Generated/AI21.PathBuilder.g.cs index b958ca34..9b14c9a1 100644 --- a/src/libs/AI21/Generated/AI21.PathBuilder.g.cs +++ b/src/libs/AI21/Generated/AI21.PathBuilder.g.cs @@ -275,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/AI21/Generated/AI21.RagEngineClient.V1LibraryManagement.g.cs b/src/libs/AI21/Generated/AI21.RagEngineClient.V1LibraryManagement.g.cs index 339b1515..745b4976 100644 --- a/src/libs/AI21/Generated/AI21.RagEngineClient.V1LibraryManagement.g.cs +++ b/src/libs/AI21/Generated/AI21.RagEngineClient.V1LibraryManagement.g.cs @@ -14,6 +14,7 @@ public partial class RagEngineClient { new global::AI21.EndPointAuthorizationRequirement { Type = "Http", + SchemeId = "HttpBearer", Location = "Header", Name = "Bearer", FriendlyName = "Bearer", @@ -44,10 +45,32 @@ partial void ProcessV1LibraryManagementResponseContent( /// Get Batch Ingestion 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 V1LibraryManagementAsync( global::System.Guid batchId, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await V1LibraryManagementAsResponseAsync( + batchId: batchId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Get Batch Ingestion 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> V1LibraryManagementAsResponseAsync( + global::System.Guid batchId, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( @@ -62,22 +85,44 @@ partial void ProcessV1LibraryManagementResponseContent( securityRequirements: s_V1LibraryManagementSecurityRequirements, operationName: "V1LibraryManagementAsync"); - var __pathBuilder = new global::AI21.PathBuilder( - path: $"/studio/v1/library/batches/{batchId}/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)); + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: $"/studio/v1/library/batches/{batchId}/status", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.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; + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; #endif foreach (var __authorization in __authorizations) { if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2") + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") { __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( scheme: __authorization.Name, @@ -87,150 +132,330 @@ partial void ProcessV1LibraryManagementResponseContent( __authorization.Location == "Header") { __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } + } } + global::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareV1LibraryManagementRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - batchId: batchId); + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareV1LibraryManagementRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + batchId: batchId!); - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); + return __httpRequest; + } - ProcessResponse( - client: HttpClient, - response: __response); - ProcessV1LibraryManagementResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Validation Error - if ((int)__response.StatusCode == 422) + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::AI21.HTTPValidationError? __value_422 = null; - try + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) { - if (ReadResponseAsString) + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1LibraryManagement", + methodName: "V1LibraryManagementAsync", + pathTemplate: "$\"/studio/v1/library/batches/{batchId}/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 { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); } - else + catch (global::System.Net.Http.HttpRequestException __exception) { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1LibraryManagement", + methodName: "V1LibraryManagementAsync", + pathTemplate: "$\"/studio/v1/library/batches/{batchId}/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; + } - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1LibraryManagement", + methodName: "V1LibraryManagementAsync", + pathTemplate: "$\"/studio/v1/library/batches/{batchId}/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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; } - catch (global::System.Exception __ex) + + if (__response == null) { - __exception_422 = __ex; + throw new global::System.InvalidOperationException("No response received."); } - throw new global::AI21.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) + using (__response) { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - ProcessResponseContent( + ProcessResponse( client: HttpClient, - response: __response, - content: ref __content); - ProcessV1LibraryManagementResponseContent( + response: __response); + ProcessV1LibraryManagementResponse( httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) { - __response.EnsureSuccessStatusCode(); - - return - global::AI21.IngestionBatchStatusResponse.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1LibraryManagement", + methodName: "V1LibraryManagementAsync", + pathTemplate: "$\"/studio/v1/library/batches/{batchId}/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); } - catch (global::System.Exception __ex) + else { - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1LibraryManagement", + methodName: "V1LibraryManagementAsync", + pathTemplate: "$\"/studio/v1/library/batches/{batchId}/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 - { - try - { - __response.EnsureSuccessStatusCode(); - using var __content = await __response.Content.ReadAsStreamAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::AI21.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - return - await global::AI21.IngestionBatchStatusResponse.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) - { - } + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessV1LibraryManagementResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::AI21.IngestionBatchStatusResponse.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => 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::AI21.IngestionBatchStatusResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; } } + finally + { + __httpRequest?.Dispose(); + } } } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.RagEngineClient.V1LibraryManagement2.g.cs b/src/libs/AI21/Generated/AI21.RagEngineClient.V1LibraryManagement2.g.cs index 0cf795b5..ff6fcbd1 100644 --- a/src/libs/AI21/Generated/AI21.RagEngineClient.V1LibraryManagement2.g.cs +++ b/src/libs/AI21/Generated/AI21.RagEngineClient.V1LibraryManagement2.g.cs @@ -14,6 +14,7 @@ public partial class RagEngineClient { new global::AI21.EndPointAuthorizationRequirement { Type = "Http", + SchemeId = "HttpBearer", Location = "Header", Name = "Bearer", FriendlyName = "Bearer", @@ -44,10 +45,32 @@ partial void ProcessV1LibraryManagement2ResponseContent( /// Generate Documents Signed Url /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// public async global::System.Threading.Tasks.Task V1LibraryManagement2Async( global::System.Guid fileId, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await V1LibraryManagement2AsResponseAsync( + fileId: fileId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Generate Documents Signed Url + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> V1LibraryManagement2AsResponseAsync( + global::System.Guid fileId, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( @@ -62,22 +85,44 @@ partial void ProcessV1LibraryManagement2ResponseContent( securityRequirements: s_V1LibraryManagement2SecurityRequirements, operationName: "V1LibraryManagement2Async"); - var __pathBuilder = new global::AI21.PathBuilder( - path: $"/studio/v1/library/files/{fileId}/download", - 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)); + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: $"/studio/v1/library/files/{fileId}/download", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.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; + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; #endif foreach (var __authorization in __authorizations) { if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2") + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") { __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( scheme: __authorization.Name, @@ -87,146 +132,326 @@ partial void ProcessV1LibraryManagement2ResponseContent( __authorization.Location == "Header") { __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } + } } + global::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareV1LibraryManagement2Request( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - fileId: fileId); + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareV1LibraryManagement2Request( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + fileId: fileId!); - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); + return __httpRequest; + } - ProcessResponse( - client: HttpClient, - response: __response); - ProcessV1LibraryManagement2Response( - httpClient: HttpClient, - httpResponseMessage: __response); - // Validation Error - if ((int)__response.StatusCode == 422) + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::AI21.HTTPValidationError? __value_422 = null; - try + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) { - if (ReadResponseAsString) + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1LibraryManagement2", + methodName: "V1LibraryManagement2Async", + pathTemplate: "$\"/studio/v1/library/files/{fileId}/download\"", + 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 { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); } - else + catch (global::System.Net.Http.HttpRequestException __exception) { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1LibraryManagement2", + methodName: "V1LibraryManagement2Async", + pathTemplate: "$\"/studio/v1/library/files/{fileId}/download\"", + 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; + } - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1LibraryManagement2", + methodName: "V1LibraryManagement2Async", + pathTemplate: "$\"/studio/v1/library/files/{fileId}/download\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; } - catch (global::System.Exception __ex) + + if (__response == null) { - __exception_422 = __ex; + throw new global::System.InvalidOperationException("No response received."); } - throw new global::AI21.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) + using (__response) { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - ProcessResponseContent( + ProcessResponse( client: HttpClient, - response: __response, - content: ref __content); - ProcessV1LibraryManagement2ResponseContent( + response: __response); + ProcessV1LibraryManagement2Response( httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) { - __response.EnsureSuccessStatusCode(); - - return __content; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1LibraryManagement2", + methodName: "V1LibraryManagement2Async", + pathTemplate: "$\"/studio/v1/library/files/{fileId}/download\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } - catch (global::System.Exception __ex) + else { - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1LibraryManagement2", + methodName: "V1LibraryManagement2Async", + pathTemplate: "$\"/studio/v1/library/files/{fileId}/download\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::AI21.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).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) - { - } + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessV1LibraryManagement2ResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? 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::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.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::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; } } + finally + { + __httpRequest?.Dispose(); + } } } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.RagEngineClient.V1LibraryManagement3.g.cs b/src/libs/AI21/Generated/AI21.RagEngineClient.V1LibraryManagement3.g.cs index 92aca013..d2e3ec0f 100644 --- a/src/libs/AI21/Generated/AI21.RagEngineClient.V1LibraryManagement3.g.cs +++ b/src/libs/AI21/Generated/AI21.RagEngineClient.V1LibraryManagement3.g.cs @@ -14,6 +14,7 @@ public partial class RagEngineClient { new global::AI21.EndPointAuthorizationRequirement { Type = "Http", + SchemeId = "HttpBearer", Location = "Header", Name = "Bearer", FriendlyName = "Bearer", @@ -45,10 +46,33 @@ partial void ProcessV1LibraryManagement3ResponseContent( /// Download parsed document with Content-Disposition header for immediate download. /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// public async global::System.Threading.Tasks.Task V1LibraryManagement3Async( global::System.Guid fileId, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await V1LibraryManagement3AsResponseAsync( + fileId: fileId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Download Parsed Document
+ /// Download parsed document with Content-Disposition header for immediate download. + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> V1LibraryManagement3AsResponseAsync( + global::System.Guid fileId, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( @@ -63,22 +87,44 @@ partial void ProcessV1LibraryManagement3ResponseContent( securityRequirements: s_V1LibraryManagement3SecurityRequirements, operationName: "V1LibraryManagement3Async"); - var __pathBuilder = new global::AI21.PathBuilder( - path: $"/studio/v1/library/files/{fileId}/parsed", - 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)); + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: $"/studio/v1/library/files/{fileId}/parsed", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.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; + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; #endif foreach (var __authorization in __authorizations) { if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2") + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") { __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( scheme: __authorization.Name, @@ -88,146 +134,326 @@ partial void ProcessV1LibraryManagement3ResponseContent( __authorization.Location == "Header") { __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } + } } + global::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareV1LibraryManagement3Request( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - fileId: fileId); + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareV1LibraryManagement3Request( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + fileId: fileId!); - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); + return __httpRequest; + } - ProcessResponse( - client: HttpClient, - response: __response); - ProcessV1LibraryManagement3Response( - httpClient: HttpClient, - httpResponseMessage: __response); - // Validation Error - if ((int)__response.StatusCode == 422) + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::AI21.HTTPValidationError? __value_422 = null; - try + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) { - if (ReadResponseAsString) + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1LibraryManagement3", + methodName: "V1LibraryManagement3Async", + pathTemplate: "$\"/studio/v1/library/files/{fileId}/parsed\"", + 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 { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); } - else + catch (global::System.Net.Http.HttpRequestException __exception) { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1LibraryManagement3", + methodName: "V1LibraryManagement3Async", + pathTemplate: "$\"/studio/v1/library/files/{fileId}/parsed\"", + 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; + } - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1LibraryManagement3", + methodName: "V1LibraryManagement3Async", + pathTemplate: "$\"/studio/v1/library/files/{fileId}/parsed\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; } - catch (global::System.Exception __ex) + + if (__response == null) { - __exception_422 = __ex; + throw new global::System.InvalidOperationException("No response received."); } - throw new global::AI21.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) + using (__response) { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - ProcessResponseContent( + ProcessResponse( client: HttpClient, - response: __response, - content: ref __content); - ProcessV1LibraryManagement3ResponseContent( + response: __response); + ProcessV1LibraryManagement3Response( httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) { - __response.EnsureSuccessStatusCode(); - - return __content; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1LibraryManagement3", + methodName: "V1LibraryManagement3Async", + pathTemplate: "$\"/studio/v1/library/files/{fileId}/parsed\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } - catch (global::System.Exception __ex) + else { - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1LibraryManagement3", + methodName: "V1LibraryManagement3Async", + pathTemplate: "$\"/studio/v1/library/files/{fileId}/parsed\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::AI21.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).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) - { - } + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessV1LibraryManagement3ResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? 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::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.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::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; } } + finally + { + __httpRequest?.Dispose(); + } } } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.RagEngineClient.V1LibrarySearch.g.cs b/src/libs/AI21/Generated/AI21.RagEngineClient.V1LibrarySearch.g.cs deleted file mode 100644 index af68f868..00000000 --- a/src/libs/AI21/Generated/AI21.RagEngineClient.V1LibrarySearch.g.cs +++ /dev/null @@ -1,296 +0,0 @@ - -#nullable enable - -namespace AI21 -{ - public partial class RagEngineClient - { - - - private static readonly global::AI21.EndPointSecurityRequirement s_V1LibrarySearchSecurityRequirement0 = - new global::AI21.EndPointSecurityRequirement - { - Authorizations = new global::AI21.EndPointAuthorizationRequirement[] - { new global::AI21.EndPointAuthorizationRequirement - { - Type = "Http", - Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", - }, - }, - }; - private static readonly global::AI21.EndPointSecurityRequirement[] s_V1LibrarySearchSecurityRequirements = - new global::AI21.EndPointSecurityRequirement[] - { s_V1LibrarySearchSecurityRequirement0, - }; - partial void PrepareV1LibrarySearchArguments( - global::System.Net.Http.HttpClient httpClient, - global::AI21.LibrarySearchRequest request); - partial void PrepareV1LibrarySearchRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - global::AI21.LibrarySearchRequest request); - partial void ProcessV1LibrarySearchResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessV1LibrarySearchResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Search - /// - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task V1LibrarySearchAsync( - - global::AI21.LibrarySearchRequest request, - global::System.Threading.CancellationToken cancellationToken = default) - { - request = request ?? throw new global::System.ArgumentNullException(nameof(request)); - - PrepareArguments( - client: HttpClient); - PrepareV1LibrarySearchArguments( - httpClient: HttpClient, - request: request); - - - var __authorizations = global::AI21.EndPointSecurityResolver.ResolveAuthorizations( - availableAuthorizations: Authorizations, - securityRequirements: s_V1LibrarySearchSecurityRequirements, - operationName: "V1LibrarySearchAsync"); - - var __pathBuilder = new global::AI21.PathBuilder( - path: "/studio/v1/library/search", - 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); - PrepareV1LibrarySearchRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - 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); - ProcessV1LibrarySearchResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Validation Error - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::AI21.HTTPValidationError? __value_422 = null; - try - { - if (ReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - throw new global::AI21.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) - { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessV1LibrarySearchResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return __content; - } - catch (global::System.Exception __ex) - { - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __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::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - } - /// - /// Search - /// - /// - /// - /// - /// - /// - /// - /// Default Value: AND - /// - /// - /// - /// Default Value: segments - /// - /// - /// Default Value: 1 - /// - /// - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task V1LibrarySearchAsync( - string query, - int? maxSegments = default, - string? path = default, - global::System.Collections.Generic.IList? labels = default, - global::AI21.QueryFilter? labelsFilter = default, - global::AI21.LibrarySearchRequestLabelsFilterMode? labelsFilterMode = default, - global::System.Collections.Generic.IList? fileIds = default, - global::AI21.RetrievalStrategy? retrievalStrategy = default, - int? maxNeighbors = default, - double? retrievalSimilarityThreshold = default, - double? hybridSearchAlpha = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __request = new global::AI21.LibrarySearchRequest - { - Query = query, - MaxSegments = maxSegments, - Path = path, - Labels = labels, - LabelsFilter = labelsFilter, - LabelsFilterMode = labelsFilterMode, - FileIds = fileIds, - RetrievalStrategy = retrievalStrategy, - MaxNeighbors = maxNeighbors, - RetrievalSimilarityThreshold = retrievalSimilarityThreshold, - HybridSearchAlpha = hybridSearchAlpha, - }; - - return await V1LibrarySearchAsync( - request: __request, - cancellationToken: cancellationToken).ConfigureAwait(false); - } - } -} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.RagEngineClient.g.cs b/src/libs/AI21/Generated/AI21.RagEngineClient.g.cs index 902b80d3..dc233d73 100644 --- a/src/libs/AI21/Generated/AI21.RagEngineClient.g.cs +++ b/src/libs/AI21/Generated/AI21.RagEngineClient.g.cs @@ -30,6 +30,9 @@ public sealed partial class RagEngineClient : global::AI21.IRagEngineClient, glo #if DEBUG = true; #endif + + /// + public global::AI21.AutoSDKClientOptions Options { get; } /// /// /// @@ -49,11 +52,58 @@ public RagEngineClient( 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 RagEngineClient 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 RagEngineClient( + global::System.Net.Http.HttpClient? httpClient, + global::System.Collections.Generic.List? authorizations, + global::AI21.AutoSDKClientOptions? options, + bool disposeHttpClient = true) : this( + httpClient, + baseUri: null, + authorizations, + options, + disposeHttpClient: disposeHttpClient) + { + } + + /// + /// Creates a new instance of the RagEngineClient. + /// 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 RagEngineClient( + global::System.Net.Http.HttpClient? httpClient, + global::System.Uri? baseUri, + global::System.Collections.Generic.List? authorizations, + global::AI21.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::AI21.AutoSDKClientOptions(); _disposeHttpClient = disposeHttpClient; Initialized(HttpClient); diff --git a/src/libs/AI21/Generated/AI21.SecretsClient.V1SecretStorage.g.cs b/src/libs/AI21/Generated/AI21.SecretsClient.V1SecretStorage.g.cs index 936a58d7..86c3aad5 100644 --- a/src/libs/AI21/Generated/AI21.SecretsClient.V1SecretStorage.g.cs +++ b/src/libs/AI21/Generated/AI21.SecretsClient.V1SecretStorage.g.cs @@ -14,6 +14,7 @@ public partial class SecretsClient { new global::AI21.EndPointAuthorizationRequirement { Type = "Http", + SchemeId = "HttpBearer", Location = "Header", Name = "Bearer", FriendlyName = "Bearer", @@ -41,9 +42,28 @@ partial void ProcessV1SecretStorageResponseContent( /// /// Get Secret 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 V1SecretStorageAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await V1SecretStorageAsResponseAsync( + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Get Secret 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> V1SecretStorageAsResponseAsync( + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( @@ -57,22 +77,44 @@ partial void ProcessV1SecretStorageResponseContent( securityRequirements: s_V1SecretStorageSecurityRequirements, operationName: "V1SecretStorageAsync"); - var __pathBuilder = new global::AI21.PathBuilder( - path: "/studio/v1/secrets", - 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)); + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: "/studio/v1/secrets", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.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; + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; #endif foreach (var __authorization in __authorizations) { if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2") + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") { __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( scheme: __authorization.Name, @@ -82,107 +124,288 @@ partial void ProcessV1SecretStorageResponseContent( __authorization.Location == "Header") { __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } + } } + global::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareV1SecretStorageRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareV1SecretStorageRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest); - ProcessResponse( - client: HttpClient, - response: __response); - ProcessV1SecretStorageResponse( - httpClient: HttpClient, - httpResponseMessage: __response); + return __httpRequest; + } - if (ReadResponseAsString) + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SecretStorage", + methodName: "V1SecretStorageAsync", + pathTemplate: "\"/studio/v1/secrets\"", + 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::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SecretStorage", + methodName: "V1SecretStorageAsync", + pathTemplate: "\"/studio/v1/secrets\"", + 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; + } - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessV1SecretStorageResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } - try - { - __response.EnsureSuccessStatusCode(); + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SecretStorage", + methodName: "V1SecretStorageAsync", + pathTemplate: "\"/studio/v1/secrets\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } - return __content; + break; } - catch (global::System.Exception __ex) + + if (__response == null) { - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; + throw new global::System.InvalidOperationException("No response received."); } - } - else - { - try + + using (__response) { - __response.EnsureSuccessStatusCode(); - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - return __content; + ProcessResponse( + client: HttpClient, + response: __response); + ProcessV1SecretStorageResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SecretStorage", + methodName: "V1SecretStorageAsync", + pathTemplate: "\"/studio/v1/secrets\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } - catch (global::System.Exception __ex) + else { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SecretStorage", + methodName: "V1SecretStorageAsync", + pathTemplate: "\"/studio/v1/secrets\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: __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); + ProcessV1SecretStorageResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? 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::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.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::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; } } + finally + { + __httpRequest?.Dispose(); + } } } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.SecretsClient.V1SecretStorage2.g.cs b/src/libs/AI21/Generated/AI21.SecretsClient.V1SecretStorage2.g.cs index ac5c87d5..ab1eebf2 100644 --- a/src/libs/AI21/Generated/AI21.SecretsClient.V1SecretStorage2.g.cs +++ b/src/libs/AI21/Generated/AI21.SecretsClient.V1SecretStorage2.g.cs @@ -14,6 +14,7 @@ public partial class SecretsClient { new global::AI21.EndPointAuthorizationRequirement { Type = "Http", + SchemeId = "HttpBearer", Location = "Header", Name = "Bearer", FriendlyName = "Bearer", @@ -44,11 +45,35 @@ partial void ProcessV1SecretStorage2ResponseContent( /// Save Secret /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// public async global::System.Threading.Tasks.Task V1SecretStorage2Async( global::AI21.CreateSecretPayload request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await V1SecretStorage2AsResponseAsync( + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Save Secret + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> V1SecretStorage2AsResponseAsync( + + global::AI21.CreateSecretPayload request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) { request = request ?? throw new global::System.ArgumentNullException(nameof(request)); @@ -65,22 +90,44 @@ partial void ProcessV1SecretStorage2ResponseContent( securityRequirements: s_V1SecretStorage2SecurityRequirements, operationName: "V1SecretStorage2Async"); - var __pathBuilder = new global::AI21.PathBuilder( - path: "/studio/v1/secrets", - 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)); + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: "/studio/v1/secrets", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.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; + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; #endif foreach (var __authorization in __authorizations) { if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2") + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") { __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( scheme: __authorization.Name, @@ -90,163 +137,345 @@ partial void ProcessV1SecretStorage2ResponseContent( __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); - PrepareV1SecretStorage2Request( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - request: request); + 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::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareV1SecretStorage2Request( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + request: request); - ProcessResponse( - client: HttpClient, - response: __response); - ProcessV1SecretStorage2Response( - httpClient: HttpClient, - httpResponseMessage: __response); - // Validation Error - if ((int)__response.StatusCode == 422) + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::AI21.HTTPValidationError? __value_422 = null; - try + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) { - if (ReadResponseAsString) + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SecretStorage2", + methodName: "V1SecretStorage2Async", + pathTemplate: "\"/studio/v1/secrets\"", + 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 { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); } - else + catch (global::System.Net.Http.HttpRequestException __exception) { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SecretStorage2", + methodName: "V1SecretStorage2Async", + pathTemplate: "\"/studio/v1/secrets\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SecretStorage2", + methodName: "V1SecretStorage2Async", + pathTemplate: "\"/studio/v1/secrets\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; } + + break; } - catch (global::System.Exception __ex) + + if (__response == null) { - __exception_422 = __ex; + throw new global::System.InvalidOperationException("No response received."); } - throw new global::AI21.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) + using (__response) { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - ProcessResponseContent( + ProcessResponse( client: HttpClient, - response: __response, - content: ref __content); - ProcessV1SecretStorage2ResponseContent( + response: __response); + ProcessV1SecretStorage2Response( httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) { - __response.EnsureSuccessStatusCode(); - - return __content; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SecretStorage2", + methodName: "V1SecretStorage2Async", + pathTemplate: "\"/studio/v1/secrets\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } - catch (global::System.Exception __ex) + else { - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SecretStorage2", + methodName: "V1SecretStorage2Async", + pathTemplate: "\"/studio/v1/secrets\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::AI21.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).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) - { - } + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessV1SecretStorage2ResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? 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::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.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::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; } } + finally + { + __httpRequest?.Dispose(); + } } /// /// Save Secret /// /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// public async global::System.Threading.Tasks.Task V1SecretStorage2Async( string secretName, string secretValue, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) { var __request = new global::AI21.CreateSecretPayload @@ -257,6 +486,7 @@ partial void ProcessV1SecretStorage2ResponseContent( return await V1SecretStorage2Async( request: __request, + requestOptions: requestOptions, cancellationToken: cancellationToken).ConfigureAwait(false); } } diff --git a/src/libs/AI21/Generated/AI21.SecretsClient.V1SecretStorage3.g.cs b/src/libs/AI21/Generated/AI21.SecretsClient.V1SecretStorage3.g.cs index bf282ef4..a4a22faa 100644 --- a/src/libs/AI21/Generated/AI21.SecretsClient.V1SecretStorage3.g.cs +++ b/src/libs/AI21/Generated/AI21.SecretsClient.V1SecretStorage3.g.cs @@ -14,6 +14,7 @@ public partial class SecretsClient { new global::AI21.EndPointAuthorizationRequirement { Type = "Http", + SchemeId = "HttpBearer", Location = "Header", Name = "Bearer", FriendlyName = "Bearer", @@ -44,10 +45,32 @@ partial void ProcessV1SecretStorage3ResponseContent( /// Delete Secret /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// public async global::System.Threading.Tasks.Task V1SecretStorage3Async( string secretId, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await V1SecretStorage3AsResponseAsync( + secretId: secretId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Delete Secret + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> V1SecretStorage3AsResponseAsync( + string secretId, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( @@ -62,25 +85,47 @@ partial void ProcessV1SecretStorage3ResponseContent( securityRequirements: s_V1SecretStorage3SecurityRequirements, operationName: "V1SecretStorage3Async"); - var __pathBuilder = new global::AI21.PathBuilder( - path: "/studio/v1/secrets", - baseUri: HttpClient.BaseAddress); - __pathBuilder - .AddRequiredParameter("secret_id", secretId) - ; - 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)); + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: "/studio/v1/secrets", + baseUri: HttpClient.BaseAddress); + __pathBuilder + .AddRequiredParameter("secret_id", secretId) + ; + var __path = __pathBuilder.ToString(); + __path = global::AI21.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; + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; #endif foreach (var __authorization in __authorizations) { if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2") + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") { __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( scheme: __authorization.Name, @@ -90,146 +135,326 @@ partial void ProcessV1SecretStorage3ResponseContent( __authorization.Location == "Header") { __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } + } } + global::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareV1SecretStorage3Request( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - secretId: secretId); + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareV1SecretStorage3Request( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + secretId: secretId!); - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); + return __httpRequest; + } - ProcessResponse( - client: HttpClient, - response: __response); - ProcessV1SecretStorage3Response( - httpClient: HttpClient, - httpResponseMessage: __response); - // Validation Error - if ((int)__response.StatusCode == 422) + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::AI21.HTTPValidationError? __value_422 = null; - try + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) { - if (ReadResponseAsString) + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SecretStorage3", + methodName: "V1SecretStorage3Async", + pathTemplate: "\"/studio/v1/secrets\"", + 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 { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); } - else + catch (global::System.Net.Http.HttpRequestException __exception) { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SecretStorage3", + methodName: "V1SecretStorage3Async", + pathTemplate: "\"/studio/v1/secrets\"", + 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; + } - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SecretStorage3", + methodName: "V1SecretStorage3Async", + pathTemplate: "\"/studio/v1/secrets\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; } - catch (global::System.Exception __ex) + + if (__response == null) { - __exception_422 = __ex; + throw new global::System.InvalidOperationException("No response received."); } - throw new global::AI21.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) + using (__response) { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - ProcessResponseContent( + ProcessResponse( client: HttpClient, - response: __response, - content: ref __content); - ProcessV1SecretStorage3ResponseContent( + response: __response); + ProcessV1SecretStorage3Response( httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) { - __response.EnsureSuccessStatusCode(); - - return __content; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SecretStorage3", + methodName: "V1SecretStorage3Async", + pathTemplate: "\"/studio/v1/secrets\"", + 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); } - catch (global::System.Exception __ex) + else { - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SecretStorage3", + methodName: "V1SecretStorage3Async", + pathTemplate: "\"/studio/v1/secrets\"", + 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 - { - try - { - __response.EnsureSuccessStatusCode(); - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::AI21.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).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) - { - } + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessV1SecretStorage3ResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? 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::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.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::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; } } + finally + { + __httpRequest?.Dispose(); + } } } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.SecretsClient.V1SecretStorage4.g.cs b/src/libs/AI21/Generated/AI21.SecretsClient.V1SecretStorage4.g.cs index e5f4fd31..21359ce9 100644 --- a/src/libs/AI21/Generated/AI21.SecretsClient.V1SecretStorage4.g.cs +++ b/src/libs/AI21/Generated/AI21.SecretsClient.V1SecretStorage4.g.cs @@ -14,6 +14,7 @@ public partial class SecretsClient { new global::AI21.EndPointAuthorizationRequirement { Type = "Http", + SchemeId = "HttpBearer", Location = "Header", Name = "Bearer", FriendlyName = "Bearer", @@ -47,12 +48,39 @@ partial void ProcessV1SecretStorage4ResponseContent( /// /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// public async global::System.Threading.Tasks.Task V1SecretStorage4Async( string secretId, global::AI21.UpdateSecretPayload request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await V1SecretStorage4AsResponseAsync( + secretId: secretId, + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Update Secret + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> V1SecretStorage4AsResponseAsync( + string secretId, + + global::AI21.UpdateSecretPayload request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) { request = request ?? throw new global::System.ArgumentNullException(nameof(request)); @@ -70,22 +98,44 @@ partial void ProcessV1SecretStorage4ResponseContent( securityRequirements: s_V1SecretStorage4SecurityRequirements, operationName: "V1SecretStorage4Async"); - var __pathBuilder = new global::AI21.PathBuilder( - path: $"/studio/v1/secrets/{secretId}", - 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)); + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: $"/studio/v1/secrets/{secretId}", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.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; + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; #endif foreach (var __authorization in __authorizations) { if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2") + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") { __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( scheme: __authorization.Name, @@ -95,153 +145,333 @@ partial void ProcessV1SecretStorage4ResponseContent( __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); - PrepareV1SecretStorage4Request( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - secretId: secretId, - request: request); + 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::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareV1SecretStorage4Request( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + secretId: secretId!, + request: request); - ProcessResponse( - client: HttpClient, - response: __response); - ProcessV1SecretStorage4Response( - httpClient: HttpClient, - httpResponseMessage: __response); - // Validation Error - if ((int)__response.StatusCode == 422) + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::AI21.HTTPValidationError? __value_422 = null; - try + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) { - if (ReadResponseAsString) + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SecretStorage4", + methodName: "V1SecretStorage4Async", + pathTemplate: "$\"/studio/v1/secrets/{secretId}\"", + 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 { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); } - else + catch (global::System.Net.Http.HttpRequestException __exception) { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SecretStorage4", + methodName: "V1SecretStorage4Async", + pathTemplate: "$\"/studio/v1/secrets/{secretId}\"", + 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; + } - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SecretStorage4", + methodName: "V1SecretStorage4Async", + pathTemplate: "$\"/studio/v1/secrets/{secretId}\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; } - catch (global::System.Exception __ex) + + if (__response == null) { - __exception_422 = __ex; + throw new global::System.InvalidOperationException("No response received."); } - throw new global::AI21.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) + using (__response) { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( + ProcessResponse( client: HttpClient, - response: __response, - content: ref __content); - ProcessV1SecretStorage4ResponseContent( + response: __response); + ProcessV1SecretStorage4Response( httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) { - __response.EnsureSuccessStatusCode(); - - return __content; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SecretStorage4", + methodName: "V1SecretStorage4Async", + pathTemplate: "$\"/studio/v1/secrets/{secretId}\"", + 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); } - catch (global::System.Exception __ex) + else { - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1SecretStorage4", + methodName: "V1SecretStorage4Async", + pathTemplate: "$\"/studio/v1/secrets/{secretId}\"", + 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 - { - try - { - __response.EnsureSuccessStatusCode(); - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::AI21.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).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) - { - } + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessV1SecretStorage4ResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? 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::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.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::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; } } + finally + { + __httpRequest?.Dispose(); + } } /// /// Update Secret @@ -249,12 +479,14 @@ partial void ProcessV1SecretStorage4ResponseContent( /// /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// public async global::System.Threading.Tasks.Task V1SecretStorage4Async( string secretId, string? secretName = default, string? secretValue = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) { var __request = new global::AI21.UpdateSecretPayload @@ -266,6 +498,7 @@ partial void ProcessV1SecretStorage4ResponseContent( return await V1SecretStorage4Async( secretId: secretId, request: __request, + requestOptions: requestOptions, cancellationToken: cancellationToken).ConfigureAwait(false); } } diff --git a/src/libs/AI21/Generated/AI21.SecretsClient.g.cs b/src/libs/AI21/Generated/AI21.SecretsClient.g.cs index 7f9c8028..5f689dc0 100644 --- a/src/libs/AI21/Generated/AI21.SecretsClient.g.cs +++ b/src/libs/AI21/Generated/AI21.SecretsClient.g.cs @@ -30,6 +30,9 @@ public sealed partial class SecretsClient : global::AI21.ISecretsClient, global: #if DEBUG = true; #endif + + /// + public global::AI21.AutoSDKClientOptions Options { get; } /// /// /// @@ -49,11 +52,58 @@ public SecretsClient( 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 SecretsClient 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 SecretsClient( + global::System.Net.Http.HttpClient? httpClient, + global::System.Collections.Generic.List? authorizations, + global::AI21.AutoSDKClientOptions? options, + bool disposeHttpClient = true) : this( + httpClient, + baseUri: null, + authorizations, + options, + disposeHttpClient: disposeHttpClient) + { + } + + /// + /// Creates a new instance of the SecretsClient. + /// 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 SecretsClient( + global::System.Net.Http.HttpClient? httpClient, + global::System.Uri? baseUri, + global::System.Collections.Generic.List? authorizations, + global::AI21.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::AI21.AutoSDKClientOptions(); _disposeHttpClient = disposeHttpClient; Initialized(HttpClient); diff --git a/src/libs/AI21/Generated/AI21.Security.g.cs b/src/libs/AI21/Generated/AI21.Security.g.cs index cfc236d4..a2356a01 100644 --- a/src/libs/AI21/Generated/AI21.Security.g.cs +++ b/src/libs/AI21/Generated/AI21.Security.g.cs @@ -6,6 +6,8 @@ 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; @@ -97,7 +99,18 @@ private static bool Matches( return requiredAuthorization.Type switch { - "OAuth2" => true, + "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, diff --git a/src/libs/AI21/Generated/AI21.WebsiteConnectorClient.V1WebsiteConnectorCreateConfig.g.cs b/src/libs/AI21/Generated/AI21.WebsiteConnectorClient.V1WebsiteConnectorCreateConfig.g.cs index 0f098cae..c8093c82 100644 --- a/src/libs/AI21/Generated/AI21.WebsiteConnectorClient.V1WebsiteConnectorCreateConfig.g.cs +++ b/src/libs/AI21/Generated/AI21.WebsiteConnectorClient.V1WebsiteConnectorCreateConfig.g.cs @@ -14,6 +14,7 @@ public partial class WebsiteConnectorClient { new global::AI21.EndPointAuthorizationRequirement { Type = "Http", + SchemeId = "HttpBearer", Location = "Header", Name = "Bearer", FriendlyName = "Bearer", @@ -44,11 +45,35 @@ partial void ProcessV1WebsiteConnectorCreateConfigResponseContent( /// Create Client 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 V1WebsiteConnectorCreateConfigAsync( global::AI21.WebsiteConnectorCreateConfigPayload request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await V1WebsiteConnectorCreateConfigAsResponseAsync( + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Create Client 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> V1WebsiteConnectorCreateConfigAsResponseAsync( + + global::AI21.WebsiteConnectorCreateConfigPayload request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) { request = request ?? throw new global::System.ArgumentNullException(nameof(request)); @@ -65,22 +90,44 @@ partial void ProcessV1WebsiteConnectorCreateConfigResponseContent( securityRequirements: s_V1WebsiteConnectorCreateConfigSecurityRequirements, operationName: "V1WebsiteConnectorCreateConfigAsync"); - var __pathBuilder = new global::AI21.PathBuilder( - path: "/studio/v1/website-connector/client-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)); + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: "/studio/v1/website-connector/client-config", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.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; + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; #endif foreach (var __authorization in __authorizations) { if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2") + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") { __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( scheme: __authorization.Name, @@ -90,152 +137,332 @@ partial void ProcessV1WebsiteConnectorCreateConfigResponseContent( __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); - PrepareV1WebsiteConnectorCreateConfigRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - request: request); + 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::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareV1WebsiteConnectorCreateConfigRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + request: request); - ProcessResponse( - client: HttpClient, - response: __response); - ProcessV1WebsiteConnectorCreateConfigResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Validation Error - if ((int)__response.StatusCode == 422) + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::AI21.HTTPValidationError? __value_422 = null; - try + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) { - if (ReadResponseAsString) + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1WebsiteConnectorCreateConfig", + methodName: "V1WebsiteConnectorCreateConfigAsync", + pathTemplate: "\"/studio/v1/website-connector/client-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 { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); } - else + catch (global::System.Net.Http.HttpRequestException __exception) { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1WebsiteConnectorCreateConfig", + methodName: "V1WebsiteConnectorCreateConfigAsync", + pathTemplate: "\"/studio/v1/website-connector/client-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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1WebsiteConnectorCreateConfig", + methodName: "V1WebsiteConnectorCreateConfigAsync", + pathTemplate: "\"/studio/v1/website-connector/client-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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; } + + break; } - catch (global::System.Exception __ex) + + if (__response == null) { - __exception_422 = __ex; + throw new global::System.InvalidOperationException("No response received."); } - throw new global::AI21.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) + using (__response) { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - ProcessResponseContent( + ProcessResponse( client: HttpClient, - response: __response, - content: ref __content); - ProcessV1WebsiteConnectorCreateConfigResponseContent( + response: __response); + ProcessV1WebsiteConnectorCreateConfigResponse( httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) { - __response.EnsureSuccessStatusCode(); - - return __content; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1WebsiteConnectorCreateConfig", + methodName: "V1WebsiteConnectorCreateConfigAsync", + pathTemplate: "\"/studio/v1/website-connector/client-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); } - catch (global::System.Exception __ex) + else { - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1WebsiteConnectorCreateConfig", + methodName: "V1WebsiteConnectorCreateConfigAsync", + pathTemplate: "\"/studio/v1/website-connector/client-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 - { - try - { - __response.EnsureSuccessStatusCode(); - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::AI21.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).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) - { - } + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessV1WebsiteConnectorCreateConfigResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? 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::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.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::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; } } + finally + { + __httpRequest?.Dispose(); + } } /// /// Create Client Config @@ -250,6 +477,7 @@ partial void ProcessV1WebsiteConnectorCreateConfigResponseContent( /// /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// public async global::System.Threading.Tasks.Task V1WebsiteConnectorCreateConfigAsync( @@ -259,6 +487,7 @@ partial void ProcessV1WebsiteConnectorCreateConfigResponseContent( bool? extractLinkedFiles = default, bool? waitForDynamicContent = default, string? localization = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) { var __request = new global::AI21.WebsiteConnectorCreateConfigPayload @@ -273,6 +502,7 @@ partial void ProcessV1WebsiteConnectorCreateConfigResponseContent( return await V1WebsiteConnectorCreateConfigAsync( request: __request, + requestOptions: requestOptions, cancellationToken: cancellationToken).ConfigureAwait(false); } } diff --git a/src/libs/AI21/Generated/AI21.WebsiteConnectorClient.V1WebsiteConnectorGetConfig.g.cs b/src/libs/AI21/Generated/AI21.WebsiteConnectorClient.V1WebsiteConnectorGetConfig.g.cs index af1c7258..40da99e1 100644 --- a/src/libs/AI21/Generated/AI21.WebsiteConnectorClient.V1WebsiteConnectorGetConfig.g.cs +++ b/src/libs/AI21/Generated/AI21.WebsiteConnectorClient.V1WebsiteConnectorGetConfig.g.cs @@ -14,6 +14,7 @@ public partial class WebsiteConnectorClient { new global::AI21.EndPointAuthorizationRequirement { Type = "Http", + SchemeId = "HttpBearer", Location = "Header", Name = "Bearer", FriendlyName = "Bearer", @@ -44,10 +45,32 @@ partial void ProcessV1WebsiteConnectorGetConfigResponseContent( /// Get Client 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 V1WebsiteConnectorGetConfigAsync( string configName, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await V1WebsiteConnectorGetConfigAsResponseAsync( + configName: configName, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Get Client 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> V1WebsiteConnectorGetConfigAsResponseAsync( + string configName, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( @@ -62,25 +85,47 @@ partial void ProcessV1WebsiteConnectorGetConfigResponseContent( securityRequirements: s_V1WebsiteConnectorGetConfigSecurityRequirements, operationName: "V1WebsiteConnectorGetConfigAsync"); - var __pathBuilder = new global::AI21.PathBuilder( - path: "/studio/v1/website-connector/client-config", - baseUri: HttpClient.BaseAddress); - __pathBuilder - .AddRequiredParameter("config_name", configName) - ; - 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)); + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: "/studio/v1/website-connector/client-config", + baseUri: HttpClient.BaseAddress); + __pathBuilder + .AddRequiredParameter("config_name", configName) + ; + var __path = __pathBuilder.ToString(); + __path = global::AI21.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; + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; #endif foreach (var __authorization in __authorizations) { if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2") + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") { __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( scheme: __authorization.Name, @@ -90,146 +135,326 @@ partial void ProcessV1WebsiteConnectorGetConfigResponseContent( __authorization.Location == "Header") { __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } + } } + global::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareV1WebsiteConnectorGetConfigRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - configName: configName); + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareV1WebsiteConnectorGetConfigRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + configName: configName!); - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); + return __httpRequest; + } - ProcessResponse( - client: HttpClient, - response: __response); - ProcessV1WebsiteConnectorGetConfigResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Validation Error - if ((int)__response.StatusCode == 422) + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::AI21.HTTPValidationError? __value_422 = null; - try + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) { - if (ReadResponseAsString) + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1WebsiteConnectorGetConfig", + methodName: "V1WebsiteConnectorGetConfigAsync", + pathTemplate: "\"/studio/v1/website-connector/client-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 { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); } - else + catch (global::System.Net.Http.HttpRequestException __exception) { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1WebsiteConnectorGetConfig", + methodName: "V1WebsiteConnectorGetConfigAsync", + pathTemplate: "\"/studio/v1/website-connector/client-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; + } - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1WebsiteConnectorGetConfig", + methodName: "V1WebsiteConnectorGetConfigAsync", + pathTemplate: "\"/studio/v1/website-connector/client-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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; } - catch (global::System.Exception __ex) + + if (__response == null) { - __exception_422 = __ex; + throw new global::System.InvalidOperationException("No response received."); } - throw new global::AI21.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) + using (__response) { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - ProcessResponseContent( + ProcessResponse( client: HttpClient, - response: __response, - content: ref __content); - ProcessV1WebsiteConnectorGetConfigResponseContent( + response: __response); + ProcessV1WebsiteConnectorGetConfigResponse( httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) { - __response.EnsureSuccessStatusCode(); - - return __content; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1WebsiteConnectorGetConfig", + methodName: "V1WebsiteConnectorGetConfigAsync", + pathTemplate: "\"/studio/v1/website-connector/client-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); } - catch (global::System.Exception __ex) + else { - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1WebsiteConnectorGetConfig", + methodName: "V1WebsiteConnectorGetConfigAsync", + pathTemplate: "\"/studio/v1/website-connector/client-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 - { - try - { - __response.EnsureSuccessStatusCode(); - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::AI21.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).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) - { - } + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessV1WebsiteConnectorGetConfigResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? 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::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.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::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; } } + finally + { + __httpRequest?.Dispose(); + } } } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.WebsiteConnectorClient.V1WebsiteConnectorGetUrlStatus.g.cs b/src/libs/AI21/Generated/AI21.WebsiteConnectorClient.V1WebsiteConnectorGetUrlStatus.g.cs index 39f1d8d0..e542a88a 100644 --- a/src/libs/AI21/Generated/AI21.WebsiteConnectorClient.V1WebsiteConnectorGetUrlStatus.g.cs +++ b/src/libs/AI21/Generated/AI21.WebsiteConnectorClient.V1WebsiteConnectorGetUrlStatus.g.cs @@ -14,6 +14,7 @@ public partial class WebsiteConnectorClient { new global::AI21.EndPointAuthorizationRequirement { Type = "Http", + SchemeId = "HttpBearer", Location = "Header", Name = "Bearer", FriendlyName = "Bearer", @@ -44,10 +45,32 @@ partial void ProcessV1WebsiteConnectorGetUrlStatusResponseContent( /// Get Url 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 V1WebsiteConnectorGetUrlStatusAsync( string urlId, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await V1WebsiteConnectorGetUrlStatusAsResponseAsync( + urlId: urlId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Get Url 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> V1WebsiteConnectorGetUrlStatusAsResponseAsync( + string urlId, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( @@ -62,25 +85,47 @@ partial void ProcessV1WebsiteConnectorGetUrlStatusResponseContent( securityRequirements: s_V1WebsiteConnectorGetUrlStatusSecurityRequirements, operationName: "V1WebsiteConnectorGetUrlStatusAsync"); - var __pathBuilder = new global::AI21.PathBuilder( - path: "/studio/v1/website-connector/url-status", - baseUri: HttpClient.BaseAddress); - __pathBuilder - .AddRequiredParameter("url_id", urlId) - ; - 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)); + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: "/studio/v1/website-connector/url-status", + baseUri: HttpClient.BaseAddress); + __pathBuilder + .AddRequiredParameter("url_id", urlId) + ; + var __path = __pathBuilder.ToString(); + __path = global::AI21.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; + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; #endif foreach (var __authorization in __authorizations) { if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2") + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") { __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( scheme: __authorization.Name, @@ -90,146 +135,326 @@ partial void ProcessV1WebsiteConnectorGetUrlStatusResponseContent( __authorization.Location == "Header") { __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } + } } + global::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareV1WebsiteConnectorGetUrlStatusRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - urlId: urlId); + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareV1WebsiteConnectorGetUrlStatusRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + urlId: urlId!); - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); + return __httpRequest; + } - ProcessResponse( - client: HttpClient, - response: __response); - ProcessV1WebsiteConnectorGetUrlStatusResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Validation Error - if ((int)__response.StatusCode == 422) + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::AI21.HTTPValidationError? __value_422 = null; - try + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) { - if (ReadResponseAsString) + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1WebsiteConnectorGetUrlStatus", + methodName: "V1WebsiteConnectorGetUrlStatusAsync", + pathTemplate: "\"/studio/v1/website-connector/url-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 { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); } - else + catch (global::System.Net.Http.HttpRequestException __exception) { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1WebsiteConnectorGetUrlStatus", + methodName: "V1WebsiteConnectorGetUrlStatusAsync", + pathTemplate: "\"/studio/v1/website-connector/url-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; + } - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1WebsiteConnectorGetUrlStatus", + methodName: "V1WebsiteConnectorGetUrlStatusAsync", + pathTemplate: "\"/studio/v1/website-connector/url-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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; } - catch (global::System.Exception __ex) + + if (__response == null) { - __exception_422 = __ex; + throw new global::System.InvalidOperationException("No response received."); } - throw new global::AI21.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) + using (__response) { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - ProcessResponseContent( + ProcessResponse( client: HttpClient, - response: __response, - content: ref __content); - ProcessV1WebsiteConnectorGetUrlStatusResponseContent( + response: __response); + ProcessV1WebsiteConnectorGetUrlStatusResponse( httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) { - __response.EnsureSuccessStatusCode(); - - return __content; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1WebsiteConnectorGetUrlStatus", + methodName: "V1WebsiteConnectorGetUrlStatusAsync", + pathTemplate: "\"/studio/v1/website-connector/url-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); } - catch (global::System.Exception __ex) + else { - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1WebsiteConnectorGetUrlStatus", + methodName: "V1WebsiteConnectorGetUrlStatusAsync", + pathTemplate: "\"/studio/v1/website-connector/url-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 - { - try - { - __response.EnsureSuccessStatusCode(); - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::AI21.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).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) - { - } + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessV1WebsiteConnectorGetUrlStatusResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? 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::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.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::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; } } + finally + { + __httpRequest?.Dispose(); + } } } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.WebsiteConnectorClient.V1WebsiteConnectorGetWebsiteStatus.g.cs b/src/libs/AI21/Generated/AI21.WebsiteConnectorClient.V1WebsiteConnectorGetWebsiteStatus.g.cs index 87a49437..6685561a 100644 --- a/src/libs/AI21/Generated/AI21.WebsiteConnectorClient.V1WebsiteConnectorGetWebsiteStatus.g.cs +++ b/src/libs/AI21/Generated/AI21.WebsiteConnectorClient.V1WebsiteConnectorGetWebsiteStatus.g.cs @@ -14,6 +14,7 @@ public partial class WebsiteConnectorClient { new global::AI21.EndPointAuthorizationRequirement { Type = "Http", + SchemeId = "HttpBearer", Location = "Header", Name = "Bearer", FriendlyName = "Bearer", @@ -44,10 +45,32 @@ partial void ProcessV1WebsiteConnectorGetWebsiteStatusResponseContent( /// Get Website 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 V1WebsiteConnectorGetWebsiteStatusAsync( global::System.Guid websiteId, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await V1WebsiteConnectorGetWebsiteStatusAsResponseAsync( + websiteId: websiteId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Get Website 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> V1WebsiteConnectorGetWebsiteStatusAsResponseAsync( + global::System.Guid websiteId, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( @@ -62,25 +85,47 @@ partial void ProcessV1WebsiteConnectorGetWebsiteStatusResponseContent( securityRequirements: s_V1WebsiteConnectorGetWebsiteStatusSecurityRequirements, operationName: "V1WebsiteConnectorGetWebsiteStatusAsync"); - var __pathBuilder = new global::AI21.PathBuilder( - path: "/studio/v1/website-connector/website-status", - baseUri: HttpClient.BaseAddress); - __pathBuilder - .AddRequiredParameter("website_id", websiteId.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)); + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: "/studio/v1/website-connector/website-status", + baseUri: HttpClient.BaseAddress); + __pathBuilder + .AddRequiredParameter("website_id", websiteId.ToString()!) + ; + var __path = __pathBuilder.ToString(); + __path = global::AI21.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; + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; #endif foreach (var __authorization in __authorizations) { if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2") + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") { __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( scheme: __authorization.Name, @@ -90,146 +135,326 @@ partial void ProcessV1WebsiteConnectorGetWebsiteStatusResponseContent( __authorization.Location == "Header") { __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } + } } + global::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareV1WebsiteConnectorGetWebsiteStatusRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - websiteId: websiteId); + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareV1WebsiteConnectorGetWebsiteStatusRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + websiteId: websiteId!); - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); + return __httpRequest; + } - ProcessResponse( - client: HttpClient, - response: __response); - ProcessV1WebsiteConnectorGetWebsiteStatusResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Validation Error - if ((int)__response.StatusCode == 422) + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::AI21.HTTPValidationError? __value_422 = null; - try + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) { - if (ReadResponseAsString) + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1WebsiteConnectorGetWebsiteStatus", + methodName: "V1WebsiteConnectorGetWebsiteStatusAsync", + pathTemplate: "\"/studio/v1/website-connector/website-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 { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); } - else + catch (global::System.Net.Http.HttpRequestException __exception) { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1WebsiteConnectorGetWebsiteStatus", + methodName: "V1WebsiteConnectorGetWebsiteStatusAsync", + pathTemplate: "\"/studio/v1/website-connector/website-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; + } - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + __httpRequest.Dispose(); + __httpRequest = null; + await global::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; } + + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1WebsiteConnectorGetWebsiteStatus", + methodName: "V1WebsiteConnectorGetWebsiteStatusAsync", + pathTemplate: "\"/studio/v1/website-connector/website-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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; } - catch (global::System.Exception __ex) + + if (__response == null) { - __exception_422 = __ex; + throw new global::System.InvalidOperationException("No response received."); } - throw new global::AI21.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) + using (__response) { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - ProcessResponseContent( + ProcessResponse( client: HttpClient, - response: __response, - content: ref __content); - ProcessV1WebsiteConnectorGetWebsiteStatusResponseContent( + response: __response); + ProcessV1WebsiteConnectorGetWebsiteStatusResponse( httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) { - __response.EnsureSuccessStatusCode(); - - return __content; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1WebsiteConnectorGetWebsiteStatus", + methodName: "V1WebsiteConnectorGetWebsiteStatusAsync", + pathTemplate: "\"/studio/v1/website-connector/website-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); } - catch (global::System.Exception __ex) + else { - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1WebsiteConnectorGetWebsiteStatus", + methodName: "V1WebsiteConnectorGetWebsiteStatusAsync", + pathTemplate: "\"/studio/v1/website-connector/website-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 - { - try - { - __response.EnsureSuccessStatusCode(); - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::AI21.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).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) - { - } + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessV1WebsiteConnectorGetWebsiteStatusResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? 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::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.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::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; } } + finally + { + __httpRequest?.Dispose(); + } } } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.WebsiteConnectorClient.V1WebsiteConnectorIngestUrl.g.cs b/src/libs/AI21/Generated/AI21.WebsiteConnectorClient.V1WebsiteConnectorIngestUrl.g.cs index b1b0ee91..a9094c40 100644 --- a/src/libs/AI21/Generated/AI21.WebsiteConnectorClient.V1WebsiteConnectorIngestUrl.g.cs +++ b/src/libs/AI21/Generated/AI21.WebsiteConnectorClient.V1WebsiteConnectorIngestUrl.g.cs @@ -14,6 +14,7 @@ public partial class WebsiteConnectorClient { new global::AI21.EndPointAuthorizationRequirement { Type = "Http", + SchemeId = "HttpBearer", Location = "Header", Name = "Bearer", FriendlyName = "Bearer", @@ -44,11 +45,35 @@ partial void ProcessV1WebsiteConnectorIngestUrlResponseContent( /// Connect Website /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// public async global::System.Threading.Tasks.Task V1WebsiteConnectorIngestUrlAsync( global::AI21.WebsiteConnectorIngestUrlPayload request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await V1WebsiteConnectorIngestUrlAsResponseAsync( + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Connect Website + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> V1WebsiteConnectorIngestUrlAsResponseAsync( + + global::AI21.WebsiteConnectorIngestUrlPayload request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) { request = request ?? throw new global::System.ArgumentNullException(nameof(request)); @@ -65,22 +90,44 @@ partial void ProcessV1WebsiteConnectorIngestUrlResponseContent( securityRequirements: s_V1WebsiteConnectorIngestUrlSecurityRequirements, operationName: "V1WebsiteConnectorIngestUrlAsync"); - var __pathBuilder = new global::AI21.PathBuilder( - path: "/studio/v1/website-connector/ingest-url", - 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)); + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: "/studio/v1/website-connector/ingest-url", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.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; + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; #endif foreach (var __authorization in __authorizations) { if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2") + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") { __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( scheme: __authorization.Name, @@ -90,161 +137,343 @@ partial void ProcessV1WebsiteConnectorIngestUrlResponseContent( __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); - PrepareV1WebsiteConnectorIngestUrlRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - request: request); + 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::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareV1WebsiteConnectorIngestUrlRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + request: request); - ProcessResponse( - client: HttpClient, - response: __response); - ProcessV1WebsiteConnectorIngestUrlResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Validation Error - if ((int)__response.StatusCode == 422) + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::AI21.HTTPValidationError? __value_422 = null; - try + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) { - if (ReadResponseAsString) + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1WebsiteConnectorIngestUrl", + methodName: "V1WebsiteConnectorIngestUrlAsync", + pathTemplate: "\"/studio/v1/website-connector/ingest-url\"", + 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 { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); } - else + catch (global::System.Net.Http.HttpRequestException __exception) { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1WebsiteConnectorIngestUrl", + methodName: "V1WebsiteConnectorIngestUrlAsync", + pathTemplate: "\"/studio/v1/website-connector/ingest-url\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1WebsiteConnectorIngestUrl", + methodName: "V1WebsiteConnectorIngestUrlAsync", + pathTemplate: "\"/studio/v1/website-connector/ingest-url\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; } + + break; } - catch (global::System.Exception __ex) + + if (__response == null) { - __exception_422 = __ex; + throw new global::System.InvalidOperationException("No response received."); } - throw new global::AI21.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) + using (__response) { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - ProcessResponseContent( + ProcessResponse( client: HttpClient, - response: __response, - content: ref __content); - ProcessV1WebsiteConnectorIngestUrlResponseContent( + response: __response); + ProcessV1WebsiteConnectorIngestUrlResponse( httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) { - __response.EnsureSuccessStatusCode(); - - return __content; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1WebsiteConnectorIngestUrl", + methodName: "V1WebsiteConnectorIngestUrlAsync", + pathTemplate: "\"/studio/v1/website-connector/ingest-url\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } - catch (global::System.Exception __ex) + else { - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1WebsiteConnectorIngestUrl", + methodName: "V1WebsiteConnectorIngestUrlAsync", + pathTemplate: "\"/studio/v1/website-connector/ingest-url\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::AI21.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).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) - { - } + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessV1WebsiteConnectorIngestUrlResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? 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::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.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::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; } } + finally + { + __httpRequest?.Dispose(); + } } /// /// Connect Website /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// public async global::System.Threading.Tasks.Task V1WebsiteConnectorIngestUrlAsync( string url, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) { var __request = new global::AI21.WebsiteConnectorIngestUrlPayload @@ -254,6 +483,7 @@ partial void ProcessV1WebsiteConnectorIngestUrlResponseContent( return await V1WebsiteConnectorIngestUrlAsync( request: __request, + requestOptions: requestOptions, cancellationToken: cancellationToken).ConfigureAwait(false); } } diff --git a/src/libs/AI21/Generated/AI21.WebsiteConnectorClient.V1WebsiteConnectorIngestWebsite.g.cs b/src/libs/AI21/Generated/AI21.WebsiteConnectorClient.V1WebsiteConnectorIngestWebsite.g.cs index 0388fbd9..f74ee1b0 100644 --- a/src/libs/AI21/Generated/AI21.WebsiteConnectorClient.V1WebsiteConnectorIngestWebsite.g.cs +++ b/src/libs/AI21/Generated/AI21.WebsiteConnectorClient.V1WebsiteConnectorIngestWebsite.g.cs @@ -14,6 +14,7 @@ public partial class WebsiteConnectorClient { new global::AI21.EndPointAuthorizationRequirement { Type = "Http", + SchemeId = "HttpBearer", Location = "Header", Name = "Bearer", FriendlyName = "Bearer", @@ -44,11 +45,35 @@ partial void ProcessV1WebsiteConnectorIngestWebsiteResponseContent( /// Ingest Website /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// public async global::System.Threading.Tasks.Task V1WebsiteConnectorIngestWebsiteAsync( global::AI21.WebsiteConnectorIngestWebsitePayload request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await V1WebsiteConnectorIngestWebsiteAsResponseAsync( + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Ingest Website + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> V1WebsiteConnectorIngestWebsiteAsResponseAsync( + + global::AI21.WebsiteConnectorIngestWebsitePayload request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) { request = request ?? throw new global::System.ArgumentNullException(nameof(request)); @@ -65,22 +90,44 @@ partial void ProcessV1WebsiteConnectorIngestWebsiteResponseContent( securityRequirements: s_V1WebsiteConnectorIngestWebsiteSecurityRequirements, operationName: "V1WebsiteConnectorIngestWebsiteAsync"); - var __pathBuilder = new global::AI21.PathBuilder( - path: "/studio/v1/website-connector/ingest-website", - 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)); + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: "/studio/v1/website-connector/ingest-website", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.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; + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; #endif foreach (var __authorization in __authorizations) { if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2") + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") { __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( scheme: __authorization.Name, @@ -90,152 +137,332 @@ partial void ProcessV1WebsiteConnectorIngestWebsiteResponseContent( __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); - PrepareV1WebsiteConnectorIngestWebsiteRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - request: request); + 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::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareV1WebsiteConnectorIngestWebsiteRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + request: request); - ProcessResponse( - client: HttpClient, - response: __response); - ProcessV1WebsiteConnectorIngestWebsiteResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Validation Error - if ((int)__response.StatusCode == 422) + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::AI21.HTTPValidationError? __value_422 = null; - try + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) { - if (ReadResponseAsString) + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1WebsiteConnectorIngestWebsite", + methodName: "V1WebsiteConnectorIngestWebsiteAsync", + pathTemplate: "\"/studio/v1/website-connector/ingest-website\"", + 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 { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); } - else + catch (global::System.Net.Http.HttpRequestException __exception) { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1WebsiteConnectorIngestWebsite", + methodName: "V1WebsiteConnectorIngestWebsiteAsync", + pathTemplate: "\"/studio/v1/website-connector/ingest-website\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1WebsiteConnectorIngestWebsite", + methodName: "V1WebsiteConnectorIngestWebsiteAsync", + pathTemplate: "\"/studio/v1/website-connector/ingest-website\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; } + + break; } - catch (global::System.Exception __ex) + + if (__response == null) { - __exception_422 = __ex; + throw new global::System.InvalidOperationException("No response received."); } - throw new global::AI21.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) + using (__response) { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - ProcessResponseContent( + ProcessResponse( client: HttpClient, - response: __response, - content: ref __content); - ProcessV1WebsiteConnectorIngestWebsiteResponseContent( + response: __response); + ProcessV1WebsiteConnectorIngestWebsiteResponse( httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) { - __response.EnsureSuccessStatusCode(); - - return __content; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1WebsiteConnectorIngestWebsite", + methodName: "V1WebsiteConnectorIngestWebsiteAsync", + pathTemplate: "\"/studio/v1/website-connector/ingest-website\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } - catch (global::System.Exception __ex) + else { - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1WebsiteConnectorIngestWebsite", + methodName: "V1WebsiteConnectorIngestWebsiteAsync", + pathTemplate: "\"/studio/v1/website-connector/ingest-website\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::AI21.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).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) - { - } + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessV1WebsiteConnectorIngestWebsiteResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? 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::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.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::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; } } + finally + { + __httpRequest?.Dispose(); + } } /// /// Ingest Website @@ -243,12 +470,14 @@ partial void ProcessV1WebsiteConnectorIngestWebsiteResponseContent( /// /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// public async global::System.Threading.Tasks.Task V1WebsiteConnectorIngestWebsiteAsync( string sitemapUrl, string? clientConfig = default, global::System.Collections.Generic.IList? labels = default, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) { var __request = new global::AI21.WebsiteConnectorIngestWebsitePayload @@ -260,6 +489,7 @@ partial void ProcessV1WebsiteConnectorIngestWebsiteResponseContent( return await V1WebsiteConnectorIngestWebsiteAsync( request: __request, + requestOptions: requestOptions, cancellationToken: cancellationToken).ConfigureAwait(false); } } diff --git a/src/libs/AI21/Generated/AI21.WebsiteConnectorClient.V1WebsiteConnectorRetryIngestWebsite.g.cs b/src/libs/AI21/Generated/AI21.WebsiteConnectorClient.V1WebsiteConnectorRetryIngestWebsite.g.cs index 84a7685f..23475bf4 100644 --- a/src/libs/AI21/Generated/AI21.WebsiteConnectorClient.V1WebsiteConnectorRetryIngestWebsite.g.cs +++ b/src/libs/AI21/Generated/AI21.WebsiteConnectorClient.V1WebsiteConnectorRetryIngestWebsite.g.cs @@ -14,6 +14,7 @@ public partial class WebsiteConnectorClient { new global::AI21.EndPointAuthorizationRequirement { Type = "Http", + SchemeId = "HttpBearer", Location = "Header", Name = "Bearer", FriendlyName = "Bearer", @@ -44,11 +45,35 @@ partial void ProcessV1WebsiteConnectorRetryIngestWebsiteResponseContent( /// Retry Ingest Website /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// public async global::System.Threading.Tasks.Task V1WebsiteConnectorRetryIngestWebsiteAsync( global::AI21.WebsiteConnectorRetryIngestWebsitePayload request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await V1WebsiteConnectorRetryIngestWebsiteAsResponseAsync( + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Retry Ingest Website + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> V1WebsiteConnectorRetryIngestWebsiteAsResponseAsync( + + global::AI21.WebsiteConnectorRetryIngestWebsitePayload request, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) { request = request ?? throw new global::System.ArgumentNullException(nameof(request)); @@ -65,22 +90,44 @@ partial void ProcessV1WebsiteConnectorRetryIngestWebsiteResponseContent( securityRequirements: s_V1WebsiteConnectorRetryIngestWebsiteSecurityRequirements, operationName: "V1WebsiteConnectorRetryIngestWebsiteAsync"); - var __pathBuilder = new global::AI21.PathBuilder( - path: "/studio/v1/website-connector/retry-ingest-website", - 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)); + using var __timeoutCancellationTokenSource = global::AI21.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::AI21.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::AI21.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::AI21.PathBuilder( + path: "/studio/v1/website-connector/retry-ingest-website", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::AI21.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; + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; #endif foreach (var __authorization in __authorizations) { if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2") + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") { __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( scheme: __authorization.Name, @@ -90,161 +137,343 @@ partial void ProcessV1WebsiteConnectorRetryIngestWebsiteResponseContent( __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); - PrepareV1WebsiteConnectorRetryIngestWebsiteRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - request: request); + 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::AI21.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareV1WebsiteConnectorRetryIngestWebsiteRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + request: request); - ProcessResponse( - client: HttpClient, - response: __response); - ProcessV1WebsiteConnectorRetryIngestWebsiteResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Validation Error - if ((int)__response.StatusCode == 422) + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::AI21.HTTPValidationError? __value_422 = null; - try + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) { - if (ReadResponseAsString) + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::AI21.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1WebsiteConnectorRetryIngestWebsite", + methodName: "V1WebsiteConnectorRetryIngestWebsiteAsync", + pathTemplate: "\"/studio/v1/website-connector/retry-ingest-website\"", + 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 { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); } - else + catch (global::System.Net.Http.HttpRequestException __exception) { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1WebsiteConnectorRetryIngestWebsite", + methodName: "V1WebsiteConnectorRetryIngestWebsiteAsync", + pathTemplate: "\"/studio/v1/website-connector/retry-ingest-website\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } - __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + if (__response != null && + __attempt < __maxAttempts && + global::AI21.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::AI21.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1WebsiteConnectorRetryIngestWebsite", + methodName: "V1WebsiteConnectorRetryIngestWebsiteAsync", + pathTemplate: "\"/studio/v1/website-connector/retry-ingest-website\"", + 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::AI21.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; } + + break; } - catch (global::System.Exception __ex) + + if (__response == null) { - __exception_422 = __ex; + throw new global::System.InvalidOperationException("No response received."); } - throw new global::AI21.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) + using (__response) { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - ProcessResponseContent( + ProcessResponse( client: HttpClient, - response: __response, - content: ref __content); - ProcessV1WebsiteConnectorRetryIngestWebsiteResponseContent( + response: __response); + ProcessV1WebsiteConnectorRetryIngestWebsiteResponse( httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) { - __response.EnsureSuccessStatusCode(); - - return __content; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1WebsiteConnectorRetryIngestWebsite", + methodName: "V1WebsiteConnectorRetryIngestWebsiteAsync", + pathTemplate: "\"/studio/v1/website-connector/retry-ingest-website\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } - catch (global::System.Exception __ex) + else { - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; + await global::AI21.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::AI21.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "V1WebsiteConnectorRetryIngestWebsite", + methodName: "V1WebsiteConnectorRetryIngestWebsiteAsync", + pathTemplate: "\"/studio/v1/website-connector/retry-ingest-website\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::AI21.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).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) - { - } + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessV1WebsiteConnectorRetryIngestWebsiteResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return new global::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + catch (global::System.Exception __ex) + { + throw global::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? 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::AI21.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::AI21.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::AI21.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } - throw new global::AI21.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; } } + finally + { + __httpRequest?.Dispose(); + } } /// /// Retry Ingest Website /// /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// public async global::System.Threading.Tasks.Task V1WebsiteConnectorRetryIngestWebsiteAsync( global::System.Guid websiteId, + global::AI21.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) { var __request = new global::AI21.WebsiteConnectorRetryIngestWebsitePayload @@ -254,6 +483,7 @@ partial void ProcessV1WebsiteConnectorRetryIngestWebsiteResponseContent( return await V1WebsiteConnectorRetryIngestWebsiteAsync( request: __request, + requestOptions: requestOptions, cancellationToken: cancellationToken).ConfigureAwait(false); } } diff --git a/src/libs/AI21/Generated/AI21.WebsiteConnectorClient.g.cs b/src/libs/AI21/Generated/AI21.WebsiteConnectorClient.g.cs index fca0ae48..cd12cb5e 100644 --- a/src/libs/AI21/Generated/AI21.WebsiteConnectorClient.g.cs +++ b/src/libs/AI21/Generated/AI21.WebsiteConnectorClient.g.cs @@ -30,6 +30,9 @@ public sealed partial class WebsiteConnectorClient : global::AI21.IWebsiteConnec #if DEBUG = true; #endif + + /// + public global::AI21.AutoSDKClientOptions Options { get; } /// /// /// @@ -49,11 +52,58 @@ public WebsiteConnectorClient( 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 WebsiteConnectorClient 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 WebsiteConnectorClient( + global::System.Net.Http.HttpClient? httpClient, + global::System.Collections.Generic.List? authorizations, + global::AI21.AutoSDKClientOptions? options, + bool disposeHttpClient = true) : this( + httpClient, + baseUri: null, + authorizations, + options, + disposeHttpClient: disposeHttpClient) + { + } + + /// + /// Creates a new instance of the WebsiteConnectorClient. + /// 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 WebsiteConnectorClient( + global::System.Net.Http.HttpClient? httpClient, + global::System.Uri? baseUri, + global::System.Collections.Generic.List? authorizations, + global::AI21.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::AI21.AutoSDKClientOptions(); _disposeHttpClient = disposeHttpClient; Initialized(HttpClient); diff --git a/src/libs/AI21/openapi.json b/src/libs/AI21/openapi.json index d882827c..d07067bf 100644 --- a/src/libs/AI21/openapi.json +++ b/src/libs/AI21/openapi.json @@ -1 +1 @@ -{"openapi":"3.1.0","info":{"title":"AI21 Studio API","description":"Access our powerful language models using an API that makes you smile","version":"1.0.0"},"paths":{"/studio/v1/chat/files/convert":{"post":{"summary":"Convert Document File","operationId":"convert_document_file_studio_v1_chat_files_convert_post","requestBody":{"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_convert_document_file_studio_v1_chat_files_convert_post"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/studio/v1/chat/completions":{"post":{"tags":["Jamba Complete"],"summary":"Studio Chat Complete","description":"This is the endpoint for the [Jamba Instruct model](https://docs.ai21.com/docs/jamba-models).\nThis is a foundation model that supports both single-turn (question answering,\ntext completion) and multi-turn (chat style) interactions.\n\nYou can optionally stream results if you want to get the response as each\ntoken is generated, rather than waiting for the entire response.","operationId":"v1_chat_complete","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChatRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/ChatCompletion"},{"items":{"$ref":"#/components/schemas/ChatCompletionVllmStreamingMessage"},"type":"array"}],"title":"Response V1 Chat Complete"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/studio/v1/library/files":{"get":{"tags":["Library management"],"summary":"Get Workspace Files","description":"Get metadata about a specific file by file ID. The file ID is generated by\nAI21 when you upload the file.","operationId":"v1_library_management","parameters":[{"required":false,"schema":{"type":"string","title":"Name"},"name":"name","in":"query"},{"required":false,"schema":{"type":"string","title":"Path"},"name":"path","in":"query"},{"required":false,"schema":{"$ref":"#/components/schemas/FileStatus"},"name":"status","in":"query"},{"required":false,"schema":{"items":{"type":"string"},"type":"array","title":"Label"},"name":"label","in":"query"},{"required":false,"schema":{"type":"integer","title":"Limit","default":500000},"name":"limit","in":"query"},{"required":false,"schema":{"type":"integer","title":"Offset"},"name":"offset","in":"query"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/FileResponse"},"type":"array","title":"Response V1 Library Management"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["Library management"],"summary":"Upload Workspace File","description":"Upload files to use for [RAG Engine document searches](https://docs.ai21.com/docs/rag-engine-overview).\nYou can assign metadata to your files to limit searches to specific files by file metadata.\nThere is no bulk upload method; files must be loaded one at a time.\n\n- **Max number of files:** No limit. The playground limits bulk uploads to 50 files per request.\n- **Max library size:** 1 GB total size. No limit to individual file size.\n- **Supported file types:** PDF, DocX, HTML, TXT","operationId":"v1_library_upload","requestBody":{"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_v1_library_upload"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/studio/v1/library/files/{file_id}":{"get":{"tags":["Library management"],"summary":"Get File By Id","description":"Retrieve a list of documents in the user's library. Optionally specify a\nfilter to find only files with matching labels or paths. This method\nreturns only metadata about files; to download a file, call\n`GET .../files/{file_id}/download`\n\nWhen specifying qualifiers with your request, only files that match\n_all_ qualifiers will be returns. So, for example, if you specify\n`label='financial'` and `status='UPLOADED'`, only files with the label\n\"financial\" AND status UPLOADED will be returned.","operationId":"v1_library_management","parameters":[{"required":true,"schema":{"type":"string","format":"uuid","title":"File Id"},"name":"file_id","in":"path"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FileResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["Library management"],"summary":"Update File","description":"Update the specified parameters of a specific document in the user's library.\nThis operation currently supports updating the publicUrl and labels parameters.\n\n> **This operation overwrites the specified items with the new data you provide.**\n> If you wish to add new labels to the labels list without removing the existing ones,\n> you must submit a labels list that includes both the current and new labels.**\n>\n> For instance, if the current labels are \"Label A\" and \"Label B\", and you wish to\n> add \"New Label C\" and \"New Label D\" to the list, you must specify `\"labels\": [\"Label A\", \"Label B\", \"New Label C\", \"New Label D\"]`.","operationId":"v1_library_management","parameters":[{"required":true,"schema":{"type":"string","format":"uuid","title":"File Id"},"name":"file_id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FilesUpdateRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["Library management"],"summary":"Delete File","description":"Delete the specified file from the library.\n\n**Restrictions**:\nFiles in `PROCESSING` status cannot be deleted. Attempts to delete such files will result in a 422 error.","operationId":"v1_library_delete","parameters":[{"required":true,"schema":{"type":"string","format":"uuid","title":"File Id"},"name":"file_id","in":"path"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/studio/v1/library/search":{"post":{"tags":["RAG Engine"],"summary":"Search","operationId":"v1_library_search","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LibrarySearchRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/studio/v1/secrets":{"get":{"tags":["Secrets"],"summary":"Get Secret List","operationId":"v1_secret_storage","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}},"post":{"tags":["Secrets"],"summary":"Save Secret","operationId":"v1_secret_storage","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateSecretPayload"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["Secrets"],"summary":"Delete Secret","operationId":"v1_secret_storage","parameters":[{"required":true,"schema":{"type":"string","title":"Secret Id"},"name":"secret_id","in":"query"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/studio/v1/secrets/{secret_id}":{"patch":{"tags":["Secrets"],"summary":"Update Secret","operationId":"v1_secret_storage","parameters":[{"required":true,"schema":{"type":"string","title":"Secret Id"},"name":"secret_id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateSecretPayload"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/studio/v1/library/batches/{batch_id}/status":{"get":{"tags":["RAG Engine"],"summary":"Get Batch Ingestion Status","operationId":"v1_library_management","parameters":[{"required":true,"schema":{"type":"string","format":"uuid","title":"Batch Id"},"name":"batch_id","in":"path"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IngestionBatchStatusResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/studio/v1/library/files/{file_id}/download":{"get":{"tags":["RAG Engine"],"summary":"Generate Documents Signed Url","operationId":"v1_library_management","parameters":[{"required":true,"schema":{"type":"string","format":"uuid","title":"File Id"},"name":"file_id","in":"path"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/studio/v1/library/files/{file_id}/parsed":{"get":{"tags":["RAG Engine"],"summary":"Download Parsed Document","description":"Download parsed document with Content-Disposition header for immediate download.","operationId":"v1_library_management","parameters":[{"required":true,"schema":{"type":"string","format":"uuid","title":"File Id"},"name":"file_id","in":"path"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/studio/v1/connectors/connected-users/{entity_id}/tokens":{"post":{"summary":"Generate Org Token","operationId":"generate_org_token_studio_v1_connectors_connected_users__entity_id__tokens_post","parameters":[{"required":true,"schema":{"type":"string","title":"Entity Id"},"name":"entity_id","in":"path"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConnectorsToken"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/studio/v1/connectors/connected-users/{entity_id}/data-sources":{"get":{"summary":"Get Org Data Sources Info","operationId":"get_org_data_sources_info_studio_v1_connectors_connected_users__entity_id__data_sources_get","parameters":[{"required":true,"schema":{"type":"string","title":"Entity Id"},"name":"entity_id","in":"path"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConnectorsDataSources"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/studio/v1/connectors/connected-users/{entity_id}/data-sources/{data_source}/status":{"get":{"summary":"Get Data Source Status","operationId":"get_data_source_status_studio_v1_connectors_connected_users__entity_id__data_sources__data_source__status_get","parameters":[{"required":true,"schema":{"type":"string","title":"Entity Id"},"name":"entity_id","in":"path"},{"required":true,"schema":{"type":"string","title":"Data Source"},"name":"data_source","in":"path"},{"required":true,"schema":{"type":"string","title":"Paragon Token"},"name":"paragon_token","in":"query"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConnectorsStatus"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/studio/v1/connectors/connected-users/{entity_id}/data-sources/{data_source}/connection-status":{"get":{"summary":"Get Connector Connection Status","operationId":"get_connector_connection_status_studio_v1_connectors_connected_users__entity_id__data_sources__data_source__connection_status_get","parameters":[{"required":true,"schema":{"type":"string","title":"Entity Id"},"name":"entity_id","in":"path"},{"required":true,"schema":{"type":"string","title":"Data Source"},"name":"data_source","in":"path"},{"required":true,"schema":{"type":"string","title":"Paragon Token"},"name":"paragon_token","in":"query"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConnectorConnectionStatus"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/studio/v1/connectors/connected-users/{entity_id}/data-sources/{data_source}/workflows/{workflow_name}/run":{"post":{"summary":"Run Workflow","operationId":"run_workflow_studio_v1_connectors_connected_users__entity_id__data_sources__data_source__workflows__workflow_name__run_post","parameters":[{"required":true,"schema":{"type":"string","title":"Entity Id"},"name":"entity_id","in":"path"},{"required":true,"schema":{"type":"string","title":"Data Source"},"name":"data_source","in":"path"},{"required":true,"schema":{"type":"string","title":"Workflow Name"},"name":"workflow_name","in":"path"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/studio/v1/connectors/connected-users/data-sources/syncs":{"post":{"summary":"Run Sync","operationId":"run_sync_studio_v1_connectors_connected_users_data_sources_syncs_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConnectorsSyncParams"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/studio/v1/connectors/website":{"get":{"summary":"Get Website Connector","operationId":"get_website_connector_studio_v1_connectors_website_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}},"post":{"summary":"Post Website Connector","operationId":"post_website_connector_studio_v1_connectors_website_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebsiteConnectorPayload"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/studio/v1/connectors/website/{connector_id}":{"get":{"summary":"Get Website Connector By Id","operationId":"get_website_connector_by_id_studio_v1_connectors_website__connector_id__get","parameters":[{"required":true,"schema":{"type":"string","title":"Connector Id"},"name":"connector_id","in":"path"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"summary":"Delete Website Connector","operationId":"delete_website_connector_studio_v1_connectors_website__connector_id__delete","parameters":[{"required":true,"schema":{"type":"string","title":"Connector Id"},"name":"connector_id","in":"path"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/studio/v1/connectors/website/{connector_id}/sync":{"post":{"summary":"Sync Website","operationId":"sync_website_studio_v1_connectors_website__connector_id__sync_post","parameters":[{"required":true,"schema":{"type":"string","title":"Connector Id"},"name":"connector_id","in":"path"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/studio/v1/connectors/paragon/webhook":{"post":{"summary":"Forward Paragon Webhook","operationId":"forward_paragon_webhook_studio_v1_connectors_paragon_webhook_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/studio/v1/maestro/runs":{"post":{"summary":"Create Maestro Run","operationId":"v1_maestro_run","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateMaestroRunsPayload"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MaestroRunResult"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/studio/v1/maestro/runs/{execution_id}":{"get":{"summary":"Get Maestro Run","operationId":"v1_get_maestro_run","parameters":[{"required":true,"schema":{"type":"string","title":"Execution Id"},"name":"execution_id","in":"path"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MaestroRunResult"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/studio/v1/demos":{"get":{"summary":"List Demos","description":"List all available demos.","operationId":"list_demos_studio_v1_demos_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/Demo"},"type":"array","title":"Response List Demos Studio V1 Demos Get"}}}}}},"post":{"summary":"Create Demo","description":"Create a new demo.","operationId":"create_demo_studio_v1_demos_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DemoCreate"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Demo"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/studio/v1/demos/{demo_id}":{"get":{"summary":"Get Demo","description":"Get a specific demo by ID.","operationId":"get_demo_studio_v1_demos__demo_id__get","parameters":[{"required":true,"schema":{"type":"string","title":"Demo Id"},"name":"demo_id","in":"path"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Demo"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"summary":"Update Demo","description":"Update an existing demo.","operationId":"update_demo_studio_v1_demos__demo_id__put","parameters":[{"required":true,"schema":{"type":"string","title":"Demo Id"},"name":"demo_id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DemoUpdate"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Demo"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"summary":"Delete Demo","description":"Delete a demo.","operationId":"delete_demo_studio_v1_demos__demo_id__delete","parameters":[{"required":true,"schema":{"type":"string","title":"Demo Id"},"name":"demo_id","in":"path"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/studio/v1/demos/document-modifier/parse-pdf":{"post":{"summary":"Parse Pdf","description":"Parse a PDF file and return its contents.","operationId":"parse_pdf_studio_v1_demos_document_modifier_parse_pdf_post","requestBody":{"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_parse_pdf_studio_v1_demos_document_modifier_parse_pdf_post"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","title":"Response Parse Pdf Studio V1 Demos Document Modifier Parse Pdf Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/studio/v1/demos/document-modifier/get-parsed-file":{"get":{"summary":"Get Parsed File","description":"Get the parsed file from the document modifier.","operationId":"get_parsed_file_studio_v1_demos_document_modifier_get_parsed_file_get","parameters":[{"required":true,"schema":{"type":"string","title":"File Name"},"name":"file_name","in":"query"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","title":"Response Get Parsed File Studio V1 Demos Document Modifier Get Parsed File Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/studio/v1/demos/document-modifier/compare-text":{"post":{"summary":"Compare Text","description":"Compare text in a document file against a reference text.","operationId":"compare_text_studio_v1_demos_document_modifier_compare_text_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CompareTextRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","title":"Response Compare Text Studio V1 Demos Document Modifier Compare Text Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/studio/v1/demos/document-modifier/download":{"post":{"summary":"Download Modified Document","description":"Download a modified document.","operationId":"download_modified_document_studio_v1_demos_document_modifier_download_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DownloadModifiedDocumentRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/studio/v1/demos/document-modifier/jamba-execute":{"post":{"summary":"Jamba Execute","description":"Execute a Jamba request.","operationId":"jamba_execute_studio_v1_demos_document_modifier_jamba_execute_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/JambaExecuteRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","title":"Response Jamba Execute Studio V1 Demos Document Modifier Jamba Execute Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/studio/v1/demos/regulations/upload-check-compliance":{"post":{"summary":"Upload Check Compliance","description":"Check compliance of a document file against regulatory requirements.","operationId":"upload_check_compliance_studio_v1_demos_regulations_upload_check_compliance_post","requestBody":{"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_upload_check_compliance_studio_v1_demos_regulations_upload_check_compliance_post"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","title":"Response Upload Check Compliance Studio V1 Demos Regulations Upload Check Compliance Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/studio/v1/demos/regulations/vector-store/{vector_store_id}":{"get":{"summary":"Get Vector Store","description":"Get a vector store by ID.","operationId":"get_vector_store_studio_v1_demos_regulations_vector_store__vector_store_id__get","parameters":[{"required":true,"schema":{"type":"string","title":"Vector Store Id"},"name":"vector_store_id","in":"path"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","title":"Response Get Vector Store Studio V1 Demos Regulations Vector Store Vector Store Id Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/studio/v1/demos/rfi/generate-response-pdf":{"post":{"summary":"Combine section answers ➜ styled PDF for download","operationId":"generate_response_pdf_studio_v1_demos_rfi_generate_response_pdf_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MarkdownRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}},"application/pdf":{}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/studio/v1/demos/rfi/process-rfi":{"post":{"summary":"Process Rfi Document","operationId":"process_rfi_document_studio_v1_demos_rfi_process_rfi_post","requestBody":{"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_process_rfi_document_studio_v1_demos_rfi_process_rfi_post"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/RFIResponseSection"},"type":"array","title":"Response Process Rfi Document Studio V1 Demos Rfi Process Rfi Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/studio/v1/demos/scraper/file-url/{file_id}":{"get":{"summary":"Get File Url","operationId":"get_file_url_studio_v1_demos_scraper_file_url__file_id__get","parameters":[{"required":true,"schema":{"type":"string","title":"File Id"},"name":"file_id","in":"path"},{"required":false,"schema":{"type":"string","title":"Api Key"},"name":"api_key","in":"query"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/studio/v1/demos/scraper/can-iframe":{"get":{"summary":"Can Iframe","operationId":"can_iframe_studio_v1_demos_scraper_can_iframe_get","parameters":[{"required":true,"schema":{"type":"string","title":"Url"},"name":"url","in":"query"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","title":"Response Can Iframe Studio V1 Demos Scraper Can Iframe Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/studio/v1/website-connector/ingest-url":{"post":{"tags":["Website Connector"],"summary":"Connect Website","operationId":"v1_website_connector_ingest_url","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebsiteConnectorIngestUrlPayload"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/studio/v1/website-connector/url-status":{"get":{"tags":["Website Connector"],"summary":"Get Url Status","operationId":"v1_website_connector_get_url_status","parameters":[{"required":true,"schema":{"type":"string","title":"Url Id"},"name":"url_id","in":"query"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/studio/v1/website-connector/ingest-website":{"post":{"tags":["Website Connector"],"summary":"Ingest Website","operationId":"v1_website_connector_ingest_website","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebsiteConnectorIngestWebsitePayload"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/studio/v1/website-connector/website-status":{"get":{"tags":["Website Connector"],"summary":"Get Website Status","operationId":"v1_website_connector_get_website_status","parameters":[{"required":true,"schema":{"type":"string","format":"uuid","title":"Website Id"},"name":"website_id","in":"query"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/studio/v1/website-connector/retry-ingest-website":{"post":{"tags":["Website Connector"],"summary":"Retry Ingest Website","operationId":"v1_website_connector_retry_ingest_website","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebsiteConnectorRetryIngestWebsitePayload"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/studio/v1/website-connector/client-config":{"get":{"tags":["Website Connector"],"summary":"Get Client Config","operationId":"v1_website_connector_get_config","parameters":[{"required":true,"schema":{"type":"string","title":"Config Name"},"name":"config_name","in":"query"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["Website Connector"],"summary":"Create Client Config","operationId":"v1_website_connector_create_config","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebsiteConnectorCreateConfigPayload"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/studio/v1/structured-rag/organizations/{organization_id}/schemas":{"get":{"summary":"Get Organization Schemas","operationId":"get_organization_schemas_studio_v1_structured_rag_organizations__organization_id__schemas_get","parameters":[{"required":true,"schema":{"type":"string","title":"Organization Id"},"name":"organization_id","in":"path"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrgSchemas"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"summary":"Create Organization Schema","operationId":"create_organization_schema_studio_v1_structured_rag_organizations__organization_id__schemas_post","parameters":[{"required":true,"schema":{"type":"string","title":"Organization Id"},"name":"organization_id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateOrganizationSchemaRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/studio/v1/structured-rag/organizations/{organization_id}/schema-detection":{"post":{"summary":"Detect Schema","operationId":"detect_schema_studio_v1_structured_rag_organizations__organization_id__schema_detection_post","parameters":[{"required":true,"schema":{"type":"string","title":"Organization Id"},"name":"organization_id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DetectSchemaRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DetectSchemaResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/studio/v1/structured-rag/organizations/{organization_id}/schemas/{schema_name}":{"delete":{"summary":"Delete Organization Schema","operationId":"delete_organization_schema_studio_v1_structured_rag_organizations__organization_id__schemas__schema_name__delete","parameters":[{"required":true,"schema":{"type":"string","title":"Organization Id"},"name":"organization_id","in":"path"},{"required":true,"schema":{"type":"string","title":"Schema Name"},"name":"schema_name","in":"path"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/studio/v1/generation/requirements":{"post":{"summary":"Generate Requirements","operationId":"v1_studio_api_generation_requirements","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RequirementsGenerationRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RequirementsGenerationResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/studio/v1/generation/thread-name":{"post":{"summary":"Generate Thread Name","operationId":"v1_studio_api_generation_thread_name","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ThreadNameGenerationRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ThreadNameGenerationResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/studio/v1/models":{"get":{"summary":"Get Models Info","operationId":"v1_list_models_info","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ModelsInfoResponse"}}}}}}},"/studio/v1/assistants":{"get":{"summary":"Get Assistants","operationId":"v1_list_assistants","parameters":[{"required":false,"schema":{"items":{"type":"string"},"type":"array","title":"Workspace Ids"},"name":"workspace_ids","in":"query"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListAssistantsResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"summary":"Create Assistant","operationId":"v1_create_assistant","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateAssistantRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Assistant"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/studio/v1/assistants/generate":{"post":{"summary":"Generate Assistant","operationId":"v1_generate_assistant","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GenerateAssistantRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GenerateAssistantResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/studio/v1/assistants/{assistant_id}":{"get":{"summary":"Get Assistant","operationId":"v1_get_assistant","parameters":[{"required":true,"schema":{"type":"string","title":"Assistant Id"},"name":"assistant_id","in":"path"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Assistant"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"summary":"Delete Assistant","operationId":"v1_delete_assistant","parameters":[{"required":true,"schema":{"type":"string","title":"Assistant Id"},"name":"assistant_id","in":"path"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeleteAssistantResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"summary":"Modify Assistant","operationId":"v1_modify_assistant","parameters":[{"required":true,"schema":{"type":"string","title":"Assistant Id"},"name":"assistant_id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ModifyAssistantRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Assistant"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/studio/v1/assistants/{assistant_id}/run":{"post":{"summary":"Run Assistant","operationId":"v1_run_assistant","parameters":[{"required":true,"schema":{"type":"string","title":"Assistant Id"},"name":"assistant_id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunAssistantRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MaestroRunResult"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/studio/v1/assistants/{assistant_id}/plans":{"get":{"summary":"List Plans","operationId":"v1_list_plans","parameters":[{"required":true,"schema":{"type":"string","title":"Assistant Id"},"name":"assistant_id","in":"path"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListPlansResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"summary":"Create Plan","operationId":"v1_create_plan","parameters":[{"required":true,"schema":{"type":"string","title":"Assistant Id"},"name":"assistant_id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreatePlanPayload"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Plan"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/studio/v1/assistants/{assistant_id}/plans/{plan_id}":{"get":{"summary":"Get Plan","operationId":"v1_get_plan","parameters":[{"required":true,"schema":{"type":"string","title":"Plan Id"},"name":"plan_id","in":"path"},{"required":true,"schema":{"type":"string","title":"Assistant Id"},"name":"assistant_id","in":"path"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Plan"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"summary":"Modify Plan","operationId":"v1_modify_plan","parameters":[{"required":true,"schema":{"type":"string","title":"Plan Id"},"name":"plan_id","in":"path"},{"required":true,"schema":{"type":"string","title":"Assistant Id"},"name":"assistant_id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreatePlanPayload"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Plan"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/studio/v1/assistants/{assistant_id}/routes":{"get":{"summary":"Get Routes","operationId":"v1_list_routes","parameters":[{"required":true,"schema":{"type":"string","title":"Assistant Id"},"name":"assistant_id","in":"path"},{"required":false,"schema":{"type":"string","title":"Name"},"name":"name","in":"query"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListRoutesResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"summary":"Create Route","operationId":"v1_create_route","parameters":[{"required":true,"schema":{"type":"string","title":"Assistant Id"},"name":"assistant_id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateRoutePayload"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AssistantRoute"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/studio/v1/assistants/{assistant_id}/routes/{route_id}":{"get":{"summary":"Get Route","operationId":"v1_get_route","parameters":[{"required":true,"schema":{"type":"string","title":"Route Id"},"name":"route_id","in":"path"},{"required":true,"schema":{"type":"string","title":"Assistant Id"},"name":"assistant_id","in":"path"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AssistantRoute"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"summary":"Delete Route","operationId":"v1_delete_route","parameters":[{"required":true,"schema":{"type":"string","title":"Route Id"},"name":"route_id","in":"path"},{"required":true,"schema":{"type":"string","title":"Assistant Id"},"name":"assistant_id","in":"path"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"summary":"Modify Route","operationId":"v1_modify_route","parameters":[{"required":true,"schema":{"type":"string","title":"Route Id"},"name":"route_id","in":"path"},{"required":true,"schema":{"type":"string","title":"Assistant Id"},"name":"assistant_id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateRoutePayload"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AssistantRoute"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/studio/v1/assistants/{assistant_id}/validate_plan":{"post":{"summary":"Validate Plan","operationId":"v1_validate_plan","parameters":[{"required":true,"schema":{"type":"string","title":"Assistant Id"},"name":"assistant_id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreatePlanPayload"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationResult"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/studio/v1/executions/{execution_id}/explanations/steps":{"get":{"summary":"Get Step Explanations","description":"Get step explanations for an execution (cached or generated).\nSet force_regenerate=True to regenerate even if cached.","operationId":"get_step_explanations_studio_v1_executions__execution_id__explanations_steps_get","parameters":[{"required":true,"schema":{"type":"string","title":"Execution Id"},"name":"execution_id","in":"path"},{"required":false,"schema":{"type":"boolean","title":"Force Regenerate","default":false},"name":"force_regenerate","in":"query"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/studio/v1/executions/{execution_id}/explanations/output":{"get":{"summary":"Get Output Explanation","description":"Get output explanation for an execution (cached or generated).\nSet force_regenerate=True to regenerate even if cached.","operationId":"get_output_explanation_studio_v1_executions__execution_id__explanations_output_get","parameters":[{"required":true,"schema":{"type":"string","title":"Execution Id"},"name":"execution_id","in":"path"},{"required":false,"schema":{"type":"boolean","title":"Force Regenerate","default":false},"name":"force_regenerate","in":"query"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/studio/v1/mcp/discover":{"post":{"summary":"Mcp Tool Discovery","operationId":"mcp_tool_discovery_studio_v1_mcp_discover_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MCPDefinition"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MCPDiscoveryResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/studio/v1/mcp/storage":{"get":{"summary":"List Mcp Storage","operationId":"list_mcp_storage_studio_v1_mcp_storage_get","parameters":[{"required":false,"schema":{"type":"string","format":"uuid","title":"Workspace Id"},"name":"workspace_id","in":"query"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListMCPsStorageResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"summary":"Create Mcp Storage","operationId":"create_mcp_storage_studio_v1_mcp_storage_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateMCPStorageRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MCPStorageResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/studio/v1/mcp/storage/{mcp_id}":{"get":{"summary":"Get Mcp Storage","operationId":"get_mcp_storage_studio_v1_mcp_storage__mcp_id__get","parameters":[{"required":true,"schema":{"type":"string","title":"Mcp Id"},"name":"mcp_id","in":"path"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MCPStorageResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"summary":"Delete Mcp Storage","operationId":"delete_mcp_storage_studio_v1_mcp_storage__mcp_id__delete","parameters":[{"required":true,"schema":{"type":"string","title":"Mcp Id"},"name":"mcp_id","in":"path"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeleteMCPStorageResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"summary":"Update Mcp Storage","operationId":"update_mcp_storage_studio_v1_mcp_storage__mcp_id__patch","parameters":[{"required":true,"schema":{"type":"string","title":"Mcp Id"},"name":"mcp_id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateMCPStorageRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MCPStorageResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/studio/v1/mcp/storage/{mcp_id}/assistants":{"get":{"summary":"Get Assistants By Mcp","operationId":"get_assistants_by_mcp_studio_v1_mcp_storage__mcp_id__assistants_get","parameters":[{"required":true,"schema":{"type":"string","title":"Mcp Id"},"name":"mcp_id","in":"path"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AssistantsByMcpResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/studio/v1/settings/models":{"get":{"summary":"Get Workspace Models By Organization Endpoint","operationId":"get_workspace_models_by_organization_endpoint_studio_v1_settings_models_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkspaceModelsResponse"}}}}}}},"/studio/v1/settings/models/available":{"get":{"summary":"Get Available Models Endpoint","operationId":"get_available_models_endpoint_studio_v1_settings_models_available_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/studio/v1/settings/models/{name}/secrets":{"get":{"summary":"Get Workspace Model Secret Endpoint","operationId":"get_workspace_model_secret_endpoint_studio_v1_settings_models__name__secrets_get","parameters":[{"required":true,"schema":{"type":"string","title":"Name"},"name":"name","in":"path"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SecretResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/studio/v1/settings/models/{name}":{"delete":{"summary":"Delete Workspace Model Endpoint","operationId":"delete_workspace_model_endpoint_studio_v1_settings_models__name__delete","parameters":[{"required":true,"schema":{"type":"string","title":"Name"},"name":"name","in":"path"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"summary":"Update Workspace Model Endpoint","operationId":"update_workspace_model_endpoint_studio_v1_settings_models__name__patch","parameters":[{"required":true,"schema":{"type":"string","title":"Name"},"name":"name","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkspaceModelUpdate"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkspaceModelResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/solutions/tlv_municipality/convrag":{"post":{"summary":"Tlv Convrag","operationId":"tlv_convrag_solutions_tlv_municipality_convrag_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/solutions-preview/tlv_municipality/convrag":{"post":{"summary":"Tlv Convrag Prefix Preview","operationId":"tlv_convrag_prefix_preview_solutions_preview_tlv_municipality_convrag_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/solutions/fnac/v1/classifications":{"post":{"summary":"Fnac V1 Classifications","operationId":"fnac_v1_classifications_solutions_fnac_v1_classifications_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/solutions/fnac/v1/descriptions":{"post":{"summary":"Fnac V1 Descriptions","operationId":"fnac_v1_descriptions_solutions_fnac_v1_descriptions_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/solutions/fnac/v1-deprecated/classifications":{"post":{"summary":"Fnac V1 Deprecated Classifications","operationId":"fnac_v1_deprecated_classifications_solutions_fnac_v1_deprecated_classifications_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/solutions/fnac/v1-deprecated/descriptions":{"post":{"summary":"Fnac V1 Deprecated Descriptions","operationId":"fnac_v1_deprecated_descriptions_solutions_fnac_v1_deprecated_descriptions_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/solutions/fd/batches/v1/classifications":{"post":{"summary":"Fnac Batch Classifications","operationId":"fnac_batch_classifications_solutions_fd_batches_v1_classifications_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/solutions/fd/batches/v1/classifications/{batch_id}/status":{"post":{"summary":"Fnac Batch Classifications Status","operationId":"fnac_batch_classifications_status_solutions_fd_batches_v1_classifications__batch_id__status_post","parameters":[{"required":true,"schema":{"type":"string","title":"Batch Id"},"name":"batch_id","in":"path"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/solutions/fd/batches/v1/classifications/{batch_id}/results":{"post":{"summary":"Fnac Batch Classifications Results","operationId":"fnac_batch_classifications_results_solutions_fd_batches_v1_classifications__batch_id__results_post","parameters":[{"required":true,"schema":{"type":"string","title":"Batch Id"},"name":"batch_id","in":"path"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/solutions/fd/batches/v1/descriptions":{"post":{"summary":"Fnac Batch Descriptions","operationId":"fnac_batch_descriptions_solutions_fd_batches_v1_descriptions_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/solutions/fd/batches/v1/descriptions/{batch_id}/status":{"post":{"summary":"Fnac Batch Descriptions Status","operationId":"fnac_batch_descriptions_status_solutions_fd_batches_v1_descriptions__batch_id__status_post","parameters":[{"required":true,"schema":{"type":"string","title":"Batch Id"},"name":"batch_id","in":"path"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/solutions/fd/batches/v1/descriptions/{batch_id}/results":{"post":{"summary":"Fnac Batch Descriptions Results","operationId":"fnac_batch_descriptions_results_solutions_fd_batches_v1_descriptions__batch_id__results_post","parameters":[{"required":true,"schema":{"type":"string","title":"Batch Id"},"name":"batch_id","in":"path"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/solutions-preview/fnac/v1/classifications":{"post":{"summary":"Fnac V1 Classifications Prefix Preview","operationId":"fnac_v1_classifications_prefix_preview_solutions_preview_fnac_v1_classifications_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/solutions-preview/fnac/v1/descriptions":{"post":{"summary":"Fnac V1 Descriptions Prefix Preview","operationId":"fnac_v1_descriptions_prefix_preview_solutions_preview_fnac_v1_descriptions_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/solutions-preview/fnac/v1-deprecated/classifications":{"post":{"summary":"Fnac V1 Deprecated Classifications Prefix Preview","operationId":"fnac_v1_deprecated_classifications_prefix_preview_solutions_preview_fnac_v1_deprecated_classifications_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/solutions-preview/fnac/v1-deprecated/descriptions":{"post":{"summary":"Fnac V1 Deprecated Descriptions Prefix Preview","operationId":"fnac_v1_deprecated_descriptions_prefix_preview_solutions_preview_fnac_v1_deprecated_descriptions_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/solutions-preview/fd/batches/v1/classifications":{"post":{"summary":"Fnac Batch Classifications Prefix Preview","operationId":"fnac_batch_classifications_prefix_preview_solutions_preview_fd_batches_v1_classifications_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/solutions-preview/fd/batches/v1/classifications/{batch_id}/status":{"post":{"summary":"Fnac Batch Classifications Status Prefix Preview","operationId":"fnac_batch_classifications_status_prefix_preview_solutions_preview_fd_batches_v1_classifications__batch_id__status_post","parameters":[{"required":true,"schema":{"type":"string","title":"Batch Id"},"name":"batch_id","in":"path"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/solutions-preview/fd/batches/v1/classifications/{batch_id}/results":{"post":{"summary":"Fnac Batch Classifications Results Prefix Preview","operationId":"fnac_batch_classifications_results_prefix_preview_solutions_preview_fd_batches_v1_classifications__batch_id__results_post","parameters":[{"required":true,"schema":{"type":"string","title":"Batch Id"},"name":"batch_id","in":"path"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/solutions-preview/fd/batches/v1/descriptions":{"post":{"summary":"Fnac Batch Descriptions Prefix Preview","operationId":"fnac_batch_descriptions_prefix_preview_solutions_preview_fd_batches_v1_descriptions_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/solutions-preview/fd/batches/v1/descriptions/{batch_id}/status":{"post":{"summary":"Fnac Batch Descriptions Status Prefix Preview","operationId":"fnac_batch_descriptions_status_prefix_preview_solutions_preview_fd_batches_v1_descriptions__batch_id__status_post","parameters":[{"required":true,"schema":{"type":"string","title":"Batch Id"},"name":"batch_id","in":"path"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/solutions-preview/fd/batches/v1/descriptions/{batch_id}/results":{"post":{"summary":"Fnac Batch Descriptions Results Prefix Preview","operationId":"fnac_batch_descriptions_results_prefix_preview_solutions_preview_fd_batches_v1_descriptions__batch_id__results_post","parameters":[{"required":true,"schema":{"type":"string","title":"Batch Id"},"name":"batch_id","in":"path"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/solutions/fd_aftersales/parts-classification/batch":{"post":{"summary":"Fnac Aftersales Batch Predict","operationId":"fnac_aftersales_batch_predict_solutions_fd_aftersales_parts_classification_batch_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/solutions/fd_aftersales/parts-classification/batch/{batch_id}/status":{"get":{"summary":"Fnac Aftersales Batch Predict Status","operationId":"fnac_aftersales_batch_predict_status_solutions_fd_aftersales_parts_classification_batch__batch_id__status_get","parameters":[{"required":true,"schema":{"type":"string","title":"Batch Id"},"name":"batch_id","in":"path"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/solutions-preview/fd_aftersales/parts-classification/batch":{"post":{"summary":"Fnac Aftersales Batch Predict Prefix Preview","operationId":"fnac_aftersales_batch_predict_prefix_preview_solutions_preview_fd_aftersales_parts_classification_batch_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/solutions-preview/fd_aftersales/parts-classification/batch/{batch_id}/status":{"get":{"summary":"Fnac Aftersales Batch Predict Status Prefix Preview","operationId":"fnac_aftersales_batch_predict_status_prefix_preview_solutions_preview_fd_aftersales_parts_classification_batch__batch_id__status_get","parameters":[{"required":true,"schema":{"type":"string","title":"Batch Id"},"name":"batch_id","in":"path"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/solutions/vidaa/summarize":{"post":{"summary":"Vidaa Summarize","operationId":"vidaa_summarize_solutions_vidaa_summarize_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/solutions/vidaa/action-items":{"post":{"summary":"Vidaa Action Items","operationId":"vidaa_action_items_solutions_vidaa_action_items_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/solutions/vidaa/sources":{"get":{"summary":"Vidaa Sources","operationId":"vidaa_sources_solutions_vidaa_sources_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/solutions/vidaa/feed-items":{"get":{"summary":"Vidaa Feed Items","operationId":"vidaa_feed_items_solutions_vidaa_feed_items_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/solutions/vidaa/subscribe":{"post":{"summary":"Vidaa Subscribe","operationId":"vidaa_subscribe_solutions_vidaa_subscribe_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/solutions/vidaa/unsubscribe":{"post":{"summary":"Vidaa Unsubscribe","operationId":"vidaa_unsubscribe_solutions_vidaa_unsubscribe_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/solutions/vidaa/subscriptions":{"get":{"summary":"Vidaa Subscriptions","operationId":"vidaa_subscriptions_solutions_vidaa_subscriptions_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/solutions/vidaa/scheduler-stats":{"get":{"summary":"Vidaa Scheduler Stats","operationId":"vidaa_scheduler_stats_solutions_vidaa_scheduler_stats_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/solutions/vidaa/trigger-poll":{"post":{"summary":"Vidaa Trigger Poll","operationId":"vidaa_trigger_poll_solutions_vidaa_trigger_poll_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/solutions/vidaa/api/messages":{"post":{"summary":"Vidaa Messages","operationId":"vidaa_messages_solutions_vidaa_api_messages_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/solutions-preview/vidaa/api/messages":{"post":{"summary":"Vidaa Messages Preview","operationId":"vidaa_messages_preview_solutions_preview_vidaa_api_messages_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/solutions-preview/vidaa/summarize":{"post":{"summary":"Vidaa Summarize Preview","operationId":"vidaa_summarize_preview_solutions_preview_vidaa_summarize_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/solutions-preview/vidaa/action-items":{"post":{"summary":"Vidaa Action Items Preview","operationId":"vidaa_action_items_preview_solutions_preview_vidaa_action_items_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/solutions-preview/vidaa/sources":{"get":{"summary":"Vidaa Sources Preview","operationId":"vidaa_sources_preview_solutions_preview_vidaa_sources_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/solutions-preview/vidaa/feed-items":{"get":{"summary":"Vidaa Feed Items Preview","operationId":"vidaa_feed_items_preview_solutions_preview_vidaa_feed_items_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/solutions-preview/vidaa/subscribe":{"post":{"summary":"Vidaa Subscribe Preview","operationId":"vidaa_subscribe_preview_solutions_preview_vidaa_subscribe_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/solutions-preview/vidaa/unsubscribe":{"post":{"summary":"Vidaa Unsubscribe Preview","operationId":"vidaa_unsubscribe_preview_solutions_preview_vidaa_unsubscribe_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/solutions-preview/vidaa/subscriptions":{"get":{"summary":"Vidaa Subscriptions Preview","operationId":"vidaa_subscriptions_preview_solutions_preview_vidaa_subscriptions_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/solutions-preview/vidaa/scheduler-stats":{"get":{"summary":"Vidaa Scheduler Stats Preview","operationId":"vidaa_scheduler_stats_preview_solutions_preview_vidaa_scheduler_stats_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/solutions-preview/vidaa/trigger-poll":{"post":{"summary":"Vidaa Trigger Poll Preview","operationId":"vidaa_trigger_poll_preview_solutions_preview_vidaa_trigger_poll_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/solutions/wpp/query":{"post":{"summary":"Wpp Query","operationId":"wpp_query_solutions_wpp_query_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/solutions/wpp/feedback":{"post":{"summary":"Wpp Feedback","operationId":"wpp_feedback_solutions_wpp_feedback_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/solutions-preview/wpp/query":{"post":{"summary":"Wpp Query Prefix Preview","operationId":"wpp_query_prefix_preview_solutions_preview_wpp_query_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/solutions-preview/wpp/feedback":{"post":{"summary":"Wpp Feedback Prefix Preview","operationId":"wpp_feedback_prefix_preview_solutions_preview_wpp_feedback_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/solutions/kirsh/grant-compliance":{"post":{"summary":"Kirsh Grant Compliance","operationId":"kirsh_grant_compliance_solutions_kirsh_grant_compliance_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/solutions/kirsh/grant-metadata":{"post":{"summary":"Kirsh Grant Metadata","operationId":"kirsh_grant_metadata_solutions_kirsh_grant_metadata_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/solutions/kirsh/funding-and-categorization-check":{"post":{"summary":"Kirsh Funding And Categorization Check","operationId":"kirsh_funding_and_categorization_check_solutions_kirsh_funding_and_categorization_check_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/solutions/kirsh/public-information-check":{"post":{"summary":"Kirsh Public Information Check","operationId":"kirsh_public_information_check_solutions_kirsh_public_information_check_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/solutions/kirsh-document-upload/process":{"post":{"summary":"Kirsh Document Upload Process","operationId":"kirsh_document_upload_process_solutions_kirsh_document_upload_process_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/solutions/kirsh/email-assistant":{"post":{"summary":"Kirsh Email Assistant","operationId":"kirsh_email_assistant_solutions_kirsh_email_assistant_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/solutions-preview/kirsh/grant-compliance":{"post":{"summary":"Kirsh Grant Compliance Prefix Preview","operationId":"kirsh_grant_compliance_prefix_preview_solutions_preview_kirsh_grant_compliance_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/solutions-preview/kirsh/grant-metadata":{"post":{"summary":"Kirsh Grant Metadata Prefix Preview","operationId":"kirsh_grant_metadata_prefix_preview_solutions_preview_kirsh_grant_metadata_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/solutions-preview/kirsh/funding-and-categorization-check":{"post":{"summary":"Kirsh Funding And Categorization Check Prefix Preview","operationId":"kirsh_funding_and_categorization_check_prefix_preview_solutions_preview_kirsh_funding_and_categorization_check_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/solutions-preview/kirsh/public-information-check":{"post":{"summary":"Kirsh Public Information Check Prefix Preview","operationId":"kirsh_public_information_check_prefix_preview_solutions_preview_kirsh_public_information_check_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/solutions-preview/kirsh-document-upload/process":{"post":{"summary":"Kirsh Document Upload Process Prefix Preview","operationId":"kirsh_document_upload_process_prefix_preview_solutions_preview_kirsh_document_upload_process_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/solutions-preview/kirsh/email-assistant":{"post":{"summary":"Kirsh Email Assistant Prefix Preview","operationId":"kirsh_email_assistant_prefix_preview_solutions_preview_kirsh_email_assistant_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/solutions/claroty/product-lookup":{"post":{"summary":"Claroty Product Lookup","operationId":"claroty_product_lookup_solutions_claroty_product_lookup_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/solutions/claroty/suggest-vendor-model":{"post":{"summary":"Claroty Suggest Vendor Model","operationId":"claroty_suggest_vendor_model_solutions_claroty_suggest_vendor_model_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/solutions/claroty/scrape-url":{"post":{"summary":"Claroty Scrape Url","operationId":"claroty_scrape_url_solutions_claroty_scrape_url_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}}},"components":{"schemas":{"Assistant":{"properties":{"id":{"type":"string","title":"Id","description":"A unique ID for the request (not the message). Repeated identical requests\nget different IDs. However, for a streaming response, the ID will be the same\nfor all responses in the stream.\n"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"},"object":{"type":"string","title":"Object"},"name":{"type":"string","title":"Name"},"description":{"type":"string","title":"Description"},"optimization":{"type":"string","title":"Optimization"},"organization_id":{"type":"string","title":"Organization Id"},"workspace_id":{"type":"string","title":"Workspace Id"},"user_id":{"type":"string","title":"User Id"},"avatar":{"type":"string","title":"Avatar"},"is_archived":{"type":"boolean","title":"Is Archived","default":false},"models":{"anyOf":[{"items":{"type":"string","format":"uuid"},"type":"array"},{"items":{"type":"string"},"type":"array"}],"title":"Models"},"tools":{"items":{"$ref":"#/components/schemas/language_studio_api_server__data_types__execution_engine__ToolDefinition"},"type":"array","title":"Tools"},"requirements":{"items":{"$ref":"#/components/schemas/language_studio_api_server__data_types__assistant__Requirement"},"type":"array","title":"Requirements"},"budget":{"allOf":[{"$ref":"#/components/schemas/BudgetLevel"}],"default":"medium"},"visibility":{"allOf":[{"$ref":"#/components/schemas/Visibility"}],"default":"public"},"assistant_type":{"allOf":[{"$ref":"#/components/schemas/AssistantType"}],"default":"default"},"response_language":{"type":"string","enum":["arabic","dutch","english","french","german","hebrew","italian","portuguese","spanish","unset"],"title":"Response Language","default":"unset"},"vibe_prompt":{"type":"string","title":"Vibe Prompt"},"starter_questions":{"items":{"$ref":"#/components/schemas/StarterQuestion"},"type":"array","title":"Starter Questions"},"system_prompt":{"type":"string","title":"System Prompt"},"workflow_config":{"$ref":"#/components/schemas/WorkflowConfig"},"config_overrides":{"type":"object","title":"Config Overrides"}},"type":"object","required":["id","created_at","updated_at","object","name","organization_id","user_id"],"title":"Assistant"},"AssistantBasicInfo":{"properties":{"id":{"type":"string","format":"uuid","title":"Id","description":"A unique ID for the request (not the message). Repeated identical requests\nget different IDs. However, for a streaming response, the ID will be the same\nfor all responses in the stream.\n"},"name":{"type":"string","title":"Name"}},"type":"object","required":["id","name"],"title":"AssistantBasicInfo"},"AssistantMessage":{"properties":{"role":{"type":"string","enum":["assistant"],"title":"Role","default":"assistant","description":"The role of an individual message.\n- `user`: Input provided by the user. Any instructions given here that conflict\n with instructions given in the `system` prompt take precedence over the `system`\n prompt instructions.\n- `assistant`: Response generated by the model.\n- `system`: Initial instructions provided to the system to provide general guidance\n on the tone and voice of the generated message. An initial system message is\n optional but recommended to provide guidance on the tone of the chat. For\n example, \"You are a helpful chatbot with a background in earth sciences and a\n charming French accent.\"\n"},"content":{"type":"string","title":"Content"},"tool_calls":{"items":{"$ref":"#/components/schemas/ToolCall"},"type":"array","title":"Tool Calls"},"reasoning_content":{"type":"string","title":"Reasoning Content"}},"type":"object","title":"AssistantMessage"},"AssistantRoute":{"properties":{"id":{"type":"string","title":"Id","description":"A unique ID for the request (not the message). Repeated identical requests\nget different IDs. However, for a streaming response, the ID will be the same\nfor all responses in the stream.\n"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"},"plan_id":{"type":"string","title":"Plan Id"},"name":{"type":"string","title":"Name"},"description":{"type":"string","title":"Description"},"examples":{"items":{"type":"string"},"type":"array","title":"Examples"},"assistant_id":{"type":"string","title":"Assistant Id"}},"type":"object","required":["id","created_at","updated_at","plan_id","name","description","examples","assistant_id"],"title":"AssistantRoute"},"AssistantType":{"enum":["default","chat","maestro"],"title":"AssistantType","description":"An enumeration."},"AssistantsByMcpResponse":{"properties":{"results":{"items":{"$ref":"#/components/schemas/AssistantBasicInfo"},"type":"array","title":"Results"}},"type":"object","required":["results"],"title":"AssistantsByMcpResponse"},"AuthenticationType":{"type":"string","enum":["none","token-api","custom-header"],"title":"AuthenticationType","description":"An enumeration."},"Body_convert_document_file_studio_v1_chat_files_convert_post":{"properties":{"files":{"items":{"type":"string","format":"binary"},"type":"array","title":"Files"}},"type":"object","required":["files"],"title":"Body_convert_document_file_studio_v1_chat_files_convert_post"},"Body_parse_pdf_studio_v1_demos_document_modifier_parse_pdf_post":{"properties":{"file":{"type":"string","format":"binary","title":"File"}},"type":"object","required":["file"],"title":"Body_parse_pdf_studio_v1_demos_document_modifier_parse_pdf_post"},"Body_process_rfi_document_studio_v1_demos_rfi_process_rfi_post":{"properties":{"file":{"type":"string","format":"binary","title":"File","description":"RFI document file (PDF supported)"},"budget":{"type":"string","title":"Budget","description":"Budget level: LOW, MEDIUM, or HIGH","default":"MEDIUM"},"vector_store_id":{"type":"string","title":"Vector Store Id","description":"Vector store ID to use for RFI processing"}},"type":"object","required":["file"],"title":"Body_process_rfi_document_studio_v1_demos_rfi_process_rfi_post"},"Body_upload_check_compliance_studio_v1_demos_regulations_upload_check_compliance_post":{"properties":{"file":{"type":"string","format":"binary","title":"File"},"budget":{"type":"string","title":"Budget","default":"MEDIUM"},"vector_store_id":{"type":"string","title":"Vector Store Id","description":"Vector store ID to use for RFI processing"}},"type":"object","required":["file"],"title":"Body_upload_check_compliance_studio_v1_demos_regulations_upload_check_compliance_post"},"Body_v1_library_upload":{"properties":{"file":{"type":"string","format":"binary","title":"File"},"path":{"type":"string","title":"Path"},"labels":{"items":{"type":"string"},"type":"array","title":"Labels"},"publicUrl":{"type":"string","title":"Publicurl"},"custom_configs":{"type":"string","title":"Custom Configs"},"upload_mode":{"allOf":[{"$ref":"#/components/schemas/UploadMode"}],"default":"immediate"},"batch_id":{"type":"string","format":"uuid","title":"Batch Id"},"data_source":{"type":"string","title":"Data Source"},"metadata":{"type":"string","title":"Metadata"}},"type":"object","required":["file"],"title":"Body_v1_library_upload"},"BudgetLevel":{"enum":["low","medium","high"],"title":"BudgetLevel","description":"An enumeration."},"ChatCompletion":{"properties":{"id":{"type":"string","title":"Id","description":"A unique ID for the request (not the message). Repeated identical requests\nget different IDs. However, for a streaming response, the ID will be the same\nfor all responses in the stream.\n"},"choices":{"items":{"$ref":"#/components/schemas/ChatCompletionResponseChoice"},"type":"array","title":"Choices","description":"One or more responses, depending on the `n` parameter from the request.\n"},"usage":{"$ref":"#/components/schemas/UsageInfo","description":"The token counts for this request. Per-token billing is based on the\nprompt token and completion token counts and rates.\n"},"meta":{"type":"object","title":"Meta"}},"type":"object","required":["id","choices","usage"],"title":"ChatCompletion","description":"Used for non-streaming responses. Streaming responses return `ChatCompletionVllmStreamingMessage`."},"ChatCompletionResponseChoice":{"properties":{"index":{"type":"integer","title":"Index","description":"Zero-based index of the message in the list of messages. Note that this might not\ncorrespond with the position in the response list.\n"},"message":{"$ref":"#/components/schemas/AssistantMessage","description":"The message generated by the model. Same structure as the request message, with `role` and `content` members.\n"},"logprobs":{"$ref":"#/components/schemas/Logprobs"},"finish_reason":{"type":"string","title":"Finish Reason","description":"Why the message ended. Possible reasons:\n - `stop`: The response ended naturally as a complete answer (due to\n [end-of-sequence token](https://huggingface.co/docs/transformers/v4.32.1/en/llm_tutorial#generate-text))\n or because the model generated a stop sequence provided in the request.\n - `length`: The response ended by reaching `max_tokens`.\n"}},"type":"object","required":["index","message"],"title":"ChatCompletionResponseChoice","description":"A single possible response generated by the system. For non-streaming replies, There\ncan be multiple responses, depending on what `n` value you specified in the request.\n"},"ChatCompletionResponseDeltaChoice":{"properties":{"index":{"type":"integer","title":"Index","description":"Always zero in streamed responses."},"delta":{"anyOf":[{"$ref":"#/components/schemas/ChatStreamingFirstDelta"},{"$ref":"#/components/schemas/ChatStreamingContentDelta"},{"$ref":"#/components/schemas/ChatStreamingToolCallsFirstDelta"},{"$ref":"#/components/schemas/ChatStreamingToolCallsDelta"}],"title":"Delta","description":"- **The first message** in the stream will be an object set to `{\"role\":\"assistant\"}`.\n- **Subsequent messages** will have an object `{\"content\": __token__}` with the generated token.\n"},"logprobs":{"$ref":"#/components/schemas/Logprobs"},"finish_reason":{"type":"string","title":"Finish Reason","description":"One of the following string values:\n - `null`: All messages but the last will return null for `finish_reason`.\n - `stop`: The response ended naturally as a complete answer (due to\n [end-of-sequence token](https://huggingface.co/docs/transformers/v4.32.1/en/llm_tutorial#generate-text))\n or because the model generated a stop sequence provided in the request.\n - `length`: The response ended by reaching `max_tokens`.\n"}},"type":"object","required":["index","delta"],"title":"ChatCompletionResponseDeltaChoice"},"ChatCompletionVllmStreamingMessage":{"properties":{"id":{"type":"string","title":"Id","description":"A unique ID for the request (not the message). Repeated identical requests\nget different IDs. However, for a streaming response, the ID will be the same\nfor all responses in the stream.\n"},"choices":{"items":{"$ref":"#/components/schemas/ChatCompletionResponseDeltaChoice"},"type":"array","title":"Choices","description":"The message"},"usage":{"$ref":"#/components/schemas/UsageInfo","description":"Included in the last message only. Total token counts for the message."},"meta":{"type":"object","title":"Meta"}},"type":"object","required":["id","choices"],"title":"ChatCompletionVllmStreamingMessage","description":"Returned for streaming messages. Non-streaming responses return `ChatCompletion`."},"ChatRequest":{"properties":{"model":{"$ref":"#/components/schemas/ModelName","description":"The name of the model to use. Choose one of the following values:\n* `jamba-instruct-preview`\n"},"messages":{"items":{"oneOf":[{"$ref":"#/components/schemas/UserMessage"},{"$ref":"#/components/schemas/AssistantMessage"},{"$ref":"#/components/schemas/ToolMessage"},{"$ref":"#/components/schemas/SystemMessage"}],"discriminator":{"propertyName":"role","mapping":{"user":"#/components/schemas/UserMessage","assistant":"#/components/schemas/AssistantMessage","tool":"#/components/schemas/ToolMessage","system":"#/components/schemas/SystemMessage"}}},"type":"array","title":"Messages","description":"The previous messages in this chat, from oldest (index 0) to newest. Messages\nmust be alternating `user`/`assistant` messages, optionally starting with a `system`\nmessage. For single turn interactions, this should be an optional `system` message,\nand a single `user` message. Maximum total size for the list is about 256K tokens.\n"},"tools":{"items":{"$ref":"#/components/schemas/language_studio_api_server__data_types__chat__ToolDefinition"},"type":"array","title":"Tools"},"n":{"type":"integer","title":"N","default":1,"description":"How many chat responses to generate. _Range: 1 – 16_ **Notes:**\n- If `n > 1`, setting `temperature=0` will fail because all answers are guaranteed to be duplicates.\n- `n` must be 1 when `stream = True`\n"},"max_tokens":{"type":"integer","title":"Max Tokens","default":4096,"description":"The maximum number of tokens to allow for each generated response message. Typically\nthe best way to limit output length is by providing a length limit in the system\nprompt (for example, \"limit your answers to three sentences\"). _Range: 0 – 4096_\n"},"temperature":{"type":"number","title":"Temperature","description":"How much variation to provide in each answer. Setting this value to 0 guarantees the\nsame response to the same question every time. Setting a higher value encourages more\nvariation. Modifies the distribution from which tokens are sampled.\n[More information](https://docs.ai21.com/docs/sampling-from-language-models#temperature)\n_Range: 0.0 – 2.0_\n"},"top_p":{"type":"number","maximum":1.0,"exclusiveMinimum":0.0,"title":"Top P","default":1,"description":"Limit the pool of next tokens in each step to the top N percentile of possible\ntokens, where 1.0 means the pool of all possible tokens, and 0.01 means the\npool of only the most likely next tokens. [More information]\n(https://docs.ai21.com/docs/sampling-from-language-models#topp) _Range: 0 \\<= value \\<=1.0_\n"},"stop":{"anyOf":[{"type":"string"},{"items":{"type":"string"},"type":"array"}],"title":"Stop","description":"End the message when the model generates one of these strings. The stop sequence\nis not included in the generated message. Each sequence can be up to 64K long, and\ncan contain newlines as `\\n` characters. Examples:\n- Single stop string with a word and a period: \"monkeys.\"\n- Multiple stop strings and a newline: [\"cat\", \"dog\", \" .\", \"####\", \"\\n\"]\n"},"stream":{"type":"boolean","title":"Stream","default":false,"description":"Whether or not to stream the result one token at a time using\n[server-sent events](https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events/Using_server-sent_events).\nThis can be useful when waiting for long results where a long wait time for an\nanswer can be problematic, such as a chatbot. If set to `True`, then `n` must\nbe 1. A streaming response is different than the non-streaming response.\n"},"mock_response":{"$ref":"#/components/schemas/MockResponseConfig"},"documents":{"items":{"$ref":"#/components/schemas/DocumentSchema"},"type":"array","title":"Documents","default":[]},"response_format":{"allOf":[{"$ref":"#/components/schemas/ResponseFormat"}],"title":"Response Format","default":{"type":"text"}}},"type":"object","required":["model","messages"],"title":"ChatRequest"},"ChatStreamingContentDelta":{"properties":{"content":{"type":"string","title":"Content"}},"type":"object","required":["content"],"title":"ChatStreamingContentDelta"},"ChatStreamingFirstDelta":{"properties":{"role":{"type":"string","enum":["system","user","assistant","tool"],"title":"Role","description":"The role of an individual message.\n- `user`: Input provided by the user. Any instructions given here that conflict\n with instructions given in the `system` prompt take precedence over the `system`\n prompt instructions.\n- `assistant`: Response generated by the model.\n- `system`: Initial instructions provided to the system to provide general guidance\n on the tone and voice of the generated message. An initial system message is\n optional but recommended to provide guidance on the tone of the chat. For\n example, \"You are a helpful chatbot with a background in earth sciences and a\n charming French accent.\"\n"}},"type":"object","required":["role"],"title":"ChatStreamingFirstDelta"},"ChatStreamingToolCallsDelta":{"properties":{"tool_calls":{"items":{"$ref":"#/components/schemas/ToolCallDelta"},"type":"array","title":"Tool Calls"}},"type":"object","required":["tool_calls"],"title":"ChatStreamingToolCallsDelta"},"ChatStreamingToolCallsFirstDelta":{"properties":{"tool_calls":{"items":{"$ref":"#/components/schemas/ToolCallDeltaStart"},"type":"array","title":"Tool Calls"}},"type":"object","required":["tool_calls"],"title":"ChatStreamingToolCallsFirstDelta"},"CompareTextRequest":{"properties":{"original_text":{"type":"string","title":"Original Text"},"modified_text":{"type":"string","title":"Modified Text"}},"type":"object","required":["original_text","modified_text"],"title":"CompareTextRequest"},"ComparisonOperator":{"type":"object","title":"ComparisonOperator"},"ConnectorConnectionStatus":{"properties":{"latest_updated":{"type":"string","format":"date-time","title":"Latest Updated"},"files_indexed":{"type":"integer","title":"Files Indexed"},"creation_date":{"type":"string","format":"date-time","title":"Creation Date"},"status":{"$ref":"#/components/schemas/ParagonSyncStatus"},"last_synced_at":{"type":"string","title":"Last Synced At"}},"type":"object","required":["files_indexed","creation_date","status"],"title":"ConnectorConnectionStatus"},"ConnectorsDataSources":{"properties":{"data_sources":{"items":{"$ref":"#/components/schemas/DataSourceMetadata"},"type":"array","title":"Data Sources"}},"type":"object","required":["data_sources"],"title":"ConnectorsDataSources"},"ConnectorsStatus":{"properties":{"created_at":{"type":"string","title":"Created At"},"workflow_status":{"$ref":"#/components/schemas/ConnectorsWorkflowStatus"},"files_successfully_uploaded":{"type":"integer","title":"Files Successfully Uploaded"},"failed_uploaded_files":{"type":"integer","title":"Failed Uploaded Files"}},"type":"object","required":["created_at","workflow_status","files_successfully_uploaded","failed_uploaded_files"],"title":"ConnectorsStatus"},"ConnectorsSyncParams":{"properties":{"token":{"type":"string","title":"Token"},"data_source":{"type":"string","title":"Data Source"},"organization_id":{"type":"string","title":"Organization Id"},"pipeline":{"type":"string","title":"Pipeline"},"configuration":{"type":"object","title":"Configuration"},"configuration_name":{"type":"string","title":"Configuration Name"}},"type":"object","required":["token","data_source","organization_id","pipeline"],"title":"ConnectorsSyncParams"},"ConnectorsToken":{"properties":{"token":{"type":"string","title":"Token"}},"type":"object","required":["token"],"title":"ConnectorsToken"},"ConnectorsWorkflowStatus":{"enum":["IN_PROGRESS","PARTIALLY_COMPLETED","FAILED","SUCCEEDED"],"title":"ConnectorsWorkflowStatus","description":"An enumeration."},"CreateAssistantRequest":{"properties":{"name":{"type":"string","title":"Name"},"description":{"type":"string","title":"Description"},"optimization":{"type":"string","title":"Optimization"},"avatar":{"type":"string","title":"Avatar"},"models":{"items":{"type":"string"},"type":"array","title":"Models"},"tools":{"items":{"$ref":"#/components/schemas/language_studio_api_server__data_types__execution_engine__ToolDefinition"},"type":"array","title":"Tools"},"requirements":{"items":{"$ref":"#/components/schemas/language_studio_api_server__data_types__assistant__Requirement"},"type":"array","title":"Requirements"},"budget":{"allOf":[{"$ref":"#/components/schemas/BudgetLevel"}],"default":"medium"},"assistant_type":{"allOf":[{"$ref":"#/components/schemas/AssistantType"}],"default":"default"},"starter_questions":{"items":{"$ref":"#/components/schemas/StarterQuestion"},"type":"array","title":"Starter Questions"},"system_prompt":{"type":"string","title":"System Prompt"},"workflow_config":{"$ref":"#/components/schemas/WorkflowConfig"},"config_overrides":{"type":"object","title":"Config Overrides"}},"type":"object","required":["name"],"title":"CreateAssistantRequest"},"CreateMCPStorageRequest":{"properties":{"server_url":{"type":"string","title":"Server Url"},"server_label":{"type":"string","title":"Server Label"},"workspace_id":{"type":"string","format":"uuid","title":"Workspace Id"},"authentication_type":{"$ref":"#/components/schemas/AuthenticationType"},"auth_header_name":{"type":"string","title":"Auth Header Name"},"auth_value":{"type":"string","title":"Auth Value"},"allowed_tools":{"items":{"type":"string"},"type":"array","title":"Allowed Tools"}},"type":"object","required":["server_url","server_label"],"title":"CreateMCPStorageRequest"},"CreateMaestroRunsPayload":{"properties":{"input":{"anyOf":[{"items":{"$ref":"#/components/schemas/Message"},"type":"array"},{"type":"string"}],"title":"Input"},"output_type":{"type":"object","title":"Output Type"},"models":{"items":{"type":"string"},"type":"array","title":"Models"},"tools":{"items":{"$ref":"#/components/schemas/language_studio_api_server__data_types__execution_engine__ToolDefinition"},"type":"array","title":"Tools"},"context":{"type":"object","title":"Context"},"requirements":{"items":{"$ref":"#/components/schemas/language_studio_api_server__data_types__execution_engine__Requirement"},"type":"array","title":"Requirements"},"budget":{"type":"string","enum":["low","medium","high"],"title":"Budget"},"verbose":{"type":"boolean","title":"Verbose","default":false},"include":{"items":{"type":"string"},"type":"array","title":"Include"},"structured_rag_enabled":{"type":"boolean","title":"Structured Rag Enabled","default":false},"dynamic_planning_enabled":{"type":"boolean","title":"Dynamic Planning Enabled","default":false},"assistant_id":{"type":"string","title":"Assistant Id"},"variant":{"type":"string","enum":["main","ingestion"],"title":"Variant","default":"main"},"custom_retrieval_configs":{"items":{"type":"object"},"type":"array","title":"Custom Retrieval Configs"},"response_language":{"type":"string","enum":["arabic","dutch","english","french","german","hebrew","italian","portuguese","spanish","unset"],"title":"Response Language","default":"unset"},"system_prompt":{"type":"string","title":"System Prompt"},"stream":{"type":"boolean","title":"Stream","default":false,"description":"Whether or not to stream the result one token at a time using\n[server-sent events](https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events/Using_server-sent_events).\nThis can be useful when waiting for long results where a long wait time for an\nanswer can be problematic, such as a chatbot. If set to `True`, then `n` must\nbe 1. A streaming response is different than the non-streaming response.\n"}},"type":"object","required":["input"],"title":"CreateMaestroRunsPayload"},"CreateOrganizationSchemaRequest":{"properties":{"schema_name":{"type":"string","title":"Schema Name"},"schema_object":{"type":"object","title":"Schema Object"},"run_classification":{"type":"boolean","title":"Run Classification","default":false}},"type":"object","required":["schema_name","schema_object"],"title":"CreateOrganizationSchemaRequest"},"CreatePlanPayload":{"properties":{"code":{"type":"string","title":"Code"},"schemas":{"items":{"type":"object"},"type":"array","title":"Schemas"}},"type":"object","required":["code"],"title":"CreatePlanPayload"},"CreateRoutePayload":{"properties":{"plan_id":{"type":"string","title":"Plan Id"},"name":{"type":"string","title":"Name"},"description":{"type":"string","title":"Description"},"examples":{"items":{"type":"string"},"type":"array","title":"Examples"}},"type":"object","required":["plan_id","name","description","examples"],"title":"CreateRoutePayload"},"CreateSecretPayload":{"properties":{"secret_name":{"type":"string","title":"Secret Name"},"secret_value":{"type":"string","title":"Secret Value"}},"type":"object","required":["secret_name","secret_value"],"title":"CreateSecretPayload"},"DataSourceMetadata":{"properties":{"name":{"type":"string","title":"Name"},"type":{"type":"string","title":"Type"},"description":{"type":"string","title":"Description"},"icon":{"type":"string","title":"Icon"},"connected":{"type":"boolean","title":"Connected"}},"type":"object","required":["name","type","description","icon","connected"],"title":"DataSourceMetadata"},"DeleteAssistantResponse":{"properties":{"object":{"type":"string","title":"Object","default":"assistant"},"deleted":{"type":"boolean","title":"Deleted","default":true},"id":{"type":"string","title":"Id","description":"A unique ID for the request (not the message). Repeated identical requests\nget different IDs. However, for a streaming response, the ID will be the same\nfor all responses in the stream.\n"}},"type":"object","required":["id"],"title":"DeleteAssistantResponse"},"DeleteMCPStorageResponse":{"properties":{"id":{"type":"string","format":"uuid","title":"Id","description":"A unique ID for the request (not the message). Repeated identical requests\nget different IDs. However, for a streaming response, the ID will be the same\nfor all responses in the stream.\n"}},"type":"object","required":["id"],"title":"DeleteMCPStorageResponse"},"Demo":{"properties":{"id":{"type":"string","title":"Id","description":"A unique ID for the request (not the message). Repeated identical requests\nget different IDs. However, for a streaming response, the ID will be the same\nfor all responses in the stream.\n"},"name":{"type":"string","title":"Name","description":"Name of the demo"},"visibility":{"allOf":[{"$ref":"#/components/schemas/DemoVisibility"}],"description":"Visibility of the demo (public/private)"},"status":{"allOf":[{"$ref":"#/components/schemas/DemoStatus"}],"description":"Status of the demo (active/inactive)"},"config":{"type":"object","title":"Config","description":"Demo configuration"},"ui_component_name":{"type":"string","title":"Ui Component Name","description":"Name of the UI component"}},"type":"object","required":["id","name","visibility","status","ui_component_name"],"title":"Demo"},"DemoCreate":{"properties":{"name":{"type":"string","title":"Name","description":"Name of the demo"},"visibility":{"allOf":[{"$ref":"#/components/schemas/DemoVisibility"}],"description":"Visibility of the demo (public/private)"},"status":{"allOf":[{"$ref":"#/components/schemas/DemoStatus"}],"description":"Status of the demo (active/inactive)"},"config":{"type":"object","title":"Config","description":"Demo configuration"},"ui_component_name":{"type":"string","title":"Ui Component Name","description":"Name of the UI component"}},"type":"object","required":["name","visibility","status","ui_component_name"],"title":"DemoCreate"},"DemoStatus":{"enum":["active","inactive"],"title":"DemoStatus","description":"An enumeration."},"DemoUpdate":{"properties":{"name":{"type":"string","title":"Name","description":"Name of the demo"},"visibility":{"allOf":[{"$ref":"#/components/schemas/DemoVisibility"}],"description":"Visibility of the demo (public/private)"},"status":{"allOf":[{"$ref":"#/components/schemas/DemoStatus"}],"description":"Status of the demo (active/inactive)"},"config":{"type":"object","title":"Config","description":"Demo configuration"},"ui_component_name":{"type":"string","title":"Ui Component Name","description":"Name of the UI component"}},"type":"object","title":"DemoUpdate"},"DemoVisibility":{"enum":["public","private"],"title":"DemoVisibility","description":"An enumeration."},"DetectSchemaRequest":{"properties":{"documents":{"items":{"$ref":"#/components/schemas/DocumentReference"},"type":"array","title":"Documents"},"queries":{"items":{"type":"string"},"type":"array","title":"Queries"}},"type":"object","required":["documents"],"title":"DetectSchemaRequest"},"DetectSchemaResponse":{"properties":{"schema_name":{"type":"string","title":"Schema Name"},"schema_definition":{"type":"object","title":"Schema Definition"}},"type":"object","required":["schema_name","schema_definition"],"title":"DetectSchemaResponse"},"DocumentReference":{"properties":{"document_id":{"type":"string","format":"uuid","title":"Document Id"},"name":{"type":"string","title":"Name"}},"type":"object","required":["document_id","name"],"title":"DocumentReference"},"DocumentSchema":{"properties":{"id":{"type":"string","title":"Id","description":"A unique ID for the request (not the message). Repeated identical requests\nget different IDs. However, for a streaming response, the ID will be the same\nfor all responses in the stream.\n"},"content":{"type":"string","title":"Content"},"metadata":{"additionalProperties":{"type":"string"},"type":"object","title":"Metadata","default":{}}},"type":"object","required":["content"],"title":"DocumentSchema"},"DownloadModifiedDocumentRequest":{"properties":{"content":{"type":"string","title":"Content"},"filename":{"type":"string","title":"Filename"}},"type":"object","required":["content","filename"],"title":"DownloadModifiedDocumentRequest"},"FileResponse":{"properties":{"fileId":{"type":"string","format":"uuid","title":"Fileid","description":"The unique identifier of the file, generated by AI21.\n"},"name":{"type":"string","title":"Name","description":"The name of the file. This is the local file name from when the file was\nuploaded. It cannot be modified.\n"},"path":{"type":"string","title":"Path","description":"An arbitrary file-path-like string to indicate the content of a file. This has\nnothing to do with the location of the file in storage or on disk, and is only\nanother label that you can assign to the file in path-like format to help you\norganize the contents of the file or filter queries against your files. Example\npaths might be `pets/fish` or `pets/dogs`. Then, when searching your library,\nyou can filter files by the full path or path prefix. So to search only files\nin the \"dog folder\", filter by the path `/pets/dogs`. To search all files in\nthe \"pet folder\", filter your search by the path `pets/` when searching by path.\nThere isn't a restriction on whether a path must start or end with a / mark, but\nbe consistent in your usage, and all matches are prefix matching, not substring\nmatching. So filtering by `dog/` matches `dog/` and `dog/setter` but not `pets/dog/`.\n"},"fileType":{"type":"string","title":"Filetype","description":"The file type. See the file upload method to learn what file types are supported.\n"},"sizeBytes":{"type":"integer","title":"Sizebytes","description":"The size of the file, in bytes."},"labels":{"items":{"type":"string"},"type":"array","title":"Labels","description":"Any string labels you have associated with the file. You can apply arbitrary\nstring labels to your files and limit queries to files with one or more labels.\nSimilar to paths, but labels do not prefix match. Labels are case-sensitive.\nThere can be a maximum of 20 unique labels per account.\n"},"publicUrl":{"type":"string","title":"Publicurl","description":"The public URL of the file, if any. This URL is not validated by\nAI21 or used in any way. It is strictly a piece of metadata that you can\noptionally attach to a file.\n"},"createdBy":{"type":"string","format":"uuid","title":"Createdby","description":"An internal identifier of the user who uploaded the file.\n"},"creationDate":{"type":"string","format":"date","title":"Creationdate","description":"The date when the file was uploaded."},"lastUpdated":{"type":"string","format":"date","title":"Lastupdated","description":"When the file data or metadata was last changed."},"status":{"type":"string","title":"Status","description":"File status. One of the following values: \"DB_RECORD_CREATED\",\n\"UPLOADED\", \"UPLOAD_FAILED\", \"PROCESSED\", \"PROCESSING_FAILED\"\n"},"dataSource":{"type":"string","title":"Datasource"}},"type":"object","required":["fileId","name","fileType","sizeBytes","createdBy","creationDate","lastUpdated","status"],"title":"FileResponse"},"FileSearchToolResource":{"properties":{"type":{"type":"string","enum":["file_search"],"title":"Type","default":"file_search"},"retrieval_similarity_threshold":{"type":"number","title":"Retrieval Similarity Threshold"},"labels":{"items":{"type":"string"},"type":"array","title":"Labels"},"labels_filter_mode":{"type":"string","enum":["AND","OR"],"title":"Labels Filter Mode","default":"AND"},"labels_filter":{"$ref":"#/components/schemas/QueryFilter"},"file_ids":{"items":{"type":"string"},"type":"array","title":"File Ids"},"retrieval_strategy":{"allOf":[{"$ref":"#/components/schemas/RetrievalStrategy"}],"default":"segments"},"max_neighbors":{"type":"integer","title":"Max Neighbors"},"path":{"type":"string","title":"Path"},"response_language":{"type":"string","enum":["arabic","dutch","english","french","german","hebrew","italian","portuguese","spanish","unset"],"title":"Response Language","default":"unset"},"hybrid_search_alpha":{"type":"number","title":"Hybrid Search Alpha","default":1},"use_two_step_embedders":{"type":"boolean","title":"Use Two Step Embedders","default":false}},"type":"object","title":"FileSearchToolResource"},"FileStatus":{"type":"string","enum":["DB_RECORD_CREATED","UPLOADED","UPLOAD_FAILED","PROCESSED","PROCESSING_FAILED"],"title":"FileStatus","description":"An enumeration."},"FilesUpdateRequest":{"properties":{"publicUrl":{"type":"string","title":"Publicurl","description":"The public URL of the file, if any. This URL is not validated by\nAI21 or used in any way. It is strictly a piece of metadata that you can\noptionally attach to a file.\n"},"labels":{"items":{"type":"string"},"type":"array","title":"Labels","description":"Any labels to associate with this file. Separate multiple labels with commas. If\nprovided, will overwrite all existing labels.\n"}},"type":"object","title":"FilesUpdateRequest"},"FunctionToolDefinition":{"properties":{"name":{"type":"string","title":"Name"},"description":{"type":"string","title":"Description"},"parameters":{"$ref":"#/components/schemas/ToolParameters"}},"type":"object","required":["name"],"title":"FunctionToolDefinition"},"GenerateAssistantRequest":{"properties":{"prompt":{"type":"string","title":"Prompt"},"avatar":{"type":"string","title":"Avatar"}},"type":"object","required":["prompt"],"title":"GenerateAssistantRequest"},"GenerateAssistantResponse":{"properties":{"id":{"type":"string","title":"Id","description":"A unique ID for the request (not the message). Repeated identical requests\nget different IDs. However, for a streaming response, the ID will be the same\nfor all responses in the stream.\n"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"},"object":{"type":"string","title":"Object"},"name":{"type":"string","title":"Name"},"description":{"type":"string","title":"Description"},"optimization":{"type":"string","title":"Optimization"},"organization_id":{"type":"string","title":"Organization Id"},"workspace_id":{"type":"string","title":"Workspace Id"},"user_id":{"type":"string","title":"User Id"},"avatar":{"type":"string","title":"Avatar"},"is_archived":{"type":"boolean","title":"Is Archived","default":false},"models":{"anyOf":[{"items":{"type":"string","format":"uuid"},"type":"array"},{"items":{"type":"string"},"type":"array"}],"title":"Models"},"tools":{"items":{"$ref":"#/components/schemas/language_studio_api_server__data_types__execution_engine__ToolDefinition"},"type":"array","title":"Tools"},"requirements":{"items":{"$ref":"#/components/schemas/language_studio_api_server__data_types__assistant__Requirement"},"type":"array","title":"Requirements"},"budget":{"allOf":[{"$ref":"#/components/schemas/BudgetLevel"}],"default":"medium"},"visibility":{"allOf":[{"$ref":"#/components/schemas/Visibility"}],"default":"public"},"assistant_type":{"allOf":[{"$ref":"#/components/schemas/AssistantType"}],"default":"default"},"response_language":{"type":"string","enum":["arabic","dutch","english","french","german","hebrew","italian","portuguese","spanish","unset"],"title":"Response Language","default":"unset"},"vibe_prompt":{"type":"string","title":"Vibe Prompt"},"starter_questions":{"items":{"$ref":"#/components/schemas/StarterQuestion"},"type":"array","title":"Starter Questions"},"system_prompt":{"type":"string","title":"System Prompt"},"workflow_config":{"$ref":"#/components/schemas/WorkflowConfig"},"config_overrides":{"type":"object","title":"Config Overrides"},"custom_tool_needed":{"additionalProperties":{"type":"string"},"type":"object","title":"Custom Tool Needed"},"recommended_files":{"items":{"type":"string"},"type":"array","title":"Recommended Files"}},"type":"object","required":["id","created_at","updated_at","object","name","organization_id","user_id"],"title":"GenerateAssistantResponse"},"HTTPToolEndpoint":{"properties":{"url":{"type":"string","title":"Url"},"headers":{"type":"object","title":"Headers"}},"type":"object","required":["url"],"title":"HTTPToolEndpoint"},"HTTPToolFunction":{"properties":{"name":{"type":"string","title":"Name"},"description":{"type":"string","title":"Description"},"parameters":{"$ref":"#/components/schemas/HTTPToolFunctionParameters"}},"type":"object","required":["name","description","parameters"],"title":"HTTPToolFunction"},"HTTPToolFunctionParamProperties":{"properties":{"type":{"type":"string","title":"Type"},"description":{"type":"string","title":"Description"}},"type":"object","required":["type","description"],"title":"HTTPToolFunctionParamProperties"},"HTTPToolFunctionParameters":{"properties":{"type":{"type":"string","enum":["object"],"title":"Type","default":"object"},"properties":{"additionalProperties":{"$ref":"#/components/schemas/HTTPToolFunctionParamProperties"},"type":"object","title":"Properties"},"required":{"items":{"type":"string"},"type":"array","title":"Required"},"additionalProperties":{"type":"boolean","title":"Additionalproperties","default":false}},"type":"object","required":["properties","required"],"title":"HTTPToolFunctionParameters"},"HTTPToolResource":{"properties":{"type":{"type":"string","enum":["http"],"title":"Type","default":"http"},"function":{"$ref":"#/components/schemas/HTTPToolFunction"},"endpoint":{"$ref":"#/components/schemas/HTTPToolEndpoint"}},"type":"object","required":["function","endpoint"],"title":"HTTPToolResource"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"IgnestionBatchStatusCount":{"properties":{"status":{"type":"string","title":"Status"},"count":{"type":"integer","title":"Count"}},"type":"object","required":["status","count"],"title":"IgnestionBatchStatusCount"},"IngestionBatchStatusResponse":{"properties":{"batch_id":{"type":"string","title":"Batch Id","description":"The UUID of the batch"},"total_documents":{"type":"integer","title":"Total Documents","description":"Total number of documents in the batch"},"statuses":{"items":{"$ref":"#/components/schemas/IgnestionBatchStatusCount"},"type":"array","title":"Statuses","description":"List of document counts by status"}},"type":"object","required":["batch_id","total_documents","statuses"],"title":"IngestionBatchStatusResponse"},"JambaExecuteRequest":{"properties":{"content":{"type":"string","title":"Content"},"task":{"type":"string","title":"Task"},"prompt":{"type":"string","title":"Prompt"},"api_key":{"type":"string","title":"Api Key"}},"type":"object","required":["content","task","prompt"],"title":"JambaExecuteRequest"},"LibrarySearchRequest":{"properties":{"query":{"type":"string","title":"Query"},"maxSegments":{"type":"integer","title":"Maxsegments"},"path":{"type":"string","title":"Path"},"labels":{"items":{"type":"string"},"type":"array","title":"Labels"},"labels_filter":{"$ref":"#/components/schemas/QueryFilter"},"labels_filter_mode":{"type":"string","enum":["AND","OR"],"title":"Labels Filter Mode","default":"AND"},"fileIds":{"items":{"type":"string","format":"uuid"},"type":"array","title":"Fileids"},"retrievalStrategy":{"allOf":[{"$ref":"#/components/schemas/RetrievalStrategy"}],"default":"segments"},"maxNeighbors":{"type":"integer","title":"Maxneighbors","default":1},"retrievalSimilarityThreshold":{"type":"number","maximum":1.0,"minimum":0.0,"title":"Retrievalsimilaritythreshold"},"hybridSearchAlpha":{"type":"number","maximum":1.0,"minimum":0.0,"title":"Hybridsearchalpha"}},"type":"object","required":["query"],"title":"LibrarySearchRequest","description":"This class is to be used as a common class to all Studio API requests payloads"},"ListAssistantsResponse":{"properties":{"results":{"items":{"$ref":"#/components/schemas/Assistant"},"type":"array","title":"Results"}},"type":"object","required":["results"],"title":"ListAssistantsResponse"},"ListMCPsStorageResponse":{"properties":{"results":{"items":{"$ref":"#/components/schemas/MCPStorageResponse"},"type":"array","title":"Results"}},"type":"object","required":["results"],"title":"ListMCPsStorageResponse"},"ListPlansResponse":{"properties":{"results":{"items":{"$ref":"#/components/schemas/Plan"},"type":"array","title":"Results"}},"type":"object","required":["results"],"title":"ListPlansResponse"},"ListRoutesResponse":{"properties":{"results":{"items":{"$ref":"#/components/schemas/AssistantRoute"},"type":"array","title":"Results"}},"type":"object","required":["results"],"title":"ListRoutesResponse"},"LogicalOperator":{"additionalProperties":{"items":{"type":"object"},"type":"array"},"type":"object","title":"LogicalOperator"},"Logprobs":{"properties":{"content":{"items":{"$ref":"#/components/schemas/LogprobsData"},"type":"array","title":"Content"}},"type":"object","required":["content"],"title":"Logprobs"},"LogprobsData":{"properties":{"token":{"type":"string","title":"Token"},"logprob":{"type":"number","title":"Logprob"},"top_logprobs":{"items":{"$ref":"#/components/schemas/TopLogprobsData"},"type":"array","title":"Top Logprobs"}},"type":"object","required":["token","logprob"],"title":"LogprobsData"},"MCPDefinition":{"properties":{"server_url":{"type":"string","title":"Server Url"},"server_label":{"type":"string","title":"Server Label"},"headers":{"type":"object","title":"Headers"}},"type":"object","required":["server_url"],"title":"MCPDefinition"},"MCPDiscoveryResponse":{"properties":{"mcp_definition":{"$ref":"#/components/schemas/MCPDefinition"},"tools":{"items":{"$ref":"#/components/schemas/MCPTool"},"type":"array","title":"Tools"}},"type":"object","required":["mcp_definition","tools"],"title":"MCPDiscoveryResponse"},"MCPStorageResponse":{"properties":{"id":{"type":"string","format":"uuid","title":"Id","description":"A unique ID for the request (not the message). Repeated identical requests\nget different IDs. However, for a streaming response, the ID will be the same\nfor all responses in the stream.\n"},"server_url":{"type":"string","title":"Server Url"},"server_label":{"type":"string","title":"Server Label"},"organization_id":{"type":"string","format":"uuid","title":"Organization Id"},"workspace_id":{"type":"string","format":"uuid","title":"Workspace Id"},"user_id":{"type":"string","format":"uuid","title":"User Id"},"authentication_type":{"$ref":"#/components/schemas/AuthenticationType"},"auth_header_name":{"type":"string","title":"Auth Header Name"},"auth_secret_key":{"type":"string","title":"Auth Secret Key"},"allowed_tools":{"items":{"type":"string"},"type":"array","title":"Allowed Tools"}},"type":"object","required":["id","server_url","server_label","organization_id","user_id"],"title":"MCPStorageResponse"},"MCPTool":{"properties":{"name":{"type":"string","title":"Name"},"description":{"type":"string","title":"Description"},"inputSchema":{"type":"object","title":"Inputschema"}},"type":"object","required":["name","inputSchema"],"title":"MCPTool"},"MCPToolResource":{"properties":{"type":{"type":"string","enum":["mcp"],"title":"Type","default":"mcp"},"server_label":{"type":"string","title":"Server Label"},"server_url":{"type":"string","title":"Server Url"},"headers":{"type":"object","title":"Headers"},"allowed_tools":{"items":{"type":"string"},"type":"array","title":"Allowed Tools"},"mcp_id":{"type":"string","title":"Mcp Id"}},"type":"object","title":"MCPToolResource"},"MaestroRunError":{"properties":{"message":{"type":"string","title":"Message"}},"type":"object","required":["message"],"title":"MaestroRunError"},"MaestroRunResult":{"properties":{"id":{"type":"string","format":"uuid","title":"Id","description":"A unique ID for the request (not the message). Repeated identical requests\nget different IDs. However, for a streaming response, the ID will be the same\nfor all responses in the stream.\n"},"status":{"type":"string","enum":["completed","failed","in_progress","requires_action"],"title":"Status"},"result":{"title":"Result"},"data_sources":{"type":"object","title":"Data Sources"},"requirements_result":{"type":"object","title":"Requirements Result"},"error":{"$ref":"#/components/schemas/MaestroRunError"}},"type":"object","required":["id","status"],"title":"MaestroRunResult"},"MarkdownRequest":{"properties":{"text":{"type":"string","title":"Text","description":"All section answers concatenated"}},"type":"object","required":["text"],"title":"MarkdownRequest"},"Message":{"properties":{"role":{"type":"string","enum":["assistant","user"],"title":"Role","description":"The role of an individual message.\n- `user`: Input provided by the user. Any instructions given here that conflict\n with instructions given in the `system` prompt take precedence over the `system`\n prompt instructions.\n- `assistant`: Response generated by the model.\n- `system`: Initial instructions provided to the system to provide general guidance\n on the tone and voice of the generated message. An initial system message is\n optional but recommended to provide guidance on the tone of the chat. For\n example, \"You are a helpful chatbot with a background in earth sciences and a\n charming French accent.\"\n"},"content":{"type":"string","title":"Content"}},"type":"object","required":["role","content"],"title":"Message"},"MockResponseConfig":{"properties":{"response_delay_seconds":{"type":"number","minimum":0.0,"title":"Response Delay Seconds","default":1},"stream_response_delay_between_deltas_seconds":{"type":"number","minimum":0.0,"title":"Stream Response Delay Between Deltas Seconds","default":0.1}},"type":"object","title":"MockResponseConfig","include_in_schema":false},"ModelInfo":{"properties":{"id":{"type":"string","title":"Id","description":"A unique ID for the request (not the message). Repeated identical requests\nget different IDs. However, for a streaming response, the ID will be the same\nfor all responses in the stream.\n"},"name":{"type":"string","title":"Name"},"updated":{"type":"string","title":"Updated"},"context_length":{"type":"integer","title":"Context Length"},"quantization":{"$ref":"#/components/schemas/ModelQuantization"},"max_completion_tokens":{"type":"integer","title":"Max Completion Tokens"},"pricing":{"$ref":"#/components/schemas/ModelPricing"}},"type":"object","required":["id","name","updated","context_length","quantization","max_completion_tokens","pricing"],"title":"ModelInfo"},"ModelName":{"type":"string","enum":["jamba-mini","jamba-large","jamba-large-1.7","jamba-large-1.7-2025-07","jamba-mini-2","jamba-mini-2-2026-01"],"title":"ModelName","description":"An enumeration."},"ModelPricing":{"properties":{"prompt":{"type":"string","title":"Prompt"},"completion":{"type":"string","title":"Completion"}},"type":"object","required":["prompt","completion"],"title":"ModelPricing"},"ModelQuantization":{"type":"string","enum":["FP8","experts_int8"],"title":"ModelQuantization","description":"An enumeration."},"ModelsInfoResponse":{"properties":{"data":{"items":{"$ref":"#/components/schemas/ModelInfo"},"type":"array","title":"Data"}},"type":"object","required":["data"],"title":"ModelsInfoResponse"},"ModifyAssistantRequest":{"properties":{"name":{"type":"string","title":"Name"},"description":{"type":"string","title":"Description"},"optimization":{"$ref":"#/components/schemas/RunOptimization"},"avatar":{"type":"string","title":"Avatar"},"is_archived":{"type":"boolean","title":"Is Archived","default":false},"models":{"items":{"type":"string"},"type":"array","title":"Models"},"tools":{"items":{"$ref":"#/components/schemas/language_studio_api_server__data_types__execution_engine__ToolDefinition"},"type":"array","title":"Tools"},"requirements":{"items":{"$ref":"#/components/schemas/language_studio_api_server__data_types__assistant__Requirement"},"type":"array","title":"Requirements"},"budget":{"$ref":"#/components/schemas/BudgetLevel"},"visibility":{"$ref":"#/components/schemas/Visibility"},"response_language":{"type":"string","enum":["arabic","dutch","english","french","german","hebrew","italian","portuguese","spanish","unset"],"title":"Response Language"},"system_prompt":{"type":"string","title":"System Prompt"},"workflow_config":{"$ref":"#/components/schemas/WorkflowConfig"},"config_overrides":{"type":"object","title":"Config Overrides"}},"type":"object","title":"ModifyAssistantRequest"},"OrgSchema":{"properties":{"organization_id":{"type":"string","format":"uuid","title":"Organization Id"},"schema_name":{"type":"string","title":"Schema Name"},"schema_definition":{"type":"object","title":"Schema Definition"},"table_stats":{"type":"object","title":"Table Stats"}},"type":"object","required":["organization_id","schema_name","schema_definition","table_stats"],"title":"OrgSchema"},"OrgSchemas":{"properties":{"schemas":{"items":{"$ref":"#/components/schemas/OrgSchema"},"type":"array","title":"Schemas"}},"type":"object","required":["schemas"],"title":"OrgSchemas"},"ParagonSyncStatus":{"type":"string","enum":["ACTIVE","IDLE","ERRORED","PAUSED"],"title":"ParagonSyncStatus","description":"An enumeration."},"Plan":{"properties":{"id":{"type":"string","title":"Id","description":"A unique ID for the request (not the message). Repeated identical requests\nget different IDs. However, for a streaming response, the ID will be the same\nfor all responses in the stream.\n"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"},"code":{"type":"string","title":"Code"},"schemas":{"items":{"type":"object"},"type":"array","title":"Schemas"},"assistant_id":{"type":"string","title":"Assistant Id"}},"type":"object","required":["id","created_at","updated_at","code","assistant_id"],"title":"Plan"},"QueryFilter":{"anyOf":[{"$ref":"#/components/schemas/ComparisonOperator"},{"$ref":"#/components/schemas/LogicalOperator"},{"additionalProperties":{"$ref":"#/components/schemas/ComparisonOperator"},"type":"object"}],"title":"QueryFilter"},"RFIResponseSection":{"properties":{"header":{"type":"string","title":"Header","description":"Exact or closest RFI heading for the section"},"description":{"type":"string","title":"Description","description":"≤350-character directive listing everything to include in that section"},"generated_content":{"type":"string","title":"Generated Content","description":"Generated content for this section based on company files"}},"type":"object","required":["header","description"],"title":"RFIResponseSection","description":"Model for a single RFI response section."},"RequirementItem":{"properties":{"name":{"type":"string","title":"Name"},"description":{"type":"string","title":"Description"}},"type":"object","required":["name","description"],"title":"RequirementItem"},"RequirementsGenerationRequest":{"properties":{"query":{"type":"string","title":"Query"}},"type":"object","required":["query"],"title":"RequirementsGenerationRequest"},"RequirementsGenerationResponse":{"properties":{"requirements":{"items":{"$ref":"#/components/schemas/RequirementItem"},"type":"array","title":"Requirements"}},"type":"object","required":["requirements"],"title":"RequirementsGenerationResponse"},"ResponseFormat":{"properties":{"type":{"type":"string","enum":["text","json_object"],"title":"Type"}},"type":"object","required":["type"],"title":"ResponseFormat"},"RetrievalStrategy":{"type":"string","enum":["segments","default","add_neighbors","full_doc"],"title":"RetrievalStrategy","description":"An enumeration."},"RunAssistantRequest":{"properties":{"input":{"items":{"$ref":"#/components/schemas/Message"},"type":"array","title":"Input"},"verbose":{"type":"boolean","title":"Verbose","default":false},"output_type":{"type":"object","title":"Output Type"},"include":{"items":{"type":"string"},"type":"array","title":"Include","default":["data_sources","requirements_result","requirements_result.metadata"]},"structured_rag_enabled":{"type":"boolean","title":"Structured Rag Enabled","default":false},"dynamic_planning_enabled":{"type":"boolean","title":"Dynamic Planning Enabled","default":false},"response_language":{"type":"string","enum":["arabic","dutch","english","french","german","hebrew","italian","portuguese","spanish","unset"],"title":"Response Language","default":"unset"},"system_prompt":{"type":"string","title":"System Prompt"}},"type":"object","required":["input"],"title":"RunAssistantRequest"},"RunOptimization":{"enum":["cost","latency"],"title":"RunOptimization","description":"An enumeration."},"SecretResponse":{"properties":{"secret_id":{"type":"string","title":"Secret Id"},"secret_key":{"type":"string","title":"Secret Key"}},"type":"object","required":["secret_id","secret_key"],"title":"SecretResponse"},"StarterQuestion":{"properties":{"title":{"type":"string","title":"Title"},"prompt":{"type":"string","title":"Prompt"}},"type":"object","required":["title","prompt"],"title":"StarterQuestion"},"SystemMessage":{"properties":{"role":{"type":"string","enum":["system"],"title":"Role","default":"system","description":"The role of an individual message.\n- `user`: Input provided by the user. Any instructions given here that conflict\n with instructions given in the `system` prompt take precedence over the `system`\n prompt instructions.\n- `assistant`: Response generated by the model.\n- `system`: Initial instructions provided to the system to provide general guidance\n on the tone and voice of the generated message. An initial system message is\n optional but recommended to provide guidance on the tone of the chat. For\n example, \"You are a helpful chatbot with a background in earth sciences and a\n charming French accent.\"\n"},"content":{"type":"string","title":"Content"}},"type":"object","required":["content"],"title":"SystemMessage"},"ThreadNameGenerationRequest":{"properties":{"query":{"type":"string","title":"Query"}},"type":"object","required":["query"],"title":"ThreadNameGenerationRequest"},"ThreadNameGenerationResponse":{"properties":{"thread_name":{"type":"string","title":"Thread Name"}},"type":"object","required":["thread_name"],"title":"ThreadNameGenerationResponse"},"ToolCall":{"properties":{"id":{"type":"string","title":"Id","description":"A unique ID for the request (not the message). Repeated identical requests\nget different IDs. However, for a streaming response, the ID will be the same\nfor all responses in the stream.\n"},"type":{"type":"string","enum":["function"],"title":"Type","default":"function"},"function":{"$ref":"#/components/schemas/ToolFunction"}},"type":"object","required":["id","function"],"title":"ToolCall"},"ToolCallDelta":{"properties":{"index":{"type":"integer","title":"Index"},"function":{"$ref":"#/components/schemas/ToolFunctionDelta"}},"type":"object","required":["index","function"],"title":"ToolCallDelta"},"ToolCallDeltaStart":{"properties":{"id":{"type":"string","title":"Id","description":"A unique ID for the request (not the message). Repeated identical requests\nget different IDs. However, for a streaming response, the ID will be the same\nfor all responses in the stream.\n"},"index":{"type":"integer","title":"Index"},"type":{"type":"string","enum":["function"],"title":"Type"},"function":{"$ref":"#/components/schemas/ToolFunctionDeltaStart"}},"type":"object","required":["id","index","type","function"],"title":"ToolCallDeltaStart"},"ToolFunction":{"properties":{"name":{"type":"string","title":"Name"},"arguments":{"type":"string","title":"Arguments"}},"type":"object","required":["name","arguments"],"title":"ToolFunction"},"ToolFunctionDelta":{"properties":{"arguments":{"type":"string","title":"Arguments"}},"type":"object","required":["arguments"],"title":"ToolFunctionDelta"},"ToolFunctionDeltaStart":{"properties":{"name":{"type":"string","title":"Name"}},"type":"object","required":["name"],"title":"ToolFunctionDeltaStart"},"ToolMessage":{"properties":{"role":{"type":"string","enum":["tool"],"title":"Role","default":"tool","description":"The role of an individual message.\n- `user`: Input provided by the user. Any instructions given here that conflict\n with instructions given in the `system` prompt take precedence over the `system`\n prompt instructions.\n- `assistant`: Response generated by the model.\n- `system`: Initial instructions provided to the system to provide general guidance\n on the tone and voice of the generated message. An initial system message is\n optional but recommended to provide guidance on the tone of the chat. For\n example, \"You are a helpful chatbot with a background in earth sciences and a\n charming French accent.\"\n"},"content":{"type":"string","title":"Content"},"tool_call_id":{"type":"string","title":"Tool Call Id"}},"type":"object","required":["content","tool_call_id"],"title":"ToolMessage"},"ToolParameters":{"properties":{"type":{"type":"string","enum":["object"],"title":"Type","description":"Type of the parameter schema, only `object` is supported","default":"object"},"properties":{"type":"object","title":"Properties"},"required":{"items":{"type":"string"},"type":"array","title":"Required","description":"List of required properties"}},"type":"object","required":["properties"],"title":"ToolParameters"},"TopLogprobsData":{"properties":{"token":{"type":"string","title":"Token"},"logprob":{"type":"number","title":"Logprob"}},"type":"object","required":["token","logprob"],"title":"TopLogprobsData"},"UpdateMCPStorageRequest":{"properties":{"server_label":{"type":"string","title":"Server Label"}},"type":"object","required":["server_label"],"title":"UpdateMCPStorageRequest"},"UpdateRoutePayload":{"properties":{"description":{"type":"string","title":"Description"},"examples":{"items":{"type":"string"},"type":"array","title":"Examples"}},"type":"object","required":["description"],"title":"UpdateRoutePayload"},"UpdateSecretPayload":{"properties":{"secret_name":{"type":"string","title":"Secret Name"},"secret_value":{"type":"string","title":"Secret Value"}},"type":"object","title":"UpdateSecretPayload"},"UploadMode":{"type":"string","enum":["immediate","batch"],"title":"UploadMode","description":"An enumeration."},"UsageInfo":{"properties":{"prompt_tokens":{"type":"integer","title":"Prompt Tokens","description":"Number of tokens in the prompt for this request. Note that the prompt token\nincludes the entire message history, plus extra tokens needed by the system\nwhen combining the list of prompt messages into a single message, as\nrequired by the model. The number of extra tokens is typically proportional\nto the number of messages in the thread, and should be relatively small.\n"},"completion_tokens":{"type":"integer","title":"Completion Tokens","description":"Number of tokens in the response message."},"total_tokens":{"type":"integer","title":"Total Tokens","description":"`prompt_tokens` + `completion_tokens`.\n"}},"type":"object","required":["prompt_tokens","completion_tokens","total_tokens"],"title":"UsageInfo"},"UserMessage":{"properties":{"role":{"type":"string","enum":["user"],"title":"Role","default":"user","description":"The role of an individual message.\n- `user`: Input provided by the user. Any instructions given here that conflict\n with instructions given in the `system` prompt take precedence over the `system`\n prompt instructions.\n- `assistant`: Response generated by the model.\n- `system`: Initial instructions provided to the system to provide general guidance\n on the tone and voice of the generated message. An initial system message is\n optional but recommended to provide guidance on the tone of the chat. For\n example, \"You are a helpful chatbot with a background in earth sciences and a\n charming French accent.\"\n"},"content":{"type":"string","title":"Content"}},"type":"object","required":["content"],"title":"UserMessage"},"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"},"ValidationResult":{"properties":{"is_valid":{"type":"boolean","title":"Is Valid"},"message":{"type":"string","title":"Message"},"details":{"type":"string","title":"Details"}},"type":"object","required":["is_valid"],"title":"ValidationResult"},"Visibility":{"enum":["public","private"],"title":"Visibility","description":"An enumeration."},"WebSearchToolResource":{"properties":{"type":{"type":"string","enum":["web_search"],"title":"Type","default":"web_search"},"urls":{"items":{"type":"string"},"type":"array","title":"Urls"},"fallback_to_web":{"type":"boolean","title":"Fallback To Web"},"query_suffix":{"type":"string","title":"Query Suffix"},"rephrase_query":{"type":"boolean","title":"Rephrase Query"},"use_cached_pages":{"type":"boolean","title":"Use Cached Pages","default":false}},"type":"object","title":"WebSearchToolResource"},"WebsiteConnectorCreateConfigPayload":{"properties":{"name":{"type":"string","title":"Name"},"extract_linked_files":{"type":"boolean","title":"Extract Linked Files","default":false},"wait_for_dynamic_content":{"type":"boolean","title":"Wait For Dynamic Content","default":false},"skip_url_patterns":{"items":{"type":"string"},"type":"array","title":"Skip Url Patterns"},"target_file_extensions":{"items":{"type":"string"},"type":"array","title":"Target File Extensions"},"localization":{"type":"string","title":"Localization"}},"type":"object","required":["name","skip_url_patterns","target_file_extensions"],"title":"WebsiteConnectorCreateConfigPayload"},"WebsiteConnectorIngestUrlPayload":{"properties":{"url":{"type":"string","title":"Url"}},"type":"object","required":["url"],"title":"WebsiteConnectorIngestUrlPayload"},"WebsiteConnectorIngestWebsitePayload":{"properties":{"sitemap_url":{"type":"string","title":"Sitemap Url"},"client_config":{"type":"string","title":"Client Config"},"labels":{"items":{"type":"string"},"type":"array","title":"Labels"}},"type":"object","required":["sitemap_url"],"title":"WebsiteConnectorIngestWebsitePayload"},"WebsiteConnectorPayload":{"properties":{"type":{"type":"string","enum":["sitemap","urls"],"title":"Type"},"value":{"anyOf":[{"type":"string"},{"items":{"type":"string"},"type":"array"}],"title":"Value"}},"type":"object","required":["type","value"],"title":"WebsiteConnectorPayload"},"WebsiteConnectorRetryIngestWebsitePayload":{"properties":{"website_id":{"type":"string","format":"uuid","title":"Website Id"}},"type":"object","required":["website_id"],"title":"WebsiteConnectorRetryIngestWebsitePayload"},"WorkflowConfig":{"properties":{"endpoint_url":{"type":"string","title":"Endpoint Url"},"headers":{"type":"object","title":"Headers"},"additional_params":{"type":"object","title":"Additional Params"}},"type":"object","required":["endpoint_url"],"title":"WorkflowConfig"},"WorkspaceModelResponse":{"properties":{"name":{"type":"string","title":"Name"},"model_type":{"type":"string","title":"Model Type"},"secret_id":{"type":"string","title":"Secret Id"},"created_by":{"type":"string","title":"Created By"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"provider":{"type":"string","title":"Provider"},"internal":{"type":"boolean","title":"Internal","default":false}},"type":"object","required":["name","model_type"],"title":"WorkspaceModelResponse"},"WorkspaceModelUpdate":{"properties":{"name":{"type":"string","title":"Name"},"model_type":{"type":"string","title":"Model Type"},"secret_id":{"type":"string","title":"Secret Id"}},"type":"object","title":"WorkspaceModelUpdate"},"WorkspaceModelsResponse":{"properties":{"models":{"items":{"$ref":"#/components/schemas/WorkspaceModelResponse"},"type":"array","title":"Models"}},"type":"object","required":["models"],"title":"WorkspaceModelsResponse"},"language_studio_api_server__data_types__assistant__Requirement":{"properties":{"id":{"type":"string","title":"Id","description":"A unique ID for the request (not the message). Repeated identical requests\nget different IDs. However, for a streaming response, the ID will be the same\nfor all responses in the stream.\n"},"title":{"type":"string","title":"Title"},"description":{"type":"string","title":"Description"},"type":{"type":"string","title":"Type"}},"type":"object","title":"Requirement"},"language_studio_api_server__data_types__chat__ToolDefinition":{"properties":{"type":{"type":"string","enum":["function"],"title":"Type"},"function":{"$ref":"#/components/schemas/FunctionToolDefinition"}},"type":"object","required":["type","function"],"title":"ToolDefinition"},"language_studio_api_server__data_types__execution_engine__Requirement":{"properties":{"name":{"type":"string","title":"Name"},"description":{"type":"string","title":"Description"},"is_mandatory":{"type":"boolean","title":"Is Mandatory"}},"type":"object","required":["name","description"],"title":"Requirement"},"language_studio_api_server__data_types__execution_engine__ToolDefinition":{"oneOf":[{"$ref":"#/components/schemas/HTTPToolResource"},{"$ref":"#/components/schemas/MCPToolResource"},{"$ref":"#/components/schemas/FileSearchToolResource"},{"$ref":"#/components/schemas/WebSearchToolResource"}],"title":"ToolDefinition","discriminator":{"propertyName":"type","mapping":{"http":"#/components/schemas/HTTPToolResource","mcp":"#/components/schemas/MCPToolResource","file_search":"#/components/schemas/FileSearchToolResource","web_search":"#/components/schemas/WebSearchToolResource"}}}}}} \ No newline at end of file +{"openapi":"3.1.0","info":{"title":"AI21 Studio API","description":"Access our powerful language models using an API that makes you smile","version":"1.0.0"},"paths":{"/studio/v1/chat/files/convert":{"post":{"summary":"Convert Document File","operationId":"convert_document_file_studio_v1_chat_files_convert_post","requestBody":{"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_convert_document_file_studio_v1_chat_files_convert_post"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/studio/v1/chat/completions":{"post":{"tags":["Jamba Complete"],"summary":"Studio Chat Complete","description":"This is the endpoint for the [Jamba Instruct model](https://docs.ai21.com/docs/jamba-models).\nThis is a foundation model that supports both single-turn (question answering,\ntext completion) and multi-turn (chat style) interactions.\n\nYou can optionally stream results if you want to get the response as each\ntoken is generated, rather than waiting for the entire response.","operationId":"v1_chat_complete","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChatRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/ChatCompletion"},{"items":{"$ref":"#/components/schemas/ChatCompletionVllmStreamingMessage"},"type":"array"}],"title":"Response V1 Chat Complete"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/studio/v1/library/files":{"get":{"tags":["Library management"],"summary":"Get Workspace Files","description":"Get metadata about a specific file by file ID. The file ID is generated by\nAI21 when you upload the file.","operationId":"v1_library_management","parameters":[{"required":false,"schema":{"type":"string","title":"Name"},"name":"name","in":"query"},{"required":false,"schema":{"type":"string","title":"Path"},"name":"path","in":"query"},{"required":false,"schema":{"$ref":"#/components/schemas/FileStatus"},"name":"status","in":"query"},{"required":false,"schema":{"items":{"type":"string"},"type":"array","title":"Label"},"name":"label","in":"query"},{"required":false,"schema":{"type":"integer","title":"Limit","default":500000},"name":"limit","in":"query"},{"required":false,"schema":{"type":"integer","title":"Offset"},"name":"offset","in":"query"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/FileResponse"},"type":"array","title":"Response V1 Library Management"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["Library management"],"summary":"Upload Workspace File","description":"Upload files to use for [RAG Engine document searches](https://docs.ai21.com/docs/rag-engine-overview).\nYou can assign metadata to your files to limit searches to specific files by file metadata.\nThere is no bulk upload method; files must be loaded one at a time.\n\n- **Max number of files:** No limit. The playground limits bulk uploads to 50 files per request.\n- **Max library size:** 1 GB total size. No limit to individual file size.\n- **Supported file types:** PDF, DocX, HTML, TXT","operationId":"v1_library_upload","requestBody":{"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_v1_library_upload"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/studio/v1/library/files/{file_id}":{"get":{"tags":["Library management"],"summary":"Get File By Id","description":"Retrieve a list of documents in the user's library. Optionally specify a\nfilter to find only files with matching labels or paths. This method\nreturns only metadata about files; to download a file, call\n`GET .../files/{file_id}/download`\n\nWhen specifying qualifiers with your request, only files that match\n_all_ qualifiers will be returns. So, for example, if you specify\n`label='financial'` and `status='UPLOADED'`, only files with the label\n\"financial\" AND status UPLOADED will be returned.","operationId":"v1_library_management","parameters":[{"required":true,"schema":{"type":"string","format":"uuid","title":"File Id"},"name":"file_id","in":"path"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FileResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["Library management"],"summary":"Update File","description":"Update the specified parameters of a specific document in the user's library.\nThis operation currently supports updating the publicUrl and labels parameters.\n\n> **This operation overwrites the specified items with the new data you provide.**\n> If you wish to add new labels to the labels list without removing the existing ones,\n> you must submit a labels list that includes both the current and new labels.**\n>\n> For instance, if the current labels are \"Label A\" and \"Label B\", and you wish to\n> add \"New Label C\" and \"New Label D\" to the list, you must specify `\"labels\": [\"Label A\", \"Label B\", \"New Label C\", \"New Label D\"]`.","operationId":"v1_library_management","parameters":[{"required":true,"schema":{"type":"string","format":"uuid","title":"File Id"},"name":"file_id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FilesUpdateRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["Library management"],"summary":"Delete File","description":"Delete the specified file from the library.\n\n**Restrictions**:\nFiles in `PROCESSING` status cannot be deleted. Attempts to delete such files will result in a 422 error.","operationId":"v1_library_delete","parameters":[{"required":true,"schema":{"type":"string","format":"uuid","title":"File Id"},"name":"file_id","in":"path"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/studio/v1/secrets":{"get":{"tags":["Secrets"],"summary":"Get Secret List","operationId":"v1_secret_storage","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}},"post":{"tags":["Secrets"],"summary":"Save Secret","operationId":"v1_secret_storage","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateSecretPayload"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["Secrets"],"summary":"Delete Secret","operationId":"v1_secret_storage","parameters":[{"required":true,"schema":{"type":"string","title":"Secret Id"},"name":"secret_id","in":"query"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/studio/v1/secrets/{secret_id}":{"patch":{"tags":["Secrets"],"summary":"Update Secret","operationId":"v1_secret_storage","parameters":[{"required":true,"schema":{"type":"string","title":"Secret Id"},"name":"secret_id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateSecretPayload"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/studio/v1/library/batches/{batch_id}/status":{"get":{"tags":["RAG Engine"],"summary":"Get Batch Ingestion Status","operationId":"v1_library_management","parameters":[{"required":true,"schema":{"type":"string","format":"uuid","title":"Batch Id"},"name":"batch_id","in":"path"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IngestionBatchStatusResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/studio/v1/library/files/{file_id}/download":{"get":{"tags":["RAG Engine"],"summary":"Generate Documents Signed Url","operationId":"v1_library_management","parameters":[{"required":true,"schema":{"type":"string","format":"uuid","title":"File Id"},"name":"file_id","in":"path"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/studio/v1/library/files/{file_id}/parsed":{"get":{"tags":["RAG Engine"],"summary":"Download Parsed Document","description":"Download parsed document with Content-Disposition header for immediate download.","operationId":"v1_library_management","parameters":[{"required":true,"schema":{"type":"string","format":"uuid","title":"File Id"},"name":"file_id","in":"path"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/studio/v1/maestro/runs":{"post":{"summary":"Create Maestro Run","operationId":"v1_maestro_run","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateMaestroRunsPayload"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MaestroRunResult"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/studio/v1/maestro/runs/{execution_id}":{"get":{"summary":"Get Maestro Run","operationId":"v1_get_maestro_run","parameters":[{"required":true,"schema":{"type":"string","title":"Execution Id"},"name":"execution_id","in":"path"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MaestroRunResult"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/studio/v1/demos":{"get":{"summary":"List Demos","description":"List all available demos.","operationId":"list_demos_studio_v1_demos_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/Demo"},"type":"array","title":"Response List Demos Studio V1 Demos Get"}}}}}},"post":{"summary":"Create Demo","description":"Create a new demo.","operationId":"create_demo_studio_v1_demos_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DemoCreate"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Demo"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/studio/v1/demos/{demo_id}":{"get":{"summary":"Get Demo","description":"Get a specific demo by ID.","operationId":"get_demo_studio_v1_demos__demo_id__get","parameters":[{"required":true,"schema":{"type":"string","title":"Demo Id"},"name":"demo_id","in":"path"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Demo"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"summary":"Update Demo","description":"Update an existing demo.","operationId":"update_demo_studio_v1_demos__demo_id__put","parameters":[{"required":true,"schema":{"type":"string","title":"Demo Id"},"name":"demo_id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DemoUpdate"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Demo"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"summary":"Delete Demo","description":"Delete a demo.","operationId":"delete_demo_studio_v1_demos__demo_id__delete","parameters":[{"required":true,"schema":{"type":"string","title":"Demo Id"},"name":"demo_id","in":"path"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/studio/v1/demos/document-modifier/parse-pdf":{"post":{"summary":"Parse Pdf","description":"Parse a PDF file and return its contents.","operationId":"parse_pdf_studio_v1_demos_document_modifier_parse_pdf_post","requestBody":{"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_parse_pdf_studio_v1_demos_document_modifier_parse_pdf_post"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","title":"Response Parse Pdf Studio V1 Demos Document Modifier Parse Pdf Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/studio/v1/demos/document-modifier/get-parsed-file":{"get":{"summary":"Get Parsed File","description":"Get the parsed file from the document modifier.","operationId":"get_parsed_file_studio_v1_demos_document_modifier_get_parsed_file_get","parameters":[{"required":true,"schema":{"type":"string","title":"File Name"},"name":"file_name","in":"query"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","title":"Response Get Parsed File Studio V1 Demos Document Modifier Get Parsed File Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/studio/v1/demos/document-modifier/compare-text":{"post":{"summary":"Compare Text","description":"Compare text in a document file against a reference text.","operationId":"compare_text_studio_v1_demos_document_modifier_compare_text_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CompareTextRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","title":"Response Compare Text Studio V1 Demos Document Modifier Compare Text Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/studio/v1/demos/document-modifier/download":{"post":{"summary":"Download Modified Document","description":"Download a modified document.","operationId":"download_modified_document_studio_v1_demos_document_modifier_download_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DownloadModifiedDocumentRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/studio/v1/demos/document-modifier/jamba-execute":{"post":{"summary":"Jamba Execute","description":"Execute a Jamba request.","operationId":"jamba_execute_studio_v1_demos_document_modifier_jamba_execute_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/JambaExecuteRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","title":"Response Jamba Execute Studio V1 Demos Document Modifier Jamba Execute Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/studio/v1/demos/regulations/upload-check-compliance":{"post":{"summary":"Upload Check Compliance","description":"Check compliance of a document file against regulatory requirements.","operationId":"upload_check_compliance_studio_v1_demos_regulations_upload_check_compliance_post","requestBody":{"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_upload_check_compliance_studio_v1_demos_regulations_upload_check_compliance_post"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","title":"Response Upload Check Compliance Studio V1 Demos Regulations Upload Check Compliance Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/studio/v1/demos/regulations/vector-store/{vector_store_id}":{"get":{"summary":"Get Vector Store","description":"Get a vector store by ID.","operationId":"get_vector_store_studio_v1_demos_regulations_vector_store__vector_store_id__get","parameters":[{"required":true,"schema":{"type":"string","title":"Vector Store Id"},"name":"vector_store_id","in":"path"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","title":"Response Get Vector Store Studio V1 Demos Regulations Vector Store Vector Store Id Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/studio/v1/demos/rfi/generate-response-pdf":{"post":{"summary":"Combine section answers ➜ styled PDF for download","operationId":"generate_response_pdf_studio_v1_demos_rfi_generate_response_pdf_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MarkdownRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}},"application/pdf":{}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/studio/v1/demos/rfi/process-rfi":{"post":{"summary":"Process Rfi Document","operationId":"process_rfi_document_studio_v1_demos_rfi_process_rfi_post","requestBody":{"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_process_rfi_document_studio_v1_demos_rfi_process_rfi_post"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/RFIResponseSection"},"type":"array","title":"Response Process Rfi Document Studio V1 Demos Rfi Process Rfi Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/studio/v1/demos/scraper/file-url/{file_id}":{"get":{"summary":"Get File Url","operationId":"get_file_url_studio_v1_demos_scraper_file_url__file_id__get","parameters":[{"required":true,"schema":{"type":"string","title":"File Id"},"name":"file_id","in":"path"},{"required":false,"schema":{"type":"string","title":"Api Key"},"name":"api_key","in":"query"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/studio/v1/demos/scraper/can-iframe":{"get":{"summary":"Can Iframe","operationId":"can_iframe_studio_v1_demos_scraper_can_iframe_get","parameters":[{"required":true,"schema":{"type":"string","title":"Url"},"name":"url","in":"query"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","title":"Response Can Iframe Studio V1 Demos Scraper Can Iframe Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/studio/v1/website-connector/ingest-url":{"post":{"tags":["Website Connector"],"summary":"Connect Website","operationId":"v1_website_connector_ingest_url","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebsiteConnectorIngestUrlPayload"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/studio/v1/website-connector/url-status":{"get":{"tags":["Website Connector"],"summary":"Get Url Status","operationId":"v1_website_connector_get_url_status","parameters":[{"required":true,"schema":{"type":"string","title":"Url Id"},"name":"url_id","in":"query"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/studio/v1/website-connector/ingest-website":{"post":{"tags":["Website Connector"],"summary":"Ingest Website","operationId":"v1_website_connector_ingest_website","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebsiteConnectorIngestWebsitePayload"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/studio/v1/website-connector/website-status":{"get":{"tags":["Website Connector"],"summary":"Get Website Status","operationId":"v1_website_connector_get_website_status","parameters":[{"required":true,"schema":{"type":"string","format":"uuid","title":"Website Id"},"name":"website_id","in":"query"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/studio/v1/website-connector/retry-ingest-website":{"post":{"tags":["Website Connector"],"summary":"Retry Ingest Website","operationId":"v1_website_connector_retry_ingest_website","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebsiteConnectorRetryIngestWebsitePayload"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/studio/v1/website-connector/client-config":{"get":{"tags":["Website Connector"],"summary":"Get Client Config","operationId":"v1_website_connector_get_config","parameters":[{"required":true,"schema":{"type":"string","title":"Config Name"},"name":"config_name","in":"query"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["Website Connector"],"summary":"Create Client Config","operationId":"v1_website_connector_create_config","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebsiteConnectorCreateConfigPayload"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/studio/v1/structured-rag/organizations/{organization_id}/schemas":{"get":{"summary":"Get Organization Schemas","operationId":"get_organization_schemas_studio_v1_structured_rag_organizations__organization_id__schemas_get","parameters":[{"required":true,"schema":{"type":"string","title":"Organization Id"},"name":"organization_id","in":"path"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrgSchemas"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"summary":"Create Organization Schema","operationId":"create_organization_schema_studio_v1_structured_rag_organizations__organization_id__schemas_post","parameters":[{"required":true,"schema":{"type":"string","title":"Organization Id"},"name":"organization_id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateOrganizationSchemaRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/studio/v1/structured-rag/organizations/{organization_id}/schema-detection":{"post":{"summary":"Detect Schema","operationId":"detect_schema_studio_v1_structured_rag_organizations__organization_id__schema_detection_post","parameters":[{"required":true,"schema":{"type":"string","title":"Organization Id"},"name":"organization_id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DetectSchemaRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DetectSchemaResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/studio/v1/structured-rag/organizations/{organization_id}/schemas/{schema_name}":{"delete":{"summary":"Delete Organization Schema","operationId":"delete_organization_schema_studio_v1_structured_rag_organizations__organization_id__schemas__schema_name__delete","parameters":[{"required":true,"schema":{"type":"string","title":"Organization Id"},"name":"organization_id","in":"path"},{"required":true,"schema":{"type":"string","title":"Schema Name"},"name":"schema_name","in":"path"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/gateway/v1/{path}":{"get":{"summary":"Proxy V1","description":"Catch-all for the Anthropic-compatible surface (``/v1/messages``, etc.).\n\nGated on a Tokenwise subscription (OPSS-55); the A/B ``/on`` and ``/off`` arms are\nintentionally left ungated.","operationId":"proxy_v1_gateway_v1__path__get","parameters":[{"required":true,"schema":{"type":"string","title":"Path"},"name":"path","in":"path"},{"required":false,"schema":{"type":"string","title":"X-Ai21-Key","default":""},"name":"X-AI21-Key","in":"header"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"summary":"Proxy V1","description":"Catch-all for the Anthropic-compatible surface (``/v1/messages``, etc.).\n\nGated on a Tokenwise subscription (OPSS-55); the A/B ``/on`` and ``/off`` arms are\nintentionally left ungated.","operationId":"proxy_v1_gateway_v1__path__get","parameters":[{"required":true,"schema":{"type":"string","title":"Path"},"name":"path","in":"path"},{"required":false,"schema":{"type":"string","title":"X-Ai21-Key","default":""},"name":"X-AI21-Key","in":"header"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"summary":"Proxy V1","description":"Catch-all for the Anthropic-compatible surface (``/v1/messages``, etc.).\n\nGated on a Tokenwise subscription (OPSS-55); the A/B ``/on`` and ``/off`` arms are\nintentionally left ungated.","operationId":"proxy_v1_gateway_v1__path__get","parameters":[{"required":true,"schema":{"type":"string","title":"Path"},"name":"path","in":"path"},{"required":false,"schema":{"type":"string","title":"X-Ai21-Key","default":""},"name":"X-AI21-Key","in":"header"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"summary":"Proxy V1","description":"Catch-all for the Anthropic-compatible surface (``/v1/messages``, etc.).\n\nGated on a Tokenwise subscription (OPSS-55); the A/B ``/on`` and ``/off`` arms are\nintentionally left ungated.","operationId":"proxy_v1_gateway_v1__path__get","parameters":[{"required":true,"schema":{"type":"string","title":"Path"},"name":"path","in":"path"},{"required":false,"schema":{"type":"string","title":"X-Ai21-Key","default":""},"name":"X-AI21-Key","in":"header"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"options":{"summary":"Proxy V1","description":"Catch-all for the Anthropic-compatible surface (``/v1/messages``, etc.).\n\nGated on a Tokenwise subscription (OPSS-55); the A/B ``/on`` and ``/off`` arms are\nintentionally left ungated.","operationId":"proxy_v1_gateway_v1__path__get","parameters":[{"required":true,"schema":{"type":"string","title":"Path"},"name":"path","in":"path"},{"required":false,"schema":{"type":"string","title":"X-Ai21-Key","default":""},"name":"X-AI21-Key","in":"header"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"summary":"Proxy V1","description":"Catch-all for the Anthropic-compatible surface (``/v1/messages``, etc.).\n\nGated on a Tokenwise subscription (OPSS-55); the A/B ``/on`` and ``/off`` arms are\nintentionally left ungated.","operationId":"proxy_v1_gateway_v1__path__get","parameters":[{"required":true,"schema":{"type":"string","title":"Path"},"name":"path","in":"path"},{"required":false,"schema":{"type":"string","title":"X-Ai21-Key","default":""},"name":"X-AI21-Key","in":"header"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/gateway/off/v1/{path}":{"get":{"summary":"Proxy Off V1","description":"A/B off-arm — forces gateway transformers off for this request only.","operationId":"proxy_off_v1_gateway_off_v1__path__get","parameters":[{"required":true,"schema":{"type":"string","title":"Path"},"name":"path","in":"path"},{"required":false,"schema":{"type":"string","title":"X-Ai21-Key","default":""},"name":"X-AI21-Key","in":"header"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"summary":"Proxy Off V1","description":"A/B off-arm — forces gateway transformers off for this request only.","operationId":"proxy_off_v1_gateway_off_v1__path__get","parameters":[{"required":true,"schema":{"type":"string","title":"Path"},"name":"path","in":"path"},{"required":false,"schema":{"type":"string","title":"X-Ai21-Key","default":""},"name":"X-AI21-Key","in":"header"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"summary":"Proxy Off V1","description":"A/B off-arm — forces gateway transformers off for this request only.","operationId":"proxy_off_v1_gateway_off_v1__path__get","parameters":[{"required":true,"schema":{"type":"string","title":"Path"},"name":"path","in":"path"},{"required":false,"schema":{"type":"string","title":"X-Ai21-Key","default":""},"name":"X-AI21-Key","in":"header"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"summary":"Proxy Off V1","description":"A/B off-arm — forces gateway transformers off for this request only.","operationId":"proxy_off_v1_gateway_off_v1__path__get","parameters":[{"required":true,"schema":{"type":"string","title":"Path"},"name":"path","in":"path"},{"required":false,"schema":{"type":"string","title":"X-Ai21-Key","default":""},"name":"X-AI21-Key","in":"header"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"options":{"summary":"Proxy Off V1","description":"A/B off-arm — forces gateway transformers off for this request only.","operationId":"proxy_off_v1_gateway_off_v1__path__get","parameters":[{"required":true,"schema":{"type":"string","title":"Path"},"name":"path","in":"path"},{"required":false,"schema":{"type":"string","title":"X-Ai21-Key","default":""},"name":"X-AI21-Key","in":"header"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"summary":"Proxy Off V1","description":"A/B off-arm — forces gateway transformers off for this request only.","operationId":"proxy_off_v1_gateway_off_v1__path__get","parameters":[{"required":true,"schema":{"type":"string","title":"Path"},"name":"path","in":"path"},{"required":false,"schema":{"type":"string","title":"X-Ai21-Key","default":""},"name":"X-AI21-Key","in":"header"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/gateway/on/v1/{path}":{"get":{"summary":"Proxy On V1","description":"A/B on-arm — forces gateway transformers on for this request only.","operationId":"proxy_on_v1_gateway_on_v1__path__get","parameters":[{"required":true,"schema":{"type":"string","title":"Path"},"name":"path","in":"path"},{"required":false,"schema":{"type":"string","title":"X-Ai21-Key","default":""},"name":"X-AI21-Key","in":"header"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"summary":"Proxy On V1","description":"A/B on-arm — forces gateway transformers on for this request only.","operationId":"proxy_on_v1_gateway_on_v1__path__get","parameters":[{"required":true,"schema":{"type":"string","title":"Path"},"name":"path","in":"path"},{"required":false,"schema":{"type":"string","title":"X-Ai21-Key","default":""},"name":"X-AI21-Key","in":"header"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"summary":"Proxy On V1","description":"A/B on-arm — forces gateway transformers on for this request only.","operationId":"proxy_on_v1_gateway_on_v1__path__get","parameters":[{"required":true,"schema":{"type":"string","title":"Path"},"name":"path","in":"path"},{"required":false,"schema":{"type":"string","title":"X-Ai21-Key","default":""},"name":"X-AI21-Key","in":"header"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"summary":"Proxy On V1","description":"A/B on-arm — forces gateway transformers on for this request only.","operationId":"proxy_on_v1_gateway_on_v1__path__get","parameters":[{"required":true,"schema":{"type":"string","title":"Path"},"name":"path","in":"path"},{"required":false,"schema":{"type":"string","title":"X-Ai21-Key","default":""},"name":"X-AI21-Key","in":"header"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"options":{"summary":"Proxy On V1","description":"A/B on-arm — forces gateway transformers on for this request only.","operationId":"proxy_on_v1_gateway_on_v1__path__get","parameters":[{"required":true,"schema":{"type":"string","title":"Path"},"name":"path","in":"path"},{"required":false,"schema":{"type":"string","title":"X-Ai21-Key","default":""},"name":"X-AI21-Key","in":"header"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"summary":"Proxy On V1","description":"A/B on-arm — forces gateway transformers on for this request only.","operationId":"proxy_on_v1_gateway_on_v1__path__get","parameters":[{"required":true,"schema":{"type":"string","title":"Path"},"name":"path","in":"path"},{"required":false,"schema":{"type":"string","title":"X-Ai21-Key","default":""},"name":"X-AI21-Key","in":"header"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/gateway/settings/agents":{"get":{"summary":"List Agents","operationId":"list_agents_gateway_settings_agents_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/AgentOut"},"type":"array","title":"Response List Agents Gateway Settings Agents Get"}}}}}},"post":{"summary":"Create Agent","operationId":"create_agent_gateway_settings_agents_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentCreate"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/gateway/settings/agents/{agent_id}/optimizations":{"get":{"summary":"Get Agent Optimizations","operationId":"get_agent_optimizations_gateway_settings_agents__agent_id__optimizations_get","parameters":[{"required":true,"schema":{"type":"string","title":"Agent Id"},"name":"agent_id","in":"path"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/AgentOptimization"},"type":"array","title":"Response Get Agent Optimizations Gateway Settings Agents Agent Id Optimizations Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/gateway/settings/agents/{agent_id}":{"get":{"summary":"Get Agent","operationId":"get_agent_gateway_settings_agents__agent_id__get","parameters":[{"required":true,"schema":{"type":"string","title":"Agent Id"},"name":"agent_id","in":"path"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"summary":"Update Agent","operationId":"update_agent_gateway_settings_agents__agent_id__put","parameters":[{"required":true,"schema":{"type":"string","title":"Agent Id"},"name":"agent_id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentUpdate"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"summary":"Delete Agent","operationId":"delete_agent_gateway_settings_agents__agent_id__delete","parameters":[{"required":true,"schema":{"type":"string","title":"Agent Id"},"name":"agent_id","in":"path"}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/gateway/settings/configs":{"get":{"summary":"List Configs","operationId":"list_configs_gateway_settings_configs_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/ConfigProfileOut"},"type":"array","title":"Response List Configs Gateway Settings Configs Get"}}}}}},"post":{"summary":"Create Config","operationId":"create_config_gateway_settings_configs_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConfigProfileCreate"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConfigProfileOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/gateway/settings/configs/schema":{"get":{"summary":"Get Config Schema","operationId":"get_config_schema_gateway_settings_configs_schema_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConfigSchemaOut"}}}}}}},"/gateway/settings/configs/{config_id}":{"get":{"summary":"Get Config","operationId":"get_config_gateway_settings_configs__config_id__get","parameters":[{"required":true,"schema":{"type":"string","title":"Config Id"},"name":"config_id","in":"path"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConfigProfileOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"summary":"Update Config","operationId":"update_config_gateway_settings_configs__config_id__put","parameters":[{"required":true,"schema":{"type":"string","title":"Config Id"},"name":"config_id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConfigProfileUpdate"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConfigProfileOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"summary":"Delete Config","operationId":"delete_config_gateway_settings_configs__config_id__delete","parameters":[{"required":true,"schema":{"type":"string","title":"Config Id"},"name":"config_id","in":"path"}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/gateway/analytics/v1/summary":{"get":{"summary":"Analytics Summary","operationId":"analytics_summary_gateway_analytics_v1_summary_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/gateway/analytics/v1/errors":{"get":{"summary":"Analytics Errors","operationId":"analytics_errors_gateway_analytics_v1_errors_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/gateway/analytics/v1/sessions":{"get":{"summary":"Analytics Sessions","operationId":"analytics_sessions_gateway_analytics_v1_sessions_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/gateway/analytics/v1/sessions/{session_id}":{"get":{"summary":"Analytics Session Detail","operationId":"analytics_session_detail_gateway_analytics_v1_sessions__session_id__get","parameters":[{"required":true,"schema":{"type":"string","title":"Session Id"},"name":"session_id","in":"path"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/gateway/analytics/v1/transformers":{"get":{"summary":"Analytics Transformers","operationId":"analytics_transformers_gateway_analytics_v1_transformers_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/gateway/analytics/v1/context/tools":{"get":{"summary":"Analytics Context Tools","operationId":"analytics_context_tools_gateway_analytics_v1_context_tools_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/gateway/analytics/v1/context/bash":{"get":{"summary":"Analytics Context Bash","operationId":"analytics_context_bash_gateway_analytics_v1_context_bash_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/gateway/analytics/v1/context/prefix":{"get":{"summary":"Analytics Context Prefix","operationId":"analytics_context_prefix_gateway_analytics_v1_context_prefix_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/gateway/analytics/v1/context/blocks":{"get":{"summary":"Analytics Context Blocks","operationId":"analytics_context_blocks_gateway_analytics_v1_context_blocks_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/gateway/analytics/v1/trends":{"get":{"summary":"Analytics Trends","operationId":"analytics_trends_gateway_analytics_v1_trends_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/gateway/analytics/v1/agents":{"get":{"summary":"Analytics Agents","operationId":"analytics_agents_gateway_analytics_v1_agents_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/gateway/analytics/v1/filters":{"get":{"summary":"Analytics Filters","operationId":"analytics_filters_gateway_analytics_v1_filters_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/tokenwise/v1/{path}":{"get":{"summary":"Proxy V1","description":"Catch-all for the Anthropic-compatible surface (``/v1/messages``, etc.).\n\nGated on a Tokenwise subscription (OPSS-55); the A/B ``/on`` and ``/off`` arms are\nintentionally left ungated.","operationId":"proxy_v1_tokenwise_v1__path__get","parameters":[{"required":true,"schema":{"type":"string","title":"Path"},"name":"path","in":"path"},{"required":false,"schema":{"type":"string","title":"X-Ai21-Key","default":""},"name":"X-AI21-Key","in":"header"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"summary":"Proxy V1","description":"Catch-all for the Anthropic-compatible surface (``/v1/messages``, etc.).\n\nGated on a Tokenwise subscription (OPSS-55); the A/B ``/on`` and ``/off`` arms are\nintentionally left ungated.","operationId":"proxy_v1_tokenwise_v1__path__get","parameters":[{"required":true,"schema":{"type":"string","title":"Path"},"name":"path","in":"path"},{"required":false,"schema":{"type":"string","title":"X-Ai21-Key","default":""},"name":"X-AI21-Key","in":"header"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"summary":"Proxy V1","description":"Catch-all for the Anthropic-compatible surface (``/v1/messages``, etc.).\n\nGated on a Tokenwise subscription (OPSS-55); the A/B ``/on`` and ``/off`` arms are\nintentionally left ungated.","operationId":"proxy_v1_tokenwise_v1__path__get","parameters":[{"required":true,"schema":{"type":"string","title":"Path"},"name":"path","in":"path"},{"required":false,"schema":{"type":"string","title":"X-Ai21-Key","default":""},"name":"X-AI21-Key","in":"header"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"summary":"Proxy V1","description":"Catch-all for the Anthropic-compatible surface (``/v1/messages``, etc.).\n\nGated on a Tokenwise subscription (OPSS-55); the A/B ``/on`` and ``/off`` arms are\nintentionally left ungated.","operationId":"proxy_v1_tokenwise_v1__path__get","parameters":[{"required":true,"schema":{"type":"string","title":"Path"},"name":"path","in":"path"},{"required":false,"schema":{"type":"string","title":"X-Ai21-Key","default":""},"name":"X-AI21-Key","in":"header"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"options":{"summary":"Proxy V1","description":"Catch-all for the Anthropic-compatible surface (``/v1/messages``, etc.).\n\nGated on a Tokenwise subscription (OPSS-55); the A/B ``/on`` and ``/off`` arms are\nintentionally left ungated.","operationId":"proxy_v1_tokenwise_v1__path__get","parameters":[{"required":true,"schema":{"type":"string","title":"Path"},"name":"path","in":"path"},{"required":false,"schema":{"type":"string","title":"X-Ai21-Key","default":""},"name":"X-AI21-Key","in":"header"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"summary":"Proxy V1","description":"Catch-all for the Anthropic-compatible surface (``/v1/messages``, etc.).\n\nGated on a Tokenwise subscription (OPSS-55); the A/B ``/on`` and ``/off`` arms are\nintentionally left ungated.","operationId":"proxy_v1_tokenwise_v1__path__get","parameters":[{"required":true,"schema":{"type":"string","title":"Path"},"name":"path","in":"path"},{"required":false,"schema":{"type":"string","title":"X-Ai21-Key","default":""},"name":"X-AI21-Key","in":"header"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/tokenwise/off/v1/{path}":{"get":{"summary":"Proxy Off V1","description":"A/B off-arm — forces gateway transformers off for this request only.","operationId":"proxy_off_v1_tokenwise_off_v1__path__get","parameters":[{"required":true,"schema":{"type":"string","title":"Path"},"name":"path","in":"path"},{"required":false,"schema":{"type":"string","title":"X-Ai21-Key","default":""},"name":"X-AI21-Key","in":"header"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"summary":"Proxy Off V1","description":"A/B off-arm — forces gateway transformers off for this request only.","operationId":"proxy_off_v1_tokenwise_off_v1__path__get","parameters":[{"required":true,"schema":{"type":"string","title":"Path"},"name":"path","in":"path"},{"required":false,"schema":{"type":"string","title":"X-Ai21-Key","default":""},"name":"X-AI21-Key","in":"header"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"summary":"Proxy Off V1","description":"A/B off-arm — forces gateway transformers off for this request only.","operationId":"proxy_off_v1_tokenwise_off_v1__path__get","parameters":[{"required":true,"schema":{"type":"string","title":"Path"},"name":"path","in":"path"},{"required":false,"schema":{"type":"string","title":"X-Ai21-Key","default":""},"name":"X-AI21-Key","in":"header"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"summary":"Proxy Off V1","description":"A/B off-arm — forces gateway transformers off for this request only.","operationId":"proxy_off_v1_tokenwise_off_v1__path__get","parameters":[{"required":true,"schema":{"type":"string","title":"Path"},"name":"path","in":"path"},{"required":false,"schema":{"type":"string","title":"X-Ai21-Key","default":""},"name":"X-AI21-Key","in":"header"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"options":{"summary":"Proxy Off V1","description":"A/B off-arm — forces gateway transformers off for this request only.","operationId":"proxy_off_v1_tokenwise_off_v1__path__get","parameters":[{"required":true,"schema":{"type":"string","title":"Path"},"name":"path","in":"path"},{"required":false,"schema":{"type":"string","title":"X-Ai21-Key","default":""},"name":"X-AI21-Key","in":"header"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"summary":"Proxy Off V1","description":"A/B off-arm — forces gateway transformers off for this request only.","operationId":"proxy_off_v1_tokenwise_off_v1__path__get","parameters":[{"required":true,"schema":{"type":"string","title":"Path"},"name":"path","in":"path"},{"required":false,"schema":{"type":"string","title":"X-Ai21-Key","default":""},"name":"X-AI21-Key","in":"header"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/tokenwise/on/v1/{path}":{"get":{"summary":"Proxy On V1","description":"A/B on-arm — forces gateway transformers on for this request only.","operationId":"proxy_on_v1_tokenwise_on_v1__path__get","parameters":[{"required":true,"schema":{"type":"string","title":"Path"},"name":"path","in":"path"},{"required":false,"schema":{"type":"string","title":"X-Ai21-Key","default":""},"name":"X-AI21-Key","in":"header"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"summary":"Proxy On V1","description":"A/B on-arm — forces gateway transformers on for this request only.","operationId":"proxy_on_v1_tokenwise_on_v1__path__get","parameters":[{"required":true,"schema":{"type":"string","title":"Path"},"name":"path","in":"path"},{"required":false,"schema":{"type":"string","title":"X-Ai21-Key","default":""},"name":"X-AI21-Key","in":"header"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"summary":"Proxy On V1","description":"A/B on-arm — forces gateway transformers on for this request only.","operationId":"proxy_on_v1_tokenwise_on_v1__path__get","parameters":[{"required":true,"schema":{"type":"string","title":"Path"},"name":"path","in":"path"},{"required":false,"schema":{"type":"string","title":"X-Ai21-Key","default":""},"name":"X-AI21-Key","in":"header"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"summary":"Proxy On V1","description":"A/B on-arm — forces gateway transformers on for this request only.","operationId":"proxy_on_v1_tokenwise_on_v1__path__get","parameters":[{"required":true,"schema":{"type":"string","title":"Path"},"name":"path","in":"path"},{"required":false,"schema":{"type":"string","title":"X-Ai21-Key","default":""},"name":"X-AI21-Key","in":"header"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"options":{"summary":"Proxy On V1","description":"A/B on-arm — forces gateway transformers on for this request only.","operationId":"proxy_on_v1_tokenwise_on_v1__path__get","parameters":[{"required":true,"schema":{"type":"string","title":"Path"},"name":"path","in":"path"},{"required":false,"schema":{"type":"string","title":"X-Ai21-Key","default":""},"name":"X-AI21-Key","in":"header"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"summary":"Proxy On V1","description":"A/B on-arm — forces gateway transformers on for this request only.","operationId":"proxy_on_v1_tokenwise_on_v1__path__get","parameters":[{"required":true,"schema":{"type":"string","title":"Path"},"name":"path","in":"path"},{"required":false,"schema":{"type":"string","title":"X-Ai21-Key","default":""},"name":"X-AI21-Key","in":"header"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/tokenwise/settings/agents":{"get":{"summary":"List Agents","operationId":"list_agents_tokenwise_settings_agents_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/AgentOut"},"type":"array","title":"Response List Agents Tokenwise Settings Agents Get"}}}}}},"post":{"summary":"Create Agent","operationId":"create_agent_tokenwise_settings_agents_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentCreate"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/tokenwise/settings/agents/{agent_id}/optimizations":{"get":{"summary":"Get Agent Optimizations","operationId":"get_agent_optimizations_tokenwise_settings_agents__agent_id__optimizations_get","parameters":[{"required":true,"schema":{"type":"string","title":"Agent Id"},"name":"agent_id","in":"path"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/AgentOptimization"},"type":"array","title":"Response Get Agent Optimizations Tokenwise Settings Agents Agent Id Optimizations Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/tokenwise/settings/agents/{agent_id}":{"get":{"summary":"Get Agent","operationId":"get_agent_tokenwise_settings_agents__agent_id__get","parameters":[{"required":true,"schema":{"type":"string","title":"Agent Id"},"name":"agent_id","in":"path"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"summary":"Update Agent","operationId":"update_agent_tokenwise_settings_agents__agent_id__put","parameters":[{"required":true,"schema":{"type":"string","title":"Agent Id"},"name":"agent_id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentUpdate"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"summary":"Delete Agent","operationId":"delete_agent_tokenwise_settings_agents__agent_id__delete","parameters":[{"required":true,"schema":{"type":"string","title":"Agent Id"},"name":"agent_id","in":"path"}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/tokenwise/settings/configs":{"get":{"summary":"List Configs","operationId":"list_configs_tokenwise_settings_configs_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/ConfigProfileOut"},"type":"array","title":"Response List Configs Tokenwise Settings Configs Get"}}}}}},"post":{"summary":"Create Config","operationId":"create_config_tokenwise_settings_configs_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConfigProfileCreate"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConfigProfileOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/tokenwise/settings/configs/schema":{"get":{"summary":"Get Config Schema","operationId":"get_config_schema_tokenwise_settings_configs_schema_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConfigSchemaOut"}}}}}}},"/tokenwise/settings/configs/{config_id}":{"get":{"summary":"Get Config","operationId":"get_config_tokenwise_settings_configs__config_id__get","parameters":[{"required":true,"schema":{"type":"string","title":"Config Id"},"name":"config_id","in":"path"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConfigProfileOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"summary":"Update Config","operationId":"update_config_tokenwise_settings_configs__config_id__put","parameters":[{"required":true,"schema":{"type":"string","title":"Config Id"},"name":"config_id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConfigProfileUpdate"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConfigProfileOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"summary":"Delete Config","operationId":"delete_config_tokenwise_settings_configs__config_id__delete","parameters":[{"required":true,"schema":{"type":"string","title":"Config Id"},"name":"config_id","in":"path"}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/tokenwise/analytics/v1/summary":{"get":{"summary":"Analytics Summary","operationId":"analytics_summary_tokenwise_analytics_v1_summary_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/tokenwise/analytics/v1/errors":{"get":{"summary":"Analytics Errors","operationId":"analytics_errors_tokenwise_analytics_v1_errors_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/tokenwise/analytics/v1/sessions":{"get":{"summary":"Analytics Sessions","operationId":"analytics_sessions_tokenwise_analytics_v1_sessions_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/tokenwise/analytics/v1/sessions/{session_id}":{"get":{"summary":"Analytics Session Detail","operationId":"analytics_session_detail_tokenwise_analytics_v1_sessions__session_id__get","parameters":[{"required":true,"schema":{"type":"string","title":"Session Id"},"name":"session_id","in":"path"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/tokenwise/analytics/v1/transformers":{"get":{"summary":"Analytics Transformers","operationId":"analytics_transformers_tokenwise_analytics_v1_transformers_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/tokenwise/analytics/v1/context/tools":{"get":{"summary":"Analytics Context Tools","operationId":"analytics_context_tools_tokenwise_analytics_v1_context_tools_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/tokenwise/analytics/v1/context/bash":{"get":{"summary":"Analytics Context Bash","operationId":"analytics_context_bash_tokenwise_analytics_v1_context_bash_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/tokenwise/analytics/v1/context/prefix":{"get":{"summary":"Analytics Context Prefix","operationId":"analytics_context_prefix_tokenwise_analytics_v1_context_prefix_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/tokenwise/analytics/v1/context/blocks":{"get":{"summary":"Analytics Context Blocks","operationId":"analytics_context_blocks_tokenwise_analytics_v1_context_blocks_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/tokenwise/analytics/v1/trends":{"get":{"summary":"Analytics Trends","operationId":"analytics_trends_tokenwise_analytics_v1_trends_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/tokenwise/analytics/v1/agents":{"get":{"summary":"Analytics Agents","operationId":"analytics_agents_tokenwise_analytics_v1_agents_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/tokenwise/analytics/v1/filters":{"get":{"summary":"Analytics Filters","operationId":"analytics_filters_tokenwise_analytics_v1_filters_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/studio/v1/generation/requirements":{"post":{"summary":"Generate Requirements","operationId":"v1_studio_api_generation_requirements","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RequirementsGenerationRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RequirementsGenerationResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/studio/v1/models":{"get":{"summary":"Get Models Info","operationId":"v1_list_models_info","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ModelsInfoResponse"}}}}}}},"/studio/v1/assistants":{"get":{"summary":"Get Assistants","operationId":"v1_list_assistants","parameters":[{"required":false,"schema":{"items":{"type":"string"},"type":"array","title":"Workspace Ids"},"name":"workspace_ids","in":"query"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListAssistantsResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"summary":"Create Assistant","operationId":"v1_create_assistant","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateAssistantRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Assistant"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/studio/v1/assistants/generate":{"post":{"summary":"Generate Assistant","operationId":"v1_generate_assistant","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GenerateAssistantRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GenerateAssistantResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/studio/v1/assistants/{assistant_id}":{"get":{"summary":"Get Assistant","operationId":"v1_get_assistant","parameters":[{"required":true,"schema":{"type":"string","title":"Assistant Id"},"name":"assistant_id","in":"path"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Assistant"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"summary":"Delete Assistant","operationId":"v1_delete_assistant","parameters":[{"required":true,"schema":{"type":"string","title":"Assistant Id"},"name":"assistant_id","in":"path"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeleteAssistantResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"summary":"Modify Assistant","operationId":"v1_modify_assistant","parameters":[{"required":true,"schema":{"type":"string","title":"Assistant Id"},"name":"assistant_id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ModifyAssistantRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Assistant"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/studio/v1/assistants/{assistant_id}/run":{"post":{"summary":"Run Assistant","operationId":"v1_run_assistant","parameters":[{"required":true,"schema":{"type":"string","title":"Assistant Id"},"name":"assistant_id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunAssistantRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MaestroRunResult"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/studio/v1/assistants/{assistant_id}/plans":{"get":{"summary":"List Plans","operationId":"v1_list_plans","parameters":[{"required":true,"schema":{"type":"string","title":"Assistant Id"},"name":"assistant_id","in":"path"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListPlansResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"summary":"Create Plan","operationId":"v1_create_plan","parameters":[{"required":true,"schema":{"type":"string","title":"Assistant Id"},"name":"assistant_id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreatePlanPayload"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Plan"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/studio/v1/assistants/{assistant_id}/plans/{plan_id}":{"get":{"summary":"Get Plan","operationId":"v1_get_plan","parameters":[{"required":true,"schema":{"type":"string","title":"Plan Id"},"name":"plan_id","in":"path"},{"required":true,"schema":{"type":"string","title":"Assistant Id"},"name":"assistant_id","in":"path"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Plan"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"summary":"Modify Plan","operationId":"v1_modify_plan","parameters":[{"required":true,"schema":{"type":"string","title":"Plan Id"},"name":"plan_id","in":"path"},{"required":true,"schema":{"type":"string","title":"Assistant Id"},"name":"assistant_id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreatePlanPayload"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Plan"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/studio/v1/assistants/{assistant_id}/routes":{"get":{"summary":"Get Routes","operationId":"v1_list_routes","parameters":[{"required":true,"schema":{"type":"string","title":"Assistant Id"},"name":"assistant_id","in":"path"},{"required":false,"schema":{"type":"string","title":"Name"},"name":"name","in":"query"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListRoutesResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"summary":"Create Route","operationId":"v1_create_route","parameters":[{"required":true,"schema":{"type":"string","title":"Assistant Id"},"name":"assistant_id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateRoutePayload"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AssistantRoute"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/studio/v1/assistants/{assistant_id}/routes/{route_id}":{"get":{"summary":"Get Route","operationId":"v1_get_route","parameters":[{"required":true,"schema":{"type":"string","title":"Route Id"},"name":"route_id","in":"path"},{"required":true,"schema":{"type":"string","title":"Assistant Id"},"name":"assistant_id","in":"path"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AssistantRoute"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"summary":"Delete Route","operationId":"v1_delete_route","parameters":[{"required":true,"schema":{"type":"string","title":"Route Id"},"name":"route_id","in":"path"},{"required":true,"schema":{"type":"string","title":"Assistant Id"},"name":"assistant_id","in":"path"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"summary":"Modify Route","operationId":"v1_modify_route","parameters":[{"required":true,"schema":{"type":"string","title":"Route Id"},"name":"route_id","in":"path"},{"required":true,"schema":{"type":"string","title":"Assistant Id"},"name":"assistant_id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateRoutePayload"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AssistantRoute"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/studio/v1/assistants/{assistant_id}/validate_plan":{"post":{"summary":"Validate Plan","operationId":"v1_validate_plan","parameters":[{"required":true,"schema":{"type":"string","title":"Assistant Id"},"name":"assistant_id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreatePlanPayload"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationResult"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/studio/v1/mcp/storage":{"get":{"summary":"List Mcp Storage","operationId":"list_mcp_storage_studio_v1_mcp_storage_get","parameters":[{"required":false,"schema":{"type":"string","format":"uuid","title":"Workspace Id"},"name":"workspace_id","in":"query"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListMCPsStorageResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"summary":"Create Mcp Storage","operationId":"create_mcp_storage_studio_v1_mcp_storage_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateMCPStorageRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MCPStorageResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/studio/v1/mcp/storage/{mcp_id}":{"get":{"summary":"Get Mcp Storage","operationId":"get_mcp_storage_studio_v1_mcp_storage__mcp_id__get","parameters":[{"required":true,"schema":{"type":"string","title":"Mcp Id"},"name":"mcp_id","in":"path"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MCPStorageResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"summary":"Delete Mcp Storage","operationId":"delete_mcp_storage_studio_v1_mcp_storage__mcp_id__delete","parameters":[{"required":true,"schema":{"type":"string","title":"Mcp Id"},"name":"mcp_id","in":"path"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeleteMCPStorageResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"summary":"Update Mcp Storage","operationId":"update_mcp_storage_studio_v1_mcp_storage__mcp_id__patch","parameters":[{"required":true,"schema":{"type":"string","title":"Mcp Id"},"name":"mcp_id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateMCPStorageRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MCPStorageResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/studio/v1/mcp/storage/{mcp_id}/assistants":{"get":{"summary":"Get Assistants By Mcp","operationId":"get_assistants_by_mcp_studio_v1_mcp_storage__mcp_id__assistants_get","parameters":[{"required":true,"schema":{"type":"string","title":"Mcp Id"},"name":"mcp_id","in":"path"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AssistantsByMcpResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/studio/v1/settings/models":{"get":{"summary":"Get Workspace Models By Organization Endpoint","operationId":"get_workspace_models_by_organization_endpoint_studio_v1_settings_models_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkspaceModelsResponse"}}}}}}},"/studio/v1/settings/models/available":{"get":{"summary":"Get Available Models Endpoint","operationId":"get_available_models_endpoint_studio_v1_settings_models_available_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/studio/v1/settings/models/{name}/secrets":{"get":{"summary":"Get Workspace Model Secret Endpoint","operationId":"get_workspace_model_secret_endpoint_studio_v1_settings_models__name__secrets_get","parameters":[{"required":true,"schema":{"type":"string","title":"Name"},"name":"name","in":"path"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SecretResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/studio/v1/settings/models/{name}":{"patch":{"summary":"Update Workspace Model Endpoint","operationId":"update_workspace_model_endpoint_studio_v1_settings_models__name__patch","parameters":[{"required":true,"schema":{"type":"string","title":"Name"},"name":"name","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkspaceModelUpdate"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkspaceModelResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/solutions/tlv_municipality/convrag":{"post":{"summary":"Tlv Convrag","operationId":"v1_solutions_tlv_municipality_convrag","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/solutions-preview/tlv_municipality/convrag":{"post":{"summary":"Tlv Convrag Prefix Preview","operationId":"v1_solutions_tlv_municipality_preview_convrag","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/solutions/fnac/v1/classifications":{"post":{"summary":"Fnac V1 Classifications","operationId":"v1_solutions_fnac_v1_classifications","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/solutions/fnac/v1/descriptions":{"post":{"summary":"Fnac V1 Descriptions","operationId":"v1_solutions_fnac_v1_descriptions","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/solutions/fnac/v1-deprecated/classifications":{"post":{"summary":"Fnac V1 Deprecated Classifications","operationId":"v1_solutions_fnac_v1_deprecated_classifications","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/solutions/fnac/v1-deprecated/descriptions":{"post":{"summary":"Fnac V1 Deprecated Descriptions","operationId":"v1_solutions_fnac_v1_deprecated_descriptions","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/solutions/fd/batches/v1/classifications":{"post":{"summary":"Fnac Batch Classifications","operationId":"v1_solutions_fd_batches_v1_classifications","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/solutions/fd/batches/v1/classifications/{batch_id}/status":{"post":{"summary":"Fnac Batch Classifications Status","operationId":"v1_solutions_fd_batches_v1_classifications_status","parameters":[{"required":true,"schema":{"type":"string","title":"Batch Id"},"name":"batch_id","in":"path"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/solutions/fd/batches/v1/classifications/{batch_id}/results":{"post":{"summary":"Fnac Batch Classifications Results","operationId":"v1_solutions_fd_batches_v1_classifications_results","parameters":[{"required":true,"schema":{"type":"string","title":"Batch Id"},"name":"batch_id","in":"path"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/solutions/fd/batches/v1/descriptions":{"post":{"summary":"Fnac Batch Descriptions","operationId":"v1_solutions_fd_batches_v1_descriptions","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/solutions/fd/batches/v1/descriptions/{batch_id}/status":{"post":{"summary":"Fnac Batch Descriptions Status","operationId":"v1_solutions_fd_batches_v1_descriptions_status","parameters":[{"required":true,"schema":{"type":"string","title":"Batch Id"},"name":"batch_id","in":"path"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/solutions/fd/batches/v1/descriptions/{batch_id}/results":{"post":{"summary":"Fnac Batch Descriptions Results","operationId":"v1_solutions_fd_batches_v1_descriptions_results","parameters":[{"required":true,"schema":{"type":"string","title":"Batch Id"},"name":"batch_id","in":"path"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/solutions-preview/fnac/v1/classifications":{"post":{"summary":"Fnac V1 Classifications Prefix Preview","operationId":"v1_solutions_fnac_preview_v1_classifications","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/solutions-preview/fnac/v1/descriptions":{"post":{"summary":"Fnac V1 Descriptions Prefix Preview","operationId":"v1_solutions_fnac_preview_v1_descriptions","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/solutions-preview/fnac/v1-deprecated/classifications":{"post":{"summary":"Fnac V1 Deprecated Classifications Prefix Preview","operationId":"v1_solutions_fnac_preview_v1_deprecated_classifications","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/solutions-preview/fnac/v1-deprecated/descriptions":{"post":{"summary":"Fnac V1 Deprecated Descriptions Prefix Preview","operationId":"v1_solutions_fnac_preview_v1_deprecated_descriptions","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/solutions-preview/fd/batches/v1/classifications":{"post":{"summary":"Fnac Batch Classifications Prefix Preview","operationId":"v1_solutions_fd_preview_batches_v1_classifications","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/solutions-preview/fd/batches/v1/classifications/{batch_id}/status":{"post":{"summary":"Fnac Batch Classifications Status Prefix Preview","operationId":"v1_solutions_fd_preview_batches_v1_classifications_status","parameters":[{"required":true,"schema":{"type":"string","title":"Batch Id"},"name":"batch_id","in":"path"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/solutions-preview/fd/batches/v1/classifications/{batch_id}/results":{"post":{"summary":"Fnac Batch Classifications Results Prefix Preview","operationId":"v1_solutions_fd_preview_batches_v1_classifications_results","parameters":[{"required":true,"schema":{"type":"string","title":"Batch Id"},"name":"batch_id","in":"path"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/solutions-preview/fd/batches/v1/descriptions":{"post":{"summary":"Fnac Batch Descriptions Prefix Preview","operationId":"v1_solutions_fd_preview_batches_v1_descriptions","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/solutions-preview/fd/batches/v1/descriptions/{batch_id}/status":{"post":{"summary":"Fnac Batch Descriptions Status Prefix Preview","operationId":"v1_solutions_fd_preview_batches_v1_descriptions_status","parameters":[{"required":true,"schema":{"type":"string","title":"Batch Id"},"name":"batch_id","in":"path"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/solutions-preview/fd/batches/v1/descriptions/{batch_id}/results":{"post":{"summary":"Fnac Batch Descriptions Results Prefix Preview","operationId":"v1_solutions_fd_preview_batches_v1_descriptions_results","parameters":[{"required":true,"schema":{"type":"string","title":"Batch Id"},"name":"batch_id","in":"path"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/solutions/fd_aftersales/parts-classification/batch":{"post":{"summary":"Fnac Aftersales Batch Predict","operationId":"v1_solutions_fnac_aftersales_batch_predict","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/solutions/fd_aftersales/parts-classification/batch/{batch_id}/status":{"get":{"summary":"Fnac Aftersales Batch Predict Status","operationId":"v1_solutions_fnac_aftersales_batch_predict_status","parameters":[{"required":true,"schema":{"type":"string","title":"Batch Id"},"name":"batch_id","in":"path"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/solutions-preview/fd_aftersales/parts-classification/batch":{"post":{"summary":"Fnac Aftersales Batch Predict Prefix Preview","operationId":"v1_solutions_fnac_aftersales_preview_batch_predict","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/solutions-preview/fd_aftersales/parts-classification/batch/{batch_id}/status":{"get":{"summary":"Fnac Aftersales Batch Predict Status Prefix Preview","operationId":"v1_solutions_fnac_aftersales_preview_batch_predict_status","parameters":[{"required":true,"schema":{"type":"string","title":"Batch Id"},"name":"batch_id","in":"path"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}}},"components":{"schemas":{"AgentCreate":{"properties":{"agent_id":{"type":"string","maxLength":128,"minLength":1,"title":"Agent Id"},"kind":{"type":"string","title":"Kind","default":"other"},"name":{"type":"string","title":"Name","default":""},"description":{"type":"string","title":"Description"},"config_id":{"type":"string","title":"Config Id"},"enabled":{"type":"boolean","title":"Enabled","default":true}},"type":"object","required":["agent_id"],"title":"AgentCreate","description":"Body for ``POST /tokenwise/settings/agents``."},"AgentOptimization":{"properties":{"id":{"type":"string","title":"Id","description":"A unique ID for the request (not the message). Repeated identical requests\nget different IDs. However, for a streaming response, the ID will be the same\nfor all responses in the stream.\n"},"keys":{"items":{"type":"string"},"type":"array","title":"Keys"},"name":{"type":"string","title":"Name"},"description":{"type":"string","title":"Description"},"category":{"type":"string","title":"Category"},"availability":{"type":"string","title":"Availability"},"safety":{"type":"string","title":"Safety"}},"type":"object","required":["id","keys","name","description","category","availability","safety"],"title":"AgentOptimization","description":"Response shape for one card in ``GET /tokenwise/settings/agents/{agent_id}/optimizations``.\n\nString-ish fields stay plain ``str`` (not ``Literal``) so a new gateway enum\nvalue (a new ``availability`` / ``safety`` / ``category``) doesn't force an\napi-server release. The gateway filters ``hidden`` cards, so we never see them."},"AgentOut":{"properties":{"id":{"type":"string","format":"uuid","title":"Id","description":"A unique ID for the request (not the message). Repeated identical requests\nget different IDs. However, for a streaming response, the ID will be the same\nfor all responses in the stream.\n"},"workspace_id":{"type":"string","format":"uuid","title":"Workspace Id"},"agent_id":{"type":"string","title":"Agent Id"},"name":{"type":"string","title":"Name"},"kind":{"type":"string","title":"Kind"},"description":{"type":"string","title":"Description"},"config_id":{"type":"string","title":"Config Id"},"enabled":{"type":"boolean","title":"Enabled"},"used":{"type":"boolean","title":"Used"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"}},"type":"object","required":["id","workspace_id","agent_id","name","kind","enabled","used","created_at","updated_at"],"title":"AgentOut","description":"Response shape for agent GET / POST / PUT."},"AgentUpdate":{"properties":{"name":{"type":"string","title":"Name"},"kind":{"type":"string","title":"Kind"},"description":{"type":"string","title":"Description"},"config_id":{"type":"string","title":"Config Id"},"enabled":{"type":"boolean","title":"Enabled"}},"type":"object","title":"AgentUpdate","description":"Body for ``PUT /tokenwise/settings/agents/{agent_id}`` — partial update."},"Assistant":{"properties":{"id":{"type":"string","title":"Id","description":"A unique ID for the request (not the message). Repeated identical requests\nget different IDs. However, for a streaming response, the ID will be the same\nfor all responses in the stream.\n"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"},"object":{"type":"string","title":"Object"},"name":{"type":"string","title":"Name"},"description":{"type":"string","title":"Description"},"optimization":{"type":"string","title":"Optimization"},"organization_id":{"type":"string","title":"Organization Id"},"workspace_id":{"type":"string","title":"Workspace Id"},"user_id":{"type":"string","title":"User Id"},"avatar":{"type":"string","title":"Avatar"},"is_archived":{"type":"boolean","title":"Is Archived","default":false},"models":{"anyOf":[{"items":{"type":"string","format":"uuid"},"type":"array"},{"items":{"type":"string"},"type":"array"}],"title":"Models"},"tools":{"items":{"$ref":"#/components/schemas/language_studio_api_server__data_types__execution_engine__ToolDefinition"},"type":"array","title":"Tools"},"requirements":{"items":{"$ref":"#/components/schemas/language_studio_api_server__data_types__assistant__Requirement"},"type":"array","title":"Requirements"},"budget":{"allOf":[{"$ref":"#/components/schemas/BudgetLevel"}],"default":"medium"},"visibility":{"allOf":[{"$ref":"#/components/schemas/Visibility"}],"default":"public"},"assistant_type":{"allOf":[{"$ref":"#/components/schemas/AssistantType"}],"default":"default"},"response_language":{"type":"string","enum":["arabic","dutch","english","french","german","hebrew","italian","portuguese","spanish","unset"],"title":"Response Language","default":"unset"},"vibe_prompt":{"type":"string","title":"Vibe Prompt"},"starter_questions":{"items":{"$ref":"#/components/schemas/StarterQuestion"},"type":"array","title":"Starter Questions"},"system_prompt":{"type":"string","title":"System Prompt"},"workflow_config":{"$ref":"#/components/schemas/WorkflowConfig"},"config_overrides":{"type":"object","title":"Config Overrides"}},"type":"object","required":["id","created_at","updated_at","object","name","organization_id","user_id"],"title":"Assistant"},"AssistantBasicInfo":{"properties":{"id":{"type":"string","format":"uuid","title":"Id","description":"A unique ID for the request (not the message). Repeated identical requests\nget different IDs. However, for a streaming response, the ID will be the same\nfor all responses in the stream.\n"},"name":{"type":"string","title":"Name"}},"type":"object","required":["id","name"],"title":"AssistantBasicInfo"},"AssistantMessage":{"properties":{"role":{"type":"string","enum":["assistant"],"title":"Role","default":"assistant","description":"The role of an individual message.\n- `user`: Input provided by the user. Any instructions given here that conflict\n with instructions given in the `system` prompt take precedence over the `system`\n prompt instructions.\n- `assistant`: Response generated by the model.\n- `system`: Initial instructions provided to the system to provide general guidance\n on the tone and voice of the generated message. An initial system message is\n optional but recommended to provide guidance on the tone of the chat. For\n example, \"You are a helpful chatbot with a background in earth sciences and a\n charming French accent.\"\n"},"content":{"type":"string","title":"Content"},"tool_calls":{"items":{"$ref":"#/components/schemas/ToolCall"},"type":"array","title":"Tool Calls"},"reasoning_content":{"type":"string","title":"Reasoning Content"}},"type":"object","title":"AssistantMessage"},"AssistantRoute":{"properties":{"id":{"type":"string","title":"Id","description":"A unique ID for the request (not the message). Repeated identical requests\nget different IDs. However, for a streaming response, the ID will be the same\nfor all responses in the stream.\n"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"},"plan_id":{"type":"string","title":"Plan Id"},"name":{"type":"string","title":"Name"},"description":{"type":"string","title":"Description"},"examples":{"items":{"type":"string"},"type":"array","title":"Examples"},"assistant_id":{"type":"string","title":"Assistant Id"}},"type":"object","required":["id","created_at","updated_at","plan_id","name","description","examples","assistant_id"],"title":"AssistantRoute"},"AssistantType":{"enum":["default","chat","maestro"],"title":"AssistantType","description":"An enumeration."},"AssistantsByMcpResponse":{"properties":{"results":{"items":{"$ref":"#/components/schemas/AssistantBasicInfo"},"type":"array","title":"Results"}},"type":"object","required":["results"],"title":"AssistantsByMcpResponse"},"AuthenticationType":{"type":"string","enum":["none","token-api","custom-header"],"title":"AuthenticationType","description":"An enumeration."},"Body_convert_document_file_studio_v1_chat_files_convert_post":{"properties":{"files":{"items":{"type":"string","format":"binary"},"type":"array","title":"Files"}},"type":"object","required":["files"],"title":"Body_convert_document_file_studio_v1_chat_files_convert_post"},"Body_parse_pdf_studio_v1_demos_document_modifier_parse_pdf_post":{"properties":{"file":{"type":"string","format":"binary","title":"File"}},"type":"object","required":["file"],"title":"Body_parse_pdf_studio_v1_demos_document_modifier_parse_pdf_post"},"Body_process_rfi_document_studio_v1_demos_rfi_process_rfi_post":{"properties":{"file":{"type":"string","format":"binary","title":"File","description":"RFI document file (PDF supported)"},"budget":{"type":"string","title":"Budget","description":"Budget level: LOW, MEDIUM, or HIGH","default":"MEDIUM"},"vector_store_id":{"type":"string","title":"Vector Store Id","description":"Vector store ID to use for RFI processing"}},"type":"object","required":["file"],"title":"Body_process_rfi_document_studio_v1_demos_rfi_process_rfi_post"},"Body_upload_check_compliance_studio_v1_demos_regulations_upload_check_compliance_post":{"properties":{"file":{"type":"string","format":"binary","title":"File"},"budget":{"type":"string","title":"Budget","default":"MEDIUM"},"vector_store_id":{"type":"string","title":"Vector Store Id","description":"Vector store ID to use for RFI processing"}},"type":"object","required":["file"],"title":"Body_upload_check_compliance_studio_v1_demos_regulations_upload_check_compliance_post"},"Body_v1_library_upload":{"properties":{"file":{"type":"string","format":"binary","title":"File"},"path":{"type":"string","title":"Path"},"labels":{"items":{"type":"string"},"type":"array","title":"Labels"},"publicUrl":{"type":"string","title":"Publicurl"},"custom_configs":{"type":"string","title":"Custom Configs"},"upload_mode":{"allOf":[{"$ref":"#/components/schemas/UploadMode"}],"default":"immediate"},"batch_id":{"type":"string","format":"uuid","title":"Batch Id"},"data_source":{"type":"string","title":"Data Source"},"metadata":{"type":"string","title":"Metadata"}},"type":"object","required":["file"],"title":"Body_v1_library_upload"},"BudgetLevel":{"enum":["low","medium","high"],"title":"BudgetLevel","description":"An enumeration."},"ChatCompletion":{"properties":{"id":{"type":"string","title":"Id","description":"A unique ID for the request (not the message). Repeated identical requests\nget different IDs. However, for a streaming response, the ID will be the same\nfor all responses in the stream.\n"},"choices":{"items":{"$ref":"#/components/schemas/ChatCompletionResponseChoice"},"type":"array","title":"Choices","description":"One or more responses, depending on the `n` parameter from the request.\n"},"usage":{"$ref":"#/components/schemas/UsageInfo","description":"The token counts for this request. Per-token billing is based on the\nprompt token and completion token counts and rates.\n"},"meta":{"type":"object","title":"Meta"}},"type":"object","required":["id","choices","usage"],"title":"ChatCompletion","description":"Used for non-streaming responses. Streaming responses return `ChatCompletionVllmStreamingMessage`."},"ChatCompletionResponseChoice":{"properties":{"index":{"type":"integer","title":"Index","description":"Zero-based index of the message in the list of messages. Note that this might not\ncorrespond with the position in the response list.\n"},"message":{"$ref":"#/components/schemas/AssistantMessage","description":"The message generated by the model. Same structure as the request message, with `role` and `content` members.\n"},"logprobs":{"$ref":"#/components/schemas/Logprobs"},"finish_reason":{"type":"string","title":"Finish Reason","description":"Why the message ended. Possible reasons:\n - `stop`: The response ended naturally as a complete answer (due to\n [end-of-sequence token](https://huggingface.co/docs/transformers/v4.32.1/en/llm_tutorial#generate-text))\n or because the model generated a stop sequence provided in the request.\n - `length`: The response ended by reaching `max_tokens`.\n"}},"type":"object","required":["index","message"],"title":"ChatCompletionResponseChoice","description":"A single possible response generated by the system. For non-streaming replies, There\ncan be multiple responses, depending on what `n` value you specified in the request.\n"},"ChatCompletionResponseDeltaChoice":{"properties":{"index":{"type":"integer","title":"Index","description":"Always zero in streamed responses."},"delta":{"anyOf":[{"$ref":"#/components/schemas/ChatStreamingFirstDelta"},{"$ref":"#/components/schemas/ChatStreamingContentDelta"},{"$ref":"#/components/schemas/ChatStreamingToolCallsFirstDelta"},{"$ref":"#/components/schemas/ChatStreamingToolCallsDelta"}],"title":"Delta","description":"- **The first message** in the stream will be an object set to `{\"role\":\"assistant\"}`.\n- **Subsequent messages** will have an object `{\"content\": __token__}` with the generated token.\n"},"logprobs":{"$ref":"#/components/schemas/Logprobs"},"finish_reason":{"type":"string","title":"Finish Reason","description":"One of the following string values:\n - `null`: All messages but the last will return null for `finish_reason`.\n - `stop`: The response ended naturally as a complete answer (due to\n [end-of-sequence token](https://huggingface.co/docs/transformers/v4.32.1/en/llm_tutorial#generate-text))\n or because the model generated a stop sequence provided in the request.\n - `length`: The response ended by reaching `max_tokens`.\n"}},"type":"object","required":["index","delta"],"title":"ChatCompletionResponseDeltaChoice"},"ChatCompletionVllmStreamingMessage":{"properties":{"id":{"type":"string","title":"Id","description":"A unique ID for the request (not the message). Repeated identical requests\nget different IDs. However, for a streaming response, the ID will be the same\nfor all responses in the stream.\n"},"choices":{"items":{"$ref":"#/components/schemas/ChatCompletionResponseDeltaChoice"},"type":"array","title":"Choices","description":"The message"},"usage":{"$ref":"#/components/schemas/UsageInfo","description":"Included in the last message only. Total token counts for the message."},"meta":{"type":"object","title":"Meta"}},"type":"object","required":["id","choices"],"title":"ChatCompletionVllmStreamingMessage","description":"Returned for streaming messages. Non-streaming responses return `ChatCompletion`."},"ChatRequest":{"properties":{"model":{"$ref":"#/components/schemas/ModelName","description":"The name of the model to use. Choose one of the following values:\n* `jamba-instruct-preview`\n"},"messages":{"items":{"oneOf":[{"$ref":"#/components/schemas/UserMessage"},{"$ref":"#/components/schemas/AssistantMessage"},{"$ref":"#/components/schemas/ToolMessage"},{"$ref":"#/components/schemas/SystemMessage"}],"discriminator":{"propertyName":"role","mapping":{"user":"#/components/schemas/UserMessage","assistant":"#/components/schemas/AssistantMessage","tool":"#/components/schemas/ToolMessage","system":"#/components/schemas/SystemMessage"}}},"type":"array","title":"Messages","description":"The previous messages in this chat, from oldest (index 0) to newest. Messages\nmust be alternating `user`/`assistant` messages, optionally starting with a `system`\nmessage. For single turn interactions, this should be an optional `system` message,\nand a single `user` message. Maximum total size for the list is about 256K tokens.\n"},"tools":{"items":{"$ref":"#/components/schemas/language_studio_api_server__data_types__chat__ToolDefinition"},"type":"array","title":"Tools"},"n":{"type":"integer","title":"N","default":1,"description":"How many chat responses to generate. _Range: 1 – 16_ **Notes:**\n- If `n > 1`, setting `temperature=0` will fail because all answers are guaranteed to be duplicates.\n- `n` must be 1 when `stream = True`\n"},"max_tokens":{"type":"integer","title":"Max Tokens","default":4096,"description":"The maximum number of tokens to allow for each generated response message. Typically\nthe best way to limit output length is by providing a length limit in the system\nprompt (for example, \"limit your answers to three sentences\"). _Range: 0 – 4096_\n"},"temperature":{"type":"number","title":"Temperature","description":"How much variation to provide in each answer. Setting this value to 0 guarantees the\nsame response to the same question every time. Setting a higher value encourages more\nvariation. Modifies the distribution from which tokens are sampled.\n[More information](https://docs.ai21.com/docs/sampling-from-language-models#temperature)\n_Range: 0.0 – 2.0_\n"},"top_p":{"type":"number","maximum":1.0,"exclusiveMinimum":0.0,"title":"Top P","default":1,"description":"Limit the pool of next tokens in each step to the top N percentile of possible\ntokens, where 1.0 means the pool of all possible tokens, and 0.01 means the\npool of only the most likely next tokens. [More information]\n(https://docs.ai21.com/docs/sampling-from-language-models#topp) _Range: 0 \\<= value \\<=1.0_\n"},"stop":{"anyOf":[{"type":"string"},{"items":{"type":"string"},"type":"array"}],"title":"Stop","description":"End the message when the model generates one of these strings. The stop sequence\nis not included in the generated message. Each sequence can be up to 64K long, and\ncan contain newlines as `\\n` characters. Examples:\n- Single stop string with a word and a period: \"monkeys.\"\n- Multiple stop strings and a newline: [\"cat\", \"dog\", \" .\", \"####\", \"\\n\"]\n"},"stream":{"type":"boolean","title":"Stream","default":false,"description":"Whether or not to stream the result one token at a time using\n[server-sent events](https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events/Using_server-sent_events).\nThis can be useful when waiting for long results where a long wait time for an\nanswer can be problematic, such as a chatbot. If set to `True`, then `n` must\nbe 1. A streaming response is different than the non-streaming response.\n"},"mock_response":{"$ref":"#/components/schemas/MockResponseConfig"},"documents":{"items":{"$ref":"#/components/schemas/DocumentSchema"},"type":"array","title":"Documents","default":[]},"response_format":{"allOf":[{"$ref":"#/components/schemas/ResponseFormat"}],"title":"Response Format","default":{"type":"text"}}},"type":"object","required":["model","messages"],"title":"ChatRequest"},"ChatStreamingContentDelta":{"properties":{"content":{"type":"string","title":"Content"}},"type":"object","required":["content"],"title":"ChatStreamingContentDelta"},"ChatStreamingFirstDelta":{"properties":{"role":{"type":"string","enum":["system","user","assistant","tool"],"title":"Role","description":"The role of an individual message.\n- `user`: Input provided by the user. Any instructions given here that conflict\n with instructions given in the `system` prompt take precedence over the `system`\n prompt instructions.\n- `assistant`: Response generated by the model.\n- `system`: Initial instructions provided to the system to provide general guidance\n on the tone and voice of the generated message. An initial system message is\n optional but recommended to provide guidance on the tone of the chat. For\n example, \"You are a helpful chatbot with a background in earth sciences and a\n charming French accent.\"\n"}},"type":"object","required":["role"],"title":"ChatStreamingFirstDelta"},"ChatStreamingToolCallsDelta":{"properties":{"tool_calls":{"items":{"$ref":"#/components/schemas/ToolCallDelta"},"type":"array","title":"Tool Calls"}},"type":"object","required":["tool_calls"],"title":"ChatStreamingToolCallsDelta"},"ChatStreamingToolCallsFirstDelta":{"properties":{"tool_calls":{"items":{"$ref":"#/components/schemas/ToolCallDeltaStart"},"type":"array","title":"Tool Calls"}},"type":"object","required":["tool_calls"],"title":"ChatStreamingToolCallsFirstDelta"},"CompareTextRequest":{"properties":{"original_text":{"type":"string","title":"Original Text"},"modified_text":{"type":"string","title":"Modified Text"}},"type":"object","required":["original_text","modified_text"],"title":"CompareTextRequest"},"ComparisonOperator":{"type":"object","title":"ComparisonOperator"},"ConfigProfileCreate":{"properties":{"config_id":{"type":"string","maxLength":128,"minLength":1,"title":"Config Id"},"name":{"type":"string","title":"Name","default":""},"description":{"type":"string","title":"Description"},"overrides":{"type":"object","title":"Overrides"},"enabled":{"type":"boolean","title":"Enabled","default":true}},"type":"object","required":["config_id"],"title":"ConfigProfileCreate","description":"Body for ``POST /tokenwise/settings/configs``."},"ConfigProfileOut":{"properties":{"id":{"type":"string","format":"uuid","title":"Id","description":"A unique ID for the request (not the message). Repeated identical requests\nget different IDs. However, for a streaming response, the ID will be the same\nfor all responses in the stream.\n"},"workspace_id":{"type":"string","format":"uuid","title":"Workspace Id"},"config_id":{"type":"string","title":"Config Id"},"name":{"type":"string","title":"Name"},"description":{"type":"string","title":"Description"},"overrides":{"type":"object","title":"Overrides"},"enabled":{"type":"boolean","title":"Enabled"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"}},"type":"object","required":["id","workspace_id","config_id","name","overrides","enabled","created_at","updated_at"],"title":"ConfigProfileOut","description":"Response shape for config GET / POST / PUT."},"ConfigProfileUpdate":{"properties":{"name":{"type":"string","title":"Name"},"description":{"type":"string","title":"Description"},"overrides":{"type":"object","title":"Overrides"},"enabled":{"type":"boolean","title":"Enabled"}},"type":"object","title":"ConfigProfileUpdate","description":"Body for ``PUT /tokenwise/settings/configs/{config_id}`` — partial update.\n\nAn explicit ``overrides: null`` is \"leave unchanged\"; ``{}`` clears them.\nThe gateway enforces the same semantics; we forward the JSON verbatim."},"ConfigSchemaOut":{"properties":{"groups":{"items":{"type":"object"},"type":"array","title":"Groups"}},"type":"object","required":["groups"],"title":"ConfigSchemaOut","description":"Response shape for ``GET /tokenwise/settings/configs/schema``.\n\nLoosely typed — the gateway derives this from its ``ProxySettings`` and the\nshape evolves with new transformer groups. Kept as a flexible envelope so\napi-server does not need a release every time the gateway adds a knob."},"CreateAssistantRequest":{"properties":{"name":{"type":"string","title":"Name"},"description":{"type":"string","title":"Description"},"optimization":{"type":"string","title":"Optimization"},"avatar":{"type":"string","title":"Avatar"},"models":{"items":{"type":"string"},"type":"array","title":"Models"},"tools":{"items":{"$ref":"#/components/schemas/language_studio_api_server__data_types__execution_engine__ToolDefinition"},"type":"array","title":"Tools"},"requirements":{"items":{"$ref":"#/components/schemas/language_studio_api_server__data_types__assistant__Requirement"},"type":"array","title":"Requirements"},"budget":{"allOf":[{"$ref":"#/components/schemas/BudgetLevel"}],"default":"medium"},"assistant_type":{"allOf":[{"$ref":"#/components/schemas/AssistantType"}],"default":"default"},"starter_questions":{"items":{"$ref":"#/components/schemas/StarterQuestion"},"type":"array","title":"Starter Questions"},"system_prompt":{"type":"string","title":"System Prompt"},"workflow_config":{"$ref":"#/components/schemas/WorkflowConfig"},"config_overrides":{"type":"object","title":"Config Overrides"}},"type":"object","required":["name"],"title":"CreateAssistantRequest"},"CreateMCPStorageRequest":{"properties":{"server_url":{"type":"string","title":"Server Url"},"server_label":{"type":"string","title":"Server Label"},"workspace_id":{"type":"string","format":"uuid","title":"Workspace Id"},"authentication_type":{"$ref":"#/components/schemas/AuthenticationType"},"auth_header_name":{"type":"string","title":"Auth Header Name"},"auth_value":{"type":"string","title":"Auth Value"},"allowed_tools":{"items":{"type":"string"},"type":"array","title":"Allowed Tools"}},"type":"object","required":["server_url","server_label"],"title":"CreateMCPStorageRequest"},"CreateMaestroRunsPayload":{"properties":{"input":{"anyOf":[{"items":{"$ref":"#/components/schemas/Message"},"type":"array"},{"type":"string"}],"title":"Input"},"output_type":{"type":"object","title":"Output Type"},"models":{"items":{"type":"string"},"type":"array","title":"Models"},"tools":{"items":{"$ref":"#/components/schemas/language_studio_api_server__data_types__execution_engine__ToolDefinition"},"type":"array","title":"Tools"},"context":{"type":"object","title":"Context"},"requirements":{"items":{"$ref":"#/components/schemas/language_studio_api_server__data_types__execution_engine__Requirement"},"type":"array","title":"Requirements"},"budget":{"type":"string","enum":["low","medium","high"],"title":"Budget"},"verbose":{"type":"boolean","title":"Verbose","default":false},"include":{"items":{"type":"string"},"type":"array","title":"Include"},"structured_rag_enabled":{"type":"boolean","title":"Structured Rag Enabled","default":false},"dynamic_planning_enabled":{"type":"boolean","title":"Dynamic Planning Enabled","default":false},"assistant_id":{"type":"string","title":"Assistant Id"},"variant":{"type":"string","enum":["main","ingestion"],"title":"Variant","default":"main"},"custom_retrieval_configs":{"items":{"type":"object"},"type":"array","title":"Custom Retrieval Configs"},"response_language":{"type":"string","enum":["arabic","dutch","english","french","german","hebrew","italian","portuguese","spanish","unset"],"title":"Response Language","default":"unset"},"system_prompt":{"type":"string","title":"System Prompt"},"stream":{"type":"boolean","title":"Stream","default":false,"description":"Whether or not to stream the result one token at a time using\n[server-sent events](https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events/Using_server-sent_events).\nThis can be useful when waiting for long results where a long wait time for an\nanswer can be problematic, such as a chatbot. If set to `True`, then `n` must\nbe 1. A streaming response is different than the non-streaming response.\n"}},"type":"object","required":["input"],"title":"CreateMaestroRunsPayload"},"CreateOrganizationSchemaRequest":{"properties":{"schema_name":{"type":"string","title":"Schema Name"},"schema_object":{"type":"object","title":"Schema Object"},"run_classification":{"type":"boolean","title":"Run Classification","default":false}},"type":"object","required":["schema_name","schema_object"],"title":"CreateOrganizationSchemaRequest"},"CreatePlanPayload":{"properties":{"code":{"type":"string","title":"Code"},"schemas":{"items":{"type":"object"},"type":"array","title":"Schemas"}},"type":"object","required":["code"],"title":"CreatePlanPayload"},"CreateRoutePayload":{"properties":{"plan_id":{"type":"string","title":"Plan Id"},"name":{"type":"string","title":"Name"},"description":{"type":"string","title":"Description"},"examples":{"items":{"type":"string"},"type":"array","title":"Examples"}},"type":"object","required":["plan_id","name","description","examples"],"title":"CreateRoutePayload"},"CreateSecretPayload":{"properties":{"secret_name":{"type":"string","title":"Secret Name"},"secret_value":{"type":"string","title":"Secret Value"}},"type":"object","required":["secret_name","secret_value"],"title":"CreateSecretPayload"},"DeleteAssistantResponse":{"properties":{"object":{"type":"string","title":"Object","default":"assistant"},"deleted":{"type":"boolean","title":"Deleted","default":true},"id":{"type":"string","title":"Id","description":"A unique ID for the request (not the message). Repeated identical requests\nget different IDs. However, for a streaming response, the ID will be the same\nfor all responses in the stream.\n"}},"type":"object","required":["id"],"title":"DeleteAssistantResponse"},"DeleteMCPStorageResponse":{"properties":{"id":{"type":"string","format":"uuid","title":"Id","description":"A unique ID for the request (not the message). Repeated identical requests\nget different IDs. However, for a streaming response, the ID will be the same\nfor all responses in the stream.\n"}},"type":"object","required":["id"],"title":"DeleteMCPStorageResponse"},"Demo":{"properties":{"id":{"type":"string","title":"Id","description":"A unique ID for the request (not the message). Repeated identical requests\nget different IDs. However, for a streaming response, the ID will be the same\nfor all responses in the stream.\n"},"name":{"type":"string","title":"Name","description":"Name of the demo"},"visibility":{"allOf":[{"$ref":"#/components/schemas/DemoVisibility"}],"description":"Visibility of the demo (public/private)"},"status":{"allOf":[{"$ref":"#/components/schemas/DemoStatus"}],"description":"Status of the demo (active/inactive)"},"config":{"type":"object","title":"Config","description":"Demo configuration"},"ui_component_name":{"type":"string","title":"Ui Component Name","description":"Name of the UI component"}},"type":"object","required":["id","name","visibility","status","ui_component_name"],"title":"Demo"},"DemoCreate":{"properties":{"name":{"type":"string","title":"Name","description":"Name of the demo"},"visibility":{"allOf":[{"$ref":"#/components/schemas/DemoVisibility"}],"description":"Visibility of the demo (public/private)"},"status":{"allOf":[{"$ref":"#/components/schemas/DemoStatus"}],"description":"Status of the demo (active/inactive)"},"config":{"type":"object","title":"Config","description":"Demo configuration"},"ui_component_name":{"type":"string","title":"Ui Component Name","description":"Name of the UI component"}},"type":"object","required":["name","visibility","status","ui_component_name"],"title":"DemoCreate"},"DemoStatus":{"enum":["active","inactive"],"title":"DemoStatus","description":"An enumeration."},"DemoUpdate":{"properties":{"name":{"type":"string","title":"Name","description":"Name of the demo"},"visibility":{"allOf":[{"$ref":"#/components/schemas/DemoVisibility"}],"description":"Visibility of the demo (public/private)"},"status":{"allOf":[{"$ref":"#/components/schemas/DemoStatus"}],"description":"Status of the demo (active/inactive)"},"config":{"type":"object","title":"Config","description":"Demo configuration"},"ui_component_name":{"type":"string","title":"Ui Component Name","description":"Name of the UI component"}},"type":"object","title":"DemoUpdate"},"DemoVisibility":{"enum":["public","private"],"title":"DemoVisibility","description":"An enumeration."},"DetectSchemaRequest":{"properties":{"documents":{"items":{"$ref":"#/components/schemas/DocumentReference"},"type":"array","title":"Documents"},"queries":{"items":{"type":"string"},"type":"array","title":"Queries"}},"type":"object","required":["documents"],"title":"DetectSchemaRequest"},"DetectSchemaResponse":{"properties":{"schema_name":{"type":"string","title":"Schema Name"},"schema_definition":{"type":"object","title":"Schema Definition"}},"type":"object","required":["schema_name","schema_definition"],"title":"DetectSchemaResponse"},"DocumentReference":{"properties":{"document_id":{"type":"string","format":"uuid","title":"Document Id"},"name":{"type":"string","title":"Name"}},"type":"object","required":["document_id","name"],"title":"DocumentReference"},"DocumentSchema":{"properties":{"id":{"type":"string","title":"Id","description":"A unique ID for the request (not the message). Repeated identical requests\nget different IDs. However, for a streaming response, the ID will be the same\nfor all responses in the stream.\n"},"content":{"type":"string","title":"Content"},"metadata":{"additionalProperties":{"type":"string"},"type":"object","title":"Metadata","default":{}}},"type":"object","required":["content"],"title":"DocumentSchema"},"DownloadModifiedDocumentRequest":{"properties":{"content":{"type":"string","title":"Content"},"filename":{"type":"string","title":"Filename"}},"type":"object","required":["content","filename"],"title":"DownloadModifiedDocumentRequest"},"FileResponse":{"properties":{"fileId":{"type":"string","format":"uuid","title":"Fileid","description":"The unique identifier of the file, generated by AI21.\n"},"name":{"type":"string","title":"Name","description":"The name of the file. This is the local file name from when the file was\nuploaded. It cannot be modified.\n"},"path":{"type":"string","title":"Path","description":"An arbitrary file-path-like string to indicate the content of a file. This has\nnothing to do with the location of the file in storage or on disk, and is only\nanother label that you can assign to the file in path-like format to help you\norganize the contents of the file or filter queries against your files. Example\npaths might be `pets/fish` or `pets/dogs`. Then, when searching your library,\nyou can filter files by the full path or path prefix. So to search only files\nin the \"dog folder\", filter by the path `/pets/dogs`. To search all files in\nthe \"pet folder\", filter your search by the path `pets/` when searching by path.\nThere isn't a restriction on whether a path must start or end with a / mark, but\nbe consistent in your usage, and all matches are prefix matching, not substring\nmatching. So filtering by `dog/` matches `dog/` and `dog/setter` but not `pets/dog/`.\n"},"fileType":{"type":"string","title":"Filetype","description":"The file type. See the file upload method to learn what file types are supported.\n"},"sizeBytes":{"type":"integer","title":"Sizebytes","description":"The size of the file, in bytes."},"labels":{"items":{"type":"string"},"type":"array","title":"Labels","description":"Any string labels you have associated with the file. You can apply arbitrary\nstring labels to your files and limit queries to files with one or more labels.\nSimilar to paths, but labels do not prefix match. Labels are case-sensitive.\nThere can be a maximum of 20 unique labels per account.\n"},"publicUrl":{"type":"string","title":"Publicurl","description":"The public URL of the file, if any. This URL is not validated by\nAI21 or used in any way. It is strictly a piece of metadata that you can\noptionally attach to a file.\n"},"createdBy":{"type":"string","format":"uuid","title":"Createdby","description":"An internal identifier of the user who uploaded the file.\n"},"creationDate":{"type":"string","format":"date","title":"Creationdate","description":"The date when the file was uploaded."},"lastUpdated":{"type":"string","format":"date","title":"Lastupdated","description":"When the file data or metadata was last changed."},"status":{"type":"string","title":"Status","description":"File status. One of the following values: \"DB_RECORD_CREATED\",\n\"UPLOADED\", \"UPLOAD_FAILED\", \"PROCESSED\", \"PROCESSING_FAILED\"\n"},"dataSource":{"type":"string","title":"Datasource"}},"type":"object","required":["fileId","name","fileType","sizeBytes","createdBy","creationDate","lastUpdated","status"],"title":"FileResponse"},"FileSearchToolResource":{"properties":{"type":{"type":"string","enum":["file_search"],"title":"Type","default":"file_search"},"retrieval_similarity_threshold":{"type":"number","title":"Retrieval Similarity Threshold"},"labels":{"items":{"type":"string"},"type":"array","title":"Labels"},"labels_filter_mode":{"type":"string","enum":["AND","OR"],"title":"Labels Filter Mode","default":"AND"},"labels_filter":{"$ref":"#/components/schemas/QueryFilter"},"file_ids":{"items":{"type":"string"},"type":"array","title":"File Ids"},"retrieval_strategy":{"allOf":[{"$ref":"#/components/schemas/RetrievalStrategy"}],"default":"segments"},"max_neighbors":{"type":"integer","title":"Max Neighbors"},"path":{"type":"string","title":"Path"},"response_language":{"type":"string","enum":["arabic","dutch","english","french","german","hebrew","italian","portuguese","spanish","unset"],"title":"Response Language","default":"unset"},"hybrid_search_alpha":{"type":"number","title":"Hybrid Search Alpha","default":1},"use_two_step_embedders":{"type":"boolean","title":"Use Two Step Embedders","default":false}},"type":"object","title":"FileSearchToolResource"},"FileStatus":{"type":"string","enum":["DB_RECORD_CREATED","UPLOADED","UPLOAD_FAILED","PROCESSED","PROCESSING_FAILED"],"title":"FileStatus","description":"An enumeration."},"FilesUpdateRequest":{"properties":{"publicUrl":{"type":"string","title":"Publicurl","description":"The public URL of the file, if any. This URL is not validated by\nAI21 or used in any way. It is strictly a piece of metadata that you can\noptionally attach to a file.\n"},"labels":{"items":{"type":"string"},"type":"array","title":"Labels","description":"Any labels to associate with this file. Separate multiple labels with commas. If\nprovided, will overwrite all existing labels.\n"}},"type":"object","title":"FilesUpdateRequest"},"FunctionToolDefinition":{"properties":{"name":{"type":"string","title":"Name"},"description":{"type":"string","title":"Description"},"parameters":{"$ref":"#/components/schemas/ToolParameters"}},"type":"object","required":["name"],"title":"FunctionToolDefinition"},"GenerateAssistantRequest":{"properties":{"prompt":{"type":"string","title":"Prompt"},"avatar":{"type":"string","title":"Avatar"}},"type":"object","required":["prompt"],"title":"GenerateAssistantRequest"},"GenerateAssistantResponse":{"properties":{"id":{"type":"string","title":"Id","description":"A unique ID for the request (not the message). Repeated identical requests\nget different IDs. However, for a streaming response, the ID will be the same\nfor all responses in the stream.\n"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"},"object":{"type":"string","title":"Object"},"name":{"type":"string","title":"Name"},"description":{"type":"string","title":"Description"},"optimization":{"type":"string","title":"Optimization"},"organization_id":{"type":"string","title":"Organization Id"},"workspace_id":{"type":"string","title":"Workspace Id"},"user_id":{"type":"string","title":"User Id"},"avatar":{"type":"string","title":"Avatar"},"is_archived":{"type":"boolean","title":"Is Archived","default":false},"models":{"anyOf":[{"items":{"type":"string","format":"uuid"},"type":"array"},{"items":{"type":"string"},"type":"array"}],"title":"Models"},"tools":{"items":{"$ref":"#/components/schemas/language_studio_api_server__data_types__execution_engine__ToolDefinition"},"type":"array","title":"Tools"},"requirements":{"items":{"$ref":"#/components/schemas/language_studio_api_server__data_types__assistant__Requirement"},"type":"array","title":"Requirements"},"budget":{"allOf":[{"$ref":"#/components/schemas/BudgetLevel"}],"default":"medium"},"visibility":{"allOf":[{"$ref":"#/components/schemas/Visibility"}],"default":"public"},"assistant_type":{"allOf":[{"$ref":"#/components/schemas/AssistantType"}],"default":"default"},"response_language":{"type":"string","enum":["arabic","dutch","english","french","german","hebrew","italian","portuguese","spanish","unset"],"title":"Response Language","default":"unset"},"vibe_prompt":{"type":"string","title":"Vibe Prompt"},"starter_questions":{"items":{"$ref":"#/components/schemas/StarterQuestion"},"type":"array","title":"Starter Questions"},"system_prompt":{"type":"string","title":"System Prompt"},"workflow_config":{"$ref":"#/components/schemas/WorkflowConfig"},"config_overrides":{"type":"object","title":"Config Overrides"},"custom_tool_needed":{"additionalProperties":{"type":"string"},"type":"object","title":"Custom Tool Needed"},"recommended_files":{"items":{"type":"string"},"type":"array","title":"Recommended Files"}},"type":"object","required":["id","created_at","updated_at","object","name","organization_id","user_id"],"title":"GenerateAssistantResponse"},"HTTPToolEndpoint":{"properties":{"url":{"type":"string","title":"Url"},"headers":{"type":"object","title":"Headers"}},"type":"object","required":["url"],"title":"HTTPToolEndpoint"},"HTTPToolFunction":{"properties":{"name":{"type":"string","title":"Name"},"description":{"type":"string","title":"Description"},"parameters":{"$ref":"#/components/schemas/HTTPToolFunctionParameters"}},"type":"object","required":["name","description","parameters"],"title":"HTTPToolFunction"},"HTTPToolFunctionParamProperties":{"properties":{"type":{"type":"string","title":"Type"},"description":{"type":"string","title":"Description"}},"type":"object","required":["type","description"],"title":"HTTPToolFunctionParamProperties"},"HTTPToolFunctionParameters":{"properties":{"type":{"type":"string","enum":["object"],"title":"Type","default":"object"},"properties":{"additionalProperties":{"$ref":"#/components/schemas/HTTPToolFunctionParamProperties"},"type":"object","title":"Properties"},"required":{"items":{"type":"string"},"type":"array","title":"Required"},"additionalProperties":{"type":"boolean","title":"Additionalproperties","default":false}},"type":"object","required":["properties","required"],"title":"HTTPToolFunctionParameters"},"HTTPToolResource":{"properties":{"type":{"type":"string","enum":["http"],"title":"Type","default":"http"},"function":{"$ref":"#/components/schemas/HTTPToolFunction"},"endpoint":{"$ref":"#/components/schemas/HTTPToolEndpoint"}},"type":"object","required":["function","endpoint"],"title":"HTTPToolResource"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"IgnestionBatchStatusCount":{"properties":{"status":{"type":"string","title":"Status"},"count":{"type":"integer","title":"Count"}},"type":"object","required":["status","count"],"title":"IgnestionBatchStatusCount"},"IngestionBatchStatusResponse":{"properties":{"batch_id":{"type":"string","title":"Batch Id","description":"The UUID of the batch"},"total_documents":{"type":"integer","title":"Total Documents","description":"Total number of documents in the batch"},"statuses":{"items":{"$ref":"#/components/schemas/IgnestionBatchStatusCount"},"type":"array","title":"Statuses","description":"List of document counts by status"}},"type":"object","required":["batch_id","total_documents","statuses"],"title":"IngestionBatchStatusResponse"},"JambaExecuteRequest":{"properties":{"content":{"type":"string","title":"Content"},"task":{"type":"string","title":"Task"},"prompt":{"type":"string","title":"Prompt"},"api_key":{"type":"string","title":"Api Key"}},"type":"object","required":["content","task","prompt"],"title":"JambaExecuteRequest"},"ListAssistantsResponse":{"properties":{"results":{"items":{"$ref":"#/components/schemas/Assistant"},"type":"array","title":"Results"}},"type":"object","required":["results"],"title":"ListAssistantsResponse"},"ListMCPsStorageResponse":{"properties":{"results":{"items":{"$ref":"#/components/schemas/MCPStorageResponse"},"type":"array","title":"Results"}},"type":"object","required":["results"],"title":"ListMCPsStorageResponse"},"ListPlansResponse":{"properties":{"results":{"items":{"$ref":"#/components/schemas/Plan"},"type":"array","title":"Results"}},"type":"object","required":["results"],"title":"ListPlansResponse"},"ListRoutesResponse":{"properties":{"results":{"items":{"$ref":"#/components/schemas/AssistantRoute"},"type":"array","title":"Results"}},"type":"object","required":["results"],"title":"ListRoutesResponse"},"LogicalOperator":{"additionalProperties":{"items":{"type":"object"},"type":"array"},"type":"object","title":"LogicalOperator"},"Logprobs":{"properties":{"content":{"items":{"$ref":"#/components/schemas/LogprobsData"},"type":"array","title":"Content"}},"type":"object","required":["content"],"title":"Logprobs"},"LogprobsData":{"properties":{"token":{"type":"string","title":"Token"},"logprob":{"type":"number","title":"Logprob"},"top_logprobs":{"items":{"$ref":"#/components/schemas/TopLogprobsData"},"type":"array","title":"Top Logprobs"}},"type":"object","required":["token","logprob"],"title":"LogprobsData"},"MCPStorageResponse":{"properties":{"id":{"type":"string","format":"uuid","title":"Id","description":"A unique ID for the request (not the message). Repeated identical requests\nget different IDs. However, for a streaming response, the ID will be the same\nfor all responses in the stream.\n"},"server_url":{"type":"string","title":"Server Url"},"server_label":{"type":"string","title":"Server Label"},"organization_id":{"type":"string","format":"uuid","title":"Organization Id"},"workspace_id":{"type":"string","format":"uuid","title":"Workspace Id"},"user_id":{"type":"string","format":"uuid","title":"User Id"},"authentication_type":{"$ref":"#/components/schemas/AuthenticationType"},"auth_header_name":{"type":"string","title":"Auth Header Name"},"auth_secret_key":{"type":"string","title":"Auth Secret Key"},"allowed_tools":{"items":{"type":"string"},"type":"array","title":"Allowed Tools"}},"type":"object","required":["id","server_url","server_label","organization_id","user_id"],"title":"MCPStorageResponse"},"MCPToolResource":{"properties":{"type":{"type":"string","enum":["mcp"],"title":"Type","default":"mcp"},"server_label":{"type":"string","title":"Server Label"},"server_url":{"type":"string","title":"Server Url"},"headers":{"type":"object","title":"Headers"},"allowed_tools":{"items":{"type":"string"},"type":"array","title":"Allowed Tools"},"mcp_id":{"type":"string","title":"Mcp Id"}},"type":"object","title":"MCPToolResource"},"MaestroRunError":{"properties":{"message":{"type":"string","title":"Message"}},"type":"object","required":["message"],"title":"MaestroRunError"},"MaestroRunResult":{"properties":{"id":{"type":"string","format":"uuid","title":"Id","description":"A unique ID for the request (not the message). Repeated identical requests\nget different IDs. However, for a streaming response, the ID will be the same\nfor all responses in the stream.\n"},"status":{"type":"string","enum":["completed","failed","in_progress","requires_action"],"title":"Status"},"result":{"title":"Result"},"data_sources":{"type":"object","title":"Data Sources"},"requirements_result":{"type":"object","title":"Requirements Result"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"error":{"$ref":"#/components/schemas/MaestroRunError"}},"type":"object","required":["id","status"],"title":"MaestroRunResult"},"MarkdownRequest":{"properties":{"text":{"type":"string","title":"Text","description":"All section answers concatenated"}},"type":"object","required":["text"],"title":"MarkdownRequest"},"Message":{"properties":{"role":{"type":"string","enum":["assistant","user"],"title":"Role","description":"The role of an individual message.\n- `user`: Input provided by the user. Any instructions given here that conflict\n with instructions given in the `system` prompt take precedence over the `system`\n prompt instructions.\n- `assistant`: Response generated by the model.\n- `system`: Initial instructions provided to the system to provide general guidance\n on the tone and voice of the generated message. An initial system message is\n optional but recommended to provide guidance on the tone of the chat. For\n example, \"You are a helpful chatbot with a background in earth sciences and a\n charming French accent.\"\n"},"content":{"type":"string","title":"Content"}},"type":"object","required":["role","content"],"title":"Message"},"MockResponseConfig":{"properties":{"response_delay_seconds":{"type":"number","minimum":0.0,"title":"Response Delay Seconds","default":1},"stream_response_delay_between_deltas_seconds":{"type":"number","minimum":0.0,"title":"Stream Response Delay Between Deltas Seconds","default":0.1}},"type":"object","title":"MockResponseConfig","include_in_schema":false},"ModelInfo":{"properties":{"id":{"type":"string","title":"Id","description":"A unique ID for the request (not the message). Repeated identical requests\nget different IDs. However, for a streaming response, the ID will be the same\nfor all responses in the stream.\n"},"name":{"type":"string","title":"Name"},"updated":{"type":"string","title":"Updated"},"context_length":{"type":"integer","title":"Context Length"},"quantization":{"$ref":"#/components/schemas/ModelQuantization"},"max_completion_tokens":{"type":"integer","title":"Max Completion Tokens"},"pricing":{"$ref":"#/components/schemas/ModelPricing"}},"type":"object","required":["id","name","updated","context_length","quantization","max_completion_tokens","pricing"],"title":"ModelInfo"},"ModelName":{"type":"string","enum":["jamba-mini","jamba-large","jamba-large-1.7","jamba-large-1.7-2025-07","jamba-mini-2","jamba-mini-2-2026-01"],"title":"ModelName","description":"An enumeration."},"ModelPricing":{"properties":{"prompt":{"type":"string","title":"Prompt"},"completion":{"type":"string","title":"Completion"}},"type":"object","required":["prompt","completion"],"title":"ModelPricing"},"ModelQuantization":{"type":"string","enum":["FP8","experts_int8"],"title":"ModelQuantization","description":"An enumeration."},"ModelsInfoResponse":{"properties":{"data":{"items":{"$ref":"#/components/schemas/ModelInfo"},"type":"array","title":"Data"}},"type":"object","required":["data"],"title":"ModelsInfoResponse"},"ModifyAssistantRequest":{"properties":{"name":{"type":"string","title":"Name"},"description":{"type":"string","title":"Description"},"optimization":{"$ref":"#/components/schemas/RunOptimization"},"avatar":{"type":"string","title":"Avatar"},"is_archived":{"type":"boolean","title":"Is Archived","default":false},"models":{"items":{"type":"string"},"type":"array","title":"Models"},"tools":{"items":{"$ref":"#/components/schemas/language_studio_api_server__data_types__execution_engine__ToolDefinition"},"type":"array","title":"Tools"},"requirements":{"items":{"$ref":"#/components/schemas/language_studio_api_server__data_types__assistant__Requirement"},"type":"array","title":"Requirements"},"budget":{"$ref":"#/components/schemas/BudgetLevel"},"visibility":{"$ref":"#/components/schemas/Visibility"},"response_language":{"type":"string","enum":["arabic","dutch","english","french","german","hebrew","italian","portuguese","spanish","unset"],"title":"Response Language"},"system_prompt":{"type":"string","title":"System Prompt"},"workflow_config":{"$ref":"#/components/schemas/WorkflowConfig"},"config_overrides":{"type":"object","title":"Config Overrides"}},"type":"object","title":"ModifyAssistantRequest"},"OrgSchema":{"properties":{"organization_id":{"type":"string","format":"uuid","title":"Organization Id"},"schema_name":{"type":"string","title":"Schema Name"},"schema_definition":{"type":"object","title":"Schema Definition"},"table_stats":{"type":"object","title":"Table Stats"}},"type":"object","required":["organization_id","schema_name","schema_definition","table_stats"],"title":"OrgSchema"},"OrgSchemas":{"properties":{"schemas":{"items":{"$ref":"#/components/schemas/OrgSchema"},"type":"array","title":"Schemas"}},"type":"object","required":["schemas"],"title":"OrgSchemas"},"Plan":{"properties":{"id":{"type":"string","title":"Id","description":"A unique ID for the request (not the message). Repeated identical requests\nget different IDs. However, for a streaming response, the ID will be the same\nfor all responses in the stream.\n"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"},"code":{"type":"string","title":"Code"},"schemas":{"items":{"type":"object"},"type":"array","title":"Schemas"},"assistant_id":{"type":"string","title":"Assistant Id"}},"type":"object","required":["id","created_at","updated_at","code","assistant_id"],"title":"Plan"},"QueryFilter":{"anyOf":[{"$ref":"#/components/schemas/ComparisonOperator"},{"$ref":"#/components/schemas/LogicalOperator"},{"additionalProperties":{"$ref":"#/components/schemas/ComparisonOperator"},"type":"object"}],"title":"QueryFilter"},"RFIResponseSection":{"properties":{"header":{"type":"string","title":"Header","description":"Exact or closest RFI heading for the section"},"description":{"type":"string","title":"Description","description":"≤350-character directive listing everything to include in that section"},"generated_content":{"type":"string","title":"Generated Content","description":"Generated content for this section based on company files"}},"type":"object","required":["header","description"],"title":"RFIResponseSection","description":"Model for a single RFI response section."},"RequirementItem":{"properties":{"name":{"type":"string","title":"Name"},"description":{"type":"string","title":"Description"}},"type":"object","required":["name","description"],"title":"RequirementItem"},"RequirementsGenerationRequest":{"properties":{"query":{"type":"string","title":"Query"}},"type":"object","required":["query"],"title":"RequirementsGenerationRequest"},"RequirementsGenerationResponse":{"properties":{"requirements":{"items":{"$ref":"#/components/schemas/RequirementItem"},"type":"array","title":"Requirements"}},"type":"object","required":["requirements"],"title":"RequirementsGenerationResponse"},"ResponseFormat":{"properties":{"type":{"type":"string","enum":["text","json_object"],"title":"Type"}},"type":"object","required":["type"],"title":"ResponseFormat"},"RetrievalStrategy":{"type":"string","enum":["segments","default","add_neighbors","full_doc"],"title":"RetrievalStrategy","description":"An enumeration."},"RunAssistantRequest":{"properties":{"input":{"items":{"$ref":"#/components/schemas/Message"},"type":"array","title":"Input"},"verbose":{"type":"boolean","title":"Verbose","default":false},"output_type":{"type":"object","title":"Output Type"},"include":{"items":{"type":"string"},"type":"array","title":"Include","default":["data_sources","requirements_result","requirements_result.metadata"]},"structured_rag_enabled":{"type":"boolean","title":"Structured Rag Enabled","default":false},"dynamic_planning_enabled":{"type":"boolean","title":"Dynamic Planning Enabled","default":false},"response_language":{"type":"string","enum":["arabic","dutch","english","french","german","hebrew","italian","portuguese","spanish","unset"],"title":"Response Language","default":"unset"},"system_prompt":{"type":"string","title":"System Prompt"}},"type":"object","required":["input"],"title":"RunAssistantRequest"},"RunOptimization":{"enum":["cost","latency"],"title":"RunOptimization","description":"An enumeration."},"SecretResponse":{"properties":{"secret_id":{"type":"string","title":"Secret Id"},"secret_key":{"type":"string","title":"Secret Key"}},"type":"object","required":["secret_id","secret_key"],"title":"SecretResponse"},"StarterQuestion":{"properties":{"title":{"type":"string","title":"Title"},"prompt":{"type":"string","title":"Prompt"}},"type":"object","required":["title","prompt"],"title":"StarterQuestion"},"SystemMessage":{"properties":{"role":{"type":"string","enum":["system"],"title":"Role","default":"system","description":"The role of an individual message.\n- `user`: Input provided by the user. Any instructions given here that conflict\n with instructions given in the `system` prompt take precedence over the `system`\n prompt instructions.\n- `assistant`: Response generated by the model.\n- `system`: Initial instructions provided to the system to provide general guidance\n on the tone and voice of the generated message. An initial system message is\n optional but recommended to provide guidance on the tone of the chat. For\n example, \"You are a helpful chatbot with a background in earth sciences and a\n charming French accent.\"\n"},"content":{"type":"string","title":"Content"}},"type":"object","required":["content"],"title":"SystemMessage"},"ToolCall":{"properties":{"id":{"type":"string","title":"Id","description":"A unique ID for the request (not the message). Repeated identical requests\nget different IDs. However, for a streaming response, the ID will be the same\nfor all responses in the stream.\n"},"type":{"type":"string","enum":["function"],"title":"Type","default":"function"},"function":{"$ref":"#/components/schemas/ToolFunction"}},"type":"object","required":["id","function"],"title":"ToolCall"},"ToolCallDelta":{"properties":{"index":{"type":"integer","title":"Index"},"function":{"$ref":"#/components/schemas/ToolFunctionDelta"}},"type":"object","required":["index","function"],"title":"ToolCallDelta"},"ToolCallDeltaStart":{"properties":{"id":{"type":"string","title":"Id","description":"A unique ID for the request (not the message). Repeated identical requests\nget different IDs. However, for a streaming response, the ID will be the same\nfor all responses in the stream.\n"},"index":{"type":"integer","title":"Index"},"type":{"type":"string","enum":["function"],"title":"Type"},"function":{"$ref":"#/components/schemas/ToolFunctionDeltaStart"}},"type":"object","required":["id","index","type","function"],"title":"ToolCallDeltaStart"},"ToolFunction":{"properties":{"name":{"type":"string","title":"Name"},"arguments":{"type":"string","title":"Arguments"}},"type":"object","required":["name","arguments"],"title":"ToolFunction"},"ToolFunctionDelta":{"properties":{"arguments":{"type":"string","title":"Arguments"}},"type":"object","required":["arguments"],"title":"ToolFunctionDelta"},"ToolFunctionDeltaStart":{"properties":{"name":{"type":"string","title":"Name"}},"type":"object","required":["name"],"title":"ToolFunctionDeltaStart"},"ToolMessage":{"properties":{"role":{"type":"string","enum":["tool"],"title":"Role","default":"tool","description":"The role of an individual message.\n- `user`: Input provided by the user. Any instructions given here that conflict\n with instructions given in the `system` prompt take precedence over the `system`\n prompt instructions.\n- `assistant`: Response generated by the model.\n- `system`: Initial instructions provided to the system to provide general guidance\n on the tone and voice of the generated message. An initial system message is\n optional but recommended to provide guidance on the tone of the chat. For\n example, \"You are a helpful chatbot with a background in earth sciences and a\n charming French accent.\"\n"},"content":{"type":"string","title":"Content"},"tool_call_id":{"type":"string","title":"Tool Call Id"}},"type":"object","required":["content","tool_call_id"],"title":"ToolMessage"},"ToolParameters":{"properties":{"type":{"type":"string","enum":["object"],"title":"Type","description":"Type of the parameter schema, only `object` is supported","default":"object"},"properties":{"type":"object","title":"Properties"},"required":{"items":{"type":"string"},"type":"array","title":"Required","description":"List of required properties"}},"type":"object","required":["properties"],"title":"ToolParameters"},"TopLogprobsData":{"properties":{"token":{"type":"string","title":"Token"},"logprob":{"type":"number","title":"Logprob"}},"type":"object","required":["token","logprob"],"title":"TopLogprobsData"},"UpdateMCPStorageRequest":{"properties":{"server_label":{"type":"string","title":"Server Label"}},"type":"object","required":["server_label"],"title":"UpdateMCPStorageRequest"},"UpdateRoutePayload":{"properties":{"description":{"type":"string","title":"Description"},"examples":{"items":{"type":"string"},"type":"array","title":"Examples"}},"type":"object","required":["description"],"title":"UpdateRoutePayload"},"UpdateSecretPayload":{"properties":{"secret_name":{"type":"string","title":"Secret Name"},"secret_value":{"type":"string","title":"Secret Value"}},"type":"object","title":"UpdateSecretPayload"},"UploadMode":{"type":"string","enum":["immediate","batch"],"title":"UploadMode","description":"An enumeration."},"UsageInfo":{"properties":{"prompt_tokens":{"type":"integer","title":"Prompt Tokens","description":"Number of tokens in the prompt for this request. Note that the prompt token\nincludes the entire message history, plus extra tokens needed by the system\nwhen combining the list of prompt messages into a single message, as\nrequired by the model. The number of extra tokens is typically proportional\nto the number of messages in the thread, and should be relatively small.\n"},"completion_tokens":{"type":"integer","title":"Completion Tokens","description":"Number of tokens in the response message."},"total_tokens":{"type":"integer","title":"Total Tokens","description":"`prompt_tokens` + `completion_tokens`.\n"}},"type":"object","required":["prompt_tokens","completion_tokens","total_tokens"],"title":"UsageInfo"},"UserMessage":{"properties":{"role":{"type":"string","enum":["user"],"title":"Role","default":"user","description":"The role of an individual message.\n- `user`: Input provided by the user. Any instructions given here that conflict\n with instructions given in the `system` prompt take precedence over the `system`\n prompt instructions.\n- `assistant`: Response generated by the model.\n- `system`: Initial instructions provided to the system to provide general guidance\n on the tone and voice of the generated message. An initial system message is\n optional but recommended to provide guidance on the tone of the chat. For\n example, \"You are a helpful chatbot with a background in earth sciences and a\n charming French accent.\"\n"},"content":{"type":"string","title":"Content"}},"type":"object","required":["content"],"title":"UserMessage"},"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"},"ValidationResult":{"properties":{"is_valid":{"type":"boolean","title":"Is Valid"},"message":{"type":"string","title":"Message"},"details":{"type":"string","title":"Details"}},"type":"object","required":["is_valid"],"title":"ValidationResult"},"Visibility":{"enum":["public","private"],"title":"Visibility","description":"An enumeration."},"WebSearchToolResource":{"properties":{"type":{"type":"string","enum":["web_search"],"title":"Type","default":"web_search"},"urls":{"items":{"type":"string"},"type":"array","title":"Urls"},"fallback_to_web":{"type":"boolean","title":"Fallback To Web"},"query_suffix":{"type":"string","title":"Query Suffix"},"rephrase_query":{"type":"boolean","title":"Rephrase Query"},"use_cached_pages":{"type":"boolean","title":"Use Cached Pages","default":false}},"type":"object","title":"WebSearchToolResource"},"WebsiteConnectorCreateConfigPayload":{"properties":{"name":{"type":"string","title":"Name"},"extract_linked_files":{"type":"boolean","title":"Extract Linked Files","default":false},"wait_for_dynamic_content":{"type":"boolean","title":"Wait For Dynamic Content","default":false},"skip_url_patterns":{"items":{"type":"string"},"type":"array","title":"Skip Url Patterns"},"target_file_extensions":{"items":{"type":"string"},"type":"array","title":"Target File Extensions"},"localization":{"type":"string","title":"Localization"}},"type":"object","required":["name","skip_url_patterns","target_file_extensions"],"title":"WebsiteConnectorCreateConfigPayload"},"WebsiteConnectorIngestUrlPayload":{"properties":{"url":{"type":"string","title":"Url"}},"type":"object","required":["url"],"title":"WebsiteConnectorIngestUrlPayload"},"WebsiteConnectorIngestWebsitePayload":{"properties":{"sitemap_url":{"type":"string","title":"Sitemap Url"},"client_config":{"type":"string","title":"Client Config"},"labels":{"items":{"type":"string"},"type":"array","title":"Labels"}},"type":"object","required":["sitemap_url"],"title":"WebsiteConnectorIngestWebsitePayload"},"WebsiteConnectorRetryIngestWebsitePayload":{"properties":{"website_id":{"type":"string","format":"uuid","title":"Website Id"}},"type":"object","required":["website_id"],"title":"WebsiteConnectorRetryIngestWebsitePayload"},"WorkflowConfig":{"properties":{"endpoint_url":{"type":"string","title":"Endpoint Url"},"headers":{"type":"object","title":"Headers"},"additional_params":{"type":"object","title":"Additional Params"}},"type":"object","required":["endpoint_url"],"title":"WorkflowConfig"},"WorkspaceModelResponse":{"properties":{"name":{"type":"string","title":"Name"},"model_type":{"type":"string","title":"Model Type"},"secret_id":{"type":"string","title":"Secret Id"},"created_by":{"type":"string","title":"Created By"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"provider":{"type":"string","title":"Provider"},"internal":{"type":"boolean","title":"Internal","default":false}},"type":"object","required":["name","model_type"],"title":"WorkspaceModelResponse"},"WorkspaceModelUpdate":{"properties":{"name":{"type":"string","title":"Name"},"model_type":{"type":"string","title":"Model Type"},"secret_id":{"type":"string","title":"Secret Id"}},"type":"object","title":"WorkspaceModelUpdate"},"WorkspaceModelsResponse":{"properties":{"models":{"items":{"$ref":"#/components/schemas/WorkspaceModelResponse"},"type":"array","title":"Models"}},"type":"object","required":["models"],"title":"WorkspaceModelsResponse"},"language_studio_api_server__data_types__assistant__Requirement":{"properties":{"id":{"type":"string","title":"Id","description":"A unique ID for the request (not the message). Repeated identical requests\nget different IDs. However, for a streaming response, the ID will be the same\nfor all responses in the stream.\n"},"title":{"type":"string","title":"Title"},"description":{"type":"string","title":"Description"},"type":{"type":"string","title":"Type"}},"type":"object","title":"Requirement"},"language_studio_api_server__data_types__chat__ToolDefinition":{"properties":{"type":{"type":"string","enum":["function"],"title":"Type"},"function":{"$ref":"#/components/schemas/FunctionToolDefinition"}},"type":"object","required":["type","function"],"title":"ToolDefinition"},"language_studio_api_server__data_types__execution_engine__Requirement":{"properties":{"name":{"type":"string","title":"Name"},"description":{"type":"string","title":"Description"},"is_mandatory":{"type":"boolean","title":"Is Mandatory"}},"type":"object","required":["name","description"],"title":"Requirement"},"language_studio_api_server__data_types__execution_engine__ToolDefinition":{"oneOf":[{"$ref":"#/components/schemas/HTTPToolResource"},{"$ref":"#/components/schemas/MCPToolResource"},{"$ref":"#/components/schemas/FileSearchToolResource"},{"$ref":"#/components/schemas/WebSearchToolResource"}],"title":"ToolDefinition","discriminator":{"propertyName":"type","mapping":{"http":"#/components/schemas/HTTPToolResource","mcp":"#/components/schemas/MCPToolResource","file_search":"#/components/schemas/FileSearchToolResource","web_search":"#/components/schemas/WebSearchToolResource"}}}}}} \ No newline at end of file