From 922aa84e202dc23e2c8650c51a1f06c67a4c530b Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Wed, 7 Oct 2026 00:31:07 +0000 Subject: [PATCH] feat: Updated OpenAPI spec --- .../CreateRoutesCommandApiCommand.g.cs | 2 +- ...ateRoutesConnectionsCommandApiCommand.g.cs | 113 +++ .../Commands/DefaultApiGroupCommand.g.cs | 4 + ...ctionsByConnectionIdCommandApiCommand.g.cs | 67 ++ ...ctionsByConnectionIdCommandApiCommand.g.cs | 77 ++ .../Commands/GetRoutesCommandApiCommand.g.cs | 4 +- ...GetRoutesConnectionsCommandApiCommand.g.cs | 93 +++ .../Baseten.BasetenClient.CreateRoutes.g.cs | 2 +- ...BasetenClient.CreateRoutesConnections.g.cs | 492 +++++++++++ ...DeleteRoutesConnectionsByConnectionId.g.cs | 436 ++++++++++ ...t.EditRoutesConnectionsByConnectionId.g.cs | 496 ++++++++++++ .../Baseten.BasetenClient.GetRoutes.g.cs | 4 +- ...en.BasetenClient.GetRoutesConnections.g.cs | 471 +++++++++++ .../Baseten.IBasetenClient.CreateRoutes.g.cs | 2 +- ...BasetenClient.CreateRoutesConnections.g.cs | 77 ++ ...DeleteRoutesConnectionsByConnectionId.g.cs | 42 + ...t.EditRoutesConnectionsByConnectionId.g.cs | 76 ++ .../Baseten.IBasetenClient.GetRoutes.g.cs | 4 +- ...n.IBasetenClient.GetRoutesConnections.g.cs | 62 ++ .../Baseten.JsonConverters.Config.g.cs | 87 ++ .../Baseten.JsonConverters.Config2.g.cs | 87 ++ .../Baseten.JsonConverters.Config3.g.cs | 87 ++ ...nRequestV1ConfigDiscriminatorProvider.g.cs | 53 ++ ...V1ConfigDiscriminatorProviderNullable.g.cs | 60 ++ ...nnectionV1ConfigDiscriminatorProvider.g.cs | 53 ++ ...V1ConfigDiscriminatorProviderNullable.g.cs | 60 ++ ...nRequestV1ConfigDiscriminatorProvider.g.cs | 53 ++ ...V1ConfigDiscriminatorProviderNullable.g.cs | 60 ++ .../Baseten.JsonSerializerContext.g.cs | 77 ++ .../Baseten.JsonSerializerContextTypes.g.cs | 216 +++-- .../Generated/Baseten.Models.Config.Json.g.cs | 141 ++++ .../Generated/Baseten.Models.Config.g.cs | 386 +++++++++ .../Baseten.Models.Config2.Json.g.cs | 141 ++++ .../Generated/Baseten.Models.Config2.g.cs | 386 +++++++++ .../Baseten.Models.Config3.Json.g.cs | 141 ++++ .../Generated/Baseten.Models.Config3.g.cs | 386 +++++++++ ...s.CreateRouteConnectionRequestV1.Json.g.cs | 141 ++++ ...Models.CreateRouteConnectionRequestV1.g.cs | 61 ++ ...tionRequestV1ConfigDiscriminator.Json.g.cs | 141 ++++ ...onnectionRequestV1ConfigDiscriminator.g.cs | 45 + ...nRequestV1ConfigDiscriminatorProvider.g.cs | 57 ++ .../Baseten.Models.CreateRouteRequestV1.g.cs | 4 +- ...odels.RouteConnectionAnthropicV1.Json.g.cs | 141 ++++ ...ten.Models.RouteConnectionAnthropicV1.g.cs | 71 ++ ...RouteConnectionConfigAnthropicV1.Json.g.cs | 141 ++++ ...dels.RouteConnectionConfigAnthropicV1.g.cs | 71 ++ ...ls.RouteConnectionConfigOpenAIV1.Json.g.cs | 141 ++++ ....Models.RouteConnectionConfigOpenAIV1.g.cs | 71 ++ ...odels.RouteConnectionConfigXAIV1.Json.g.cs | 141 ++++ ...ten.Models.RouteConnectionConfigXAIV1.g.cs | 71 ++ ...n.Models.RouteConnectionOpenAIV1.Json.g.cs | 141 ++++ ...aseten.Models.RouteConnectionOpenAIV1.g.cs | 71 ++ ...odels.RouteConnectionTombstoneV1.Json.g.cs | 141 ++++ ...ten.Models.RouteConnectionTombstoneV1.g.cs | 47 ++ ...Baseten.Models.RouteConnectionV1.Json.g.cs | 141 ++++ .../Baseten.Models.RouteConnectionV1.g.cs | 96 +++ ...eConnectionV1ConfigDiscriminator.Json.g.cs | 141 ++++ ....RouteConnectionV1ConfigDiscriminator.g.cs | 45 + ...nnectionV1ConfigDiscriminatorProvider.g.cs | 57 ++ ...eten.Models.RouteConnectionXAIV1.Json.g.cs | 141 ++++ .../Baseten.Models.RouteConnectionXAIV1.g.cs | 71 ++ ...Models.RouteConnectionsRequestV1.Json.g.cs | 141 ++++ ...eten.Models.RouteConnectionsRequestV1.g.cs | 74 ++ ...odels.RouteConnectionsResponseV1.Json.g.cs | 141 ++++ ...ten.Models.RouteConnectionsResponseV1.g.cs | 59 ++ .../Baseten.Models.RoutesRequestV1.g.cs | 4 +- ...RouteConnectionConfigAnthropicV1.Json.g.cs | 141 ++++ ...pdateRouteConnectionConfigAnthropicV1.g.cs | 60 ++ ...ateRouteConnectionConfigOpenAIV1.Json.g.cs | 141 ++++ ...s.UpdateRouteConnectionConfigOpenAIV1.g.cs | 60 ++ ...UpdateRouteConnectionConfigXAIV1.Json.g.cs | 141 ++++ ...dels.UpdateRouteConnectionConfigXAIV1.g.cs | 60 ++ ...s.UpdateRouteConnectionRequestV1.Json.g.cs | 141 ++++ ...Models.UpdateRouteConnectionRequestV1.g.cs | 48 ++ ...tionRequestV1ConfigDiscriminator.Json.g.cs | 141 ++++ ...onnectionRequestV1ConfigDiscriminator.g.cs | 45 + ...nRequestV1ConfigDiscriminatorProvider.g.cs | 57 ++ src/libs/Baseten/openapi.yaml | 766 ++++++++++++++++-- 78 files changed, 9489 insertions(+), 118 deletions(-) create mode 100644 src/cli/Baseten.CLI/Commands/CreateRoutesConnectionsCommandApiCommand.g.cs create mode 100644 src/cli/Baseten.CLI/Commands/DeleteRoutesConnectionsByConnectionIdCommandApiCommand.g.cs create mode 100644 src/cli/Baseten.CLI/Commands/EditRoutesConnectionsByConnectionIdCommandApiCommand.g.cs create mode 100644 src/cli/Baseten.CLI/Commands/GetRoutesConnectionsCommandApiCommand.g.cs create mode 100644 src/libs/Baseten/Generated/Baseten.BasetenClient.CreateRoutesConnections.g.cs create mode 100644 src/libs/Baseten/Generated/Baseten.BasetenClient.DeleteRoutesConnectionsByConnectionId.g.cs create mode 100644 src/libs/Baseten/Generated/Baseten.BasetenClient.EditRoutesConnectionsByConnectionId.g.cs create mode 100644 src/libs/Baseten/Generated/Baseten.BasetenClient.GetRoutesConnections.g.cs create mode 100644 src/libs/Baseten/Generated/Baseten.IBasetenClient.CreateRoutesConnections.g.cs create mode 100644 src/libs/Baseten/Generated/Baseten.IBasetenClient.DeleteRoutesConnectionsByConnectionId.g.cs create mode 100644 src/libs/Baseten/Generated/Baseten.IBasetenClient.EditRoutesConnectionsByConnectionId.g.cs create mode 100644 src/libs/Baseten/Generated/Baseten.IBasetenClient.GetRoutesConnections.g.cs create mode 100644 src/libs/Baseten/Generated/Baseten.JsonConverters.Config.g.cs create mode 100644 src/libs/Baseten/Generated/Baseten.JsonConverters.Config2.g.cs create mode 100644 src/libs/Baseten/Generated/Baseten.JsonConverters.Config3.g.cs create mode 100644 src/libs/Baseten/Generated/Baseten.JsonConverters.CreateRouteConnectionRequestV1ConfigDiscriminatorProvider.g.cs create mode 100644 src/libs/Baseten/Generated/Baseten.JsonConverters.CreateRouteConnectionRequestV1ConfigDiscriminatorProviderNullable.g.cs create mode 100644 src/libs/Baseten/Generated/Baseten.JsonConverters.RouteConnectionV1ConfigDiscriminatorProvider.g.cs create mode 100644 src/libs/Baseten/Generated/Baseten.JsonConverters.RouteConnectionV1ConfigDiscriminatorProviderNullable.g.cs create mode 100644 src/libs/Baseten/Generated/Baseten.JsonConverters.UpdateRouteConnectionRequestV1ConfigDiscriminatorProvider.g.cs create mode 100644 src/libs/Baseten/Generated/Baseten.JsonConverters.UpdateRouteConnectionRequestV1ConfigDiscriminatorProviderNullable.g.cs create mode 100644 src/libs/Baseten/Generated/Baseten.Models.Config.Json.g.cs create mode 100644 src/libs/Baseten/Generated/Baseten.Models.Config.g.cs create mode 100644 src/libs/Baseten/Generated/Baseten.Models.Config2.Json.g.cs create mode 100644 src/libs/Baseten/Generated/Baseten.Models.Config2.g.cs create mode 100644 src/libs/Baseten/Generated/Baseten.Models.Config3.Json.g.cs create mode 100644 src/libs/Baseten/Generated/Baseten.Models.Config3.g.cs create mode 100644 src/libs/Baseten/Generated/Baseten.Models.CreateRouteConnectionRequestV1.Json.g.cs create mode 100644 src/libs/Baseten/Generated/Baseten.Models.CreateRouteConnectionRequestV1.g.cs create mode 100644 src/libs/Baseten/Generated/Baseten.Models.CreateRouteConnectionRequestV1ConfigDiscriminator.Json.g.cs create mode 100644 src/libs/Baseten/Generated/Baseten.Models.CreateRouteConnectionRequestV1ConfigDiscriminator.g.cs create mode 100644 src/libs/Baseten/Generated/Baseten.Models.CreateRouteConnectionRequestV1ConfigDiscriminatorProvider.g.cs create mode 100644 src/libs/Baseten/Generated/Baseten.Models.RouteConnectionAnthropicV1.Json.g.cs create mode 100644 src/libs/Baseten/Generated/Baseten.Models.RouteConnectionAnthropicV1.g.cs create mode 100644 src/libs/Baseten/Generated/Baseten.Models.RouteConnectionConfigAnthropicV1.Json.g.cs create mode 100644 src/libs/Baseten/Generated/Baseten.Models.RouteConnectionConfigAnthropicV1.g.cs create mode 100644 src/libs/Baseten/Generated/Baseten.Models.RouteConnectionConfigOpenAIV1.Json.g.cs create mode 100644 src/libs/Baseten/Generated/Baseten.Models.RouteConnectionConfigOpenAIV1.g.cs create mode 100644 src/libs/Baseten/Generated/Baseten.Models.RouteConnectionConfigXAIV1.Json.g.cs create mode 100644 src/libs/Baseten/Generated/Baseten.Models.RouteConnectionConfigXAIV1.g.cs create mode 100644 src/libs/Baseten/Generated/Baseten.Models.RouteConnectionOpenAIV1.Json.g.cs create mode 100644 src/libs/Baseten/Generated/Baseten.Models.RouteConnectionOpenAIV1.g.cs create mode 100644 src/libs/Baseten/Generated/Baseten.Models.RouteConnectionTombstoneV1.Json.g.cs create mode 100644 src/libs/Baseten/Generated/Baseten.Models.RouteConnectionTombstoneV1.g.cs create mode 100644 src/libs/Baseten/Generated/Baseten.Models.RouteConnectionV1.Json.g.cs create mode 100644 src/libs/Baseten/Generated/Baseten.Models.RouteConnectionV1.g.cs create mode 100644 src/libs/Baseten/Generated/Baseten.Models.RouteConnectionV1ConfigDiscriminator.Json.g.cs create mode 100644 src/libs/Baseten/Generated/Baseten.Models.RouteConnectionV1ConfigDiscriminator.g.cs create mode 100644 src/libs/Baseten/Generated/Baseten.Models.RouteConnectionV1ConfigDiscriminatorProvider.g.cs create mode 100644 src/libs/Baseten/Generated/Baseten.Models.RouteConnectionXAIV1.Json.g.cs create mode 100644 src/libs/Baseten/Generated/Baseten.Models.RouteConnectionXAIV1.g.cs create mode 100644 src/libs/Baseten/Generated/Baseten.Models.RouteConnectionsRequestV1.Json.g.cs create mode 100644 src/libs/Baseten/Generated/Baseten.Models.RouteConnectionsRequestV1.g.cs create mode 100644 src/libs/Baseten/Generated/Baseten.Models.RouteConnectionsResponseV1.Json.g.cs create mode 100644 src/libs/Baseten/Generated/Baseten.Models.RouteConnectionsResponseV1.g.cs create mode 100644 src/libs/Baseten/Generated/Baseten.Models.UpdateRouteConnectionConfigAnthropicV1.Json.g.cs create mode 100644 src/libs/Baseten/Generated/Baseten.Models.UpdateRouteConnectionConfigAnthropicV1.g.cs create mode 100644 src/libs/Baseten/Generated/Baseten.Models.UpdateRouteConnectionConfigOpenAIV1.Json.g.cs create mode 100644 src/libs/Baseten/Generated/Baseten.Models.UpdateRouteConnectionConfigOpenAIV1.g.cs create mode 100644 src/libs/Baseten/Generated/Baseten.Models.UpdateRouteConnectionConfigXAIV1.Json.g.cs create mode 100644 src/libs/Baseten/Generated/Baseten.Models.UpdateRouteConnectionConfigXAIV1.g.cs create mode 100644 src/libs/Baseten/Generated/Baseten.Models.UpdateRouteConnectionRequestV1.Json.g.cs create mode 100644 src/libs/Baseten/Generated/Baseten.Models.UpdateRouteConnectionRequestV1.g.cs create mode 100644 src/libs/Baseten/Generated/Baseten.Models.UpdateRouteConnectionRequestV1ConfigDiscriminator.Json.g.cs create mode 100644 src/libs/Baseten/Generated/Baseten.Models.UpdateRouteConnectionRequestV1ConfigDiscriminator.g.cs create mode 100644 src/libs/Baseten/Generated/Baseten.Models.UpdateRouteConnectionRequestV1ConfigDiscriminatorProvider.g.cs diff --git a/src/cli/Baseten.CLI/Commands/CreateRoutesCommandApiCommand.g.cs b/src/cli/Baseten.CLI/Commands/CreateRoutesCommandApiCommand.g.cs index 4cfd548..49eedb8 100644 --- a/src/cli/Baseten.CLI/Commands/CreateRoutesCommandApiCommand.g.cs +++ b/src/cli/Baseten.CLI/Commands/CreateRoutesCommandApiCommand.g.cs @@ -10,7 +10,7 @@ internal static partial class CreateRoutesCommandApiCommand private static Option TeamId { get; } = new( name: @"--team-id") { - Description = @"Identifier of the team that owns the route. When omitted, uses your organization's default team.", + Description = @"Identifier of the team that owns the route.", }; private static Option DisplayName { get; } = new( diff --git a/src/cli/Baseten.CLI/Commands/CreateRoutesConnectionsCommandApiCommand.g.cs b/src/cli/Baseten.CLI/Commands/CreateRoutesConnectionsCommandApiCommand.g.cs new file mode 100644 index 0000000..ec8cd42 --- /dev/null +++ b/src/cli/Baseten.CLI/Commands/CreateRoutesConnectionsCommandApiCommand.g.cs @@ -0,0 +1,113 @@ +#nullable enable +#pragma warning disable CS0618 + +using System.CommandLine; + +namespace Baseten.CLI.Commands; + +internal static partial class CreateRoutesConnectionsCommandApiCommand +{ + private static Option TeamId { get; } = new( + name: @"--team-id") + { + Description = @"Identifier of the team that owns the connection.", + }; + + private static Option Config { get; } = new( + name: @"--config") + { + Description = @"Provider the connection authenticates with, and the team secret holding its API key.", + Required = true, + }; + private static Option Input { get; } = new(@"--input") + { + Description = "Load request JSON from a file path, '-' for stdin, or an inline JSON object/array string.", + }; + + private static Option RequestJson { get; } = new(@"--request-json") + { + Description = "Request body as JSON.", + Hidden = true, + }; + + private static Option RequestFile { get; } = new(@"--request-file") + { + Description = "Path to a JSON request file, or '-' for stdin.", + Hidden = true, + }; + + private static string FormatResponse(ParseResult parseResult, global::Baseten.RouteConnectionV1 value, global::System.Text.Json.Serialization.JsonSerializerContext context, bool truncateLongStrings) + { + string? text = null; + CustomizeResponseText(parseResult, value, ref text); + if (!string.IsNullOrWhiteSpace(text)) + { + return text; + } + + var hints = new Dictionary(StringComparer.OrdinalIgnoreCase) + { + }; + CustomizeResponseFormatHints(hints); + return CliRuntime.FormatHumanReadable(value, context, truncateLongStrings, hints); + } + + static partial void CustomizeResponseText(ParseResult parseResult, global::Baseten.RouteConnectionV1 value, ref string? text); + static partial void CustomizeResponseFormatHints(Dictionary hints); + + + static partial void CustomizeCommand(ref Command command); + + public static Command Create(string? commandName = null) + { + var command = new Command(commandName ?? @"create-routes-connections", @"Creates a connection +Creates a connection from the team to an upstream provider."); + command.Options.Add(TeamId); + command.Options.Add(Config); + 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::Baseten.SourceGenerationContext.Default, + cancellationToken).ConfigureAwait(false); + var teamId = CliRuntime.WasSpecified(parseResult, TeamId) ? parseResult.GetValue(TeamId) : (__requestBase is { } __TeamIdBaseValue ? __TeamIdBaseValue.TeamId : default); + var config = parseResult.GetRequiredValue(Config); + using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); + + + var response = await client.CreateRoutesConnectionsAsync( + teamId: teamId, + config: config, + cancellationToken: cancellationToken).ConfigureAwait(false); + + + await CliRuntime.WriteResponseAsync( + parseResult, + response, + global::Baseten.SourceGenerationContext.Default, + FormatResponse, + cancellationToken).ConfigureAwait(false); + }, cancellationToken).ConfigureAwait(false)); + CustomizeCommand(ref command); + return command; + } +} \ No newline at end of file diff --git a/src/cli/Baseten.CLI/Commands/DefaultApiGroupCommand.g.cs b/src/cli/Baseten.CLI/Commands/DefaultApiGroupCommand.g.cs index a1f03c6..69ad01d 100644 --- a/src/cli/Baseten.CLI/Commands/DefaultApiGroupCommand.g.cs +++ b/src/cli/Baseten.CLI/Commands/DefaultApiGroupCommand.g.cs @@ -61,6 +61,7 @@ public static Command Create() command.Subcommands.Add(CreateModelsByModelIdEnvironmentsByEnvNameResumePromotionCommandApiCommand.Create()); command.Subcommands.Add(CreatePrepareModelUploadCommandApiCommand.Create()); command.Subcommands.Add(CreateRoutesCommandApiCommand.Create()); + command.Subcommands.Add(CreateRoutesConnectionsCommandApiCommand.Create()); command.Subcommands.Add(CreateSecretsCommandApiCommand.Create()); command.Subcommands.Add(CreateTeamsByTeamIdApiKeysCommandApiCommand.Create()); command.Subcommands.Add(CreateTeamsByTeamIdLlmModelsCommandApiCommand.Create()); @@ -93,6 +94,7 @@ public static Command Create() command.Subcommands.Add(DeleteModelsByModelIdDeploymentsByDeploymentIdReplicasByReplicaIdCommandApiCommand.Create()); command.Subcommands.Add(DeleteModelsByModelIdEnvironmentsByEnvNameCommandApiCommand.Create()); command.Subcommands.Add(DeleteRoutesByRouteIdCommandApiCommand.Create()); + command.Subcommands.Add(DeleteRoutesConnectionsByConnectionIdCommandApiCommand.Create()); command.Subcommands.Add(DeleteSecretsBySecretNameCommandApiCommand.Create()); command.Subcommands.Add(DeleteTeamsByTeamIdSecretsBySecretNameCommandApiCommand.Create()); command.Subcommands.Add(DeleteTrainingProjectsByTrainingProjectIdCommandApiCommand.Create()); @@ -115,6 +117,7 @@ public static Command Create() command.Subcommands.Add(EditModelsByModelIdDeploymentsProductionAutoscalingSettingsCommandApiCommand.Create()); command.Subcommands.Add(EditModelsByModelIdEnvironmentsByEnvNameCommandApiCommand.Create()); command.Subcommands.Add(EditRoutesByRouteIdCommandApiCommand.Create()); + command.Subcommands.Add(EditRoutesConnectionsByConnectionIdCommandApiCommand.Create()); command.Subcommands.Add(EditRoutesSettingsTeamsByTeamIdCommandApiCommand.Create()); command.Subcommands.Add(EditRoutesSettingsUsersByUserIdCommandApiCommand.Create()); command.Subcommands.Add(EditTeamsByTeamIdEnvironmentGroupsByEnvNameCommandApiCommand.Create()); @@ -189,6 +192,7 @@ public static Command Create() command.Subcommands.Add(GetRegionsCommandApiCommand.Create()); command.Subcommands.Add(GetRoutesCommandApiCommand.Create()); command.Subcommands.Add(GetRoutesByRouteIdCommandApiCommand.Create()); + command.Subcommands.Add(GetRoutesConnectionsCommandApiCommand.Create()); command.Subcommands.Add(GetRoutesSettingsTeamsByTeamIdCommandApiCommand.Create()); command.Subcommands.Add(GetRoutesSettingsUsersByUserIdCommandApiCommand.Create()); command.Subcommands.Add(GetRoutesUsageCommandApiCommand.Create()); diff --git a/src/cli/Baseten.CLI/Commands/DeleteRoutesConnectionsByConnectionIdCommandApiCommand.g.cs b/src/cli/Baseten.CLI/Commands/DeleteRoutesConnectionsByConnectionIdCommandApiCommand.g.cs new file mode 100644 index 0000000..a60be7e --- /dev/null +++ b/src/cli/Baseten.CLI/Commands/DeleteRoutesConnectionsByConnectionIdCommandApiCommand.g.cs @@ -0,0 +1,67 @@ +#nullable enable +#pragma warning disable CS0618 + +using System.CommandLine; + +namespace Baseten.CLI.Commands; + +internal static partial class DeleteRoutesConnectionsByConnectionIdCommandApiCommand +{ + private static Argument ConnectionId { get; } = new( + name: @"connection-id") + { + Description = @"This is a missing parameter that was added automatically. Please check the OpenAPI spec.", + }; + + private static string FormatResponse(ParseResult parseResult, global::Baseten.RouteConnectionTombstoneV1 value, global::System.Text.Json.Serialization.JsonSerializerContext context, bool truncateLongStrings) + { + string? text = null; + CustomizeResponseText(parseResult, value, ref text); + if (!string.IsNullOrWhiteSpace(text)) + { + return text; + } + + var hints = new Dictionary(StringComparer.OrdinalIgnoreCase) + { + }; + CustomizeResponseFormatHints(hints); + return CliRuntime.FormatHumanReadable(value, context, truncateLongStrings, hints); + } + + static partial void CustomizeResponseText(ParseResult parseResult, global::Baseten.RouteConnectionTombstoneV1 value, ref string? text); + static partial void CustomizeResponseFormatHints(Dictionary hints); + + + static partial void CustomizeCommand(ref Command command); + + public static Command Create(string? commandName = null) + { + var command = new Command(commandName ?? @"delete-routes-connections-by-connection-id", @"Deletes a connection +Deletes the connection. The team secret it points at is left in place."); + command.Arguments.Add(ConnectionId); + + + command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => + await CliRuntime.RunAsync(async () => + { + var connectionId = parseResult.GetRequiredValue(ConnectionId); + using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); + + + var response = await client.DeleteRoutesConnectionsByConnectionIdAsync( + connectionId: connectionId, + cancellationToken: cancellationToken).ConfigureAwait(false); + + + await CliRuntime.WriteResponseAsync( + parseResult, + response, + global::Baseten.SourceGenerationContext.Default, + FormatResponse, + cancellationToken).ConfigureAwait(false); + }, cancellationToken).ConfigureAwait(false)); + CustomizeCommand(ref command); + return command; + } +} \ No newline at end of file diff --git a/src/cli/Baseten.CLI/Commands/EditRoutesConnectionsByConnectionIdCommandApiCommand.g.cs b/src/cli/Baseten.CLI/Commands/EditRoutesConnectionsByConnectionIdCommandApiCommand.g.cs new file mode 100644 index 0000000..7ab02b2 --- /dev/null +++ b/src/cli/Baseten.CLI/Commands/EditRoutesConnectionsByConnectionIdCommandApiCommand.g.cs @@ -0,0 +1,77 @@ +#nullable enable +#pragma warning disable CS0618 + +using System.CommandLine; + +namespace Baseten.CLI.Commands; + +internal static partial class EditRoutesConnectionsByConnectionIdCommandApiCommand +{ + private static Argument ConnectionId { get; } = new( + name: @"connection-id") + { + Description = @"This is a missing parameter that was added automatically. Please check the OpenAPI spec.", + }; + + private static Option Config { get; } = new( + name: @"--config") + { + Description = @"Connection fields to change. The provider must match the connection and is immutable.", + Required = true, + }; + + private static string FormatResponse(ParseResult parseResult, global::Baseten.RouteConnectionV1 value, global::System.Text.Json.Serialization.JsonSerializerContext context, bool truncateLongStrings) + { + string? text = null; + CustomizeResponseText(parseResult, value, ref text); + if (!string.IsNullOrWhiteSpace(text)) + { + return text; + } + + var hints = new Dictionary(StringComparer.OrdinalIgnoreCase) + { + }; + CustomizeResponseFormatHints(hints); + return CliRuntime.FormatHumanReadable(value, context, truncateLongStrings, hints); + } + + static partial void CustomizeResponseText(ParseResult parseResult, global::Baseten.RouteConnectionV1 value, ref string? text); + static partial void CustomizeResponseFormatHints(Dictionary hints); + + + static partial void CustomizeCommand(ref Command command); + + public static Command Create(string? commandName = null) + { + var command = new Command(commandName ?? @"edit-routes-connections-by-connection-id", @"Updates a connection +Updates the connection's fields. The provider and owning team are immutable; point the connection at a new team secret to change its API key, or rotate the key itself by updating the secret."); + command.Arguments.Add(ConnectionId); + command.Options.Add(Config); + + + command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => + await CliRuntime.RunAsync(async () => + { + var connectionId = parseResult.GetRequiredValue(ConnectionId); + var config = parseResult.GetRequiredValue(Config); + using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); + + + var response = await client.EditRoutesConnectionsByConnectionIdAsync( + connectionId: connectionId, + config: config, + cancellationToken: cancellationToken).ConfigureAwait(false); + + + await CliRuntime.WriteResponseAsync( + parseResult, + response, + global::Baseten.SourceGenerationContext.Default, + FormatResponse, + cancellationToken).ConfigureAwait(false); + }, cancellationToken).ConfigureAwait(false)); + CustomizeCommand(ref command); + return command; + } +} \ No newline at end of file diff --git a/src/cli/Baseten.CLI/Commands/GetRoutesCommandApiCommand.g.cs b/src/cli/Baseten.CLI/Commands/GetRoutesCommandApiCommand.g.cs index 1db9843..7c6ca4b 100644 --- a/src/cli/Baseten.CLI/Commands/GetRoutesCommandApiCommand.g.cs +++ b/src/cli/Baseten.CLI/Commands/GetRoutesCommandApiCommand.g.cs @@ -22,7 +22,7 @@ internal static partial class GetRoutesCommandApiCommand private static Option TeamId { get; } = new( name: @"--team-id") { - Description = @"Filter by owning team ID. Preserved by the cursor; if repeated, must match the original filter.", + Description = @"Identifier of the team whose routes to list.", }; private static Option NameOption { get; } = new( @@ -56,7 +56,7 @@ private static string FormatResponse(ParseResult parseResult, global::Baseten.Ro public static Command Create(string? commandName = null) { var command = new Command(commandName ?? @"get-routes", @"Lists routes -Lists routes you can invoke, newest first, optionally filtered by team and exact name."); +Lists routes you can invoke in the team, newest first, optionally filtered by exact name."); command.Options.Add(Cursor); command.Options.Add(Limit); command.Options.Add(TeamId); diff --git a/src/cli/Baseten.CLI/Commands/GetRoutesConnectionsCommandApiCommand.g.cs b/src/cli/Baseten.CLI/Commands/GetRoutesConnectionsCommandApiCommand.g.cs new file mode 100644 index 0000000..c02408c --- /dev/null +++ b/src/cli/Baseten.CLI/Commands/GetRoutesConnectionsCommandApiCommand.g.cs @@ -0,0 +1,93 @@ +#nullable enable +#pragma warning disable CS0618 + +using System.CommandLine; + +namespace Baseten.CLI.Commands; + +internal static partial class GetRoutesConnectionsCommandApiCommand +{ + private static Option Cursor { get; } = new( + name: @"--cursor") + { + Description = @"Opaque cursor returned by a previous page. Omit to fetch the first page.", + }; + + private static Option Limit { get; } = new( + name: @"--limit") + { + Description = @"Maximum number of items to return.", + }; + + private static Option TeamId { get; } = new( + name: @"--team-id") + { + Description = @"Identifier of the team whose connections to list.", + }; + + private static string FormatResponse(ParseResult parseResult, global::Baseten.RouteConnectionsResponseV1 value, global::System.Text.Json.Serialization.JsonSerializerContext context, bool truncateLongStrings) + { + string? text = null; + CustomizeResponseText(parseResult, value, ref text); + if (!string.IsNullOrWhiteSpace(text)) + { + return text; + } + + var hints = new Dictionary(StringComparer.OrdinalIgnoreCase) + { + }; + CustomizeResponseFormatHints(hints); + return CliRuntime.FormatHumanReadable(value, context, truncateLongStrings, hints); + } + + static partial void CustomizeResponseText(ParseResult parseResult, global::Baseten.RouteConnectionsResponseV1 value, ref string? text); + static partial void CustomizeResponseFormatHints(Dictionary hints); + + + static partial void CustomizeCommand(ref Command command); + + public static Command Create(string? commandName = null) + { + var command = new Command(commandName ?? @"get-routes-connections", @"Lists connections +Lists the team's connections, newest first."); + command.Options.Add(Cursor); + command.Options.Add(Limit); + command.Options.Add(TeamId); + + + command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => + await CliRuntime.RunAsync(async () => + { + var cursor = parseResult.GetValue(Cursor); + var limit = parseResult.GetValue(Limit); + var teamId = parseResult.GetValue(TeamId); + using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); + + + var response = await client.GetRoutesConnectionsAsync( + cursor: cursor, + limit: limit, + teamId: teamId, + cancellationToken: cancellationToken).ConfigureAwait(false); + + + if (!await CliRuntime.TryWriteOutputDirectoryAsync( + parseResult, + response, + global::Baseten.SourceGenerationContext.Default, + @"Items", + cancellationToken).ConfigureAwait(false)) + { + await CliRuntime.WriteResponseAsync( + parseResult, + response, + global::Baseten.SourceGenerationContext.Default, + FormatResponse, + cancellationToken).ConfigureAwait(false); + } + }, cancellationToken).ConfigureAwait(false)); + CustomizeCommand(ref command); + return command; + } +} \ No newline at end of file diff --git a/src/libs/Baseten/Generated/Baseten.BasetenClient.CreateRoutes.g.cs b/src/libs/Baseten/Generated/Baseten.BasetenClient.CreateRoutes.g.cs index 9d616fc..94868f8 100644 --- a/src/libs/Baseten/Generated/Baseten.BasetenClient.CreateRoutes.g.cs +++ b/src/libs/Baseten/Generated/Baseten.BasetenClient.CreateRoutes.g.cs @@ -466,7 +466,7 @@ partial void ProcessCreateRoutesResponseContent( /// Creates and derives a name for the provided route configuration /// /// - /// Identifier of the team that owns the route. When omitted, uses your organization's default team.
+ /// Identifier of the team that owns the route.
/// Default Value: openapi-json-null-sentinel-value-2BF93600-0FE4-4250-987A-E5DDB203E464 /// /// diff --git a/src/libs/Baseten/Generated/Baseten.BasetenClient.CreateRoutesConnections.g.cs b/src/libs/Baseten/Generated/Baseten.BasetenClient.CreateRoutesConnections.g.cs new file mode 100644 index 0000000..04096d4 --- /dev/null +++ b/src/libs/Baseten/Generated/Baseten.BasetenClient.CreateRoutesConnections.g.cs @@ -0,0 +1,492 @@ + +#nullable enable + +namespace Baseten +{ + public partial class BasetenClient + { + + + private static readonly global::Baseten.EndPointSecurityRequirement s_CreateRoutesConnectionsSecurityRequirement0 = + new global::Baseten.EndPointSecurityRequirement + { + Authorizations = new global::Baseten.EndPointAuthorizationRequirement[] + { new global::Baseten.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::Baseten.EndPointSecurityRequirement[] s_CreateRoutesConnectionsSecurityRequirements = + new global::Baseten.EndPointSecurityRequirement[] + { s_CreateRoutesConnectionsSecurityRequirement0, + }; + partial void PrepareCreateRoutesConnectionsArguments( + global::System.Net.Http.HttpClient httpClient, + global::Baseten.CreateRouteConnectionRequestV1 request); + partial void PrepareCreateRoutesConnectionsRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + global::Baseten.CreateRouteConnectionRequestV1 request); + partial void ProcessCreateRoutesConnectionsResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessCreateRoutesConnectionsResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Creates a connection
+ /// Creates a connection from the team to an upstream provider. + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + /// + /// curl --request POST \
+ /// --url https://api.baseten.co/v1/routes/connections \
+ /// --header "Authorization: Bearer $BASETEN_API_KEY" \
+ /// --data '{
+ /// "team_id": "abc1234",
+ /// "config": {
+ /// "provider": "ANTHROPIC",
+ /// "secret_id": "abc1234"
+ /// }
+ /// }' + ///
+ public async global::System.Threading.Tasks.Task CreateRoutesConnectionsAsync( + + global::Baseten.CreateRouteConnectionRequestV1 request, + global::Baseten.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await CreateRoutesConnectionsAsResponseAsync( + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Creates a connection
+ /// Creates a connection from the team to an upstream provider. + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + /// + /// curl --request POST \
+ /// --url https://api.baseten.co/v1/routes/connections \
+ /// --header "Authorization: Bearer $BASETEN_API_KEY" \
+ /// --data '{
+ /// "team_id": "abc1234",
+ /// "config": {
+ /// "provider": "ANTHROPIC",
+ /// "secret_id": "abc1234"
+ /// }
+ /// }' + ///
+ public async global::System.Threading.Tasks.Task> CreateRoutesConnectionsAsResponseAsync( + + global::Baseten.CreateRouteConnectionRequestV1 request, + global::Baseten.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + request = request ?? throw new global::System.ArgumentNullException(nameof(request)); + + PrepareArguments( + client: HttpClient); + PrepareCreateRoutesConnectionsArguments( + httpClient: HttpClient, + request: request); + + + var __authorizations = global::Baseten.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_CreateRoutesConnectionsSecurityRequirements, + operationName: "CreateRoutesConnectionsAsync"); + + using var __timeoutCancellationTokenSource = global::Baseten.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::Baseten.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::Baseten.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::Baseten.PathBuilder( + path: "/v1/routes/connections", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::Baseten.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Post, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.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::Baseten.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareCreateRoutesConnectionsRequest( + 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::Baseten.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::Baseten.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "createRoutesConnections", + methodName: "CreateRoutesConnectionsAsync", + pathTemplate: "\"/v1/routes/connections\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::Baseten.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::Baseten.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Baseten.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "createRoutesConnections", + methodName: "CreateRoutesConnectionsAsync", + pathTemplate: "\"/v1/routes/connections\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::Baseten.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::Baseten.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::Baseten.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::Baseten.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Baseten.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "createRoutesConnections", + methodName: "CreateRoutesConnectionsAsync", + pathTemplate: "\"/v1/routes/connections\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::Baseten.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessCreateRoutesConnectionsResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::Baseten.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::Baseten.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "createRoutesConnections", + methodName: "CreateRoutesConnectionsAsync", + pathTemplate: "\"/v1/routes/connections\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::Baseten.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Baseten.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "createRoutesConnections", + methodName: "CreateRoutesConnectionsAsync", + pathTemplate: "\"/v1/routes/connections\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __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); + ProcessCreateRoutesConnectionsResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::Baseten.RouteConnectionV1.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Baseten.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Baseten.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::Baseten.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + var __value = await global::Baseten.RouteConnectionV1.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Baseten.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Baseten.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::Baseten.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + /// + /// Creates a connection
+ /// Creates a connection from the team to an upstream provider. + ///
+ /// + /// Identifier of the team that owns the connection.
+ /// Default Value: openapi-json-null-sentinel-value-2BF93600-0FE4-4250-987A-E5DDB203E464 + /// + /// + /// Provider the connection authenticates with, and the team secret holding its API key. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task CreateRoutesConnectionsAsync( + global::Baseten.Config2 config, + string? teamId = default, + global::Baseten.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __request = new global::Baseten.CreateRouteConnectionRequestV1 + { + TeamId = teamId, + Config = config, + }; + + return await CreateRoutesConnectionsAsync( + request: __request, + requestOptions: requestOptions, + cancellationToken: cancellationToken).ConfigureAwait(false); + } + } +} \ No newline at end of file diff --git a/src/libs/Baseten/Generated/Baseten.BasetenClient.DeleteRoutesConnectionsByConnectionId.g.cs b/src/libs/Baseten/Generated/Baseten.BasetenClient.DeleteRoutesConnectionsByConnectionId.g.cs new file mode 100644 index 0000000..d96b297 --- /dev/null +++ b/src/libs/Baseten/Generated/Baseten.BasetenClient.DeleteRoutesConnectionsByConnectionId.g.cs @@ -0,0 +1,436 @@ + +#nullable enable + +namespace Baseten +{ + public partial class BasetenClient + { + + + private static readonly global::Baseten.EndPointSecurityRequirement s_DeleteRoutesConnectionsByConnectionIdSecurityRequirement0 = + new global::Baseten.EndPointSecurityRequirement + { + Authorizations = new global::Baseten.EndPointAuthorizationRequirement[] + { new global::Baseten.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::Baseten.EndPointSecurityRequirement[] s_DeleteRoutesConnectionsByConnectionIdSecurityRequirements = + new global::Baseten.EndPointSecurityRequirement[] + { s_DeleteRoutesConnectionsByConnectionIdSecurityRequirement0, + }; + partial void PrepareDeleteRoutesConnectionsByConnectionIdArguments( + global::System.Net.Http.HttpClient httpClient, + ref string connectionId); + partial void PrepareDeleteRoutesConnectionsByConnectionIdRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string connectionId); + partial void ProcessDeleteRoutesConnectionsByConnectionIdResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessDeleteRoutesConnectionsByConnectionIdResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Deletes a connection
+ /// Deletes the connection. The team secret it points at is left in place. + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + /// + /// curl --request DELETE \
+ /// --url https://api.baseten.co/v1/routes/connections/{connection_id} \
+ /// --header "Authorization: Bearer $BASETEN_API_KEY" + ///
+ public async global::System.Threading.Tasks.Task DeleteRoutesConnectionsByConnectionIdAsync( + string connectionId, + global::Baseten.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await DeleteRoutesConnectionsByConnectionIdAsResponseAsync( + connectionId: connectionId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Deletes a connection
+ /// Deletes the connection. The team secret it points at is left in place. + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + /// + /// curl --request DELETE \
+ /// --url https://api.baseten.co/v1/routes/connections/{connection_id} \
+ /// --header "Authorization: Bearer $BASETEN_API_KEY" + ///
+ public async global::System.Threading.Tasks.Task> DeleteRoutesConnectionsByConnectionIdAsResponseAsync( + string connectionId, + global::Baseten.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareDeleteRoutesConnectionsByConnectionIdArguments( + httpClient: HttpClient, + connectionId: ref connectionId); + + + var __authorizations = global::Baseten.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_DeleteRoutesConnectionsByConnectionIdSecurityRequirements, + operationName: "DeleteRoutesConnectionsByConnectionIdAsync"); + + using var __timeoutCancellationTokenSource = global::Baseten.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::Baseten.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::Baseten.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::Baseten.PathBuilder( + path: $"/v1/routes/connections/{connectionId}", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::Baseten.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::Baseten.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareDeleteRoutesConnectionsByConnectionIdRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + connectionId: connectionId); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::Baseten.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::Baseten.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "deleteRoutesConnectionsByConnectionId", + methodName: "DeleteRoutesConnectionsByConnectionIdAsync", + pathTemplate: "$\"/v1/routes/connections/{connectionId}\"", + httpMethod: "DELETE", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::Baseten.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::Baseten.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Baseten.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "deleteRoutesConnectionsByConnectionId", + methodName: "DeleteRoutesConnectionsByConnectionIdAsync", + pathTemplate: "$\"/v1/routes/connections/{connectionId}\"", + httpMethod: "DELETE", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::Baseten.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::Baseten.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::Baseten.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::Baseten.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Baseten.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "deleteRoutesConnectionsByConnectionId", + methodName: "DeleteRoutesConnectionsByConnectionIdAsync", + pathTemplate: "$\"/v1/routes/connections/{connectionId}\"", + httpMethod: "DELETE", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::Baseten.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessDeleteRoutesConnectionsByConnectionIdResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::Baseten.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::Baseten.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "deleteRoutesConnectionsByConnectionId", + methodName: "DeleteRoutesConnectionsByConnectionIdAsync", + pathTemplate: "$\"/v1/routes/connections/{connectionId}\"", + httpMethod: "DELETE", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::Baseten.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Baseten.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "deleteRoutesConnectionsByConnectionId", + methodName: "DeleteRoutesConnectionsByConnectionIdAsync", + pathTemplate: "$\"/v1/routes/connections/{connectionId}\"", + httpMethod: "DELETE", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __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); + ProcessDeleteRoutesConnectionsByConnectionIdResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::Baseten.RouteConnectionTombstoneV1.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Baseten.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Baseten.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::Baseten.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + var __value = await global::Baseten.RouteConnectionTombstoneV1.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Baseten.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Baseten.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::Baseten.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/Baseten/Generated/Baseten.BasetenClient.EditRoutesConnectionsByConnectionId.g.cs b/src/libs/Baseten/Generated/Baseten.BasetenClient.EditRoutesConnectionsByConnectionId.g.cs new file mode 100644 index 0000000..83ca705 --- /dev/null +++ b/src/libs/Baseten/Generated/Baseten.BasetenClient.EditRoutesConnectionsByConnectionId.g.cs @@ -0,0 +1,496 @@ + +#nullable enable + +namespace Baseten +{ + public partial class BasetenClient + { + + + private static readonly global::Baseten.EndPointSecurityRequirement s_EditRoutesConnectionsByConnectionIdSecurityRequirement0 = + new global::Baseten.EndPointSecurityRequirement + { + Authorizations = new global::Baseten.EndPointAuthorizationRequirement[] + { new global::Baseten.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::Baseten.EndPointSecurityRequirement[] s_EditRoutesConnectionsByConnectionIdSecurityRequirements = + new global::Baseten.EndPointSecurityRequirement[] + { s_EditRoutesConnectionsByConnectionIdSecurityRequirement0, + }; + partial void PrepareEditRoutesConnectionsByConnectionIdArguments( + global::System.Net.Http.HttpClient httpClient, + ref string connectionId, + global::Baseten.UpdateRouteConnectionRequestV1 request); + partial void PrepareEditRoutesConnectionsByConnectionIdRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string connectionId, + global::Baseten.UpdateRouteConnectionRequestV1 request); + partial void ProcessEditRoutesConnectionsByConnectionIdResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessEditRoutesConnectionsByConnectionIdResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Updates a connection
+ /// Updates the connection's fields. The provider and owning team are immutable; point the connection at a new team secret to change its API key, or rotate the key itself by updating the secret. + ///
+ /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + /// + /// curl --request PATCH \
+ /// --url https://api.baseten.co/v1/routes/connections/{connection_id} \
+ /// --header "Authorization: Bearer $BASETEN_API_KEY" \
+ /// --data '{
+ /// "config": {
+ /// "provider": "ANTHROPIC",
+ /// "secret_id": "abc1234"
+ /// }
+ /// }' + ///
+ public async global::System.Threading.Tasks.Task EditRoutesConnectionsByConnectionIdAsync( + string connectionId, + + global::Baseten.UpdateRouteConnectionRequestV1 request, + global::Baseten.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await EditRoutesConnectionsByConnectionIdAsResponseAsync( + connectionId: connectionId, + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Updates a connection
+ /// Updates the connection's fields. The provider and owning team are immutable; point the connection at a new team secret to change its API key, or rotate the key itself by updating the secret. + ///
+ /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + /// + /// curl --request PATCH \
+ /// --url https://api.baseten.co/v1/routes/connections/{connection_id} \
+ /// --header "Authorization: Bearer $BASETEN_API_KEY" \
+ /// --data '{
+ /// "config": {
+ /// "provider": "ANTHROPIC",
+ /// "secret_id": "abc1234"
+ /// }
+ /// }' + ///
+ public async global::System.Threading.Tasks.Task> EditRoutesConnectionsByConnectionIdAsResponseAsync( + string connectionId, + + global::Baseten.UpdateRouteConnectionRequestV1 request, + global::Baseten.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + request = request ?? throw new global::System.ArgumentNullException(nameof(request)); + + PrepareArguments( + client: HttpClient); + PrepareEditRoutesConnectionsByConnectionIdArguments( + httpClient: HttpClient, + connectionId: ref connectionId, + request: request); + + + var __authorizations = global::Baseten.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_EditRoutesConnectionsByConnectionIdSecurityRequirements, + operationName: "EditRoutesConnectionsByConnectionIdAsync"); + + using var __timeoutCancellationTokenSource = global::Baseten.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::Baseten.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::Baseten.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::Baseten.PathBuilder( + path: $"/v1/routes/connections/{connectionId}", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::Baseten.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); + } + } + var __httpRequestContentBody = request.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::Baseten.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareEditRoutesConnectionsByConnectionIdRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + connectionId: connectionId, + 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::Baseten.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::Baseten.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "editRoutesConnectionsByConnectionId", + methodName: "EditRoutesConnectionsByConnectionIdAsync", + pathTemplate: "$\"/v1/routes/connections/{connectionId}\"", + httpMethod: "PATCH", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::Baseten.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::Baseten.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Baseten.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "editRoutesConnectionsByConnectionId", + methodName: "EditRoutesConnectionsByConnectionIdAsync", + pathTemplate: "$\"/v1/routes/connections/{connectionId}\"", + httpMethod: "PATCH", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::Baseten.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::Baseten.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::Baseten.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::Baseten.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Baseten.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "editRoutesConnectionsByConnectionId", + methodName: "EditRoutesConnectionsByConnectionIdAsync", + pathTemplate: "$\"/v1/routes/connections/{connectionId}\"", + httpMethod: "PATCH", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::Baseten.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessEditRoutesConnectionsByConnectionIdResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::Baseten.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::Baseten.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "editRoutesConnectionsByConnectionId", + methodName: "EditRoutesConnectionsByConnectionIdAsync", + pathTemplate: "$\"/v1/routes/connections/{connectionId}\"", + httpMethod: "PATCH", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::Baseten.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Baseten.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "editRoutesConnectionsByConnectionId", + methodName: "EditRoutesConnectionsByConnectionIdAsync", + pathTemplate: "$\"/v1/routes/connections/{connectionId}\"", + httpMethod: "PATCH", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __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); + ProcessEditRoutesConnectionsByConnectionIdResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::Baseten.RouteConnectionV1.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Baseten.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Baseten.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::Baseten.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + var __value = await global::Baseten.RouteConnectionV1.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Baseten.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Baseten.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::Baseten.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + /// + /// Updates a connection
+ /// Updates the connection's fields. The provider and owning team are immutable; point the connection at a new team secret to change its API key, or rotate the key itself by updating the secret. + ///
+ /// + /// + /// Connection fields to change. The provider must match the connection and is immutable. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task EditRoutesConnectionsByConnectionIdAsync( + string connectionId, + global::Baseten.Config3 config, + global::Baseten.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __request = new global::Baseten.UpdateRouteConnectionRequestV1 + { + Config = config, + }; + + return await EditRoutesConnectionsByConnectionIdAsync( + connectionId: connectionId, + request: __request, + requestOptions: requestOptions, + cancellationToken: cancellationToken).ConfigureAwait(false); + } + } +} \ No newline at end of file diff --git a/src/libs/Baseten/Generated/Baseten.BasetenClient.GetRoutes.g.cs b/src/libs/Baseten/Generated/Baseten.BasetenClient.GetRoutes.g.cs index cf2a653..4ba1b13 100644 --- a/src/libs/Baseten/Generated/Baseten.BasetenClient.GetRoutes.g.cs +++ b/src/libs/Baseten/Generated/Baseten.BasetenClient.GetRoutes.g.cs @@ -49,7 +49,7 @@ partial void ProcessGetRoutesResponseContent( /// /// Lists routes
- /// Lists routes you can invoke, newest first, optionally filtered by team and exact name. + /// Lists routes you can invoke in the team, newest first, optionally filtered by exact name. ///
/// /// Default Value: openapi-json-null-sentinel-value-2BF93600-0FE4-4250-987A-E5DDB203E464 @@ -92,7 +92,7 @@ partial void ProcessGetRoutesResponseContent( } /// /// Lists routes
- /// Lists routes you can invoke, newest first, optionally filtered by team and exact name. + /// Lists routes you can invoke in the team, newest first, optionally filtered by exact name. ///
/// /// Default Value: openapi-json-null-sentinel-value-2BF93600-0FE4-4250-987A-E5DDB203E464 diff --git a/src/libs/Baseten/Generated/Baseten.BasetenClient.GetRoutesConnections.g.cs b/src/libs/Baseten/Generated/Baseten.BasetenClient.GetRoutesConnections.g.cs new file mode 100644 index 0000000..d50c951 --- /dev/null +++ b/src/libs/Baseten/Generated/Baseten.BasetenClient.GetRoutesConnections.g.cs @@ -0,0 +1,471 @@ + +#nullable enable + +namespace Baseten +{ + public partial class BasetenClient + { + + + private static readonly global::Baseten.EndPointSecurityRequirement s_GetRoutesConnectionsSecurityRequirement0 = + new global::Baseten.EndPointSecurityRequirement + { + Authorizations = new global::Baseten.EndPointAuthorizationRequirement[] + { new global::Baseten.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::Baseten.EndPointSecurityRequirement[] s_GetRoutesConnectionsSecurityRequirements = + new global::Baseten.EndPointSecurityRequirement[] + { s_GetRoutesConnectionsSecurityRequirement0, + }; + partial void PrepareGetRoutesConnectionsArguments( + global::System.Net.Http.HttpClient httpClient, + ref string? cursor, + ref int? limit, + ref string? teamId); + partial void PrepareGetRoutesConnectionsRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string? cursor, + int? limit, + string? teamId); + partial void ProcessGetRoutesConnectionsResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessGetRoutesConnectionsResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Lists connections
+ /// Lists the team's connections, newest first. + ///
+ /// + /// Default Value: openapi-json-null-sentinel-value-2BF93600-0FE4-4250-987A-E5DDB203E464 + /// + /// + /// Default Value: 100 + /// + /// + /// Default Value: openapi-json-null-sentinel-value-2BF93600-0FE4-4250-987A-E5DDB203E464 + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + /// + /// curl --request GET \
+ /// --url https://api.baseten.co/v1/routes/connections \
+ /// --header "Authorization: Bearer $BASETEN_API_KEY" + ///
+ public async global::System.Threading.Tasks.Task GetRoutesConnectionsAsync( + string? cursor = default, + int? limit = default, + string? teamId = default, + global::Baseten.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await GetRoutesConnectionsAsResponseAsync( + cursor: cursor, + limit: limit, + teamId: teamId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Lists connections
+ /// Lists the team's connections, newest first. + ///
+ /// + /// Default Value: openapi-json-null-sentinel-value-2BF93600-0FE4-4250-987A-E5DDB203E464 + /// + /// + /// Default Value: 100 + /// + /// + /// Default Value: openapi-json-null-sentinel-value-2BF93600-0FE4-4250-987A-E5DDB203E464 + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + /// + /// curl --request GET \
+ /// --url https://api.baseten.co/v1/routes/connections \
+ /// --header "Authorization: Bearer $BASETEN_API_KEY" + ///
+ public async global::System.Threading.Tasks.Task> GetRoutesConnectionsAsResponseAsync( + string? cursor = default, + int? limit = default, + string? teamId = default, + global::Baseten.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareGetRoutesConnectionsArguments( + httpClient: HttpClient, + cursor: ref cursor, + limit: ref limit, + teamId: ref teamId); + + + var __authorizations = global::Baseten.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_GetRoutesConnectionsSecurityRequirements, + operationName: "GetRoutesConnectionsAsync"); + + using var __timeoutCancellationTokenSource = global::Baseten.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::Baseten.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::Baseten.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::Baseten.PathBuilder( + path: "/v1/routes/connections", + baseUri: HttpClient.BaseAddress); + __pathBuilder + .AddOptionalParameter("cursor", cursor) + .AddOptionalParameter("limit", limit?.ToString()) + .AddOptionalParameter("team_id", teamId) + ; + var __path = __pathBuilder.ToString(); + __path = global::Baseten.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Get, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.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::Baseten.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareGetRoutesConnectionsRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + cursor: cursor, + limit: limit, + teamId: teamId); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::Baseten.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::Baseten.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "getRoutesConnections", + methodName: "GetRoutesConnectionsAsync", + pathTemplate: "\"/v1/routes/connections\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::Baseten.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::Baseten.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Baseten.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "getRoutesConnections", + methodName: "GetRoutesConnectionsAsync", + pathTemplate: "\"/v1/routes/connections\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::Baseten.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::Baseten.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::Baseten.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::Baseten.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Baseten.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "getRoutesConnections", + methodName: "GetRoutesConnectionsAsync", + pathTemplate: "\"/v1/routes/connections\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::Baseten.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessGetRoutesConnectionsResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::Baseten.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::Baseten.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "getRoutesConnections", + methodName: "GetRoutesConnectionsAsync", + pathTemplate: "\"/v1/routes/connections\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::Baseten.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Baseten.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "getRoutesConnections", + methodName: "GetRoutesConnectionsAsync", + pathTemplate: "\"/v1/routes/connections\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __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); + ProcessGetRoutesConnectionsResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::Baseten.RouteConnectionsResponseV1.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Baseten.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Baseten.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::Baseten.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + var __value = await global::Baseten.RouteConnectionsResponseV1.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Baseten.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Baseten.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::Baseten.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/Baseten/Generated/Baseten.IBasetenClient.CreateRoutes.g.cs b/src/libs/Baseten/Generated/Baseten.IBasetenClient.CreateRoutes.g.cs index 181e13a..6daf4b7 100644 --- a/src/libs/Baseten/Generated/Baseten.IBasetenClient.CreateRoutes.g.cs +++ b/src/libs/Baseten/Generated/Baseten.IBasetenClient.CreateRoutes.g.cs @@ -63,7 +63,7 @@ public partial interface IBasetenClient /// Creates and derives a name for the provided route configuration /// /// - /// Identifier of the team that owns the route. When omitted, uses your organization's default team.
+ /// Identifier of the team that owns the route.
/// Default Value: openapi-json-null-sentinel-value-2BF93600-0FE4-4250-987A-E5DDB203E464 /// /// diff --git a/src/libs/Baseten/Generated/Baseten.IBasetenClient.CreateRoutesConnections.g.cs b/src/libs/Baseten/Generated/Baseten.IBasetenClient.CreateRoutesConnections.g.cs new file mode 100644 index 0000000..bfb2ddf --- /dev/null +++ b/src/libs/Baseten/Generated/Baseten.IBasetenClient.CreateRoutesConnections.g.cs @@ -0,0 +1,77 @@ +#nullable enable + +namespace Baseten +{ + public partial interface IBasetenClient + { + /// + /// Creates a connection
+ /// Creates a connection from the team to an upstream provider. + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + /// + /// curl --request POST \
+ /// --url https://api.baseten.co/v1/routes/connections \
+ /// --header "Authorization: Bearer $BASETEN_API_KEY" \
+ /// --data '{
+ /// "team_id": "abc1234",
+ /// "config": {
+ /// "provider": "ANTHROPIC",
+ /// "secret_id": "abc1234"
+ /// }
+ /// }' + ///
+ global::System.Threading.Tasks.Task CreateRoutesConnectionsAsync( + + global::Baseten.CreateRouteConnectionRequestV1 request, + global::Baseten.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Creates a connection
+ /// Creates a connection from the team to an upstream provider. + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + /// + /// curl --request POST \
+ /// --url https://api.baseten.co/v1/routes/connections \
+ /// --header "Authorization: Bearer $BASETEN_API_KEY" \
+ /// --data '{
+ /// "team_id": "abc1234",
+ /// "config": {
+ /// "provider": "ANTHROPIC",
+ /// "secret_id": "abc1234"
+ /// }
+ /// }' + ///
+ global::System.Threading.Tasks.Task> CreateRoutesConnectionsAsResponseAsync( + + global::Baseten.CreateRouteConnectionRequestV1 request, + global::Baseten.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Creates a connection
+ /// Creates a connection from the team to an upstream provider. + ///
+ /// + /// Identifier of the team that owns the connection.
+ /// Default Value: openapi-json-null-sentinel-value-2BF93600-0FE4-4250-987A-E5DDB203E464 + /// + /// + /// Provider the connection authenticates with, and the team secret holding its API key. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task CreateRoutesConnectionsAsync( + global::Baseten.Config2 config, + string? teamId = default, + global::Baseten.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/Baseten/Generated/Baseten.IBasetenClient.DeleteRoutesConnectionsByConnectionId.g.cs b/src/libs/Baseten/Generated/Baseten.IBasetenClient.DeleteRoutesConnectionsByConnectionId.g.cs new file mode 100644 index 0000000..60f88cc --- /dev/null +++ b/src/libs/Baseten/Generated/Baseten.IBasetenClient.DeleteRoutesConnectionsByConnectionId.g.cs @@ -0,0 +1,42 @@ +#nullable enable + +namespace Baseten +{ + public partial interface IBasetenClient + { + /// + /// Deletes a connection
+ /// Deletes the connection. The team secret it points at is left in place. + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + /// + /// curl --request DELETE \
+ /// --url https://api.baseten.co/v1/routes/connections/{connection_id} \
+ /// --header "Authorization: Bearer $BASETEN_API_KEY" + ///
+ global::System.Threading.Tasks.Task DeleteRoutesConnectionsByConnectionIdAsync( + string connectionId, + global::Baseten.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Deletes a connection
+ /// Deletes the connection. The team secret it points at is left in place. + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + /// + /// curl --request DELETE \
+ /// --url https://api.baseten.co/v1/routes/connections/{connection_id} \
+ /// --header "Authorization: Bearer $BASETEN_API_KEY" + ///
+ global::System.Threading.Tasks.Task> DeleteRoutesConnectionsByConnectionIdAsResponseAsync( + string connectionId, + global::Baseten.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/Baseten/Generated/Baseten.IBasetenClient.EditRoutesConnectionsByConnectionId.g.cs b/src/libs/Baseten/Generated/Baseten.IBasetenClient.EditRoutesConnectionsByConnectionId.g.cs new file mode 100644 index 0000000..bcb38c0 --- /dev/null +++ b/src/libs/Baseten/Generated/Baseten.IBasetenClient.EditRoutesConnectionsByConnectionId.g.cs @@ -0,0 +1,76 @@ +#nullable enable + +namespace Baseten +{ + public partial interface IBasetenClient + { + /// + /// Updates a connection
+ /// Updates the connection's fields. The provider and owning team are immutable; point the connection at a new team secret to change its API key, or rotate the key itself by updating the secret. + ///
+ /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + /// + /// curl --request PATCH \
+ /// --url https://api.baseten.co/v1/routes/connections/{connection_id} \
+ /// --header "Authorization: Bearer $BASETEN_API_KEY" \
+ /// --data '{
+ /// "config": {
+ /// "provider": "ANTHROPIC",
+ /// "secret_id": "abc1234"
+ /// }
+ /// }' + ///
+ global::System.Threading.Tasks.Task EditRoutesConnectionsByConnectionIdAsync( + string connectionId, + + global::Baseten.UpdateRouteConnectionRequestV1 request, + global::Baseten.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Updates a connection
+ /// Updates the connection's fields. The provider and owning team are immutable; point the connection at a new team secret to change its API key, or rotate the key itself by updating the secret. + ///
+ /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + /// + /// curl --request PATCH \
+ /// --url https://api.baseten.co/v1/routes/connections/{connection_id} \
+ /// --header "Authorization: Bearer $BASETEN_API_KEY" \
+ /// --data '{
+ /// "config": {
+ /// "provider": "ANTHROPIC",
+ /// "secret_id": "abc1234"
+ /// }
+ /// }' + ///
+ global::System.Threading.Tasks.Task> EditRoutesConnectionsByConnectionIdAsResponseAsync( + string connectionId, + + global::Baseten.UpdateRouteConnectionRequestV1 request, + global::Baseten.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Updates a connection
+ /// Updates the connection's fields. The provider and owning team are immutable; point the connection at a new team secret to change its API key, or rotate the key itself by updating the secret. + ///
+ /// + /// + /// Connection fields to change. The provider must match the connection and is immutable. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task EditRoutesConnectionsByConnectionIdAsync( + string connectionId, + global::Baseten.Config3 config, + global::Baseten.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/Baseten/Generated/Baseten.IBasetenClient.GetRoutes.g.cs b/src/libs/Baseten/Generated/Baseten.IBasetenClient.GetRoutes.g.cs index 360d388..54f49e9 100644 --- a/src/libs/Baseten/Generated/Baseten.IBasetenClient.GetRoutes.g.cs +++ b/src/libs/Baseten/Generated/Baseten.IBasetenClient.GetRoutes.g.cs @@ -6,7 +6,7 @@ public partial interface IBasetenClient { /// /// Lists routes
- /// Lists routes you can invoke, newest first, optionally filtered by team and exact name. + /// Lists routes you can invoke in the team, newest first, optionally filtered by exact name. ///
/// /// Default Value: openapi-json-null-sentinel-value-2BF93600-0FE4-4250-987A-E5DDB203E464 @@ -37,7 +37,7 @@ public partial interface IBasetenClient global::System.Threading.CancellationToken cancellationToken = default); /// /// Lists routes
- /// Lists routes you can invoke, newest first, optionally filtered by team and exact name. + /// Lists routes you can invoke in the team, newest first, optionally filtered by exact name. ///
/// /// Default Value: openapi-json-null-sentinel-value-2BF93600-0FE4-4250-987A-E5DDB203E464 diff --git a/src/libs/Baseten/Generated/Baseten.IBasetenClient.GetRoutesConnections.g.cs b/src/libs/Baseten/Generated/Baseten.IBasetenClient.GetRoutesConnections.g.cs new file mode 100644 index 0000000..c73aabb --- /dev/null +++ b/src/libs/Baseten/Generated/Baseten.IBasetenClient.GetRoutesConnections.g.cs @@ -0,0 +1,62 @@ +#nullable enable + +namespace Baseten +{ + public partial interface IBasetenClient + { + /// + /// Lists connections
+ /// Lists the team's connections, newest first. + ///
+ /// + /// Default Value: openapi-json-null-sentinel-value-2BF93600-0FE4-4250-987A-E5DDB203E464 + /// + /// + /// Default Value: 100 + /// + /// + /// Default Value: openapi-json-null-sentinel-value-2BF93600-0FE4-4250-987A-E5DDB203E464 + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + /// + /// curl --request GET \
+ /// --url https://api.baseten.co/v1/routes/connections \
+ /// --header "Authorization: Bearer $BASETEN_API_KEY" + ///
+ global::System.Threading.Tasks.Task GetRoutesConnectionsAsync( + string? cursor = default, + int? limit = default, + string? teamId = default, + global::Baseten.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Lists connections
+ /// Lists the team's connections, newest first. + ///
+ /// + /// Default Value: openapi-json-null-sentinel-value-2BF93600-0FE4-4250-987A-E5DDB203E464 + /// + /// + /// Default Value: 100 + /// + /// + /// Default Value: openapi-json-null-sentinel-value-2BF93600-0FE4-4250-987A-E5DDB203E464 + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + /// + /// curl --request GET \
+ /// --url https://api.baseten.co/v1/routes/connections \
+ /// --header "Authorization: Bearer $BASETEN_API_KEY" + ///
+ global::System.Threading.Tasks.Task> GetRoutesConnectionsAsResponseAsync( + string? cursor = default, + int? limit = default, + string? teamId = default, + global::Baseten.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/Baseten/Generated/Baseten.JsonConverters.Config.g.cs b/src/libs/Baseten/Generated/Baseten.JsonConverters.Config.g.cs new file mode 100644 index 0000000..4d60158 --- /dev/null +++ b/src/libs/Baseten/Generated/Baseten.JsonConverters.Config.g.cs @@ -0,0 +1,87 @@ +#nullable enable +#pragma warning disable CS0618 // Type or member is obsolete + +namespace Baseten.JsonConverters +{ + /// + public class ConfigJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Baseten.Config Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + options = options ?? throw new global::System.ArgumentNullException(nameof(options)); + var typeInfoResolver = options.TypeInfoResolver ?? throw new global::System.InvalidOperationException("TypeInfoResolver is not set."); + + + var readerCopy = reader; + var discriminatorTypeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Baseten.RouteConnectionV1ConfigDiscriminator), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {nameof(global::Baseten.RouteConnectionV1ConfigDiscriminator)}"); + var discriminator = global::System.Text.Json.JsonSerializer.Deserialize(ref readerCopy, discriminatorTypeInfo); + + global::Baseten.RouteConnectionAnthropicV1? anthropic = default; + if (discriminator?.Provider == global::Baseten.RouteConnectionV1ConfigDiscriminatorProvider.Anthropic) + { + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Baseten.RouteConnectionAnthropicV1), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {nameof(global::Baseten.RouteConnectionAnthropicV1)}"); + anthropic = global::System.Text.Json.JsonSerializer.Deserialize(ref reader, typeInfo); + } + global::Baseten.RouteConnectionOpenAIV1? openai = default; + if (discriminator?.Provider == global::Baseten.RouteConnectionV1ConfigDiscriminatorProvider.Openai) + { + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Baseten.RouteConnectionOpenAIV1), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {nameof(global::Baseten.RouteConnectionOpenAIV1)}"); + openai = global::System.Text.Json.JsonSerializer.Deserialize(ref reader, typeInfo); + } + global::Baseten.RouteConnectionXAIV1? xai = default; + if (discriminator?.Provider == global::Baseten.RouteConnectionV1ConfigDiscriminatorProvider.Xai) + { + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Baseten.RouteConnectionXAIV1), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {nameof(global::Baseten.RouteConnectionXAIV1)}"); + xai = global::System.Text.Json.JsonSerializer.Deserialize(ref reader, typeInfo); + } + + var __value = new global::Baseten.Config( + discriminator?.Provider, + anthropic, + + openai, + + xai + ); + + return __value; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Baseten.Config value, + global::System.Text.Json.JsonSerializerOptions options) + { + options = options ?? throw new global::System.ArgumentNullException(nameof(options)); + var typeInfoResolver = options.TypeInfoResolver ?? throw new global::System.InvalidOperationException("TypeInfoResolver is not set."); + + if (value.IsAnthropic) + { + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Baseten.RouteConnectionAnthropicV1), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::Baseten.RouteConnectionAnthropicV1).Name}"); + global::System.Text.Json.JsonSerializer.Serialize(writer, value.PickAnthropic(), typeInfo); + } + else if (value.IsOpenai) + { + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Baseten.RouteConnectionOpenAIV1), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::Baseten.RouteConnectionOpenAIV1).Name}"); + global::System.Text.Json.JsonSerializer.Serialize(writer, value.PickOpenai(), typeInfo); + } + else if (value.IsXai) + { + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Baseten.RouteConnectionXAIV1), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::Baseten.RouteConnectionXAIV1).Name}"); + global::System.Text.Json.JsonSerializer.Serialize(writer, value.PickXai(), typeInfo); + } + } + } +} \ No newline at end of file diff --git a/src/libs/Baseten/Generated/Baseten.JsonConverters.Config2.g.cs b/src/libs/Baseten/Generated/Baseten.JsonConverters.Config2.g.cs new file mode 100644 index 0000000..05ca102 --- /dev/null +++ b/src/libs/Baseten/Generated/Baseten.JsonConverters.Config2.g.cs @@ -0,0 +1,87 @@ +#nullable enable +#pragma warning disable CS0618 // Type or member is obsolete + +namespace Baseten.JsonConverters +{ + /// + public class Config2JsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Baseten.Config2 Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + options = options ?? throw new global::System.ArgumentNullException(nameof(options)); + var typeInfoResolver = options.TypeInfoResolver ?? throw new global::System.InvalidOperationException("TypeInfoResolver is not set."); + + + var readerCopy = reader; + var discriminatorTypeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Baseten.CreateRouteConnectionRequestV1ConfigDiscriminator), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {nameof(global::Baseten.CreateRouteConnectionRequestV1ConfigDiscriminator)}"); + var discriminator = global::System.Text.Json.JsonSerializer.Deserialize(ref readerCopy, discriminatorTypeInfo); + + global::Baseten.RouteConnectionConfigAnthropicV1? anthropic = default; + if (discriminator?.Provider == global::Baseten.CreateRouteConnectionRequestV1ConfigDiscriminatorProvider.Anthropic) + { + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Baseten.RouteConnectionConfigAnthropicV1), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {nameof(global::Baseten.RouteConnectionConfigAnthropicV1)}"); + anthropic = global::System.Text.Json.JsonSerializer.Deserialize(ref reader, typeInfo); + } + global::Baseten.RouteConnectionConfigOpenAIV1? openai = default; + if (discriminator?.Provider == global::Baseten.CreateRouteConnectionRequestV1ConfigDiscriminatorProvider.Openai) + { + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Baseten.RouteConnectionConfigOpenAIV1), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {nameof(global::Baseten.RouteConnectionConfigOpenAIV1)}"); + openai = global::System.Text.Json.JsonSerializer.Deserialize(ref reader, typeInfo); + } + global::Baseten.RouteConnectionConfigXAIV1? xai = default; + if (discriminator?.Provider == global::Baseten.CreateRouteConnectionRequestV1ConfigDiscriminatorProvider.Xai) + { + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Baseten.RouteConnectionConfigXAIV1), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {nameof(global::Baseten.RouteConnectionConfigXAIV1)}"); + xai = global::System.Text.Json.JsonSerializer.Deserialize(ref reader, typeInfo); + } + + var __value = new global::Baseten.Config2( + discriminator?.Provider, + anthropic, + + openai, + + xai + ); + + return __value; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Baseten.Config2 value, + global::System.Text.Json.JsonSerializerOptions options) + { + options = options ?? throw new global::System.ArgumentNullException(nameof(options)); + var typeInfoResolver = options.TypeInfoResolver ?? throw new global::System.InvalidOperationException("TypeInfoResolver is not set."); + + if (value.IsAnthropic) + { + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Baseten.RouteConnectionConfigAnthropicV1), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::Baseten.RouteConnectionConfigAnthropicV1).Name}"); + global::System.Text.Json.JsonSerializer.Serialize(writer, value.PickAnthropic(), typeInfo); + } + else if (value.IsOpenai) + { + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Baseten.RouteConnectionConfigOpenAIV1), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::Baseten.RouteConnectionConfigOpenAIV1).Name}"); + global::System.Text.Json.JsonSerializer.Serialize(writer, value.PickOpenai(), typeInfo); + } + else if (value.IsXai) + { + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Baseten.RouteConnectionConfigXAIV1), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::Baseten.RouteConnectionConfigXAIV1).Name}"); + global::System.Text.Json.JsonSerializer.Serialize(writer, value.PickXai(), typeInfo); + } + } + } +} \ No newline at end of file diff --git a/src/libs/Baseten/Generated/Baseten.JsonConverters.Config3.g.cs b/src/libs/Baseten/Generated/Baseten.JsonConverters.Config3.g.cs new file mode 100644 index 0000000..23eab04 --- /dev/null +++ b/src/libs/Baseten/Generated/Baseten.JsonConverters.Config3.g.cs @@ -0,0 +1,87 @@ +#nullable enable +#pragma warning disable CS0618 // Type or member is obsolete + +namespace Baseten.JsonConverters +{ + /// + public class Config3JsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Baseten.Config3 Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + options = options ?? throw new global::System.ArgumentNullException(nameof(options)); + var typeInfoResolver = options.TypeInfoResolver ?? throw new global::System.InvalidOperationException("TypeInfoResolver is not set."); + + + var readerCopy = reader; + var discriminatorTypeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Baseten.UpdateRouteConnectionRequestV1ConfigDiscriminator), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {nameof(global::Baseten.UpdateRouteConnectionRequestV1ConfigDiscriminator)}"); + var discriminator = global::System.Text.Json.JsonSerializer.Deserialize(ref readerCopy, discriminatorTypeInfo); + + global::Baseten.UpdateRouteConnectionConfigAnthropicV1? anthropic = default; + if (discriminator?.Provider == global::Baseten.UpdateRouteConnectionRequestV1ConfigDiscriminatorProvider.Anthropic) + { + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Baseten.UpdateRouteConnectionConfigAnthropicV1), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {nameof(global::Baseten.UpdateRouteConnectionConfigAnthropicV1)}"); + anthropic = global::System.Text.Json.JsonSerializer.Deserialize(ref reader, typeInfo); + } + global::Baseten.UpdateRouteConnectionConfigOpenAIV1? openai = default; + if (discriminator?.Provider == global::Baseten.UpdateRouteConnectionRequestV1ConfigDiscriminatorProvider.Openai) + { + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Baseten.UpdateRouteConnectionConfigOpenAIV1), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {nameof(global::Baseten.UpdateRouteConnectionConfigOpenAIV1)}"); + openai = global::System.Text.Json.JsonSerializer.Deserialize(ref reader, typeInfo); + } + global::Baseten.UpdateRouteConnectionConfigXAIV1? xai = default; + if (discriminator?.Provider == global::Baseten.UpdateRouteConnectionRequestV1ConfigDiscriminatorProvider.Xai) + { + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Baseten.UpdateRouteConnectionConfigXAIV1), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {nameof(global::Baseten.UpdateRouteConnectionConfigXAIV1)}"); + xai = global::System.Text.Json.JsonSerializer.Deserialize(ref reader, typeInfo); + } + + var __value = new global::Baseten.Config3( + discriminator?.Provider, + anthropic, + + openai, + + xai + ); + + return __value; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Baseten.Config3 value, + global::System.Text.Json.JsonSerializerOptions options) + { + options = options ?? throw new global::System.ArgumentNullException(nameof(options)); + var typeInfoResolver = options.TypeInfoResolver ?? throw new global::System.InvalidOperationException("TypeInfoResolver is not set."); + + if (value.IsAnthropic) + { + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Baseten.UpdateRouteConnectionConfigAnthropicV1), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::Baseten.UpdateRouteConnectionConfigAnthropicV1).Name}"); + global::System.Text.Json.JsonSerializer.Serialize(writer, value.PickAnthropic(), typeInfo); + } + else if (value.IsOpenai) + { + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Baseten.UpdateRouteConnectionConfigOpenAIV1), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::Baseten.UpdateRouteConnectionConfigOpenAIV1).Name}"); + global::System.Text.Json.JsonSerializer.Serialize(writer, value.PickOpenai(), typeInfo); + } + else if (value.IsXai) + { + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Baseten.UpdateRouteConnectionConfigXAIV1), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::Baseten.UpdateRouteConnectionConfigXAIV1).Name}"); + global::System.Text.Json.JsonSerializer.Serialize(writer, value.PickXai(), typeInfo); + } + } + } +} \ No newline at end of file diff --git a/src/libs/Baseten/Generated/Baseten.JsonConverters.CreateRouteConnectionRequestV1ConfigDiscriminatorProvider.g.cs b/src/libs/Baseten/Generated/Baseten.JsonConverters.CreateRouteConnectionRequestV1ConfigDiscriminatorProvider.g.cs new file mode 100644 index 0000000..366809f --- /dev/null +++ b/src/libs/Baseten/Generated/Baseten.JsonConverters.CreateRouteConnectionRequestV1ConfigDiscriminatorProvider.g.cs @@ -0,0 +1,53 @@ +#nullable enable + +namespace Baseten.JsonConverters +{ + /// + public sealed class CreateRouteConnectionRequestV1ConfigDiscriminatorProviderJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Baseten.CreateRouteConnectionRequestV1ConfigDiscriminatorProvider 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::Baseten.CreateRouteConnectionRequestV1ConfigDiscriminatorProviderExtensions.ToEnum(stringValue) ?? default; + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Baseten.CreateRouteConnectionRequestV1ConfigDiscriminatorProvider)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Baseten.CreateRouteConnectionRequestV1ConfigDiscriminatorProvider); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Baseten.CreateRouteConnectionRequestV1ConfigDiscriminatorProvider value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + writer.WriteStringValue(global::Baseten.CreateRouteConnectionRequestV1ConfigDiscriminatorProviderExtensions.ToValueString(value)); + } + } +} diff --git a/src/libs/Baseten/Generated/Baseten.JsonConverters.CreateRouteConnectionRequestV1ConfigDiscriminatorProviderNullable.g.cs b/src/libs/Baseten/Generated/Baseten.JsonConverters.CreateRouteConnectionRequestV1ConfigDiscriminatorProviderNullable.g.cs new file mode 100644 index 0000000..b570f32 --- /dev/null +++ b/src/libs/Baseten/Generated/Baseten.JsonConverters.CreateRouteConnectionRequestV1ConfigDiscriminatorProviderNullable.g.cs @@ -0,0 +1,60 @@ +#nullable enable + +namespace Baseten.JsonConverters +{ + /// + public sealed class CreateRouteConnectionRequestV1ConfigDiscriminatorProviderNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Baseten.CreateRouteConnectionRequestV1ConfigDiscriminatorProvider? 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::Baseten.CreateRouteConnectionRequestV1ConfigDiscriminatorProviderExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Baseten.CreateRouteConnectionRequestV1ConfigDiscriminatorProvider)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Baseten.CreateRouteConnectionRequestV1ConfigDiscriminatorProvider?); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Baseten.CreateRouteConnectionRequestV1ConfigDiscriminatorProvider? 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::Baseten.CreateRouteConnectionRequestV1ConfigDiscriminatorProviderExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/libs/Baseten/Generated/Baseten.JsonConverters.RouteConnectionV1ConfigDiscriminatorProvider.g.cs b/src/libs/Baseten/Generated/Baseten.JsonConverters.RouteConnectionV1ConfigDiscriminatorProvider.g.cs new file mode 100644 index 0000000..f157406 --- /dev/null +++ b/src/libs/Baseten/Generated/Baseten.JsonConverters.RouteConnectionV1ConfigDiscriminatorProvider.g.cs @@ -0,0 +1,53 @@ +#nullable enable + +namespace Baseten.JsonConverters +{ + /// + public sealed class RouteConnectionV1ConfigDiscriminatorProviderJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Baseten.RouteConnectionV1ConfigDiscriminatorProvider 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::Baseten.RouteConnectionV1ConfigDiscriminatorProviderExtensions.ToEnum(stringValue) ?? default; + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Baseten.RouteConnectionV1ConfigDiscriminatorProvider)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Baseten.RouteConnectionV1ConfigDiscriminatorProvider); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Baseten.RouteConnectionV1ConfigDiscriminatorProvider value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + writer.WriteStringValue(global::Baseten.RouteConnectionV1ConfigDiscriminatorProviderExtensions.ToValueString(value)); + } + } +} diff --git a/src/libs/Baseten/Generated/Baseten.JsonConverters.RouteConnectionV1ConfigDiscriminatorProviderNullable.g.cs b/src/libs/Baseten/Generated/Baseten.JsonConverters.RouteConnectionV1ConfigDiscriminatorProviderNullable.g.cs new file mode 100644 index 0000000..9ee8f63 --- /dev/null +++ b/src/libs/Baseten/Generated/Baseten.JsonConverters.RouteConnectionV1ConfigDiscriminatorProviderNullable.g.cs @@ -0,0 +1,60 @@ +#nullable enable + +namespace Baseten.JsonConverters +{ + /// + public sealed class RouteConnectionV1ConfigDiscriminatorProviderNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Baseten.RouteConnectionV1ConfigDiscriminatorProvider? 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::Baseten.RouteConnectionV1ConfigDiscriminatorProviderExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Baseten.RouteConnectionV1ConfigDiscriminatorProvider)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Baseten.RouteConnectionV1ConfigDiscriminatorProvider?); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Baseten.RouteConnectionV1ConfigDiscriminatorProvider? 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::Baseten.RouteConnectionV1ConfigDiscriminatorProviderExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/libs/Baseten/Generated/Baseten.JsonConverters.UpdateRouteConnectionRequestV1ConfigDiscriminatorProvider.g.cs b/src/libs/Baseten/Generated/Baseten.JsonConverters.UpdateRouteConnectionRequestV1ConfigDiscriminatorProvider.g.cs new file mode 100644 index 0000000..6543e62 --- /dev/null +++ b/src/libs/Baseten/Generated/Baseten.JsonConverters.UpdateRouteConnectionRequestV1ConfigDiscriminatorProvider.g.cs @@ -0,0 +1,53 @@ +#nullable enable + +namespace Baseten.JsonConverters +{ + /// + public sealed class UpdateRouteConnectionRequestV1ConfigDiscriminatorProviderJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Baseten.UpdateRouteConnectionRequestV1ConfigDiscriminatorProvider 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::Baseten.UpdateRouteConnectionRequestV1ConfigDiscriminatorProviderExtensions.ToEnum(stringValue) ?? default; + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Baseten.UpdateRouteConnectionRequestV1ConfigDiscriminatorProvider)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Baseten.UpdateRouteConnectionRequestV1ConfigDiscriminatorProvider); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Baseten.UpdateRouteConnectionRequestV1ConfigDiscriminatorProvider value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + writer.WriteStringValue(global::Baseten.UpdateRouteConnectionRequestV1ConfigDiscriminatorProviderExtensions.ToValueString(value)); + } + } +} diff --git a/src/libs/Baseten/Generated/Baseten.JsonConverters.UpdateRouteConnectionRequestV1ConfigDiscriminatorProviderNullable.g.cs b/src/libs/Baseten/Generated/Baseten.JsonConverters.UpdateRouteConnectionRequestV1ConfigDiscriminatorProviderNullable.g.cs new file mode 100644 index 0000000..d28d16a --- /dev/null +++ b/src/libs/Baseten/Generated/Baseten.JsonConverters.UpdateRouteConnectionRequestV1ConfigDiscriminatorProviderNullable.g.cs @@ -0,0 +1,60 @@ +#nullable enable + +namespace Baseten.JsonConverters +{ + /// + public sealed class UpdateRouteConnectionRequestV1ConfigDiscriminatorProviderNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Baseten.UpdateRouteConnectionRequestV1ConfigDiscriminatorProvider? 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::Baseten.UpdateRouteConnectionRequestV1ConfigDiscriminatorProviderExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Baseten.UpdateRouteConnectionRequestV1ConfigDiscriminatorProvider)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Baseten.UpdateRouteConnectionRequestV1ConfigDiscriminatorProvider?); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Baseten.UpdateRouteConnectionRequestV1ConfigDiscriminatorProvider? 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::Baseten.UpdateRouteConnectionRequestV1ConfigDiscriminatorProviderExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/libs/Baseten/Generated/Baseten.JsonSerializerContext.g.cs b/src/libs/Baseten/Generated/Baseten.JsonSerializerContext.g.cs index bb89474..823674b 100644 --- a/src/libs/Baseten/Generated/Baseten.JsonSerializerContext.g.cs +++ b/src/libs/Baseten/Generated/Baseten.JsonSerializerContext.g.cs @@ -663,6 +663,31 @@ internal sealed partial class SourceGenerationContextChunk0 : global::System.Tex [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Baseten.UpdateRouteHarnessDefaultsV1))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Baseten.UpdateRouteTeamSpendLimitSettingV1))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Baseten.UpdateRouteTeamSettingsRequestV1))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Baseten.RouteConnectionAnthropicV1))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Baseten.RouteConnectionOpenAIV1))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Baseten.RouteConnectionV1))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Baseten.Config), TypeInfoPropertyName = "Config2_3")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Baseten.RouteConnectionXAIV1))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Baseten.RouteConnectionV1ConfigDiscriminator))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Baseten.RouteConnectionV1ConfigDiscriminatorProvider), TypeInfoPropertyName = "RouteConnectionV1ConfigDiscriminatorProvider2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Baseten.RouteConnectionsResponseV1))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Baseten.RouteConnectionsRequestV1))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Baseten.RouteConnectionConfigAnthropicV1))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Baseten.RouteConnectionConfigOpenAIV1))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Baseten.RouteConnectionConfigXAIV1))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Baseten.CreateRouteConnectionRequestV1))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Baseten.Config2), TypeInfoPropertyName = "Config22")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Baseten.CreateRouteConnectionRequestV1ConfigDiscriminator))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Baseten.CreateRouteConnectionRequestV1ConfigDiscriminatorProvider), TypeInfoPropertyName = "CreateRouteConnectionRequestV1ConfigDiscriminatorProvider2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Baseten.RouteConnectionTombstoneV1))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Baseten.UpdateRouteConnectionConfigAnthropicV1))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Baseten.UpdateRouteConnectionConfigOpenAIV1))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Baseten.UpdateRouteConnectionConfigXAIV1))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Baseten.UpdateRouteConnectionRequestV1))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Baseten.Config3), TypeInfoPropertyName = "Config32")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Baseten.UpdateRouteConnectionRequestV1ConfigDiscriminator))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Baseten.UpdateRouteConnectionRequestV1ConfigDiscriminatorProvider), TypeInfoPropertyName = "UpdateRouteConnectionRequestV1ConfigDiscriminatorProvider2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Baseten.RouteTombstoneV1))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Baseten.UpdateRouteRequestV1))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Baseten.TargetVariant1))] @@ -788,6 +813,12 @@ internal sealed partial class SourceGenerationContextChunk0 : global::System.Tex [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Baseten.RouteProviderV1?), TypeInfoPropertyName = "NullableRouteProviderV12")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Baseten.RouteUsageDimensionV1?), TypeInfoPropertyName = "NullableRouteUsageDimensionV12")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Baseten.RouteSettingSourceV1?), TypeInfoPropertyName = "NullableRouteSettingSourceV12")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Baseten.Config?), TypeInfoPropertyName = "NullableConfig2_3")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Baseten.RouteConnectionV1ConfigDiscriminatorProvider?), TypeInfoPropertyName = "NullableRouteConnectionV1ConfigDiscriminatorProvider2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Baseten.Config2?), TypeInfoPropertyName = "NullableConfig22")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Baseten.CreateRouteConnectionRequestV1ConfigDiscriminatorProvider?), TypeInfoPropertyName = "NullableCreateRouteConnectionRequestV1ConfigDiscriminatorProvider2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Baseten.Config3?), TypeInfoPropertyName = "NullableConfig32")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Baseten.UpdateRouteConnectionRequestV1ConfigDiscriminatorProvider?), TypeInfoPropertyName = "NullableUpdateRouteConnectionRequestV1ConfigDiscriminatorProvider2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Baseten.UpdateRouteRequestV1TargetVariant1DiscriminatorType?), TypeInfoPropertyName = "NullableUpdateRouteRequestV1TargetVariant1DiscriminatorType2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Baseten.GatewayProvider?), TypeInfoPropertyName = "NullableGatewayProvider2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Baseten.SharedEndpointRegionV1?), TypeInfoPropertyName = "NullableSharedEndpointRegionV12")] @@ -885,6 +916,7 @@ internal sealed partial class SourceGenerationContextChunk0 : global::System.Tex [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] @@ -943,6 +975,9 @@ internal static void AddConverters(global::System.Text.Json.JsonSerializerOption options.Converters.Add(new global::Baseten.JsonConverters.Source4JsonConverter()); options.Converters.Add(new global::Baseten.JsonConverters.TargetJsonConverter()); options.Converters.Add(new global::Baseten.JsonConverters.Target2JsonConverter()); + options.Converters.Add(new global::Baseten.JsonConverters.ConfigJsonConverter()); + options.Converters.Add(new global::Baseten.JsonConverters.Config2JsonConverter()); + options.Converters.Add(new global::Baseten.JsonConverters.Config3JsonConverter()); options.Converters.Add(new global::Baseten.JsonConverters.TargetVariant1JsonConverter()); options.Converters.Add(new global::Baseten.JsonConverters.AnyOfJsonConverter()); options.Converters.Add(new global::Baseten.JsonConverters.AnyOfJsonConverter()); @@ -1240,6 +1275,18 @@ public override bool CanConvert(global::System.Type typeToConvert) || typeToConvert == typeof(global::Baseten.RouteSettingSourceV1?) + || typeToConvert == typeof(global::Baseten.RouteConnectionV1ConfigDiscriminatorProvider) + + || typeToConvert == typeof(global::Baseten.RouteConnectionV1ConfigDiscriminatorProvider?) + + || typeToConvert == typeof(global::Baseten.CreateRouteConnectionRequestV1ConfigDiscriminatorProvider) + + || typeToConvert == typeof(global::Baseten.CreateRouteConnectionRequestV1ConfigDiscriminatorProvider?) + + || typeToConvert == typeof(global::Baseten.UpdateRouteConnectionRequestV1ConfigDiscriminatorProvider) + + || typeToConvert == typeof(global::Baseten.UpdateRouteConnectionRequestV1ConfigDiscriminatorProvider?) + || typeToConvert == typeof(global::Baseten.UpdateRouteRequestV1TargetVariant1DiscriminatorType) || typeToConvert == typeof(global::Baseten.UpdateRouteRequestV1TargetVariant1DiscriminatorType?) @@ -1895,6 +1942,36 @@ public override bool CanConvert(global::System.Type typeToConvert) return new global::Baseten.JsonConverters.RouteSettingSourceV1NullableJsonConverter(); } + if (typeToConvert == typeof(global::Baseten.RouteConnectionV1ConfigDiscriminatorProvider)) + { + return new global::Baseten.JsonConverters.RouteConnectionV1ConfigDiscriminatorProviderJsonConverter(); + } + + if (typeToConvert == typeof(global::Baseten.RouteConnectionV1ConfigDiscriminatorProvider?)) + { + return new global::Baseten.JsonConverters.RouteConnectionV1ConfigDiscriminatorProviderNullableJsonConverter(); + } + + if (typeToConvert == typeof(global::Baseten.CreateRouteConnectionRequestV1ConfigDiscriminatorProvider)) + { + return new global::Baseten.JsonConverters.CreateRouteConnectionRequestV1ConfigDiscriminatorProviderJsonConverter(); + } + + if (typeToConvert == typeof(global::Baseten.CreateRouteConnectionRequestV1ConfigDiscriminatorProvider?)) + { + return new global::Baseten.JsonConverters.CreateRouteConnectionRequestV1ConfigDiscriminatorProviderNullableJsonConverter(); + } + + if (typeToConvert == typeof(global::Baseten.UpdateRouteConnectionRequestV1ConfigDiscriminatorProvider)) + { + return new global::Baseten.JsonConverters.UpdateRouteConnectionRequestV1ConfigDiscriminatorProviderJsonConverter(); + } + + if (typeToConvert == typeof(global::Baseten.UpdateRouteConnectionRequestV1ConfigDiscriminatorProvider?)) + { + return new global::Baseten.JsonConverters.UpdateRouteConnectionRequestV1ConfigDiscriminatorProviderNullableJsonConverter(); + } + if (typeToConvert == typeof(global::Baseten.UpdateRouteRequestV1TargetVariant1DiscriminatorType)) { return new global::Baseten.JsonConverters.UpdateRouteRequestV1TargetVariant1DiscriminatorTypeJsonConverter(); diff --git a/src/libs/Baseten/Generated/Baseten.JsonSerializerContextTypes.g.cs b/src/libs/Baseten/Generated/Baseten.JsonSerializerContextTypes.g.cs index b1a53b9..ccf71de 100644 --- a/src/libs/Baseten/Generated/Baseten.JsonSerializerContextTypes.g.cs +++ b/src/libs/Baseten/Generated/Baseten.JsonSerializerContextTypes.g.cs @@ -2597,187 +2597,287 @@ public sealed partial class JsonSerializerContextTypes /// /// /// - public global::Baseten.RouteTombstoneV1? Type641 { get; set; } + public global::Baseten.RouteConnectionAnthropicV1? Type641 { get; set; } /// /// /// - public global::Baseten.UpdateRouteRequestV1? Type642 { get; set; } + public global::Baseten.RouteConnectionOpenAIV1? Type642 { get; set; } /// /// /// - public global::Baseten.TargetVariant1? Type643 { get; set; } + public global::Baseten.RouteConnectionV1? Type643 { get; set; } /// /// /// - public global::Baseten.UpdateRouteRequestV1TargetVariant1Discriminator? Type644 { get; set; } + public global::Baseten.Config? Type644 { get; set; } /// /// /// - public global::Baseten.UpdateRouteRequestV1TargetVariant1DiscriminatorType? Type645 { get; set; } + public global::Baseten.RouteConnectionXAIV1? Type645 { get; set; } /// /// /// - public global::Baseten.EndpointTargetV1? Type646 { get; set; } + public global::Baseten.RouteConnectionV1ConfigDiscriminator? Type646 { get; set; } /// /// /// - public global::Baseten.GatewayProvider? Type647 { get; set; } + public global::Baseten.RouteConnectionV1ConfigDiscriminatorProvider? Type647 { get; set; } /// /// /// - public global::Baseten.VertexTargetConfigV1? Type648 { get; set; } + public global::Baseten.RouteConnectionsResponseV1? Type648 { get; set; } /// /// /// - public global::Baseten.EndpointV1? Type649 { get; set; } + public global::System.Collections.Generic.IList? Type649 { get; set; } /// /// /// - public global::Baseten.SharedEndpointRegionV1? Type650 { get; set; } + public global::Baseten.RouteConnectionsRequestV1? Type650 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type651 { get; set; } + public global::Baseten.RouteConnectionConfigAnthropicV1? Type651 { get; set; } /// /// /// - public global::Baseten.EndpointsResponseV1? Type652 { get; set; } + public global::Baseten.RouteConnectionConfigOpenAIV1? Type652 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type653 { get; set; } + public global::Baseten.RouteConnectionConfigXAIV1? Type653 { get; set; } /// /// /// - public global::Baseten.EndpointTargetRequestV1? Type654 { get; set; } + public global::Baseten.CreateRouteConnectionRequestV1? Type654 { get; set; } /// /// /// - public global::Baseten.CreateEndpointRequestV1? Type655 { get; set; } + public global::Baseten.Config2? Type655 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type656 { get; set; } + public global::Baseten.CreateRouteConnectionRequestV1ConfigDiscriminator? Type656 { get; set; } /// /// /// - public global::Baseten.EndpointTombstoneV1? Type657 { get; set; } + public global::Baseten.CreateRouteConnectionRequestV1ConfigDiscriminatorProvider? Type657 { get; set; } /// /// /// - public global::Baseten.UpdateEndpointRequestV1? Type658 { get; set; } + public global::Baseten.RouteConnectionTombstoneV1? Type658 { get; set; } /// /// /// - public global::Baseten.EffectiveModelConfigV1? Type659 { get; set; } + public global::Baseten.UpdateRouteConnectionConfigAnthropicV1? Type659 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type660 { get; set; } + public global::Baseten.UpdateRouteConnectionConfigOpenAIV1? Type660 { get; set; } /// /// /// - public global::Baseten.EffectiveRateLimitV1? Type661 { get; set; } + public global::Baseten.UpdateRouteConnectionConfigXAIV1? Type661 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type662 { get; set; } + public global::Baseten.UpdateRouteConnectionRequestV1? Type662 { get; set; } /// /// /// - public global::Baseten.EffectiveUsageLimitV1? Type663 { get; set; } + public global::Baseten.Config3? Type663 { get; set; } /// /// /// - public global::Baseten.UsageLimitUnitV1? Type664 { get; set; } + public global::Baseten.UpdateRouteConnectionRequestV1ConfigDiscriminator? Type664 { get; set; } /// /// /// - public global::Baseten.GroupHierarchyV1? Type665 { get; set; } + public global::Baseten.UpdateRouteConnectionRequestV1ConfigDiscriminatorProvider? Type665 { get; set; } /// /// /// - public global::Baseten.LimitEnforcementV1? Type666 { get; set; } + public global::Baseten.RouteTombstoneV1? Type666 { get; set; } /// /// /// - public global::Baseten.GroupMetadataV1? Type667 { get; set; } + public global::Baseten.UpdateRouteRequestV1? Type667 { get; set; } /// /// /// - public global::Baseten.GroupV1? Type668 { get; set; } + public global::Baseten.TargetVariant1? Type668 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type669 { get; set; } + public global::Baseten.UpdateRouteRequestV1TargetVariant1Discriminator? Type669 { get; set; } /// /// /// - public global::Baseten.ModelConfigV1? Type670 { get; set; } + public global::Baseten.UpdateRouteRequestV1TargetVariant1DiscriminatorType? Type670 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type671 { get; set; } + public global::Baseten.EndpointTargetV1? Type671 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type672 { get; set; } + public global::Baseten.GatewayProvider? Type672 { get; set; } /// /// /// - public global::Baseten.UsageLimitV1? Type673 { get; set; } + public global::Baseten.VertexTargetConfigV1? Type673 { get; set; } /// /// /// - public global::Baseten.GroupsResponseV1? Type674 { get; set; } + public global::Baseten.EndpointV1? Type674 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type675 { get; set; } + public global::Baseten.SharedEndpointRegionV1? Type675 { get; set; } /// /// /// - public global::Baseten.CreateGroupHierarchyV1? Type676 { get; set; } + public global::System.Collections.Generic.IList? Type676 { get; set; } /// /// /// - public global::Baseten.CreateGroupRequestV1? Type677 { get; set; } + public global::Baseten.EndpointsResponseV1? Type677 { get; set; } /// /// /// - public global::Baseten.UpdateGroupMetadataV1? Type678 { get; set; } + public global::System.Collections.Generic.IList? Type678 { get; set; } /// /// /// - public global::Baseten.UpdateGroupRequestV1? Type679 { get; set; } + public global::Baseten.EndpointTargetRequestV1? Type679 { get; set; } /// /// /// - public global::Baseten.GatewayKeyInfoV1? Type680 { get; set; } + public global::Baseten.CreateEndpointRequestV1? Type680 { get; set; } /// /// /// - public global::Baseten.KeysForGroupResponseV1? Type681 { get; set; } + public global::System.Collections.Generic.IList? Type681 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type682 { get; set; } + public global::Baseten.EndpointTombstoneV1? Type682 { get; set; } /// /// /// - public global::Baseten.CreateApiKeyForGroupRequestV1? Type683 { get; set; } + public global::Baseten.UpdateEndpointRequestV1? Type683 { get; set; } /// /// /// - public global::Baseten.CreateApiKeyForGroupResponseV1? Type684 { get; set; } + public global::Baseten.EffectiveModelConfigV1? Type684 { get; set; } /// /// /// - public global::Baseten.RegisterAPIKeyRequestV1? Type685 { get; set; } + public global::System.Collections.Generic.IList? Type685 { get; set; } /// /// /// - public global::Baseten.RegisterAPIKeyResponseV1? Type686 { get; set; } + public global::Baseten.EffectiveRateLimitV1? Type686 { get; set; } + /// + /// + /// + public global::System.Collections.Generic.IList? Type687 { get; set; } + /// + /// + /// + public global::Baseten.EffectiveUsageLimitV1? Type688 { get; set; } + /// + /// + /// + public global::Baseten.UsageLimitUnitV1? Type689 { get; set; } + /// + /// + /// + public global::Baseten.GroupHierarchyV1? Type690 { get; set; } + /// + /// + /// + public global::Baseten.LimitEnforcementV1? Type691 { get; set; } + /// + /// + /// + public global::Baseten.GroupMetadataV1? Type692 { get; set; } + /// + /// + /// + public global::Baseten.GroupV1? Type693 { get; set; } + /// + /// + /// + public global::System.Collections.Generic.IList? Type694 { get; set; } + /// + /// + /// + public global::Baseten.ModelConfigV1? Type695 { get; set; } + /// + /// + /// + public global::System.Collections.Generic.IList? Type696 { get; set; } + /// + /// + /// + public global::System.Collections.Generic.IList? Type697 { get; set; } + /// + /// + /// + public global::Baseten.UsageLimitV1? Type698 { get; set; } + /// + /// + /// + public global::Baseten.GroupsResponseV1? Type699 { get; set; } + /// + /// + /// + public global::System.Collections.Generic.IList? Type700 { get; set; } + /// + /// + /// + public global::Baseten.CreateGroupHierarchyV1? Type701 { get; set; } + /// + /// + /// + public global::Baseten.CreateGroupRequestV1? Type702 { get; set; } + /// + /// + /// + public global::Baseten.UpdateGroupMetadataV1? Type703 { get; set; } + /// + /// + /// + public global::Baseten.UpdateGroupRequestV1? Type704 { get; set; } + /// + /// + /// + public global::Baseten.GatewayKeyInfoV1? Type705 { get; set; } + /// + /// + /// + public global::Baseten.KeysForGroupResponseV1? Type706 { get; set; } + /// + /// + /// + public global::System.Collections.Generic.IList? Type707 { get; set; } + /// + /// + /// + public global::Baseten.CreateApiKeyForGroupRequestV1? Type708 { get; set; } + /// + /// + /// + public global::Baseten.CreateApiKeyForGroupResponseV1? Type709 { get; set; } + /// + /// + /// + public global::Baseten.RegisterAPIKeyRequestV1? Type710 { get; set; } + /// + /// + /// + public global::Baseten.RegisterAPIKeyResponseV1? Type711 { get; set; } /// /// @@ -3154,42 +3254,46 @@ public sealed partial class JsonSerializerContextTypes /// /// /// - public global::System.Collections.Generic.List? ListType93 { get; set; } + public global::System.Collections.Generic.List? ListType93 { get; set; } + /// + /// + /// + public global::System.Collections.Generic.List? ListType94 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType94 { get; set; } + public global::System.Collections.Generic.List? ListType95 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType95 { get; set; } + public global::System.Collections.Generic.List? ListType96 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType96 { get; set; } + public global::System.Collections.Generic.List? ListType97 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType97 { get; set; } + public global::System.Collections.Generic.List? ListType98 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType98 { get; set; } + public global::System.Collections.Generic.List? ListType99 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType99 { get; set; } + public global::System.Collections.Generic.List? ListType100 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType100 { get; set; } + public global::System.Collections.Generic.List? ListType101 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType101 { get; set; } + public global::System.Collections.Generic.List? ListType102 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType102 { get; set; } + public global::System.Collections.Generic.List? ListType103 { get; set; } } } \ No newline at end of file diff --git a/src/libs/Baseten/Generated/Baseten.Models.Config.Json.g.cs b/src/libs/Baseten/Generated/Baseten.Models.Config.Json.g.cs new file mode 100644 index 0000000..86bce24 --- /dev/null +++ b/src/libs/Baseten/Generated/Baseten.Models.Config.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Baseten +{ + public readonly partial struct Config + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Baseten.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Baseten.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Baseten.Config? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Baseten.Config), + jsonSerializerContext) as global::Baseten.Config?; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Baseten.Config? FromJson( + string json) + { + return FromJson( + json, + global::Baseten.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Baseten.Config? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Baseten.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Baseten.Config), + jsonSerializerContext).ConfigureAwait(false)) as global::Baseten.Config?; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Baseten.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Baseten.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Baseten/Generated/Baseten.Models.Config.g.cs b/src/libs/Baseten/Generated/Baseten.Models.Config.g.cs new file mode 100644 index 0000000..2bf7568 --- /dev/null +++ b/src/libs/Baseten/Generated/Baseten.Models.Config.g.cs @@ -0,0 +1,386 @@ +#pragma warning disable CS0618 // Type or member is obsolete + +#nullable enable + +namespace Baseten +{ + /// + /// Provider the connection authenticates with, and the team secret holding its API key. + /// + public readonly partial struct Config : global::System.IEquatable + { + /// + /// + /// + public global::Baseten.RouteConnectionV1ConfigDiscriminatorProvider? Provider { get; } + + /// + /// + /// +#if NET6_0_OR_GREATER + public global::Baseten.RouteConnectionAnthropicV1? Anthropic { get; init; } +#else + public global::Baseten.RouteConnectionAnthropicV1? Anthropic { get; } +#endif + + /// + /// + /// +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(Anthropic))] +#endif + public bool IsAnthropic => Anthropic != null; + + /// + /// + /// + public bool TryPickAnthropic( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Baseten.RouteConnectionAnthropicV1? value) + { + value = Anthropic; + return IsAnthropic; + } + + /// + /// + /// + public global::Baseten.RouteConnectionAnthropicV1 PickAnthropic() => Anthropic is { } value + ? value + : throw new global::System.InvalidOperationException($"Expected union variant 'Anthropic' but the value was {ToString()}."); + + /// + /// + /// +#if NET6_0_OR_GREATER + public global::Baseten.RouteConnectionOpenAIV1? Openai { get; init; } +#else + public global::Baseten.RouteConnectionOpenAIV1? Openai { get; } +#endif + + /// + /// + /// +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(Openai))] +#endif + public bool IsOpenai => Openai != null; + + /// + /// + /// + public bool TryPickOpenai( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Baseten.RouteConnectionOpenAIV1? value) + { + value = Openai; + return IsOpenai; + } + + /// + /// + /// + public global::Baseten.RouteConnectionOpenAIV1 PickOpenai() => Openai is { } value + ? value + : throw new global::System.InvalidOperationException($"Expected union variant 'Openai' but the value was {ToString()}."); + + /// + /// + /// +#if NET6_0_OR_GREATER + public global::Baseten.RouteConnectionXAIV1? Xai { get; init; } +#else + public global::Baseten.RouteConnectionXAIV1? Xai { get; } +#endif + + /// + /// + /// +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(Xai))] +#endif + public bool IsXai => Xai != null; + + /// + /// + /// + public bool TryPickXai( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Baseten.RouteConnectionXAIV1? value) + { + value = Xai; + return IsXai; + } + + /// + /// + /// + public global::Baseten.RouteConnectionXAIV1 PickXai() => Xai is { } value + ? value + : throw new global::System.InvalidOperationException($"Expected union variant 'Xai' but the value was {ToString()}."); + /// + /// + /// + public static implicit operator Config(global::Baseten.RouteConnectionAnthropicV1 value) => new Config((global::Baseten.RouteConnectionAnthropicV1?)value); + + /// + /// + /// + public static implicit operator global::Baseten.RouteConnectionAnthropicV1?(Config @this) => @this.Anthropic; + + /// + /// + /// + public Config(global::Baseten.RouteConnectionAnthropicV1? value) + { + Anthropic = value; + } + + /// + /// + /// + public static Config FromAnthropic(global::Baseten.RouteConnectionAnthropicV1? value) => new Config(value); + + /// + /// + /// + public static implicit operator Config(global::Baseten.RouteConnectionOpenAIV1 value) => new Config((global::Baseten.RouteConnectionOpenAIV1?)value); + + /// + /// + /// + public static implicit operator global::Baseten.RouteConnectionOpenAIV1?(Config @this) => @this.Openai; + + /// + /// + /// + public Config(global::Baseten.RouteConnectionOpenAIV1? value) + { + Openai = value; + } + + /// + /// + /// + public static Config FromOpenai(global::Baseten.RouteConnectionOpenAIV1? value) => new Config(value); + + /// + /// + /// + public static implicit operator Config(global::Baseten.RouteConnectionXAIV1 value) => new Config((global::Baseten.RouteConnectionXAIV1?)value); + + /// + /// + /// + public static implicit operator global::Baseten.RouteConnectionXAIV1?(Config @this) => @this.Xai; + + /// + /// + /// + public Config(global::Baseten.RouteConnectionXAIV1? value) + { + Xai = value; + } + + /// + /// + /// + public static Config FromXai(global::Baseten.RouteConnectionXAIV1? value) => new Config(value); + + /// + /// + /// + public Config( + global::Baseten.RouteConnectionV1ConfigDiscriminatorProvider? provider, + global::Baseten.RouteConnectionAnthropicV1? anthropic, + global::Baseten.RouteConnectionOpenAIV1? openai, + global::Baseten.RouteConnectionXAIV1? xai + ) + { + Provider = provider; + + Anthropic = anthropic; + Openai = openai; + Xai = xai; + } + + /// + /// + /// + public object? Object => + Xai as object ?? + Openai as object ?? + Anthropic as object + ; + + /// + /// + /// + public override string? ToString() => + Anthropic?.ToString() ?? + Openai?.ToString() ?? + Xai?.ToString() + ; + + /// + /// + /// + public bool Validate() + { + return IsAnthropic && !IsOpenai && !IsXai || !IsAnthropic && IsOpenai && !IsXai || !IsAnthropic && !IsOpenai && IsXai; + } + + /// + /// + /// + public TResult? Match( + global::System.Func? anthropic = null, + global::System.Func? openai = null, + global::System.Func? xai = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (Anthropic is { } __value0 && anthropic != null) + { + return anthropic(__value0); + } + else if (Openai is { } __value1 && openai != null) + { + return openai(__value1); + } + else if (Xai is { } __value2 && xai != null) + { + return xai(__value2); + } + + return default(TResult); + } + + /// + /// + /// + public void Match( + global::System.Action? anthropic = null, + + global::System.Action? openai = null, + + global::System.Action? xai = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (Anthropic is { } __value0) + { + anthropic?.Invoke(__value0); + } + else if (Openai is { } __value1) + { + openai?.Invoke(__value1); + } + else if (Xai is { } __value2) + { + xai?.Invoke(__value2); + } + } + + /// + /// + /// + public void Switch( + global::System.Action? anthropic = null, + global::System.Action? openai = null, + global::System.Action? xai = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (Anthropic is { } __value0) + { + anthropic?.Invoke(__value0); + } + else if (Openai is { } __value1) + { + openai?.Invoke(__value1); + } + else if (Xai is { } __value2) + { + xai?.Invoke(__value2); + } + } + + /// + /// + /// + public override int GetHashCode() + { + var fields = new object?[] + { + Anthropic, + typeof(global::Baseten.RouteConnectionAnthropicV1), + Openai, + typeof(global::Baseten.RouteConnectionOpenAIV1), + Xai, + typeof(global::Baseten.RouteConnectionXAIV1), + }; + const int offset = unchecked((int)2166136261); + const int prime = 16777619; + static int HashCodeAggregator(int hashCode, object? value) => value == null + ? (hashCode ^ 0) * prime + : (hashCode ^ value.GetHashCode()) * prime; + + return global::System.Linq.Enumerable.Aggregate(fields, offset, HashCodeAggregator); + } + + /// + /// + /// + public bool Equals(Config other) + { + return + global::System.Collections.Generic.EqualityComparer.Default.Equals(Anthropic, other.Anthropic) && + global::System.Collections.Generic.EqualityComparer.Default.Equals(Openai, other.Openai) && + global::System.Collections.Generic.EqualityComparer.Default.Equals(Xai, other.Xai) + ; + } + + /// + /// + /// + public static bool operator ==(Config obj1, Config obj2) + { + return global::System.Collections.Generic.EqualityComparer.Default.Equals(obj1, obj2); + } + + /// + /// + /// + public static bool operator !=(Config obj1, Config obj2) + { + return !(obj1 == obj2); + } + + /// + /// + /// + public override bool Equals(object? obj) + { + return obj is Config o && Equals(o); + } + } +} diff --git a/src/libs/Baseten/Generated/Baseten.Models.Config2.Json.g.cs b/src/libs/Baseten/Generated/Baseten.Models.Config2.Json.g.cs new file mode 100644 index 0000000..5745abb --- /dev/null +++ b/src/libs/Baseten/Generated/Baseten.Models.Config2.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Baseten +{ + public readonly partial struct Config2 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Baseten.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Baseten.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Baseten.Config2? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Baseten.Config2), + jsonSerializerContext) as global::Baseten.Config2?; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Baseten.Config2? FromJson( + string json) + { + return FromJson( + json, + global::Baseten.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Baseten.Config2? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Baseten.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Baseten.Config2), + jsonSerializerContext).ConfigureAwait(false)) as global::Baseten.Config2?; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Baseten.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Baseten.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Baseten/Generated/Baseten.Models.Config2.g.cs b/src/libs/Baseten/Generated/Baseten.Models.Config2.g.cs new file mode 100644 index 0000000..d8e050e --- /dev/null +++ b/src/libs/Baseten/Generated/Baseten.Models.Config2.g.cs @@ -0,0 +1,386 @@ +#pragma warning disable CS0618 // Type or member is obsolete + +#nullable enable + +namespace Baseten +{ + /// + /// Provider the connection authenticates with, and the team secret holding its API key. + /// + public readonly partial struct Config2 : global::System.IEquatable + { + /// + /// + /// + public global::Baseten.CreateRouteConnectionRequestV1ConfigDiscriminatorProvider? Provider { get; } + + /// + /// + /// +#if NET6_0_OR_GREATER + public global::Baseten.RouteConnectionConfigAnthropicV1? Anthropic { get; init; } +#else + public global::Baseten.RouteConnectionConfigAnthropicV1? Anthropic { get; } +#endif + + /// + /// + /// +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(Anthropic))] +#endif + public bool IsAnthropic => Anthropic != null; + + /// + /// + /// + public bool TryPickAnthropic( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Baseten.RouteConnectionConfigAnthropicV1? value) + { + value = Anthropic; + return IsAnthropic; + } + + /// + /// + /// + public global::Baseten.RouteConnectionConfigAnthropicV1 PickAnthropic() => Anthropic is { } value + ? value + : throw new global::System.InvalidOperationException($"Expected union variant 'Anthropic' but the value was {ToString()}."); + + /// + /// + /// +#if NET6_0_OR_GREATER + public global::Baseten.RouteConnectionConfigOpenAIV1? Openai { get; init; } +#else + public global::Baseten.RouteConnectionConfigOpenAIV1? Openai { get; } +#endif + + /// + /// + /// +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(Openai))] +#endif + public bool IsOpenai => Openai != null; + + /// + /// + /// + public bool TryPickOpenai( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Baseten.RouteConnectionConfigOpenAIV1? value) + { + value = Openai; + return IsOpenai; + } + + /// + /// + /// + public global::Baseten.RouteConnectionConfigOpenAIV1 PickOpenai() => Openai is { } value + ? value + : throw new global::System.InvalidOperationException($"Expected union variant 'Openai' but the value was {ToString()}."); + + /// + /// + /// +#if NET6_0_OR_GREATER + public global::Baseten.RouteConnectionConfigXAIV1? Xai { get; init; } +#else + public global::Baseten.RouteConnectionConfigXAIV1? Xai { get; } +#endif + + /// + /// + /// +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(Xai))] +#endif + public bool IsXai => Xai != null; + + /// + /// + /// + public bool TryPickXai( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Baseten.RouteConnectionConfigXAIV1? value) + { + value = Xai; + return IsXai; + } + + /// + /// + /// + public global::Baseten.RouteConnectionConfigXAIV1 PickXai() => Xai is { } value + ? value + : throw new global::System.InvalidOperationException($"Expected union variant 'Xai' but the value was {ToString()}."); + /// + /// + /// + public static implicit operator Config2(global::Baseten.RouteConnectionConfigAnthropicV1 value) => new Config2((global::Baseten.RouteConnectionConfigAnthropicV1?)value); + + /// + /// + /// + public static implicit operator global::Baseten.RouteConnectionConfigAnthropicV1?(Config2 @this) => @this.Anthropic; + + /// + /// + /// + public Config2(global::Baseten.RouteConnectionConfigAnthropicV1? value) + { + Anthropic = value; + } + + /// + /// + /// + public static Config2 FromAnthropic(global::Baseten.RouteConnectionConfigAnthropicV1? value) => new Config2(value); + + /// + /// + /// + public static implicit operator Config2(global::Baseten.RouteConnectionConfigOpenAIV1 value) => new Config2((global::Baseten.RouteConnectionConfigOpenAIV1?)value); + + /// + /// + /// + public static implicit operator global::Baseten.RouteConnectionConfigOpenAIV1?(Config2 @this) => @this.Openai; + + /// + /// + /// + public Config2(global::Baseten.RouteConnectionConfigOpenAIV1? value) + { + Openai = value; + } + + /// + /// + /// + public static Config2 FromOpenai(global::Baseten.RouteConnectionConfigOpenAIV1? value) => new Config2(value); + + /// + /// + /// + public static implicit operator Config2(global::Baseten.RouteConnectionConfigXAIV1 value) => new Config2((global::Baseten.RouteConnectionConfigXAIV1?)value); + + /// + /// + /// + public static implicit operator global::Baseten.RouteConnectionConfigXAIV1?(Config2 @this) => @this.Xai; + + /// + /// + /// + public Config2(global::Baseten.RouteConnectionConfigXAIV1? value) + { + Xai = value; + } + + /// + /// + /// + public static Config2 FromXai(global::Baseten.RouteConnectionConfigXAIV1? value) => new Config2(value); + + /// + /// + /// + public Config2( + global::Baseten.CreateRouteConnectionRequestV1ConfigDiscriminatorProvider? provider, + global::Baseten.RouteConnectionConfigAnthropicV1? anthropic, + global::Baseten.RouteConnectionConfigOpenAIV1? openai, + global::Baseten.RouteConnectionConfigXAIV1? xai + ) + { + Provider = provider; + + Anthropic = anthropic; + Openai = openai; + Xai = xai; + } + + /// + /// + /// + public object? Object => + Xai as object ?? + Openai as object ?? + Anthropic as object + ; + + /// + /// + /// + public override string? ToString() => + Anthropic?.ToString() ?? + Openai?.ToString() ?? + Xai?.ToString() + ; + + /// + /// + /// + public bool Validate() + { + return IsAnthropic && !IsOpenai && !IsXai || !IsAnthropic && IsOpenai && !IsXai || !IsAnthropic && !IsOpenai && IsXai; + } + + /// + /// + /// + public TResult? Match( + global::System.Func? anthropic = null, + global::System.Func? openai = null, + global::System.Func? xai = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (Anthropic is { } __value0 && anthropic != null) + { + return anthropic(__value0); + } + else if (Openai is { } __value1 && openai != null) + { + return openai(__value1); + } + else if (Xai is { } __value2 && xai != null) + { + return xai(__value2); + } + + return default(TResult); + } + + /// + /// + /// + public void Match( + global::System.Action? anthropic = null, + + global::System.Action? openai = null, + + global::System.Action? xai = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (Anthropic is { } __value0) + { + anthropic?.Invoke(__value0); + } + else if (Openai is { } __value1) + { + openai?.Invoke(__value1); + } + else if (Xai is { } __value2) + { + xai?.Invoke(__value2); + } + } + + /// + /// + /// + public void Switch( + global::System.Action? anthropic = null, + global::System.Action? openai = null, + global::System.Action? xai = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (Anthropic is { } __value0) + { + anthropic?.Invoke(__value0); + } + else if (Openai is { } __value1) + { + openai?.Invoke(__value1); + } + else if (Xai is { } __value2) + { + xai?.Invoke(__value2); + } + } + + /// + /// + /// + public override int GetHashCode() + { + var fields = new object?[] + { + Anthropic, + typeof(global::Baseten.RouteConnectionConfigAnthropicV1), + Openai, + typeof(global::Baseten.RouteConnectionConfigOpenAIV1), + Xai, + typeof(global::Baseten.RouteConnectionConfigXAIV1), + }; + const int offset = unchecked((int)2166136261); + const int prime = 16777619; + static int HashCodeAggregator(int hashCode, object? value) => value == null + ? (hashCode ^ 0) * prime + : (hashCode ^ value.GetHashCode()) * prime; + + return global::System.Linq.Enumerable.Aggregate(fields, offset, HashCodeAggregator); + } + + /// + /// + /// + public bool Equals(Config2 other) + { + return + global::System.Collections.Generic.EqualityComparer.Default.Equals(Anthropic, other.Anthropic) && + global::System.Collections.Generic.EqualityComparer.Default.Equals(Openai, other.Openai) && + global::System.Collections.Generic.EqualityComparer.Default.Equals(Xai, other.Xai) + ; + } + + /// + /// + /// + public static bool operator ==(Config2 obj1, Config2 obj2) + { + return global::System.Collections.Generic.EqualityComparer.Default.Equals(obj1, obj2); + } + + /// + /// + /// + public static bool operator !=(Config2 obj1, Config2 obj2) + { + return !(obj1 == obj2); + } + + /// + /// + /// + public override bool Equals(object? obj) + { + return obj is Config2 o && Equals(o); + } + } +} diff --git a/src/libs/Baseten/Generated/Baseten.Models.Config3.Json.g.cs b/src/libs/Baseten/Generated/Baseten.Models.Config3.Json.g.cs new file mode 100644 index 0000000..e1db210 --- /dev/null +++ b/src/libs/Baseten/Generated/Baseten.Models.Config3.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Baseten +{ + public readonly partial struct Config3 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Baseten.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Baseten.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Baseten.Config3? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Baseten.Config3), + jsonSerializerContext) as global::Baseten.Config3?; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Baseten.Config3? FromJson( + string json) + { + return FromJson( + json, + global::Baseten.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Baseten.Config3? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Baseten.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Baseten.Config3), + jsonSerializerContext).ConfigureAwait(false)) as global::Baseten.Config3?; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Baseten.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Baseten.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Baseten/Generated/Baseten.Models.Config3.g.cs b/src/libs/Baseten/Generated/Baseten.Models.Config3.g.cs new file mode 100644 index 0000000..8750cbf --- /dev/null +++ b/src/libs/Baseten/Generated/Baseten.Models.Config3.g.cs @@ -0,0 +1,386 @@ +#pragma warning disable CS0618 // Type or member is obsolete + +#nullable enable + +namespace Baseten +{ + /// + /// Connection fields to change. The provider must match the connection and is immutable. + /// + public readonly partial struct Config3 : global::System.IEquatable + { + /// + /// + /// + public global::Baseten.UpdateRouteConnectionRequestV1ConfigDiscriminatorProvider? Provider { get; } + + /// + /// + /// +#if NET6_0_OR_GREATER + public global::Baseten.UpdateRouteConnectionConfigAnthropicV1? Anthropic { get; init; } +#else + public global::Baseten.UpdateRouteConnectionConfigAnthropicV1? Anthropic { get; } +#endif + + /// + /// + /// +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(Anthropic))] +#endif + public bool IsAnthropic => Anthropic != null; + + /// + /// + /// + public bool TryPickAnthropic( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Baseten.UpdateRouteConnectionConfigAnthropicV1? value) + { + value = Anthropic; + return IsAnthropic; + } + + /// + /// + /// + public global::Baseten.UpdateRouteConnectionConfigAnthropicV1 PickAnthropic() => Anthropic is { } value + ? value + : throw new global::System.InvalidOperationException($"Expected union variant 'Anthropic' but the value was {ToString()}."); + + /// + /// + /// +#if NET6_0_OR_GREATER + public global::Baseten.UpdateRouteConnectionConfigOpenAIV1? Openai { get; init; } +#else + public global::Baseten.UpdateRouteConnectionConfigOpenAIV1? Openai { get; } +#endif + + /// + /// + /// +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(Openai))] +#endif + public bool IsOpenai => Openai != null; + + /// + /// + /// + public bool TryPickOpenai( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Baseten.UpdateRouteConnectionConfigOpenAIV1? value) + { + value = Openai; + return IsOpenai; + } + + /// + /// + /// + public global::Baseten.UpdateRouteConnectionConfigOpenAIV1 PickOpenai() => Openai is { } value + ? value + : throw new global::System.InvalidOperationException($"Expected union variant 'Openai' but the value was {ToString()}."); + + /// + /// + /// +#if NET6_0_OR_GREATER + public global::Baseten.UpdateRouteConnectionConfigXAIV1? Xai { get; init; } +#else + public global::Baseten.UpdateRouteConnectionConfigXAIV1? Xai { get; } +#endif + + /// + /// + /// +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(Xai))] +#endif + public bool IsXai => Xai != null; + + /// + /// + /// + public bool TryPickXai( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Baseten.UpdateRouteConnectionConfigXAIV1? value) + { + value = Xai; + return IsXai; + } + + /// + /// + /// + public global::Baseten.UpdateRouteConnectionConfigXAIV1 PickXai() => Xai is { } value + ? value + : throw new global::System.InvalidOperationException($"Expected union variant 'Xai' but the value was {ToString()}."); + /// + /// + /// + public static implicit operator Config3(global::Baseten.UpdateRouteConnectionConfigAnthropicV1 value) => new Config3((global::Baseten.UpdateRouteConnectionConfigAnthropicV1?)value); + + /// + /// + /// + public static implicit operator global::Baseten.UpdateRouteConnectionConfigAnthropicV1?(Config3 @this) => @this.Anthropic; + + /// + /// + /// + public Config3(global::Baseten.UpdateRouteConnectionConfigAnthropicV1? value) + { + Anthropic = value; + } + + /// + /// + /// + public static Config3 FromAnthropic(global::Baseten.UpdateRouteConnectionConfigAnthropicV1? value) => new Config3(value); + + /// + /// + /// + public static implicit operator Config3(global::Baseten.UpdateRouteConnectionConfigOpenAIV1 value) => new Config3((global::Baseten.UpdateRouteConnectionConfigOpenAIV1?)value); + + /// + /// + /// + public static implicit operator global::Baseten.UpdateRouteConnectionConfigOpenAIV1?(Config3 @this) => @this.Openai; + + /// + /// + /// + public Config3(global::Baseten.UpdateRouteConnectionConfigOpenAIV1? value) + { + Openai = value; + } + + /// + /// + /// + public static Config3 FromOpenai(global::Baseten.UpdateRouteConnectionConfigOpenAIV1? value) => new Config3(value); + + /// + /// + /// + public static implicit operator Config3(global::Baseten.UpdateRouteConnectionConfigXAIV1 value) => new Config3((global::Baseten.UpdateRouteConnectionConfigXAIV1?)value); + + /// + /// + /// + public static implicit operator global::Baseten.UpdateRouteConnectionConfigXAIV1?(Config3 @this) => @this.Xai; + + /// + /// + /// + public Config3(global::Baseten.UpdateRouteConnectionConfigXAIV1? value) + { + Xai = value; + } + + /// + /// + /// + public static Config3 FromXai(global::Baseten.UpdateRouteConnectionConfigXAIV1? value) => new Config3(value); + + /// + /// + /// + public Config3( + global::Baseten.UpdateRouteConnectionRequestV1ConfigDiscriminatorProvider? provider, + global::Baseten.UpdateRouteConnectionConfigAnthropicV1? anthropic, + global::Baseten.UpdateRouteConnectionConfigOpenAIV1? openai, + global::Baseten.UpdateRouteConnectionConfigXAIV1? xai + ) + { + Provider = provider; + + Anthropic = anthropic; + Openai = openai; + Xai = xai; + } + + /// + /// + /// + public object? Object => + Xai as object ?? + Openai as object ?? + Anthropic as object + ; + + /// + /// + /// + public override string? ToString() => + Anthropic?.ToString() ?? + Openai?.ToString() ?? + Xai?.ToString() + ; + + /// + /// + /// + public bool Validate() + { + return IsAnthropic && !IsOpenai && !IsXai || !IsAnthropic && IsOpenai && !IsXai || !IsAnthropic && !IsOpenai && IsXai; + } + + /// + /// + /// + public TResult? Match( + global::System.Func? anthropic = null, + global::System.Func? openai = null, + global::System.Func? xai = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (Anthropic is { } __value0 && anthropic != null) + { + return anthropic(__value0); + } + else if (Openai is { } __value1 && openai != null) + { + return openai(__value1); + } + else if (Xai is { } __value2 && xai != null) + { + return xai(__value2); + } + + return default(TResult); + } + + /// + /// + /// + public void Match( + global::System.Action? anthropic = null, + + global::System.Action? openai = null, + + global::System.Action? xai = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (Anthropic is { } __value0) + { + anthropic?.Invoke(__value0); + } + else if (Openai is { } __value1) + { + openai?.Invoke(__value1); + } + else if (Xai is { } __value2) + { + xai?.Invoke(__value2); + } + } + + /// + /// + /// + public void Switch( + global::System.Action? anthropic = null, + global::System.Action? openai = null, + global::System.Action? xai = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (Anthropic is { } __value0) + { + anthropic?.Invoke(__value0); + } + else if (Openai is { } __value1) + { + openai?.Invoke(__value1); + } + else if (Xai is { } __value2) + { + xai?.Invoke(__value2); + } + } + + /// + /// + /// + public override int GetHashCode() + { + var fields = new object?[] + { + Anthropic, + typeof(global::Baseten.UpdateRouteConnectionConfigAnthropicV1), + Openai, + typeof(global::Baseten.UpdateRouteConnectionConfigOpenAIV1), + Xai, + typeof(global::Baseten.UpdateRouteConnectionConfigXAIV1), + }; + const int offset = unchecked((int)2166136261); + const int prime = 16777619; + static int HashCodeAggregator(int hashCode, object? value) => value == null + ? (hashCode ^ 0) * prime + : (hashCode ^ value.GetHashCode()) * prime; + + return global::System.Linq.Enumerable.Aggregate(fields, offset, HashCodeAggregator); + } + + /// + /// + /// + public bool Equals(Config3 other) + { + return + global::System.Collections.Generic.EqualityComparer.Default.Equals(Anthropic, other.Anthropic) && + global::System.Collections.Generic.EqualityComparer.Default.Equals(Openai, other.Openai) && + global::System.Collections.Generic.EqualityComparer.Default.Equals(Xai, other.Xai) + ; + } + + /// + /// + /// + public static bool operator ==(Config3 obj1, Config3 obj2) + { + return global::System.Collections.Generic.EqualityComparer.Default.Equals(obj1, obj2); + } + + /// + /// + /// + public static bool operator !=(Config3 obj1, Config3 obj2) + { + return !(obj1 == obj2); + } + + /// + /// + /// + public override bool Equals(object? obj) + { + return obj is Config3 o && Equals(o); + } + } +} diff --git a/src/libs/Baseten/Generated/Baseten.Models.CreateRouteConnectionRequestV1.Json.g.cs b/src/libs/Baseten/Generated/Baseten.Models.CreateRouteConnectionRequestV1.Json.g.cs new file mode 100644 index 0000000..226dc19 --- /dev/null +++ b/src/libs/Baseten/Generated/Baseten.Models.CreateRouteConnectionRequestV1.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Baseten +{ + public sealed partial class CreateRouteConnectionRequestV1 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Baseten.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Baseten.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Baseten.CreateRouteConnectionRequestV1? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Baseten.CreateRouteConnectionRequestV1), + jsonSerializerContext) as global::Baseten.CreateRouteConnectionRequestV1; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Baseten.CreateRouteConnectionRequestV1? FromJson( + string json) + { + return FromJson( + json, + global::Baseten.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Baseten.CreateRouteConnectionRequestV1? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Baseten.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Baseten.CreateRouteConnectionRequestV1), + jsonSerializerContext).ConfigureAwait(false)) as global::Baseten.CreateRouteConnectionRequestV1; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Baseten.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Baseten.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Baseten/Generated/Baseten.Models.CreateRouteConnectionRequestV1.g.cs b/src/libs/Baseten/Generated/Baseten.Models.CreateRouteConnectionRequestV1.g.cs new file mode 100644 index 0000000..15411b6 --- /dev/null +++ b/src/libs/Baseten/Generated/Baseten.Models.CreateRouteConnectionRequestV1.g.cs @@ -0,0 +1,61 @@ + +#nullable enable + +namespace Baseten +{ + /// + /// + /// + public sealed partial class CreateRouteConnectionRequestV1 + { + /// + /// Identifier of the team that owns the connection.
+ /// Default Value: openapi-json-null-sentinel-value-2BF93600-0FE4-4250-987A-E5DDB203E464 + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("team_id")] + public string? TeamId { get; set; } + + /// + /// Provider the connection authenticates with, and the team secret holding its API key. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("config")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Baseten.JsonConverters.Config2JsonConverter))] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::Baseten.Config2 Config { 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. + /// + /// + /// Provider the connection authenticates with, and the team secret holding its API key. + /// + /// + /// Identifier of the team that owns the connection.
+ /// Default Value: openapi-json-null-sentinel-value-2BF93600-0FE4-4250-987A-E5DDB203E464 + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public CreateRouteConnectionRequestV1( + global::Baseten.Config2 config, + string? teamId) + { + this.TeamId = teamId; + this.Config = config; + } + + /// + /// Initializes a new instance of the class. + /// + public CreateRouteConnectionRequestV1() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Baseten/Generated/Baseten.Models.CreateRouteConnectionRequestV1ConfigDiscriminator.Json.g.cs b/src/libs/Baseten/Generated/Baseten.Models.CreateRouteConnectionRequestV1ConfigDiscriminator.Json.g.cs new file mode 100644 index 0000000..23faf0b --- /dev/null +++ b/src/libs/Baseten/Generated/Baseten.Models.CreateRouteConnectionRequestV1ConfigDiscriminator.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Baseten +{ + public sealed partial class CreateRouteConnectionRequestV1ConfigDiscriminator + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Baseten.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Baseten.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Baseten.CreateRouteConnectionRequestV1ConfigDiscriminator? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Baseten.CreateRouteConnectionRequestV1ConfigDiscriminator), + jsonSerializerContext) as global::Baseten.CreateRouteConnectionRequestV1ConfigDiscriminator; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Baseten.CreateRouteConnectionRequestV1ConfigDiscriminator? FromJson( + string json) + { + return FromJson( + json, + global::Baseten.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Baseten.CreateRouteConnectionRequestV1ConfigDiscriminator? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Baseten.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Baseten.CreateRouteConnectionRequestV1ConfigDiscriminator), + jsonSerializerContext).ConfigureAwait(false)) as global::Baseten.CreateRouteConnectionRequestV1ConfigDiscriminator; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Baseten.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Baseten.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Baseten/Generated/Baseten.Models.CreateRouteConnectionRequestV1ConfigDiscriminator.g.cs b/src/libs/Baseten/Generated/Baseten.Models.CreateRouteConnectionRequestV1ConfigDiscriminator.g.cs new file mode 100644 index 0000000..c6e2c50 --- /dev/null +++ b/src/libs/Baseten/Generated/Baseten.Models.CreateRouteConnectionRequestV1ConfigDiscriminator.g.cs @@ -0,0 +1,45 @@ + +#nullable enable + +namespace Baseten +{ + /// + /// + /// + public sealed partial class CreateRouteConnectionRequestV1ConfigDiscriminator + { + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("provider")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Baseten.JsonConverters.CreateRouteConnectionRequestV1ConfigDiscriminatorProviderJsonConverter))] + public global::Baseten.CreateRouteConnectionRequestV1ConfigDiscriminatorProvider? Provider { 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 CreateRouteConnectionRequestV1ConfigDiscriminator( + global::Baseten.CreateRouteConnectionRequestV1ConfigDiscriminatorProvider? provider) + { + this.Provider = provider; + } + + /// + /// Initializes a new instance of the class. + /// + public CreateRouteConnectionRequestV1ConfigDiscriminator() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Baseten/Generated/Baseten.Models.CreateRouteConnectionRequestV1ConfigDiscriminatorProvider.g.cs b/src/libs/Baseten/Generated/Baseten.Models.CreateRouteConnectionRequestV1ConfigDiscriminatorProvider.g.cs new file mode 100644 index 0000000..accbd6b --- /dev/null +++ b/src/libs/Baseten/Generated/Baseten.Models.CreateRouteConnectionRequestV1ConfigDiscriminatorProvider.g.cs @@ -0,0 +1,57 @@ + +#nullable enable + +namespace Baseten +{ + /// + /// + /// + public enum CreateRouteConnectionRequestV1ConfigDiscriminatorProvider + { + /// + /// + /// + Anthropic, + /// + /// + /// + Openai, + /// + /// + /// + Xai, + } + + /// + /// Enum extensions to do fast conversions without the reflection. + /// + public static class CreateRouteConnectionRequestV1ConfigDiscriminatorProviderExtensions + { + /// + /// Converts an enum to a string. + /// + public static string ToValueString(this CreateRouteConnectionRequestV1ConfigDiscriminatorProvider value) + { + return value switch + { + CreateRouteConnectionRequestV1ConfigDiscriminatorProvider.Anthropic => "ANTHROPIC", + CreateRouteConnectionRequestV1ConfigDiscriminatorProvider.Openai => "OPENAI", + CreateRouteConnectionRequestV1ConfigDiscriminatorProvider.Xai => "XAI", + _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), + }; + } + /// + /// Converts an string to a enum. + /// + public static CreateRouteConnectionRequestV1ConfigDiscriminatorProvider? ToEnum(string value) + { + return value switch + { + "ANTHROPIC" => CreateRouteConnectionRequestV1ConfigDiscriminatorProvider.Anthropic, + "OPENAI" => CreateRouteConnectionRequestV1ConfigDiscriminatorProvider.Openai, + "XAI" => CreateRouteConnectionRequestV1ConfigDiscriminatorProvider.Xai, + _ => null, + }; + } + } +} \ No newline at end of file diff --git a/src/libs/Baseten/Generated/Baseten.Models.CreateRouteRequestV1.g.cs b/src/libs/Baseten/Generated/Baseten.Models.CreateRouteRequestV1.g.cs index 38a73d4..8003a0b 100644 --- a/src/libs/Baseten/Generated/Baseten.Models.CreateRouteRequestV1.g.cs +++ b/src/libs/Baseten/Generated/Baseten.Models.CreateRouteRequestV1.g.cs @@ -9,7 +9,7 @@ namespace Baseten public sealed partial class CreateRouteRequestV1 { /// - /// Identifier of the team that owns the route. When omitted, uses your organization's default team.
+ /// Identifier of the team that owns the route.
/// Default Value: openapi-json-null-sentinel-value-2BF93600-0FE4-4250-987A-E5DDB203E464 ///
[global::System.Text.Json.Serialization.JsonPropertyName("team_id")] @@ -50,7 +50,7 @@ public sealed partial class CreateRouteRequestV1 /// Upstream target for the route. /// /// - /// Identifier of the team that owns the route. When omitted, uses your organization's default team.
+ /// Identifier of the team that owns the route.
/// Default Value: openapi-json-null-sentinel-value-2BF93600-0FE4-4250-987A-E5DDB203E464 /// /// diff --git a/src/libs/Baseten/Generated/Baseten.Models.RouteConnectionAnthropicV1.Json.g.cs b/src/libs/Baseten/Generated/Baseten.Models.RouteConnectionAnthropicV1.Json.g.cs new file mode 100644 index 0000000..a7c8245 --- /dev/null +++ b/src/libs/Baseten/Generated/Baseten.Models.RouteConnectionAnthropicV1.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Baseten +{ + public sealed partial class RouteConnectionAnthropicV1 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Baseten.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Baseten.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Baseten.RouteConnectionAnthropicV1? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Baseten.RouteConnectionAnthropicV1), + jsonSerializerContext) as global::Baseten.RouteConnectionAnthropicV1; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Baseten.RouteConnectionAnthropicV1? FromJson( + string json) + { + return FromJson( + json, + global::Baseten.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Baseten.RouteConnectionAnthropicV1? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Baseten.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Baseten.RouteConnectionAnthropicV1), + jsonSerializerContext).ConfigureAwait(false)) as global::Baseten.RouteConnectionAnthropicV1; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Baseten.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Baseten.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Baseten/Generated/Baseten.Models.RouteConnectionAnthropicV1.g.cs b/src/libs/Baseten/Generated/Baseten.Models.RouteConnectionAnthropicV1.g.cs new file mode 100644 index 0000000..93b7386 --- /dev/null +++ b/src/libs/Baseten/Generated/Baseten.Models.RouteConnectionAnthropicV1.g.cs @@ -0,0 +1,71 @@ + +#nullable enable + +namespace Baseten +{ + /// + /// + /// + public sealed partial class RouteConnectionAnthropicV1 + { + /// + /// Provider kind for Anthropic. + /// + /// "ANTHROPIC" + [global::System.Text.Json.Serialization.JsonPropertyName("provider")] + public string Provider { get; set; } = "ANTHROPIC"; + + /// + /// Identifier of the team secret holding the provider API key. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("secret_id")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string SecretId { get; set; } + + /// + /// Name of the team secret holding the provider API key. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("secret_name")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string SecretName { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// Identifier of the team secret holding the provider API key. + /// + /// + /// Name of the team secret holding the provider API key. + /// + /// + /// Provider kind for Anthropic. + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public RouteConnectionAnthropicV1( + string secretId, + string secretName, + string provider = "ANTHROPIC") + { + this.Provider = provider; + this.SecretId = secretId ?? throw new global::System.ArgumentNullException(nameof(secretId)); + this.SecretName = secretName ?? throw new global::System.ArgumentNullException(nameof(secretName)); + } + + /// + /// Initializes a new instance of the class. + /// + public RouteConnectionAnthropicV1() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Baseten/Generated/Baseten.Models.RouteConnectionConfigAnthropicV1.Json.g.cs b/src/libs/Baseten/Generated/Baseten.Models.RouteConnectionConfigAnthropicV1.Json.g.cs new file mode 100644 index 0000000..5807975 --- /dev/null +++ b/src/libs/Baseten/Generated/Baseten.Models.RouteConnectionConfigAnthropicV1.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Baseten +{ + public sealed partial class RouteConnectionConfigAnthropicV1 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Baseten.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Baseten.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Baseten.RouteConnectionConfigAnthropicV1? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Baseten.RouteConnectionConfigAnthropicV1), + jsonSerializerContext) as global::Baseten.RouteConnectionConfigAnthropicV1; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Baseten.RouteConnectionConfigAnthropicV1? FromJson( + string json) + { + return FromJson( + json, + global::Baseten.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Baseten.RouteConnectionConfigAnthropicV1? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Baseten.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Baseten.RouteConnectionConfigAnthropicV1), + jsonSerializerContext).ConfigureAwait(false)) as global::Baseten.RouteConnectionConfigAnthropicV1; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Baseten.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Baseten.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Baseten/Generated/Baseten.Models.RouteConnectionConfigAnthropicV1.g.cs b/src/libs/Baseten/Generated/Baseten.Models.RouteConnectionConfigAnthropicV1.g.cs new file mode 100644 index 0000000..24cced7 --- /dev/null +++ b/src/libs/Baseten/Generated/Baseten.Models.RouteConnectionConfigAnthropicV1.g.cs @@ -0,0 +1,71 @@ + +#nullable enable + +namespace Baseten +{ + /// + /// + /// + public sealed partial class RouteConnectionConfigAnthropicV1 + { + /// + /// Provider kind for Anthropic. + /// + /// "ANTHROPIC" + [global::System.Text.Json.Serialization.JsonPropertyName("provider")] + public string Provider { get; set; } = "ANTHROPIC"; + + /// + /// Identifier of an existing secret, owned by the same team, that holds the provider API key. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("secret_id")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string SecretId { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// Identifier of an existing secret, owned by the same team, that holds the provider API key. + /// + /// + /// Provider kind for Anthropic. + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public RouteConnectionConfigAnthropicV1( + string secretId, + string provider = "ANTHROPIC") + { + this.Provider = provider; + this.SecretId = secretId ?? throw new global::System.ArgumentNullException(nameof(secretId)); + } + + /// + /// Initializes a new instance of the class. + /// + public RouteConnectionConfigAnthropicV1() + { + } + + /// + /// Creates a new from its single non-const required field, + /// hardcoding any const discriminator fields. + /// + public static RouteConnectionConfigAnthropicV1 FromSecretId(string secretId) + { + return new RouteConnectionConfigAnthropicV1 + { + SecretId = secretId, + }; + } + + } +} \ No newline at end of file diff --git a/src/libs/Baseten/Generated/Baseten.Models.RouteConnectionConfigOpenAIV1.Json.g.cs b/src/libs/Baseten/Generated/Baseten.Models.RouteConnectionConfigOpenAIV1.Json.g.cs new file mode 100644 index 0000000..e09078f --- /dev/null +++ b/src/libs/Baseten/Generated/Baseten.Models.RouteConnectionConfigOpenAIV1.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Baseten +{ + public sealed partial class RouteConnectionConfigOpenAIV1 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Baseten.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Baseten.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Baseten.RouteConnectionConfigOpenAIV1? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Baseten.RouteConnectionConfigOpenAIV1), + jsonSerializerContext) as global::Baseten.RouteConnectionConfigOpenAIV1; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Baseten.RouteConnectionConfigOpenAIV1? FromJson( + string json) + { + return FromJson( + json, + global::Baseten.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Baseten.RouteConnectionConfigOpenAIV1? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Baseten.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Baseten.RouteConnectionConfigOpenAIV1), + jsonSerializerContext).ConfigureAwait(false)) as global::Baseten.RouteConnectionConfigOpenAIV1; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Baseten.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Baseten.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Baseten/Generated/Baseten.Models.RouteConnectionConfigOpenAIV1.g.cs b/src/libs/Baseten/Generated/Baseten.Models.RouteConnectionConfigOpenAIV1.g.cs new file mode 100644 index 0000000..9a54f56 --- /dev/null +++ b/src/libs/Baseten/Generated/Baseten.Models.RouteConnectionConfigOpenAIV1.g.cs @@ -0,0 +1,71 @@ + +#nullable enable + +namespace Baseten +{ + /// + /// + /// + public sealed partial class RouteConnectionConfigOpenAIV1 + { + /// + /// Provider kind for OpenAI. + /// + /// "OPENAI" + [global::System.Text.Json.Serialization.JsonPropertyName("provider")] + public string Provider { get; set; } = "OPENAI"; + + /// + /// Identifier of an existing secret, owned by the same team, that holds the provider API key. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("secret_id")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string SecretId { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// Identifier of an existing secret, owned by the same team, that holds the provider API key. + /// + /// + /// Provider kind for OpenAI. + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public RouteConnectionConfigOpenAIV1( + string secretId, + string provider = "OPENAI") + { + this.Provider = provider; + this.SecretId = secretId ?? throw new global::System.ArgumentNullException(nameof(secretId)); + } + + /// + /// Initializes a new instance of the class. + /// + public RouteConnectionConfigOpenAIV1() + { + } + + /// + /// Creates a new from its single non-const required field, + /// hardcoding any const discriminator fields. + /// + public static RouteConnectionConfigOpenAIV1 FromSecretId(string secretId) + { + return new RouteConnectionConfigOpenAIV1 + { + SecretId = secretId, + }; + } + + } +} \ No newline at end of file diff --git a/src/libs/Baseten/Generated/Baseten.Models.RouteConnectionConfigXAIV1.Json.g.cs b/src/libs/Baseten/Generated/Baseten.Models.RouteConnectionConfigXAIV1.Json.g.cs new file mode 100644 index 0000000..f93306c --- /dev/null +++ b/src/libs/Baseten/Generated/Baseten.Models.RouteConnectionConfigXAIV1.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Baseten +{ + public sealed partial class RouteConnectionConfigXAIV1 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Baseten.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Baseten.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Baseten.RouteConnectionConfigXAIV1? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Baseten.RouteConnectionConfigXAIV1), + jsonSerializerContext) as global::Baseten.RouteConnectionConfigXAIV1; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Baseten.RouteConnectionConfigXAIV1? FromJson( + string json) + { + return FromJson( + json, + global::Baseten.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Baseten.RouteConnectionConfigXAIV1? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Baseten.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Baseten.RouteConnectionConfigXAIV1), + jsonSerializerContext).ConfigureAwait(false)) as global::Baseten.RouteConnectionConfigXAIV1; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Baseten.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Baseten.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Baseten/Generated/Baseten.Models.RouteConnectionConfigXAIV1.g.cs b/src/libs/Baseten/Generated/Baseten.Models.RouteConnectionConfigXAIV1.g.cs new file mode 100644 index 0000000..d85574b --- /dev/null +++ b/src/libs/Baseten/Generated/Baseten.Models.RouteConnectionConfigXAIV1.g.cs @@ -0,0 +1,71 @@ + +#nullable enable + +namespace Baseten +{ + /// + /// + /// + public sealed partial class RouteConnectionConfigXAIV1 + { + /// + /// Provider kind for xAI. + /// + /// "XAI" + [global::System.Text.Json.Serialization.JsonPropertyName("provider")] + public string Provider { get; set; } = "XAI"; + + /// + /// Identifier of an existing secret, owned by the same team, that holds the provider API key. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("secret_id")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string SecretId { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// Identifier of an existing secret, owned by the same team, that holds the provider API key. + /// + /// + /// Provider kind for xAI. + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public RouteConnectionConfigXAIV1( + string secretId, + string provider = "XAI") + { + this.Provider = provider; + this.SecretId = secretId ?? throw new global::System.ArgumentNullException(nameof(secretId)); + } + + /// + /// Initializes a new instance of the class. + /// + public RouteConnectionConfigXAIV1() + { + } + + /// + /// Creates a new from its single non-const required field, + /// hardcoding any const discriminator fields. + /// + public static RouteConnectionConfigXAIV1 FromSecretId(string secretId) + { + return new RouteConnectionConfigXAIV1 + { + SecretId = secretId, + }; + } + + } +} \ No newline at end of file diff --git a/src/libs/Baseten/Generated/Baseten.Models.RouteConnectionOpenAIV1.Json.g.cs b/src/libs/Baseten/Generated/Baseten.Models.RouteConnectionOpenAIV1.Json.g.cs new file mode 100644 index 0000000..d18be32 --- /dev/null +++ b/src/libs/Baseten/Generated/Baseten.Models.RouteConnectionOpenAIV1.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Baseten +{ + public sealed partial class RouteConnectionOpenAIV1 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Baseten.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Baseten.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Baseten.RouteConnectionOpenAIV1? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Baseten.RouteConnectionOpenAIV1), + jsonSerializerContext) as global::Baseten.RouteConnectionOpenAIV1; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Baseten.RouteConnectionOpenAIV1? FromJson( + string json) + { + return FromJson( + json, + global::Baseten.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Baseten.RouteConnectionOpenAIV1? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Baseten.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Baseten.RouteConnectionOpenAIV1), + jsonSerializerContext).ConfigureAwait(false)) as global::Baseten.RouteConnectionOpenAIV1; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Baseten.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Baseten.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Baseten/Generated/Baseten.Models.RouteConnectionOpenAIV1.g.cs b/src/libs/Baseten/Generated/Baseten.Models.RouteConnectionOpenAIV1.g.cs new file mode 100644 index 0000000..c5c0e0d --- /dev/null +++ b/src/libs/Baseten/Generated/Baseten.Models.RouteConnectionOpenAIV1.g.cs @@ -0,0 +1,71 @@ + +#nullable enable + +namespace Baseten +{ + /// + /// + /// + public sealed partial class RouteConnectionOpenAIV1 + { + /// + /// Provider kind for OpenAI. + /// + /// "OPENAI" + [global::System.Text.Json.Serialization.JsonPropertyName("provider")] + public string Provider { get; set; } = "OPENAI"; + + /// + /// Identifier of the team secret holding the provider API key. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("secret_id")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string SecretId { get; set; } + + /// + /// Name of the team secret holding the provider API key. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("secret_name")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string SecretName { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// Identifier of the team secret holding the provider API key. + /// + /// + /// Name of the team secret holding the provider API key. + /// + /// + /// Provider kind for OpenAI. + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public RouteConnectionOpenAIV1( + string secretId, + string secretName, + string provider = "OPENAI") + { + this.Provider = provider; + this.SecretId = secretId ?? throw new global::System.ArgumentNullException(nameof(secretId)); + this.SecretName = secretName ?? throw new global::System.ArgumentNullException(nameof(secretName)); + } + + /// + /// Initializes a new instance of the class. + /// + public RouteConnectionOpenAIV1() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Baseten/Generated/Baseten.Models.RouteConnectionTombstoneV1.Json.g.cs b/src/libs/Baseten/Generated/Baseten.Models.RouteConnectionTombstoneV1.Json.g.cs new file mode 100644 index 0000000..c53d85b --- /dev/null +++ b/src/libs/Baseten/Generated/Baseten.Models.RouteConnectionTombstoneV1.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Baseten +{ + public sealed partial class RouteConnectionTombstoneV1 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Baseten.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Baseten.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Baseten.RouteConnectionTombstoneV1? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Baseten.RouteConnectionTombstoneV1), + jsonSerializerContext) as global::Baseten.RouteConnectionTombstoneV1; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Baseten.RouteConnectionTombstoneV1? FromJson( + string json) + { + return FromJson( + json, + global::Baseten.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Baseten.RouteConnectionTombstoneV1? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Baseten.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Baseten.RouteConnectionTombstoneV1), + jsonSerializerContext).ConfigureAwait(false)) as global::Baseten.RouteConnectionTombstoneV1; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Baseten.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Baseten.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Baseten/Generated/Baseten.Models.RouteConnectionTombstoneV1.g.cs b/src/libs/Baseten/Generated/Baseten.Models.RouteConnectionTombstoneV1.g.cs new file mode 100644 index 0000000..92ef04f --- /dev/null +++ b/src/libs/Baseten/Generated/Baseten.Models.RouteConnectionTombstoneV1.g.cs @@ -0,0 +1,47 @@ + +#nullable enable + +namespace Baseten +{ + /// + /// + /// + public sealed partial class RouteConnectionTombstoneV1 + { + /// + /// Stable identifier of the deleted connection. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("id")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Id { 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. + /// + /// + /// Stable identifier of the deleted connection. + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public RouteConnectionTombstoneV1( + string id) + { + this.Id = id ?? throw new global::System.ArgumentNullException(nameof(id)); + } + + /// + /// Initializes a new instance of the class. + /// + public RouteConnectionTombstoneV1() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Baseten/Generated/Baseten.Models.RouteConnectionV1.Json.g.cs b/src/libs/Baseten/Generated/Baseten.Models.RouteConnectionV1.Json.g.cs new file mode 100644 index 0000000..14fe23a --- /dev/null +++ b/src/libs/Baseten/Generated/Baseten.Models.RouteConnectionV1.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Baseten +{ + public sealed partial class RouteConnectionV1 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Baseten.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Baseten.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Baseten.RouteConnectionV1? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Baseten.RouteConnectionV1), + jsonSerializerContext) as global::Baseten.RouteConnectionV1; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Baseten.RouteConnectionV1? FromJson( + string json) + { + return FromJson( + json, + global::Baseten.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Baseten.RouteConnectionV1? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Baseten.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Baseten.RouteConnectionV1), + jsonSerializerContext).ConfigureAwait(false)) as global::Baseten.RouteConnectionV1; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Baseten.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Baseten.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Baseten/Generated/Baseten.Models.RouteConnectionV1.g.cs b/src/libs/Baseten/Generated/Baseten.Models.RouteConnectionV1.g.cs new file mode 100644 index 0000000..bc2020b --- /dev/null +++ b/src/libs/Baseten/Generated/Baseten.Models.RouteConnectionV1.g.cs @@ -0,0 +1,96 @@ + +#nullable enable + +namespace Baseten +{ + /// + /// + /// + public sealed partial class RouteConnectionV1 + { + /// + /// Stable connection identifier. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("id")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Id { get; set; } + + /// + /// Identifier of the team that owns the connection. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("team_id")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string TeamId { get; set; } + + /// + /// Provider the connection authenticates with, and the team secret holding its API key. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("config")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Baseten.JsonConverters.ConfigJsonConverter))] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::Baseten.Config Config { get; set; } + + /// + /// Creation time, ISO 8601. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("created_at")] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::System.DateTime CreatedAt { get; set; } + + /// + /// Last update time, ISO 8601. + /// + [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. + /// + /// + /// Stable connection identifier. + /// + /// + /// Identifier of the team that owns the connection. + /// + /// + /// Provider the connection authenticates with, and the team secret holding its API key. + /// + /// + /// Creation time, ISO 8601. + /// + /// + /// Last update time, ISO 8601. + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public RouteConnectionV1( + string id, + string teamId, + global::Baseten.Config config, + global::System.DateTime createdAt, + global::System.DateTime updatedAt) + { + this.Id = id ?? throw new global::System.ArgumentNullException(nameof(id)); + this.TeamId = teamId ?? throw new global::System.ArgumentNullException(nameof(teamId)); + this.Config = config; + this.CreatedAt = createdAt; + this.UpdatedAt = updatedAt; + } + + /// + /// Initializes a new instance of the class. + /// + public RouteConnectionV1() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Baseten/Generated/Baseten.Models.RouteConnectionV1ConfigDiscriminator.Json.g.cs b/src/libs/Baseten/Generated/Baseten.Models.RouteConnectionV1ConfigDiscriminator.Json.g.cs new file mode 100644 index 0000000..2e4a49e --- /dev/null +++ b/src/libs/Baseten/Generated/Baseten.Models.RouteConnectionV1ConfigDiscriminator.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Baseten +{ + public sealed partial class RouteConnectionV1ConfigDiscriminator + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Baseten.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Baseten.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Baseten.RouteConnectionV1ConfigDiscriminator? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Baseten.RouteConnectionV1ConfigDiscriminator), + jsonSerializerContext) as global::Baseten.RouteConnectionV1ConfigDiscriminator; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Baseten.RouteConnectionV1ConfigDiscriminator? FromJson( + string json) + { + return FromJson( + json, + global::Baseten.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Baseten.RouteConnectionV1ConfigDiscriminator? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Baseten.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Baseten.RouteConnectionV1ConfigDiscriminator), + jsonSerializerContext).ConfigureAwait(false)) as global::Baseten.RouteConnectionV1ConfigDiscriminator; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Baseten.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Baseten.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Baseten/Generated/Baseten.Models.RouteConnectionV1ConfigDiscriminator.g.cs b/src/libs/Baseten/Generated/Baseten.Models.RouteConnectionV1ConfigDiscriminator.g.cs new file mode 100644 index 0000000..d23480b --- /dev/null +++ b/src/libs/Baseten/Generated/Baseten.Models.RouteConnectionV1ConfigDiscriminator.g.cs @@ -0,0 +1,45 @@ + +#nullable enable + +namespace Baseten +{ + /// + /// + /// + public sealed partial class RouteConnectionV1ConfigDiscriminator + { + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("provider")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Baseten.JsonConverters.RouteConnectionV1ConfigDiscriminatorProviderJsonConverter))] + public global::Baseten.RouteConnectionV1ConfigDiscriminatorProvider? Provider { 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 RouteConnectionV1ConfigDiscriminator( + global::Baseten.RouteConnectionV1ConfigDiscriminatorProvider? provider) + { + this.Provider = provider; + } + + /// + /// Initializes a new instance of the class. + /// + public RouteConnectionV1ConfigDiscriminator() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Baseten/Generated/Baseten.Models.RouteConnectionV1ConfigDiscriminatorProvider.g.cs b/src/libs/Baseten/Generated/Baseten.Models.RouteConnectionV1ConfigDiscriminatorProvider.g.cs new file mode 100644 index 0000000..8ef8675 --- /dev/null +++ b/src/libs/Baseten/Generated/Baseten.Models.RouteConnectionV1ConfigDiscriminatorProvider.g.cs @@ -0,0 +1,57 @@ + +#nullable enable + +namespace Baseten +{ + /// + /// + /// + public enum RouteConnectionV1ConfigDiscriminatorProvider + { + /// + /// + /// + Anthropic, + /// + /// + /// + Openai, + /// + /// + /// + Xai, + } + + /// + /// Enum extensions to do fast conversions without the reflection. + /// + public static class RouteConnectionV1ConfigDiscriminatorProviderExtensions + { + /// + /// Converts an enum to a string. + /// + public static string ToValueString(this RouteConnectionV1ConfigDiscriminatorProvider value) + { + return value switch + { + RouteConnectionV1ConfigDiscriminatorProvider.Anthropic => "ANTHROPIC", + RouteConnectionV1ConfigDiscriminatorProvider.Openai => "OPENAI", + RouteConnectionV1ConfigDiscriminatorProvider.Xai => "XAI", + _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), + }; + } + /// + /// Converts an string to a enum. + /// + public static RouteConnectionV1ConfigDiscriminatorProvider? ToEnum(string value) + { + return value switch + { + "ANTHROPIC" => RouteConnectionV1ConfigDiscriminatorProvider.Anthropic, + "OPENAI" => RouteConnectionV1ConfigDiscriminatorProvider.Openai, + "XAI" => RouteConnectionV1ConfigDiscriminatorProvider.Xai, + _ => null, + }; + } + } +} \ No newline at end of file diff --git a/src/libs/Baseten/Generated/Baseten.Models.RouteConnectionXAIV1.Json.g.cs b/src/libs/Baseten/Generated/Baseten.Models.RouteConnectionXAIV1.Json.g.cs new file mode 100644 index 0000000..5b1e4db --- /dev/null +++ b/src/libs/Baseten/Generated/Baseten.Models.RouteConnectionXAIV1.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Baseten +{ + public sealed partial class RouteConnectionXAIV1 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Baseten.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Baseten.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Baseten.RouteConnectionXAIV1? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Baseten.RouteConnectionXAIV1), + jsonSerializerContext) as global::Baseten.RouteConnectionXAIV1; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Baseten.RouteConnectionXAIV1? FromJson( + string json) + { + return FromJson( + json, + global::Baseten.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Baseten.RouteConnectionXAIV1? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Baseten.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Baseten.RouteConnectionXAIV1), + jsonSerializerContext).ConfigureAwait(false)) as global::Baseten.RouteConnectionXAIV1; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Baseten.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Baseten.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Baseten/Generated/Baseten.Models.RouteConnectionXAIV1.g.cs b/src/libs/Baseten/Generated/Baseten.Models.RouteConnectionXAIV1.g.cs new file mode 100644 index 0000000..72ab825 --- /dev/null +++ b/src/libs/Baseten/Generated/Baseten.Models.RouteConnectionXAIV1.g.cs @@ -0,0 +1,71 @@ + +#nullable enable + +namespace Baseten +{ + /// + /// + /// + public sealed partial class RouteConnectionXAIV1 + { + /// + /// Provider kind for xAI. + /// + /// "XAI" + [global::System.Text.Json.Serialization.JsonPropertyName("provider")] + public string Provider { get; set; } = "XAI"; + + /// + /// Identifier of the team secret holding the provider API key. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("secret_id")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string SecretId { get; set; } + + /// + /// Name of the team secret holding the provider API key. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("secret_name")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string SecretName { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// Identifier of the team secret holding the provider API key. + /// + /// + /// Name of the team secret holding the provider API key. + /// + /// + /// Provider kind for xAI. + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public RouteConnectionXAIV1( + string secretId, + string secretName, + string provider = "XAI") + { + this.Provider = provider; + this.SecretId = secretId ?? throw new global::System.ArgumentNullException(nameof(secretId)); + this.SecretName = secretName ?? throw new global::System.ArgumentNullException(nameof(secretName)); + } + + /// + /// Initializes a new instance of the class. + /// + public RouteConnectionXAIV1() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Baseten/Generated/Baseten.Models.RouteConnectionsRequestV1.Json.g.cs b/src/libs/Baseten/Generated/Baseten.Models.RouteConnectionsRequestV1.Json.g.cs new file mode 100644 index 0000000..375e8e8 --- /dev/null +++ b/src/libs/Baseten/Generated/Baseten.Models.RouteConnectionsRequestV1.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Baseten +{ + public sealed partial class RouteConnectionsRequestV1 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Baseten.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Baseten.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Baseten.RouteConnectionsRequestV1? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Baseten.RouteConnectionsRequestV1), + jsonSerializerContext) as global::Baseten.RouteConnectionsRequestV1; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Baseten.RouteConnectionsRequestV1? FromJson( + string json) + { + return FromJson( + json, + global::Baseten.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Baseten.RouteConnectionsRequestV1? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Baseten.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Baseten.RouteConnectionsRequestV1), + jsonSerializerContext).ConfigureAwait(false)) as global::Baseten.RouteConnectionsRequestV1; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Baseten.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Baseten.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Baseten/Generated/Baseten.Models.RouteConnectionsRequestV1.g.cs b/src/libs/Baseten/Generated/Baseten.Models.RouteConnectionsRequestV1.g.cs new file mode 100644 index 0000000..96965a2 --- /dev/null +++ b/src/libs/Baseten/Generated/Baseten.Models.RouteConnectionsRequestV1.g.cs @@ -0,0 +1,74 @@ + +#nullable enable + +namespace Baseten +{ + /// + /// + /// + public sealed partial class RouteConnectionsRequestV1 + { + /// + /// Opaque cursor returned by a previous page. Omit to fetch the first page.
+ /// Default Value: openapi-json-null-sentinel-value-2BF93600-0FE4-4250-987A-E5DDB203E464 + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("cursor")] + public string? Cursor { get; set; } + + /// + /// Maximum number of items to return.
+ /// Default Value: 100 + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("limit")] + public int? Limit { get; set; } + + /// + /// Identifier of the team whose connections to list.
+ /// Default Value: openapi-json-null-sentinel-value-2BF93600-0FE4-4250-987A-E5DDB203E464 + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("team_id")] + public string? TeamId { 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. + /// + /// + /// Opaque cursor returned by a previous page. Omit to fetch the first page.
+ /// Default Value: openapi-json-null-sentinel-value-2BF93600-0FE4-4250-987A-E5DDB203E464 + /// + /// + /// Maximum number of items to return.
+ /// Default Value: 100 + /// + /// + /// Identifier of the team whose connections to list.
+ /// Default Value: openapi-json-null-sentinel-value-2BF93600-0FE4-4250-987A-E5DDB203E464 + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public RouteConnectionsRequestV1( + string? cursor, + int? limit, + string? teamId) + { + this.Cursor = cursor; + this.Limit = limit; + this.TeamId = teamId; + } + + /// + /// Initializes a new instance of the class. + /// + public RouteConnectionsRequestV1() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Baseten/Generated/Baseten.Models.RouteConnectionsResponseV1.Json.g.cs b/src/libs/Baseten/Generated/Baseten.Models.RouteConnectionsResponseV1.Json.g.cs new file mode 100644 index 0000000..2b49382 --- /dev/null +++ b/src/libs/Baseten/Generated/Baseten.Models.RouteConnectionsResponseV1.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Baseten +{ + public sealed partial class RouteConnectionsResponseV1 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Baseten.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Baseten.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Baseten.RouteConnectionsResponseV1? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Baseten.RouteConnectionsResponseV1), + jsonSerializerContext) as global::Baseten.RouteConnectionsResponseV1; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Baseten.RouteConnectionsResponseV1? FromJson( + string json) + { + return FromJson( + json, + global::Baseten.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Baseten.RouteConnectionsResponseV1? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Baseten.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Baseten.RouteConnectionsResponseV1), + jsonSerializerContext).ConfigureAwait(false)) as global::Baseten.RouteConnectionsResponseV1; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Baseten.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Baseten.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Baseten/Generated/Baseten.Models.RouteConnectionsResponseV1.g.cs b/src/libs/Baseten/Generated/Baseten.Models.RouteConnectionsResponseV1.g.cs new file mode 100644 index 0000000..6ff1b06 --- /dev/null +++ b/src/libs/Baseten/Generated/Baseten.Models.RouteConnectionsResponseV1.g.cs @@ -0,0 +1,59 @@ + +#nullable enable + +namespace Baseten +{ + /// + /// + /// + public sealed partial class RouteConnectionsResponseV1 + { + /// + /// Items in this page. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("items")] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::System.Collections.Generic.IList Items { get; set; } + + /// + /// Pagination metadata for the page. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("pagination")] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::Baseten.PaginationResponseV1 Pagination { 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. + /// + /// + /// Items in this page. + /// + /// + /// Pagination metadata for the page. + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public RouteConnectionsResponseV1( + global::System.Collections.Generic.IList items, + global::Baseten.PaginationResponseV1 pagination) + { + this.Items = items ?? throw new global::System.ArgumentNullException(nameof(items)); + this.Pagination = pagination ?? throw new global::System.ArgumentNullException(nameof(pagination)); + } + + /// + /// Initializes a new instance of the class. + /// + public RouteConnectionsResponseV1() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Baseten/Generated/Baseten.Models.RoutesRequestV1.g.cs b/src/libs/Baseten/Generated/Baseten.Models.RoutesRequestV1.g.cs index 3413cad..9f3316c 100644 --- a/src/libs/Baseten/Generated/Baseten.Models.RoutesRequestV1.g.cs +++ b/src/libs/Baseten/Generated/Baseten.Models.RoutesRequestV1.g.cs @@ -23,7 +23,7 @@ public sealed partial class RoutesRequestV1 public int? Limit { get; set; } /// - /// Filter by owning team ID. Preserved by the cursor; if repeated, must match the original filter.
+ /// Identifier of the team whose routes to list.
/// Default Value: openapi-json-null-sentinel-value-2BF93600-0FE4-4250-987A-E5DDB203E464 ///
[global::System.Text.Json.Serialization.JsonPropertyName("team_id")] @@ -54,7 +54,7 @@ public sealed partial class RoutesRequestV1 /// Default Value: 100 /// /// - /// Filter by owning team ID. Preserved by the cursor; if repeated, must match the original filter.
+ /// Identifier of the team whose routes to list.
/// Default Value: openapi-json-null-sentinel-value-2BF93600-0FE4-4250-987A-E5DDB203E464 /// /// diff --git a/src/libs/Baseten/Generated/Baseten.Models.UpdateRouteConnectionConfigAnthropicV1.Json.g.cs b/src/libs/Baseten/Generated/Baseten.Models.UpdateRouteConnectionConfigAnthropicV1.Json.g.cs new file mode 100644 index 0000000..6e269c0 --- /dev/null +++ b/src/libs/Baseten/Generated/Baseten.Models.UpdateRouteConnectionConfigAnthropicV1.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Baseten +{ + public sealed partial class UpdateRouteConnectionConfigAnthropicV1 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Baseten.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Baseten.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Baseten.UpdateRouteConnectionConfigAnthropicV1? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Baseten.UpdateRouteConnectionConfigAnthropicV1), + jsonSerializerContext) as global::Baseten.UpdateRouteConnectionConfigAnthropicV1; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Baseten.UpdateRouteConnectionConfigAnthropicV1? FromJson( + string json) + { + return FromJson( + json, + global::Baseten.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Baseten.UpdateRouteConnectionConfigAnthropicV1? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Baseten.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Baseten.UpdateRouteConnectionConfigAnthropicV1), + jsonSerializerContext).ConfigureAwait(false)) as global::Baseten.UpdateRouteConnectionConfigAnthropicV1; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Baseten.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Baseten.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Baseten/Generated/Baseten.Models.UpdateRouteConnectionConfigAnthropicV1.g.cs b/src/libs/Baseten/Generated/Baseten.Models.UpdateRouteConnectionConfigAnthropicV1.g.cs new file mode 100644 index 0000000..8683b27 --- /dev/null +++ b/src/libs/Baseten/Generated/Baseten.Models.UpdateRouteConnectionConfigAnthropicV1.g.cs @@ -0,0 +1,60 @@ + +#nullable enable + +namespace Baseten +{ + /// + /// + /// + public sealed partial class UpdateRouteConnectionConfigAnthropicV1 + { + /// + /// Provider kind for Anthropic. + /// + /// "ANTHROPIC" + [global::System.Text.Json.Serialization.JsonPropertyName("provider")] + public string Provider { get; set; } = "ANTHROPIC"; + + /// + /// Identifier of the new secret, owned by the connection's team, that holds the provider API key. Omit to keep the current secret.
+ /// Default Value: openapi-json-null-sentinel-value-2BF93600-0FE4-4250-987A-E5DDB203E464 + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("secret_id")] + public string? SecretId { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// Identifier of the new secret, owned by the connection's team, that holds the provider API key. Omit to keep the current secret.
+ /// Default Value: openapi-json-null-sentinel-value-2BF93600-0FE4-4250-987A-E5DDB203E464 + /// + /// + /// Provider kind for Anthropic. + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public UpdateRouteConnectionConfigAnthropicV1( + string? secretId, + string provider = "ANTHROPIC") + { + this.Provider = provider; + this.SecretId = secretId; + } + + /// + /// Initializes a new instance of the class. + /// + public UpdateRouteConnectionConfigAnthropicV1() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Baseten/Generated/Baseten.Models.UpdateRouteConnectionConfigOpenAIV1.Json.g.cs b/src/libs/Baseten/Generated/Baseten.Models.UpdateRouteConnectionConfigOpenAIV1.Json.g.cs new file mode 100644 index 0000000..eab21f5 --- /dev/null +++ b/src/libs/Baseten/Generated/Baseten.Models.UpdateRouteConnectionConfigOpenAIV1.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Baseten +{ + public sealed partial class UpdateRouteConnectionConfigOpenAIV1 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Baseten.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Baseten.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Baseten.UpdateRouteConnectionConfigOpenAIV1? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Baseten.UpdateRouteConnectionConfigOpenAIV1), + jsonSerializerContext) as global::Baseten.UpdateRouteConnectionConfigOpenAIV1; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Baseten.UpdateRouteConnectionConfigOpenAIV1? FromJson( + string json) + { + return FromJson( + json, + global::Baseten.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Baseten.UpdateRouteConnectionConfigOpenAIV1? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Baseten.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Baseten.UpdateRouteConnectionConfigOpenAIV1), + jsonSerializerContext).ConfigureAwait(false)) as global::Baseten.UpdateRouteConnectionConfigOpenAIV1; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Baseten.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Baseten.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Baseten/Generated/Baseten.Models.UpdateRouteConnectionConfigOpenAIV1.g.cs b/src/libs/Baseten/Generated/Baseten.Models.UpdateRouteConnectionConfigOpenAIV1.g.cs new file mode 100644 index 0000000..1732ff3 --- /dev/null +++ b/src/libs/Baseten/Generated/Baseten.Models.UpdateRouteConnectionConfigOpenAIV1.g.cs @@ -0,0 +1,60 @@ + +#nullable enable + +namespace Baseten +{ + /// + /// + /// + public sealed partial class UpdateRouteConnectionConfigOpenAIV1 + { + /// + /// Provider kind for OpenAI. + /// + /// "OPENAI" + [global::System.Text.Json.Serialization.JsonPropertyName("provider")] + public string Provider { get; set; } = "OPENAI"; + + /// + /// Identifier of the new secret, owned by the connection's team, that holds the provider API key. Omit to keep the current secret.
+ /// Default Value: openapi-json-null-sentinel-value-2BF93600-0FE4-4250-987A-E5DDB203E464 + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("secret_id")] + public string? SecretId { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// Identifier of the new secret, owned by the connection's team, that holds the provider API key. Omit to keep the current secret.
+ /// Default Value: openapi-json-null-sentinel-value-2BF93600-0FE4-4250-987A-E5DDB203E464 + /// + /// + /// Provider kind for OpenAI. + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public UpdateRouteConnectionConfigOpenAIV1( + string? secretId, + string provider = "OPENAI") + { + this.Provider = provider; + this.SecretId = secretId; + } + + /// + /// Initializes a new instance of the class. + /// + public UpdateRouteConnectionConfigOpenAIV1() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Baseten/Generated/Baseten.Models.UpdateRouteConnectionConfigXAIV1.Json.g.cs b/src/libs/Baseten/Generated/Baseten.Models.UpdateRouteConnectionConfigXAIV1.Json.g.cs new file mode 100644 index 0000000..6bf2ee7 --- /dev/null +++ b/src/libs/Baseten/Generated/Baseten.Models.UpdateRouteConnectionConfigXAIV1.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Baseten +{ + public sealed partial class UpdateRouteConnectionConfigXAIV1 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Baseten.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Baseten.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Baseten.UpdateRouteConnectionConfigXAIV1? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Baseten.UpdateRouteConnectionConfigXAIV1), + jsonSerializerContext) as global::Baseten.UpdateRouteConnectionConfigXAIV1; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Baseten.UpdateRouteConnectionConfigXAIV1? FromJson( + string json) + { + return FromJson( + json, + global::Baseten.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Baseten.UpdateRouteConnectionConfigXAIV1? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Baseten.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Baseten.UpdateRouteConnectionConfigXAIV1), + jsonSerializerContext).ConfigureAwait(false)) as global::Baseten.UpdateRouteConnectionConfigXAIV1; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Baseten.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Baseten.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Baseten/Generated/Baseten.Models.UpdateRouteConnectionConfigXAIV1.g.cs b/src/libs/Baseten/Generated/Baseten.Models.UpdateRouteConnectionConfigXAIV1.g.cs new file mode 100644 index 0000000..b3daaff --- /dev/null +++ b/src/libs/Baseten/Generated/Baseten.Models.UpdateRouteConnectionConfigXAIV1.g.cs @@ -0,0 +1,60 @@ + +#nullable enable + +namespace Baseten +{ + /// + /// + /// + public sealed partial class UpdateRouteConnectionConfigXAIV1 + { + /// + /// Provider kind for xAI. + /// + /// "XAI" + [global::System.Text.Json.Serialization.JsonPropertyName("provider")] + public string Provider { get; set; } = "XAI"; + + /// + /// Identifier of the new secret, owned by the connection's team, that holds the provider API key. Omit to keep the current secret.
+ /// Default Value: openapi-json-null-sentinel-value-2BF93600-0FE4-4250-987A-E5DDB203E464 + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("secret_id")] + public string? SecretId { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// Identifier of the new secret, owned by the connection's team, that holds the provider API key. Omit to keep the current secret.
+ /// Default Value: openapi-json-null-sentinel-value-2BF93600-0FE4-4250-987A-E5DDB203E464 + /// + /// + /// Provider kind for xAI. + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public UpdateRouteConnectionConfigXAIV1( + string? secretId, + string provider = "XAI") + { + this.Provider = provider; + this.SecretId = secretId; + } + + /// + /// Initializes a new instance of the class. + /// + public UpdateRouteConnectionConfigXAIV1() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Baseten/Generated/Baseten.Models.UpdateRouteConnectionRequestV1.Json.g.cs b/src/libs/Baseten/Generated/Baseten.Models.UpdateRouteConnectionRequestV1.Json.g.cs new file mode 100644 index 0000000..55a6f33 --- /dev/null +++ b/src/libs/Baseten/Generated/Baseten.Models.UpdateRouteConnectionRequestV1.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Baseten +{ + public sealed partial class UpdateRouteConnectionRequestV1 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Baseten.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Baseten.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Baseten.UpdateRouteConnectionRequestV1? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Baseten.UpdateRouteConnectionRequestV1), + jsonSerializerContext) as global::Baseten.UpdateRouteConnectionRequestV1; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Baseten.UpdateRouteConnectionRequestV1? FromJson( + string json) + { + return FromJson( + json, + global::Baseten.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Baseten.UpdateRouteConnectionRequestV1? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Baseten.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Baseten.UpdateRouteConnectionRequestV1), + jsonSerializerContext).ConfigureAwait(false)) as global::Baseten.UpdateRouteConnectionRequestV1; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Baseten.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Baseten.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Baseten/Generated/Baseten.Models.UpdateRouteConnectionRequestV1.g.cs b/src/libs/Baseten/Generated/Baseten.Models.UpdateRouteConnectionRequestV1.g.cs new file mode 100644 index 0000000..29010c8 --- /dev/null +++ b/src/libs/Baseten/Generated/Baseten.Models.UpdateRouteConnectionRequestV1.g.cs @@ -0,0 +1,48 @@ + +#nullable enable + +namespace Baseten +{ + /// + /// + /// + public sealed partial class UpdateRouteConnectionRequestV1 + { + /// + /// Connection fields to change. The provider must match the connection and is immutable. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("config")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Baseten.JsonConverters.Config3JsonConverter))] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::Baseten.Config3 Config { 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. + /// + /// + /// Connection fields to change. The provider must match the connection and is immutable. + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public UpdateRouteConnectionRequestV1( + global::Baseten.Config3 config) + { + this.Config = config; + } + + /// + /// Initializes a new instance of the class. + /// + public UpdateRouteConnectionRequestV1() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Baseten/Generated/Baseten.Models.UpdateRouteConnectionRequestV1ConfigDiscriminator.Json.g.cs b/src/libs/Baseten/Generated/Baseten.Models.UpdateRouteConnectionRequestV1ConfigDiscriminator.Json.g.cs new file mode 100644 index 0000000..a558490 --- /dev/null +++ b/src/libs/Baseten/Generated/Baseten.Models.UpdateRouteConnectionRequestV1ConfigDiscriminator.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Baseten +{ + public sealed partial class UpdateRouteConnectionRequestV1ConfigDiscriminator + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Baseten.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Baseten.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Baseten.UpdateRouteConnectionRequestV1ConfigDiscriminator? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Baseten.UpdateRouteConnectionRequestV1ConfigDiscriminator), + jsonSerializerContext) as global::Baseten.UpdateRouteConnectionRequestV1ConfigDiscriminator; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Baseten.UpdateRouteConnectionRequestV1ConfigDiscriminator? FromJson( + string json) + { + return FromJson( + json, + global::Baseten.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Baseten.UpdateRouteConnectionRequestV1ConfigDiscriminator? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Baseten.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Baseten.UpdateRouteConnectionRequestV1ConfigDiscriminator), + jsonSerializerContext).ConfigureAwait(false)) as global::Baseten.UpdateRouteConnectionRequestV1ConfigDiscriminator; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Baseten.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Baseten.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Baseten/Generated/Baseten.Models.UpdateRouteConnectionRequestV1ConfigDiscriminator.g.cs b/src/libs/Baseten/Generated/Baseten.Models.UpdateRouteConnectionRequestV1ConfigDiscriminator.g.cs new file mode 100644 index 0000000..8b54edd --- /dev/null +++ b/src/libs/Baseten/Generated/Baseten.Models.UpdateRouteConnectionRequestV1ConfigDiscriminator.g.cs @@ -0,0 +1,45 @@ + +#nullable enable + +namespace Baseten +{ + /// + /// + /// + public sealed partial class UpdateRouteConnectionRequestV1ConfigDiscriminator + { + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("provider")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Baseten.JsonConverters.UpdateRouteConnectionRequestV1ConfigDiscriminatorProviderJsonConverter))] + public global::Baseten.UpdateRouteConnectionRequestV1ConfigDiscriminatorProvider? Provider { 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 UpdateRouteConnectionRequestV1ConfigDiscriminator( + global::Baseten.UpdateRouteConnectionRequestV1ConfigDiscriminatorProvider? provider) + { + this.Provider = provider; + } + + /// + /// Initializes a new instance of the class. + /// + public UpdateRouteConnectionRequestV1ConfigDiscriminator() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Baseten/Generated/Baseten.Models.UpdateRouteConnectionRequestV1ConfigDiscriminatorProvider.g.cs b/src/libs/Baseten/Generated/Baseten.Models.UpdateRouteConnectionRequestV1ConfigDiscriminatorProvider.g.cs new file mode 100644 index 0000000..90e4585 --- /dev/null +++ b/src/libs/Baseten/Generated/Baseten.Models.UpdateRouteConnectionRequestV1ConfigDiscriminatorProvider.g.cs @@ -0,0 +1,57 @@ + +#nullable enable + +namespace Baseten +{ + /// + /// + /// + public enum UpdateRouteConnectionRequestV1ConfigDiscriminatorProvider + { + /// + /// + /// + Anthropic, + /// + /// + /// + Openai, + /// + /// + /// + Xai, + } + + /// + /// Enum extensions to do fast conversions without the reflection. + /// + public static class UpdateRouteConnectionRequestV1ConfigDiscriminatorProviderExtensions + { + /// + /// Converts an enum to a string. + /// + public static string ToValueString(this UpdateRouteConnectionRequestV1ConfigDiscriminatorProvider value) + { + return value switch + { + UpdateRouteConnectionRequestV1ConfigDiscriminatorProvider.Anthropic => "ANTHROPIC", + UpdateRouteConnectionRequestV1ConfigDiscriminatorProvider.Openai => "OPENAI", + UpdateRouteConnectionRequestV1ConfigDiscriminatorProvider.Xai => "XAI", + _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), + }; + } + /// + /// Converts an string to a enum. + /// + public static UpdateRouteConnectionRequestV1ConfigDiscriminatorProvider? ToEnum(string value) + { + return value switch + { + "ANTHROPIC" => UpdateRouteConnectionRequestV1ConfigDiscriminatorProvider.Anthropic, + "OPENAI" => UpdateRouteConnectionRequestV1ConfigDiscriminatorProvider.Openai, + "XAI" => UpdateRouteConnectionRequestV1ConfigDiscriminatorProvider.Xai, + _ => null, + }; + } + } +} \ No newline at end of file diff --git a/src/libs/Baseten/openapi.yaml b/src/libs/Baseten/openapi.yaml index 550bb2a..8876f19 100644 --- a/src/libs/Baseten/openapi.yaml +++ b/src/libs/Baseten/openapi.yaml @@ -9482,7 +9482,7 @@ "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"\")\nurl = \"https://api.baseten.co/v1/routes\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n \"GET\",\n url,\n headers=headers,\n params={'cursor': None, 'team_id': None, 'name': None}\n)\n\nprint(response.text)" } ], - "description": "Lists routes you can invoke, newest first, optionally filtered by team and exact name.", + "description": "Lists routes you can invoke in the team, newest first, optionally filtered by exact name.", "parameters": [ { "name": "cursor", @@ -9519,7 +9519,7 @@ "name": "team_id", "in": "query", "required": false, - "description": "Filter by owning team ID. Preserved by the cursor; if repeated, must match the original filter.", + "description": "Identifier of the team whose routes to list.", "schema": { "anyOf": [ { @@ -9898,6 +9898,194 @@ "x-stability": "unstable" } }, + "/v1/routes/connections": { + "get": { + "summary": "Lists connections", + "x-codeSamples": [ + { + "lang": "bash", + "source": "curl --request GET \\\n--url https://api.baseten.co/v1/routes/connections \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\"\n" + }, + { + "lang": "python", + "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"\")\nurl = \"https://api.baseten.co/v1/routes/connections\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n \"GET\",\n url,\n headers=headers,\n params={'cursor': None, 'team_id': None}\n)\n\nprint(response.text)" + } + ], + "description": "Lists the team's connections, newest first.", + "parameters": [ + { + "name": "cursor", + "in": "query", + "required": false, + "description": "Opaque cursor returned by a previous page. Omit to fetch the first page.", + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Cursor" + } + }, + { + "name": "limit", + "in": "query", + "required": false, + "description": "Maximum number of items to return.", + "schema": { + "default": 100, + "maximum": 1000, + "minimum": 1, + "title": "Limit", + "type": "integer" + } + }, + { + "name": "team_id", + "in": "query", + "required": false, + "description": "Identifier of the team whose connections to list.", + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Team Id" + } + } + ], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RouteConnectionsResponseV1" + } + } + } + } + }, + "x-stability": "unstable" + }, + "post": { + "summary": "Creates a connection", + "x-codeSamples": [ + { + "lang": "bash", + "source": "curl --request POST \\\n--url https://api.baseten.co/v1/routes/connections \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\" \\\n--data '{\n \"team_id\": \"abc1234\",\n \"config\": {\n \"provider\": \"ANTHROPIC\",\n \"secret_id\": \"abc1234\"\n }\n}'" + }, + { + "lang": "python", + "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"\")\nurl = \"https://api.baseten.co/v1/routes/connections\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n \"POST\",\n url,\n headers=headers,\n json={'team_id': 'abc1234', 'config': {'provider': 'ANTHROPIC', 'secret_id': 'abc1234'}}\n)\n\nprint(response.text)" + } + ], + "description": "Creates a connection from the team to an upstream provider.", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreateRouteConnectionRequestV1" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RouteConnectionV1" + } + } + } + } + }, + "x-stability": "unstable" + } + }, + "/v1/routes/connections/{connection_id}": { + "delete": { + "summary": "Deletes a connection", + "x-codeSamples": [ + { + "lang": "bash", + "source": "curl --request DELETE \\\n--url https://api.baseten.co/v1/routes/connections/{connection_id} \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\"\n" + }, + { + "lang": "python", + "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"\")\nurl = \"https://api.baseten.co/v1/routes/connections/{connection_id}\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n \"DELETE\",\n url,\n headers=headers,\n json={}\n)\n\nprint(response.text)" + } + ], + "description": "Deletes the connection. The team secret it points at is left in place.", + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RouteConnectionTombstoneV1" + } + } + } + } + }, + "x-stability": "unstable" + }, + "parameters": [ + { + "$ref": "#/components/parameters/connection_id" + } + ], + "patch": { + "summary": "Updates a connection", + "x-codeSamples": [ + { + "lang": "bash", + "source": "curl --request PATCH \\\n--url https://api.baseten.co/v1/routes/connections/{connection_id} \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\" \\\n--data '{\n \"config\": {\n \"provider\": \"ANTHROPIC\",\n \"secret_id\": \"abc1234\"\n }\n}'" + }, + { + "lang": "python", + "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"\")\nurl = \"https://api.baseten.co/v1/routes/connections/{connection_id}\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n \"PATCH\",\n url,\n headers=headers,\n json={'config': {'provider': 'ANTHROPIC', 'secret_id': 'abc1234'}}\n)\n\nprint(response.text)" + } + ], + "description": "Updates the connection's fields. The provider and owning team are immutable; point the connection at a new team secret to change its API key, or rotate the key itself by updating the secret.", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UpdateRouteConnectionRequestV1" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RouteConnectionV1" + } + } + } + } + }, + "x-stability": "unstable" + } + }, "/v1/routes/{route_id}": { "delete": { "summary": "Deletes a route", @@ -30782,7 +30970,7 @@ } ], "default": null, - "description": "Filter by owning team ID. Preserved by the cursor; if repeated, must match the original filter.", + "description": "Identifier of the team whose routes to list.", "title": "Team Id" }, "name": { @@ -30996,7 +31184,7 @@ } ], "default": null, - "description": "Identifier of the team that owns the route. When omitted, uses your organization's default team.", + "description": "Identifier of the team that owns the route.", "examples": [ "abc1234" ], @@ -31848,70 +32036,542 @@ "title": "UpdateRouteTeamSettingsRequestV1", "type": "object" }, - "RouteTombstoneV1": { + "RouteConnectionAnthropicV1": { "properties": { - "id": { - "description": "Stable identifier of the deleted route.", - "title": "Id", + "provider": { + "const": "ANTHROPIC", + "description": "Provider kind for Anthropic.", + "title": "Provider", "type": "string" }, - "name": { - "description": "Name of the deleted route.", - "title": "Name", + "secret_id": { + "description": "Identifier of the team secret holding the provider API key.", + "title": "Secret Id", + "type": "string" + }, + "secret_name": { + "description": "Name of the team secret holding the provider API key.", + "title": "Secret Name", "type": "string" } }, "required": [ - "id", - "name" + "provider", + "secret_id", + "secret_name" ], - "title": "RouteTombstoneV1", + "title": "RouteConnectionAnthropicV1", "type": "object" }, - "UpdateRouteRequestV1": { - "additionalProperties": false, - "minProperties": 1, + "RouteConnectionOpenAIV1": { "properties": { - "description": { - "anyOf": [ - { - "maxLength": 1000, - "type": "string" + "provider": { + "const": "OPENAI", + "description": "Provider kind for OpenAI.", + "title": "Provider", + "type": "string" + }, + "secret_id": { + "description": "Identifier of the team secret holding the provider API key.", + "title": "Secret Id", + "type": "string" + }, + "secret_name": { + "description": "Name of the team secret holding the provider API key.", + "title": "Secret Name", + "type": "string" + } + }, + "required": [ + "provider", + "secret_id", + "secret_name" + ], + "title": "RouteConnectionOpenAIV1", + "type": "object" + }, + "RouteConnectionV1": { + "properties": { + "id": { + "description": "Stable connection identifier.", + "title": "Id", + "type": "string" + }, + "team_id": { + "description": "Identifier of the team that owns the connection.", + "title": "Team Id", + "type": "string" + }, + "config": { + "description": "Provider the connection authenticates with, and the team secret holding its API key.", + "discriminator": { + "mapping": { + "ANTHROPIC": "#/components/schemas/RouteConnectionAnthropicV1", + "OPENAI": "#/components/schemas/RouteConnectionOpenAIV1", + "XAI": "#/components/schemas/RouteConnectionXAIV1" }, + "propertyName": "provider" + }, + "oneOf": [ { - "type": "null" - } - ], - "default": null, - "description": "New description. Omit to keep the current description; use an empty string to clear it. Null is not accepted.", - "examples": [ - "Assistant for code review and debugging." - ], - "title": "Description" - }, - "display_name": { - "anyOf": [ + "$ref": "#/components/schemas/RouteConnectionAnthropicV1" + }, { - "maxLength": 255, - "minLength": 1, - "type": "string" + "$ref": "#/components/schemas/RouteConnectionOpenAIV1" }, { - "type": "null" + "$ref": "#/components/schemas/RouteConnectionXAIV1" } ], - "default": null, - "description": "New display label. Omit to keep the current label; null is not accepted.", - "examples": [ - "Assistant" - ], - "title": "Display Name" + "title": "Config" }, - "target": { - "anyOf": [ - { - "discriminator": { - "mapping": { + "created_at": { + "description": "Creation time, ISO 8601.", + "format": "date-time", + "title": "Created At", + "type": "string" + }, + "updated_at": { + "description": "Last update time, ISO 8601.", + "format": "date-time", + "title": "Updated At", + "type": "string" + } + }, + "required": [ + "id", + "team_id", + "config", + "created_at", + "updated_at" + ], + "title": "RouteConnectionV1", + "type": "object" + }, + "RouteConnectionXAIV1": { + "properties": { + "provider": { + "const": "XAI", + "description": "Provider kind for xAI.", + "title": "Provider", + "type": "string" + }, + "secret_id": { + "description": "Identifier of the team secret holding the provider API key.", + "title": "Secret Id", + "type": "string" + }, + "secret_name": { + "description": "Name of the team secret holding the provider API key.", + "title": "Secret Name", + "type": "string" + } + }, + "required": [ + "provider", + "secret_id", + "secret_name" + ], + "title": "RouteConnectionXAIV1", + "type": "object" + }, + "RouteConnectionsResponseV1": { + "properties": { + "items": { + "description": "Items in this page.", + "items": { + "$ref": "#/components/schemas/RouteConnectionV1" + }, + "title": "Items", + "type": "array" + }, + "pagination": { + "$ref": "#/components/schemas/PaginationResponseV1", + "description": "Pagination metadata for the page." + } + }, + "required": [ + "items", + "pagination" + ], + "title": "RouteConnectionsResponseV1", + "type": "object" + }, + "RouteConnectionsRequestV1": { + "properties": { + "cursor": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "description": "Opaque cursor returned by a previous page. Omit to fetch the first page.", + "title": "Cursor" + }, + "limit": { + "default": 100, + "description": "Maximum number of items to return.", + "maximum": 1000, + "minimum": 1, + "title": "Limit", + "type": "integer" + }, + "team_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "description": "Identifier of the team whose connections to list.", + "title": "Team Id" + } + }, + "title": "RouteConnectionsRequestV1", + "type": "object" + }, + "RouteConnectionConfigAnthropicV1": { + "additionalProperties": false, + "properties": { + "provider": { + "const": "ANTHROPIC", + "description": "Provider kind for Anthropic.", + "title": "Provider", + "type": "string" + }, + "secret_id": { + "description": "Identifier of an existing secret, owned by the same team, that holds the provider API key.", + "minLength": 1, + "title": "Secret Id", + "type": "string" + } + }, + "required": [ + "provider", + "secret_id" + ], + "title": "RouteConnectionConfigAnthropicV1", + "type": "object" + }, + "RouteConnectionConfigOpenAIV1": { + "additionalProperties": false, + "properties": { + "provider": { + "const": "OPENAI", + "description": "Provider kind for OpenAI.", + "title": "Provider", + "type": "string" + }, + "secret_id": { + "description": "Identifier of an existing secret, owned by the same team, that holds the provider API key.", + "minLength": 1, + "title": "Secret Id", + "type": "string" + } + }, + "required": [ + "provider", + "secret_id" + ], + "title": "RouteConnectionConfigOpenAIV1", + "type": "object" + }, + "RouteConnectionConfigXAIV1": { + "additionalProperties": false, + "properties": { + "provider": { + "const": "XAI", + "description": "Provider kind for xAI.", + "title": "Provider", + "type": "string" + }, + "secret_id": { + "description": "Identifier of an existing secret, owned by the same team, that holds the provider API key.", + "minLength": 1, + "title": "Secret Id", + "type": "string" + } + }, + "required": [ + "provider", + "secret_id" + ], + "title": "RouteConnectionConfigXAIV1", + "type": "object" + }, + "CreateRouteConnectionRequestV1": { + "additionalProperties": false, + "properties": { + "team_id": { + "anyOf": [ + { + "minLength": 1, + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "description": "Identifier of the team that owns the connection.", + "examples": [ + "abc1234" + ], + "title": "Team Id" + }, + "config": { + "description": "Provider the connection authenticates with, and the team secret holding its API key.", + "discriminator": { + "mapping": { + "ANTHROPIC": "#/components/schemas/RouteConnectionConfigAnthropicV1", + "OPENAI": "#/components/schemas/RouteConnectionConfigOpenAIV1", + "XAI": "#/components/schemas/RouteConnectionConfigXAIV1" + }, + "propertyName": "provider" + }, + "examples": [ + { + "provider": "ANTHROPIC", + "secret_id": "abc1234" + } + ], + "oneOf": [ + { + "$ref": "#/components/schemas/RouteConnectionConfigAnthropicV1" + }, + { + "$ref": "#/components/schemas/RouteConnectionConfigOpenAIV1" + }, + { + "$ref": "#/components/schemas/RouteConnectionConfigXAIV1" + } + ], + "title": "Config" + } + }, + "required": [ + "config" + ], + "title": "CreateRouteConnectionRequestV1", + "type": "object" + }, + "RouteConnectionTombstoneV1": { + "properties": { + "id": { + "description": "Stable identifier of the deleted connection.", + "title": "Id", + "type": "string" + } + }, + "required": [ + "id" + ], + "title": "RouteConnectionTombstoneV1", + "type": "object" + }, + "UpdateRouteConnectionConfigAnthropicV1": { + "additionalProperties": false, + "properties": { + "provider": { + "const": "ANTHROPIC", + "description": "Provider kind for Anthropic.", + "title": "Provider", + "type": "string" + }, + "secret_id": { + "anyOf": [ + { + "minLength": 1, + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "description": "Identifier of the new secret, owned by the connection's team, that holds the provider API key. Omit to keep the current secret.", + "title": "Secret Id", + "x-null-distinct": true + } + }, + "required": [ + "provider" + ], + "title": "UpdateRouteConnectionConfigAnthropicV1", + "type": "object" + }, + "UpdateRouteConnectionConfigOpenAIV1": { + "additionalProperties": false, + "properties": { + "provider": { + "const": "OPENAI", + "description": "Provider kind for OpenAI.", + "title": "Provider", + "type": "string" + }, + "secret_id": { + "anyOf": [ + { + "minLength": 1, + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "description": "Identifier of the new secret, owned by the connection's team, that holds the provider API key. Omit to keep the current secret.", + "title": "Secret Id", + "x-null-distinct": true + } + }, + "required": [ + "provider" + ], + "title": "UpdateRouteConnectionConfigOpenAIV1", + "type": "object" + }, + "UpdateRouteConnectionConfigXAIV1": { + "additionalProperties": false, + "properties": { + "provider": { + "const": "XAI", + "description": "Provider kind for xAI.", + "title": "Provider", + "type": "string" + }, + "secret_id": { + "anyOf": [ + { + "minLength": 1, + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "description": "Identifier of the new secret, owned by the connection's team, that holds the provider API key. Omit to keep the current secret.", + "title": "Secret Id", + "x-null-distinct": true + } + }, + "required": [ + "provider" + ], + "title": "UpdateRouteConnectionConfigXAIV1", + "type": "object" + }, + "UpdateRouteConnectionRequestV1": { + "additionalProperties": false, + "properties": { + "config": { + "description": "Connection fields to change. The provider must match the connection and is immutable.", + "discriminator": { + "mapping": { + "ANTHROPIC": "#/components/schemas/UpdateRouteConnectionConfigAnthropicV1", + "OPENAI": "#/components/schemas/UpdateRouteConnectionConfigOpenAIV1", + "XAI": "#/components/schemas/UpdateRouteConnectionConfigXAIV1" + }, + "propertyName": "provider" + }, + "examples": [ + { + "provider": "ANTHROPIC", + "secret_id": "abc1234" + } + ], + "oneOf": [ + { + "$ref": "#/components/schemas/UpdateRouteConnectionConfigAnthropicV1" + }, + { + "$ref": "#/components/schemas/UpdateRouteConnectionConfigOpenAIV1" + }, + { + "$ref": "#/components/schemas/UpdateRouteConnectionConfigXAIV1" + } + ], + "title": "Config" + } + }, + "required": [ + "config" + ], + "title": "UpdateRouteConnectionRequestV1", + "type": "object" + }, + "RouteTombstoneV1": { + "properties": { + "id": { + "description": "Stable identifier of the deleted route.", + "title": "Id", + "type": "string" + }, + "name": { + "description": "Name of the deleted route.", + "title": "Name", + "type": "string" + } + }, + "required": [ + "id", + "name" + ], + "title": "RouteTombstoneV1", + "type": "object" + }, + "UpdateRouteRequestV1": { + "additionalProperties": false, + "minProperties": 1, + "properties": { + "description": { + "anyOf": [ + { + "maxLength": 1000, + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "description": "New description. Omit to keep the current description; use an empty string to clear it. Null is not accepted.", + "examples": [ + "Assistant for code review and debugging." + ], + "title": "Description" + }, + "display_name": { + "anyOf": [ + { + "maxLength": 255, + "minLength": 1, + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "description": "New display label. Omit to keep the current label; null is not accepted.", + "examples": [ + "Assistant" + ], + "title": "Display Name" + }, + "target": { + "anyOf": [ + { + "discriminator": { + "mapping": { "ANTHROPIC": "#/components/schemas/RouteTargetConfigAnthropicV1", "BASETEN_MODEL_API": "#/components/schemas/RouteTargetConfigBasetenModelAPIV1", "CLASSIFIER_MODEL_BASED": "#/components/schemas/RouteTargetConfigClassifierModelBasedV1", @@ -33212,6 +33872,14 @@ "in": "path", "required": true }, + "connection_id": { + "schema": { + "type": "string" + }, + "name": "connection_id", + "in": "path", + "required": true + }, "route_id": { "schema": { "type": "string"