From b74a0148abf6a5ef243ed331e57457423644dedf Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Thu, 8 Oct 2026 18:43:37 +0000 Subject: [PATCH] feat: Updated OpenAPI spec --- .../Commands/DefaultApiGroupCommand.g.cs | 3 + ...yTeamIdUsersByUserIdCommandApiCommand.g.cs | 128 +++++ ...ettingsUsersByUserIdCommandApiCommand.g.cs | 27 +- ...yTeamIdUsersByUserIdCommandApiCommand.g.cs | 76 +++ ...gsTeamsByTeamIdUsersCommandApiCommand.g.cs | 75 +++ ...ettingsUsersByUserIdCommandApiCommand.g.cs | 11 +- ...dateRouteSpendLimitSettingV1OptionSet.g.cs | 27 + ...tesSettingsTeamsByTeamIdUsersByUserId.g.cs | 503 ++++++++++++++++++ ...lient.EditRoutesSettingsUsersByUserId.g.cs | 6 +- ...t.GetRoutesSettingsTeamsByTeamIdUsers.g.cs | 436 +++++++++++++++ ...tesSettingsTeamsByTeamIdUsersByUserId.g.cs | 445 ++++++++++++++++ ...Client.GetRoutesSettingsUsersByUserId.g.cs | 20 +- ...tesSettingsTeamsByTeamIdUsersByUserId.g.cs | 77 +++ ...lient.EditRoutesSettingsUsersByUserId.g.cs | 6 +- ...t.GetRoutesSettingsTeamsByTeamIdUsers.g.cs | 42 ++ ...tesSettingsTeamsByTeamIdUsersByUserId.g.cs | 46 ++ ...Client.GetRoutesSettingsUsersByUserId.g.cs | 12 +- .../Baseten.JsonSerializerContext.g.cs | 21 +- .../Baseten.JsonSerializerContextTypes.g.cs | 362 +++++++------ ...seten.Models.RouteSpendLimitSettingV1.g.cs | 19 +- ...n.Models.RouteSpendLimitTeamDefaultV1.g.cs | 4 +- .../Baseten.Models.RouteTeamSettingsV1.g.cs | 4 +- ...n.Models.RouteTeamSpendLimitSettingV1.g.cs | 4 +- ...dels.RouteTeamUserSettingsListV1.Json.g.cs | 141 +++++ ...en.Models.RouteTeamUserSettingsListV1.g.cs | 47 ++ ...n.Models.RouteTeamUserSettingsV1.Json.g.cs | 141 +++++ ...aseten.Models.RouteTeamUserSettingsV1.g.cs | 106 ++++ ...odels.RouteUserSettingsRequestV1.Json.g.cs | 141 +++++ ...ten.Models.RouteUserSettingsRequestV1.g.cs | 48 ++ ...Models.UpdateRouteSpendLimitSettingV1.g.cs | 15 +- ...ls.UpdateRouteTeamSpendLimitSettingV1.g.cs | 4 +- src/libs/Baseten/openapi.yaml | 283 +++++++++- 32 files changed, 3064 insertions(+), 216 deletions(-) create mode 100644 src/cli/Baseten.CLI/Commands/EditRoutesSettingsTeamsByTeamIdUsersByUserIdCommandApiCommand.g.cs create mode 100644 src/cli/Baseten.CLI/Commands/GetRoutesSettingsTeamsByTeamIdUsersByUserIdCommandApiCommand.g.cs create mode 100644 src/cli/Baseten.CLI/Commands/GetRoutesSettingsTeamsByTeamIdUsersCommandApiCommand.g.cs create mode 100644 src/cli/Baseten.CLI/Commands/UpdateRouteSpendLimitSettingV1OptionSet.g.cs create mode 100644 src/libs/Baseten/Generated/Baseten.BasetenClient.EditRoutesSettingsTeamsByTeamIdUsersByUserId.g.cs create mode 100644 src/libs/Baseten/Generated/Baseten.BasetenClient.GetRoutesSettingsTeamsByTeamIdUsers.g.cs create mode 100644 src/libs/Baseten/Generated/Baseten.BasetenClient.GetRoutesSettingsTeamsByTeamIdUsersByUserId.g.cs create mode 100644 src/libs/Baseten/Generated/Baseten.IBasetenClient.EditRoutesSettingsTeamsByTeamIdUsersByUserId.g.cs create mode 100644 src/libs/Baseten/Generated/Baseten.IBasetenClient.GetRoutesSettingsTeamsByTeamIdUsers.g.cs create mode 100644 src/libs/Baseten/Generated/Baseten.IBasetenClient.GetRoutesSettingsTeamsByTeamIdUsersByUserId.g.cs create mode 100644 src/libs/Baseten/Generated/Baseten.Models.RouteTeamUserSettingsListV1.Json.g.cs create mode 100644 src/libs/Baseten/Generated/Baseten.Models.RouteTeamUserSettingsListV1.g.cs create mode 100644 src/libs/Baseten/Generated/Baseten.Models.RouteTeamUserSettingsV1.Json.g.cs create mode 100644 src/libs/Baseten/Generated/Baseten.Models.RouteTeamUserSettingsV1.g.cs create mode 100644 src/libs/Baseten/Generated/Baseten.Models.RouteUserSettingsRequestV1.Json.g.cs create mode 100644 src/libs/Baseten/Generated/Baseten.Models.RouteUserSettingsRequestV1.g.cs diff --git a/src/cli/Baseten.CLI/Commands/DefaultApiGroupCommand.g.cs b/src/cli/Baseten.CLI/Commands/DefaultApiGroupCommand.g.cs index 69ad01d..83243d0 100644 --- a/src/cli/Baseten.CLI/Commands/DefaultApiGroupCommand.g.cs +++ b/src/cli/Baseten.CLI/Commands/DefaultApiGroupCommand.g.cs @@ -119,6 +119,7 @@ public static Command Create() command.Subcommands.Add(EditRoutesByRouteIdCommandApiCommand.Create()); command.Subcommands.Add(EditRoutesConnectionsByConnectionIdCommandApiCommand.Create()); command.Subcommands.Add(EditRoutesSettingsTeamsByTeamIdCommandApiCommand.Create()); + command.Subcommands.Add(EditRoutesSettingsTeamsByTeamIdUsersByUserIdCommandApiCommand.Create()); command.Subcommands.Add(EditRoutesSettingsUsersByUserIdCommandApiCommand.Create()); command.Subcommands.Add(EditTeamsByTeamIdEnvironmentGroupsByEnvNameCommandApiCommand.Create()); command.Subcommands.Add(EditTrainingCapacityCommandApiCommand.Create()); @@ -194,6 +195,8 @@ public static Command Create() command.Subcommands.Add(GetRoutesByRouteIdCommandApiCommand.Create()); command.Subcommands.Add(GetRoutesConnectionsCommandApiCommand.Create()); command.Subcommands.Add(GetRoutesSettingsTeamsByTeamIdCommandApiCommand.Create()); + command.Subcommands.Add(GetRoutesSettingsTeamsByTeamIdUsersCommandApiCommand.Create()); + command.Subcommands.Add(GetRoutesSettingsTeamsByTeamIdUsersByUserIdCommandApiCommand.Create()); command.Subcommands.Add(GetRoutesSettingsUsersByUserIdCommandApiCommand.Create()); command.Subcommands.Add(GetRoutesUsageCommandApiCommand.Create()); command.Subcommands.Add(GetSecretsCommandApiCommand.Create()); diff --git a/src/cli/Baseten.CLI/Commands/EditRoutesSettingsTeamsByTeamIdUsersByUserIdCommandApiCommand.g.cs b/src/cli/Baseten.CLI/Commands/EditRoutesSettingsTeamsByTeamIdUsersByUserIdCommandApiCommand.g.cs new file mode 100644 index 0000000..8db525b --- /dev/null +++ b/src/cli/Baseten.CLI/Commands/EditRoutesSettingsTeamsByTeamIdUsersByUserIdCommandApiCommand.g.cs @@ -0,0 +1,128 @@ +#nullable enable +#pragma warning disable CS0618 + +using System.CommandLine; + +namespace Baseten.CLI.Commands; + +internal static partial class EditRoutesSettingsTeamsByTeamIdUsersByUserIdCommandApiCommand +{ + private static Argument TeamId { get; } = new( + name: @"team-id") + { + Description = @"This is a missing parameter that was added automatically. Please check the OpenAPI spec.", + }; + + private static Argument UserId { get; } = new( + name: @"user-id") + { + Description = @"This is a missing parameter that was added automatically. Please check the OpenAPI spec.", + }; + private static readonly UpdateRouteSpendLimitSettingV1OptionSet SpendLimitOptions = UpdateRouteSpendLimitSettingV1OptionSet.Create(@"spend-limit"); + 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.RouteTeamUserSettingsV1 value, global::System.Text.Json.Serialization.JsonSerializerContext context, bool truncateLongStrings) + { + string? text = null; + CustomizeResponseText(parseResult, value, ref text); + if (!string.IsNullOrWhiteSpace(text)) + { + 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.RouteTeamUserSettingsV1 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-settings-teams-by-team-id-users-by-user-id", @"Updates a user's route settings in a team +Changes only the fields in the request. Once the user's metered spend in the team in a month reaches the spend limit, requests with Routes keys they created in the team are rejected until the limit is raised or the next month starts. Spend is metered every 15 minutes and can lag, so a user can go over the limit. Requires organization admin."); + command.Arguments.Add(TeamId); + command.Arguments.Add(UserId); command.Options.Add(SpendLimitOptions.UserMonthlyLimitUsd); + command.Options.Add(SpendLimitOptions.MonthOverrideUsd); + 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 = parseResult.GetRequiredValue(TeamId); + var userId = parseResult.GetRequiredValue(UserId); + + var __SpendLimitBase = __requestBase is { } __SpendLimitBaseValue ? __SpendLimitBaseValue.SpendLimit : default; var spendLimitUserMonthlyLimitUsd = CliRuntime.WasSpecified(parseResult, SpendLimitOptions.UserMonthlyLimitUsd) ? parseResult.GetValue(SpendLimitOptions.UserMonthlyLimitUsd) : (__SpendLimitBase is { } __SpendLimituserMonthlyLimitUsdBaseValue ? __SpendLimituserMonthlyLimitUsdBaseValue.UserMonthlyLimitUsd : default); + var spendLimitMonthOverrideUsd = CliRuntime.WasSpecified(parseResult, SpendLimitOptions.MonthOverrideUsd) ? parseResult.GetValue(SpendLimitOptions.MonthOverrideUsd) : (__SpendLimitBase is { } __SpendLimitmonthOverrideUsdBaseValue ? __SpendLimitmonthOverrideUsdBaseValue.MonthOverrideUsd : default); + var __SpendLimitSpecified = CliRuntime.WasSpecified(parseResult, SpendLimitOptions.UserMonthlyLimitUsd) || CliRuntime.WasSpecified(parseResult, SpendLimitOptions.MonthOverrideUsd); + var spendLimit = + __SpendLimitSpecified || __SpendLimitBase is not null + ? new global::Baseten.UpdateRouteSpendLimitSettingV1 + { + UserMonthlyLimitUsd = spendLimitUserMonthlyLimitUsd, + MonthOverrideUsd = spendLimitMonthOverrideUsd, + + } + : __SpendLimitBase; + using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); + + + var response = await client.EditRoutesSettingsTeamsByTeamIdUsersByUserIdAsync( + teamId: teamId, + userId: userId, + spendLimit: spendLimit, + 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/EditRoutesSettingsUsersByUserIdCommandApiCommand.g.cs b/src/cli/Baseten.CLI/Commands/EditRoutesSettingsUsersByUserIdCommandApiCommand.g.cs index 7628063..c50d633 100644 --- a/src/cli/Baseten.CLI/Commands/EditRoutesSettingsUsersByUserIdCommandApiCommand.g.cs +++ b/src/cli/Baseten.CLI/Commands/EditRoutesSettingsUsersByUserIdCommandApiCommand.g.cs @@ -12,12 +12,7 @@ internal static partial class EditRoutesSettingsUsersByUserIdCommandApiCommand { Description = @"This is a missing parameter that was added automatically. Please check the OpenAPI spec.", }; - - private static Option SpendLimit { get; } = new( - name: @"--spend-limit") - { - Description = @"Spend limit fields to change. Pass null to remove the user's limit; omit to leave it unchanged.", - }; + private static readonly UpdateRouteSpendLimitSettingV1OptionSet SpendLimitOptions = UpdateRouteSpendLimitSettingV1OptionSet.Create(@"spend-limit"); private static Option Input { get; } = new(@"--input") { Description = "Load request JSON from a file path, '-' for stdin, or an inline JSON object/array string.", @@ -60,9 +55,9 @@ private static string FormatResponse(ParseResult parseResult, global::Baseten.Ro public static Command Create(string? commandName = null) { var command = new Command(commandName ?? @"edit-routes-settings-users-by-user-id", @"Updates a user's route settings -Changes only the fields in the request. Once the user's metered spend in a month reaches the spend limit, requests with Routes keys they created are rejected until the limit is raised or the next month starts. Spend is metered every 15 minutes and can lag, so a user can go over the limit. The user's own limit supersedes their team's per-member limit."); - command.Arguments.Add(UserId); - command.Options.Add(SpendLimit); +Changes only the fields in the request. Once the user's metered spend in a team in a month reaches the spend limit, requests with Routes keys they created in that team are rejected until the limit is raised or the next month starts. Spend is metered every 15 minutes and can lag, so a user can go over the limit. The user's own limit supersedes their team's per-member limit. The limit is set in the only team the user has Code spend in this month, else in their only team; the request fails when there is none."); + command.Arguments.Add(UserId); command.Options.Add(SpendLimitOptions.UserMonthlyLimitUsd); + command.Options.Add(SpendLimitOptions.MonthOverrideUsd); command.Options.Add(Input); command.Options.Add(RequestJson); command.Options.Add(RequestFile); @@ -89,7 +84,19 @@ await CliRuntime.RunAsync(async () => global::Baseten.SourceGenerationContext.Default, cancellationToken).ConfigureAwait(false); var userId = parseResult.GetRequiredValue(UserId); - var spendLimit = CliRuntime.WasSpecified(parseResult, SpendLimit) ? parseResult.GetValue(SpendLimit) : (__requestBase is { } __SpendLimitBaseValue ? __SpendLimitBaseValue.SpendLimit : default); + + var __SpendLimitBase = __requestBase is { } __SpendLimitBaseValue ? __SpendLimitBaseValue.SpendLimit : default; var spendLimitUserMonthlyLimitUsd = CliRuntime.WasSpecified(parseResult, SpendLimitOptions.UserMonthlyLimitUsd) ? parseResult.GetValue(SpendLimitOptions.UserMonthlyLimitUsd) : (__SpendLimitBase is { } __SpendLimituserMonthlyLimitUsdBaseValue ? __SpendLimituserMonthlyLimitUsdBaseValue.UserMonthlyLimitUsd : default); + var spendLimitMonthOverrideUsd = CliRuntime.WasSpecified(parseResult, SpendLimitOptions.MonthOverrideUsd) ? parseResult.GetValue(SpendLimitOptions.MonthOverrideUsd) : (__SpendLimitBase is { } __SpendLimitmonthOverrideUsdBaseValue ? __SpendLimitmonthOverrideUsdBaseValue.MonthOverrideUsd : default); + var __SpendLimitSpecified = CliRuntime.WasSpecified(parseResult, SpendLimitOptions.UserMonthlyLimitUsd) || CliRuntime.WasSpecified(parseResult, SpendLimitOptions.MonthOverrideUsd); + var spendLimit = + __SpendLimitSpecified || __SpendLimitBase is not null + ? new global::Baseten.UpdateRouteSpendLimitSettingV1 + { + UserMonthlyLimitUsd = spendLimitUserMonthlyLimitUsd, + MonthOverrideUsd = spendLimitMonthOverrideUsd, + + } + : __SpendLimitBase; using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); diff --git a/src/cli/Baseten.CLI/Commands/GetRoutesSettingsTeamsByTeamIdUsersByUserIdCommandApiCommand.g.cs b/src/cli/Baseten.CLI/Commands/GetRoutesSettingsTeamsByTeamIdUsersByUserIdCommandApiCommand.g.cs new file mode 100644 index 0000000..9a72014 --- /dev/null +++ b/src/cli/Baseten.CLI/Commands/GetRoutesSettingsTeamsByTeamIdUsersByUserIdCommandApiCommand.g.cs @@ -0,0 +1,76 @@ +#nullable enable +#pragma warning disable CS0618 + +using System.CommandLine; + +namespace Baseten.CLI.Commands; + +internal static partial class GetRoutesSettingsTeamsByTeamIdUsersByUserIdCommandApiCommand +{ + private static Argument TeamId { get; } = new( + name: @"team-id") + { + Description = @"This is a missing parameter that was added automatically. Please check the OpenAPI spec.", + }; + + private static Argument UserId { get; } = new( + name: @"user-id") + { + Description = @"This is a missing parameter that was added automatically. Please check the OpenAPI spec.", + }; + + private static string FormatResponse(ParseResult parseResult, global::Baseten.RouteTeamUserSettingsV1 value, global::System.Text.Json.Serialization.JsonSerializerContext context, bool truncateLongStrings) + { + string? text = null; + CustomizeResponseText(parseResult, value, ref text); + if (!string.IsNullOrWhiteSpace(text)) + { + 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.RouteTeamUserSettingsV1 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-settings-teams-by-team-id-users-by-user-id", @"Gets a user's route settings in a team +Returns the user's spend limit for Baseten Code in the team, their spend in the team this month, and whether that spend reached the limit. Members can read their own settings; organization admins can read anyone's."); + command.Arguments.Add(TeamId); + command.Arguments.Add(UserId); + + + command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => + await CliRuntime.RunAsync(async () => + { + var teamId = parseResult.GetRequiredValue(TeamId); + var userId = parseResult.GetRequiredValue(UserId); + using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); + + + var response = await client.GetRoutesSettingsTeamsByTeamIdUsersByUserIdAsync( + teamId: teamId, + userId: userId, + 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/GetRoutesSettingsTeamsByTeamIdUsersCommandApiCommand.g.cs b/src/cli/Baseten.CLI/Commands/GetRoutesSettingsTeamsByTeamIdUsersCommandApiCommand.g.cs new file mode 100644 index 0000000..b840f09 --- /dev/null +++ b/src/cli/Baseten.CLI/Commands/GetRoutesSettingsTeamsByTeamIdUsersCommandApiCommand.g.cs @@ -0,0 +1,75 @@ +#nullable enable +#pragma warning disable CS0618 + +using System.CommandLine; + +namespace Baseten.CLI.Commands; + +internal static partial class GetRoutesSettingsTeamsByTeamIdUsersCommandApiCommand +{ + private static Argument TeamId { get; } = new( + name: @"team-id") + { + Description = @"This is a missing parameter that was added automatically. Please check the OpenAPI spec.", + }; + + private static string FormatResponse(ParseResult parseResult, global::Baseten.RouteTeamUserSettingsListV1 value, global::System.Text.Json.Serialization.JsonSerializerContext context, bool truncateLongStrings) + { + string? text = null; + CustomizeResponseText(parseResult, value, ref text); + if (!string.IsNullOrWhiteSpace(text)) + { + 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.RouteTeamUserSettingsListV1 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-settings-teams-by-team-id-users", @"Lists users' route settings in a team +Returns the settings in the team of each user with a role in the team and of anyone with Code spend in the team this month. Requires organization admin."); + command.Arguments.Add(TeamId); + + + command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => + await CliRuntime.RunAsync(async () => + { + var teamId = parseResult.GetRequiredValue(TeamId); + using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); + + + var response = await client.GetRoutesSettingsTeamsByTeamIdUsersAsync( + teamId: teamId, + cancellationToken: cancellationToken).ConfigureAwait(false); + + + if (!await CliRuntime.TryWriteOutputDirectoryAsync( + parseResult, + response, + global::Baseten.SourceGenerationContext.Default, + @"Users", + 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/GetRoutesSettingsUsersByUserIdCommandApiCommand.g.cs b/src/cli/Baseten.CLI/Commands/GetRoutesSettingsUsersByUserIdCommandApiCommand.g.cs index 8d9dec7..1d18556 100644 --- a/src/cli/Baseten.CLI/Commands/GetRoutesSettingsUsersByUserIdCommandApiCommand.g.cs +++ b/src/cli/Baseten.CLI/Commands/GetRoutesSettingsUsersByUserIdCommandApiCommand.g.cs @@ -13,6 +13,12 @@ internal static partial class GetRoutesSettingsUsersByUserIdCommandApiCommand Description = @"This is a missing parameter that was added automatically. Please check the OpenAPI spec.", }; + private static Option TeamId { get; } = new( + name: @"--team-id") + { + Description = @"ID of the team to read the user's spend limit in. Defaults to the only team the user has Code spend in this month, else their only team.", + }; + private static string FormatResponse(ParseResult parseResult, global::Baseten.RouteUserSettingsV1 value, global::System.Text.Json.Serialization.JsonSerializerContext context, bool truncateLongStrings) { string? text = null; @@ -38,19 +44,22 @@ private static string FormatResponse(ParseResult parseResult, global::Baseten.Ro public static Command Create(string? commandName = null) { var command = new Command(commandName ?? @"get-routes-settings-users-by-user-id", @"Gets a user's route settings -Returns the settings that apply to the user, including the spend limit that caps what they can spend on Baseten Code each month: the limit set on the user, their team's per-member limit, and the effective limit for this user. The user limit always overrides the team's per-member limit."); +Returns the settings that apply to the user, including the spend limit that caps what they can spend on Baseten Code each month: the limit set on the user, their team's per-member limit, and the effective limit for this user. The user limit always overrides the team's per-member limit. The limits are read in `team_id` when given, else in the only team the user has Code spend in this month, else in their only team; they are null when there is none."); command.Arguments.Add(UserId); + command.Options.Add(TeamId); command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => await CliRuntime.RunAsync(async () => { var userId = parseResult.GetRequiredValue(UserId); + var teamId = parseResult.GetValue(TeamId); using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); var response = await client.GetRoutesSettingsUsersByUserIdAsync( userId: userId, + teamId: teamId, cancellationToken: cancellationToken).ConfigureAwait(false); diff --git a/src/cli/Baseten.CLI/Commands/UpdateRouteSpendLimitSettingV1OptionSet.g.cs b/src/cli/Baseten.CLI/Commands/UpdateRouteSpendLimitSettingV1OptionSet.g.cs new file mode 100644 index 0000000..7f5ac63 --- /dev/null +++ b/src/cli/Baseten.CLI/Commands/UpdateRouteSpendLimitSettingV1OptionSet.g.cs @@ -0,0 +1,27 @@ +#nullable enable + +using System.CommandLine; + +namespace Baseten.CLI.Commands; + +internal sealed record UpdateRouteSpendLimitSettingV1OptionSet( + Option UserMonthlyLimitUsd, + Option MonthOverrideUsd) +{ + public static UpdateRouteSpendLimitSettingV1OptionSet Create(string? prefix = null) + { + var normalizedPrefix = string.IsNullOrWhiteSpace(prefix) + ? string.Empty + : prefix.Trim().Trim('-') + "-"; + return new UpdateRouteSpendLimitSettingV1OptionSet( + UserMonthlyLimitUsd: new Option($"--{normalizedPrefix}user-monthly-limit-usd") + { + Description = @"Standing spend limit in USD for each UTC calendar month. Send null to remove the limit; omit to leave it unchanged.", + }, + MonthOverrideUsd: new Option($"--{normalizedPrefix}month-override-usd") + { + Description = @"Spend limit in USD for the current UTC calendar month, which supersedes the standing limit. Send null to remove it; omit to leave it unchanged.", + } + ); + } +} \ No newline at end of file diff --git a/src/libs/Baseten/Generated/Baseten.BasetenClient.EditRoutesSettingsTeamsByTeamIdUsersByUserId.g.cs b/src/libs/Baseten/Generated/Baseten.BasetenClient.EditRoutesSettingsTeamsByTeamIdUsersByUserId.g.cs new file mode 100644 index 0000000..1a3221f --- /dev/null +++ b/src/libs/Baseten/Generated/Baseten.BasetenClient.EditRoutesSettingsTeamsByTeamIdUsersByUserId.g.cs @@ -0,0 +1,503 @@ + +#nullable enable + +namespace Baseten +{ + public partial class BasetenClient + { + + + private static readonly global::Baseten.EndPointSecurityRequirement s_EditRoutesSettingsTeamsByTeamIdUsersByUserIdSecurityRequirement0 = + 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_EditRoutesSettingsTeamsByTeamIdUsersByUserIdSecurityRequirements = + new global::Baseten.EndPointSecurityRequirement[] + { s_EditRoutesSettingsTeamsByTeamIdUsersByUserIdSecurityRequirement0, + }; + partial void PrepareEditRoutesSettingsTeamsByTeamIdUsersByUserIdArguments( + global::System.Net.Http.HttpClient httpClient, + ref string teamId, + ref string userId, + global::Baseten.UpdateRouteUserSettingsRequestV1 request); + partial void PrepareEditRoutesSettingsTeamsByTeamIdUsersByUserIdRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string teamId, + string userId, + global::Baseten.UpdateRouteUserSettingsRequestV1 request); + partial void ProcessEditRoutesSettingsTeamsByTeamIdUsersByUserIdResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessEditRoutesSettingsTeamsByTeamIdUsersByUserIdResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Updates a user's route settings in a team
+ /// Changes only the fields in the request. Once the user's metered spend in the team in a month reaches the spend limit, requests with Routes keys they created in the team are rejected until the limit is raised or the next month starts. Spend is metered every 15 minutes and can lag, so a user can go over the limit. Requires organization admin. + ///
+ /// + /// + /// + /// 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/settings/teams/{team_id}/users/{user_id} \
+ /// --header "Authorization: Bearer $BASETEN_API_KEY" \
+ /// --data '{
+ /// "spend_limit": null
+ /// }' + ///
+ public async global::System.Threading.Tasks.Task EditRoutesSettingsTeamsByTeamIdUsersByUserIdAsync( + string teamId, + string userId, + + global::Baseten.UpdateRouteUserSettingsRequestV1 request, + global::Baseten.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await EditRoutesSettingsTeamsByTeamIdUsersByUserIdAsResponseAsync( + teamId: teamId, + userId: userId, + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Updates a user's route settings in a team
+ /// Changes only the fields in the request. Once the user's metered spend in the team in a month reaches the spend limit, requests with Routes keys they created in the team are rejected until the limit is raised or the next month starts. Spend is metered every 15 minutes and can lag, so a user can go over the limit. Requires organization admin. + ///
+ /// + /// + /// + /// 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/settings/teams/{team_id}/users/{user_id} \
+ /// --header "Authorization: Bearer $BASETEN_API_KEY" \
+ /// --data '{
+ /// "spend_limit": null
+ /// }' + ///
+ public async global::System.Threading.Tasks.Task> EditRoutesSettingsTeamsByTeamIdUsersByUserIdAsResponseAsync( + string teamId, + string userId, + + global::Baseten.UpdateRouteUserSettingsRequestV1 request, + global::Baseten.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + request = request ?? throw new global::System.ArgumentNullException(nameof(request)); + + PrepareArguments( + client: HttpClient); + PrepareEditRoutesSettingsTeamsByTeamIdUsersByUserIdArguments( + httpClient: HttpClient, + teamId: ref teamId, + userId: ref userId, + request: request); + + + var __authorizations = global::Baseten.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_EditRoutesSettingsTeamsByTeamIdUsersByUserIdSecurityRequirements, + operationName: "EditRoutesSettingsTeamsByTeamIdUsersByUserIdAsync"); + + 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/settings/teams/{teamId}/users/{userId}", + 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); + PrepareEditRoutesSettingsTeamsByTeamIdUsersByUserIdRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + teamId: teamId, + userId: userId, + 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: "editRoutesSettingsTeamsByTeamIdUsersByUserId", + methodName: "EditRoutesSettingsTeamsByTeamIdUsersByUserIdAsync", + pathTemplate: "$\"/v1/routes/settings/teams/{teamId}/users/{userId}\"", + 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: "editRoutesSettingsTeamsByTeamIdUsersByUserId", + methodName: "EditRoutesSettingsTeamsByTeamIdUsersByUserIdAsync", + pathTemplate: "$\"/v1/routes/settings/teams/{teamId}/users/{userId}\"", + 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: "editRoutesSettingsTeamsByTeamIdUsersByUserId", + methodName: "EditRoutesSettingsTeamsByTeamIdUsersByUserIdAsync", + pathTemplate: "$\"/v1/routes/settings/teams/{teamId}/users/{userId}\"", + 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); + ProcessEditRoutesSettingsTeamsByTeamIdUsersByUserIdResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::Baseten.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::Baseten.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "editRoutesSettingsTeamsByTeamIdUsersByUserId", + methodName: "EditRoutesSettingsTeamsByTeamIdUsersByUserIdAsync", + pathTemplate: "$\"/v1/routes/settings/teams/{teamId}/users/{userId}\"", + 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: "editRoutesSettingsTeamsByTeamIdUsersByUserId", + methodName: "EditRoutesSettingsTeamsByTeamIdUsersByUserIdAsync", + pathTemplate: "$\"/v1/routes/settings/teams/{teamId}/users/{userId}\"", + 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); + ProcessEditRoutesSettingsTeamsByTeamIdUsersByUserIdResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::Baseten.RouteTeamUserSettingsV1.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.RouteTeamUserSettingsV1.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 user's route settings in a team
+ /// Changes only the fields in the request. Once the user's metered spend in the team in a month reaches the spend limit, requests with Routes keys they created in the team are rejected until the limit is raised or the next month starts. Spend is metered every 15 minutes and can lag, so a user can go over the limit. Requires organization admin. + ///
+ /// + /// + /// + /// Spend limit fields to change. Pass null to remove the user's limit; omit to leave it unchanged.
+ /// 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 + /// + public async global::System.Threading.Tasks.Task EditRoutesSettingsTeamsByTeamIdUsersByUserIdAsync( + string teamId, + string userId, + global::Baseten.UpdateRouteSpendLimitSettingV1? spendLimit = default, + global::Baseten.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __request = new global::Baseten.UpdateRouteUserSettingsRequestV1 + { + SpendLimit = spendLimit, + }; + + return await EditRoutesSettingsTeamsByTeamIdUsersByUserIdAsync( + teamId: teamId, + userId: userId, + request: __request, + requestOptions: requestOptions, + cancellationToken: cancellationToken).ConfigureAwait(false); + } + } +} \ No newline at end of file diff --git a/src/libs/Baseten/Generated/Baseten.BasetenClient.EditRoutesSettingsUsersByUserId.g.cs b/src/libs/Baseten/Generated/Baseten.BasetenClient.EditRoutesSettingsUsersByUserId.g.cs index 320b838..fd30667 100644 --- a/src/libs/Baseten/Generated/Baseten.BasetenClient.EditRoutesSettingsUsersByUserId.g.cs +++ b/src/libs/Baseten/Generated/Baseten.BasetenClient.EditRoutesSettingsUsersByUserId.g.cs @@ -45,7 +45,7 @@ partial void ProcessEditRoutesSettingsUsersByUserIdResponseContent( /// /// Updates a user's route settings
- /// Changes only the fields in the request. Once the user's metered spend in a month reaches the spend limit, requests with Routes keys they created are rejected until the limit is raised or the next month starts. Spend is metered every 15 minutes and can lag, so a user can go over the limit. The user's own limit supersedes their team's per-member limit. + /// Changes only the fields in the request. Once the user's metered spend in a team in a month reaches the spend limit, requests with Routes keys they created in that team are rejected until the limit is raised or the next month starts. Spend is metered every 15 minutes and can lag, so a user can go over the limit. The user's own limit supersedes their team's per-member limit. The limit is set in the only team the user has Code spend in this month, else in their only team; the request fails when there is none. ///
/// /// @@ -79,7 +79,7 @@ partial void ProcessEditRoutesSettingsUsersByUserIdResponseContent( } /// /// Updates a user's route settings
- /// Changes only the fields in the request. Once the user's metered spend in a month reaches the spend limit, requests with Routes keys they created are rejected until the limit is raised or the next month starts. Spend is metered every 15 minutes and can lag, so a user can go over the limit. The user's own limit supersedes their team's per-member limit. + /// Changes only the fields in the request. Once the user's metered spend in a team in a month reaches the spend limit, requests with Routes keys they created in that team are rejected until the limit is raised or the next month starts. Spend is metered every 15 minutes and can lag, so a user can go over the limit. The user's own limit supersedes their team's per-member limit. The limit is set in the only team the user has Code spend in this month, else in their only team; the request fails when there is none. ///
/// /// @@ -460,7 +460,7 @@ partial void ProcessEditRoutesSettingsUsersByUserIdResponseContent( } /// /// Updates a user's route settings
- /// Changes only the fields in the request. Once the user's metered spend in a month reaches the spend limit, requests with Routes keys they created are rejected until the limit is raised or the next month starts. Spend is metered every 15 minutes and can lag, so a user can go over the limit. The user's own limit supersedes their team's per-member limit. + /// Changes only the fields in the request. Once the user's metered spend in a team in a month reaches the spend limit, requests with Routes keys they created in that team are rejected until the limit is raised or the next month starts. Spend is metered every 15 minutes and can lag, so a user can go over the limit. The user's own limit supersedes their team's per-member limit. The limit is set in the only team the user has Code spend in this month, else in their only team; the request fails when there is none. ///
/// /// diff --git a/src/libs/Baseten/Generated/Baseten.BasetenClient.GetRoutesSettingsTeamsByTeamIdUsers.g.cs b/src/libs/Baseten/Generated/Baseten.BasetenClient.GetRoutesSettingsTeamsByTeamIdUsers.g.cs new file mode 100644 index 0000000..7d687e1 --- /dev/null +++ b/src/libs/Baseten/Generated/Baseten.BasetenClient.GetRoutesSettingsTeamsByTeamIdUsers.g.cs @@ -0,0 +1,436 @@ + +#nullable enable + +namespace Baseten +{ + public partial class BasetenClient + { + + + private static readonly global::Baseten.EndPointSecurityRequirement s_GetRoutesSettingsTeamsByTeamIdUsersSecurityRequirement0 = + 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_GetRoutesSettingsTeamsByTeamIdUsersSecurityRequirements = + new global::Baseten.EndPointSecurityRequirement[] + { s_GetRoutesSettingsTeamsByTeamIdUsersSecurityRequirement0, + }; + partial void PrepareGetRoutesSettingsTeamsByTeamIdUsersArguments( + global::System.Net.Http.HttpClient httpClient, + ref string teamId); + partial void PrepareGetRoutesSettingsTeamsByTeamIdUsersRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string teamId); + partial void ProcessGetRoutesSettingsTeamsByTeamIdUsersResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessGetRoutesSettingsTeamsByTeamIdUsersResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Lists users' route settings in a team
+ /// Returns the settings in the team of each user with a role in the team and of anyone with Code spend in the team this month. Requires organization admin. + ///
+ /// + /// 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/settings/teams/{team_id}/users \
+ /// --header "Authorization: Bearer $BASETEN_API_KEY" + ///
+ public async global::System.Threading.Tasks.Task GetRoutesSettingsTeamsByTeamIdUsersAsync( + string teamId, + global::Baseten.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await GetRoutesSettingsTeamsByTeamIdUsersAsResponseAsync( + teamId: teamId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Lists users' route settings in a team
+ /// Returns the settings in the team of each user with a role in the team and of anyone with Code spend in the team this month. Requires organization admin. + ///
+ /// + /// 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/settings/teams/{team_id}/users \
+ /// --header "Authorization: Bearer $BASETEN_API_KEY" + ///
+ public async global::System.Threading.Tasks.Task> GetRoutesSettingsTeamsByTeamIdUsersAsResponseAsync( + string teamId, + global::Baseten.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareGetRoutesSettingsTeamsByTeamIdUsersArguments( + httpClient: HttpClient, + teamId: ref teamId); + + + var __authorizations = global::Baseten.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_GetRoutesSettingsTeamsByTeamIdUsersSecurityRequirements, + operationName: "GetRoutesSettingsTeamsByTeamIdUsersAsync"); + + 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/settings/teams/{teamId}/users", + 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.Get, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.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); + PrepareGetRoutesSettingsTeamsByTeamIdUsersRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + 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: "getRoutesSettingsTeamsByTeamIdUsers", + methodName: "GetRoutesSettingsTeamsByTeamIdUsersAsync", + pathTemplate: "$\"/v1/routes/settings/teams/{teamId}/users\"", + 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: "getRoutesSettingsTeamsByTeamIdUsers", + methodName: "GetRoutesSettingsTeamsByTeamIdUsersAsync", + pathTemplate: "$\"/v1/routes/settings/teams/{teamId}/users\"", + 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: "getRoutesSettingsTeamsByTeamIdUsers", + methodName: "GetRoutesSettingsTeamsByTeamIdUsersAsync", + pathTemplate: "$\"/v1/routes/settings/teams/{teamId}/users\"", + 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); + ProcessGetRoutesSettingsTeamsByTeamIdUsersResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::Baseten.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::Baseten.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "getRoutesSettingsTeamsByTeamIdUsers", + methodName: "GetRoutesSettingsTeamsByTeamIdUsersAsync", + pathTemplate: "$\"/v1/routes/settings/teams/{teamId}/users\"", + 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: "getRoutesSettingsTeamsByTeamIdUsers", + methodName: "GetRoutesSettingsTeamsByTeamIdUsersAsync", + pathTemplate: "$\"/v1/routes/settings/teams/{teamId}/users\"", + 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); + ProcessGetRoutesSettingsTeamsByTeamIdUsersResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::Baseten.RouteTeamUserSettingsListV1.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.RouteTeamUserSettingsListV1.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.GetRoutesSettingsTeamsByTeamIdUsersByUserId.g.cs b/src/libs/Baseten/Generated/Baseten.BasetenClient.GetRoutesSettingsTeamsByTeamIdUsersByUserId.g.cs new file mode 100644 index 0000000..5fbe850 --- /dev/null +++ b/src/libs/Baseten/Generated/Baseten.BasetenClient.GetRoutesSettingsTeamsByTeamIdUsersByUserId.g.cs @@ -0,0 +1,445 @@ + +#nullable enable + +namespace Baseten +{ + public partial class BasetenClient + { + + + private static readonly global::Baseten.EndPointSecurityRequirement s_GetRoutesSettingsTeamsByTeamIdUsersByUserIdSecurityRequirement0 = + 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_GetRoutesSettingsTeamsByTeamIdUsersByUserIdSecurityRequirements = + new global::Baseten.EndPointSecurityRequirement[] + { s_GetRoutesSettingsTeamsByTeamIdUsersByUserIdSecurityRequirement0, + }; + partial void PrepareGetRoutesSettingsTeamsByTeamIdUsersByUserIdArguments( + global::System.Net.Http.HttpClient httpClient, + ref string teamId, + ref string userId); + partial void PrepareGetRoutesSettingsTeamsByTeamIdUsersByUserIdRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string teamId, + string userId); + partial void ProcessGetRoutesSettingsTeamsByTeamIdUsersByUserIdResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessGetRoutesSettingsTeamsByTeamIdUsersByUserIdResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Gets a user's route settings in a team
+ /// Returns the user's spend limit for Baseten Code in the team, their spend in the team this month, and whether that spend reached the limit. Members can read their own settings; organization admins can read anyone's. + ///
+ /// + /// + /// 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/settings/teams/{team_id}/users/{user_id} \
+ /// --header "Authorization: Bearer $BASETEN_API_KEY" + ///
+ public async global::System.Threading.Tasks.Task GetRoutesSettingsTeamsByTeamIdUsersByUserIdAsync( + string teamId, + string userId, + global::Baseten.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await GetRoutesSettingsTeamsByTeamIdUsersByUserIdAsResponseAsync( + teamId: teamId, + userId: userId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Gets a user's route settings in a team
+ /// Returns the user's spend limit for Baseten Code in the team, their spend in the team this month, and whether that spend reached the limit. Members can read their own settings; organization admins can read anyone's. + ///
+ /// + /// + /// 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/settings/teams/{team_id}/users/{user_id} \
+ /// --header "Authorization: Bearer $BASETEN_API_KEY" + ///
+ public async global::System.Threading.Tasks.Task> GetRoutesSettingsTeamsByTeamIdUsersByUserIdAsResponseAsync( + string teamId, + string userId, + global::Baseten.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareGetRoutesSettingsTeamsByTeamIdUsersByUserIdArguments( + httpClient: HttpClient, + teamId: ref teamId, + userId: ref userId); + + + var __authorizations = global::Baseten.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_GetRoutesSettingsTeamsByTeamIdUsersByUserIdSecurityRequirements, + operationName: "GetRoutesSettingsTeamsByTeamIdUsersByUserIdAsync"); + + 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/settings/teams/{teamId}/users/{userId}", + 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.Get, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.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); + PrepareGetRoutesSettingsTeamsByTeamIdUsersByUserIdRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + teamId: teamId, + userId: userId); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + 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: "getRoutesSettingsTeamsByTeamIdUsersByUserId", + methodName: "GetRoutesSettingsTeamsByTeamIdUsersByUserIdAsync", + pathTemplate: "$\"/v1/routes/settings/teams/{teamId}/users/{userId}\"", + 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: "getRoutesSettingsTeamsByTeamIdUsersByUserId", + methodName: "GetRoutesSettingsTeamsByTeamIdUsersByUserIdAsync", + pathTemplate: "$\"/v1/routes/settings/teams/{teamId}/users/{userId}\"", + 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: "getRoutesSettingsTeamsByTeamIdUsersByUserId", + methodName: "GetRoutesSettingsTeamsByTeamIdUsersByUserIdAsync", + pathTemplate: "$\"/v1/routes/settings/teams/{teamId}/users/{userId}\"", + 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); + ProcessGetRoutesSettingsTeamsByTeamIdUsersByUserIdResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::Baseten.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::Baseten.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "getRoutesSettingsTeamsByTeamIdUsersByUserId", + methodName: "GetRoutesSettingsTeamsByTeamIdUsersByUserIdAsync", + pathTemplate: "$\"/v1/routes/settings/teams/{teamId}/users/{userId}\"", + 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: "getRoutesSettingsTeamsByTeamIdUsersByUserId", + methodName: "GetRoutesSettingsTeamsByTeamIdUsersByUserIdAsync", + pathTemplate: "$\"/v1/routes/settings/teams/{teamId}/users/{userId}\"", + 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); + ProcessGetRoutesSettingsTeamsByTeamIdUsersByUserIdResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::Baseten.RouteTeamUserSettingsV1.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.RouteTeamUserSettingsV1.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.GetRoutesSettingsUsersByUserId.g.cs b/src/libs/Baseten/Generated/Baseten.BasetenClient.GetRoutesSettingsUsersByUserId.g.cs index bb77eb2..76791b1 100644 --- a/src/libs/Baseten/Generated/Baseten.BasetenClient.GetRoutesSettingsUsersByUserId.g.cs +++ b/src/libs/Baseten/Generated/Baseten.BasetenClient.GetRoutesSettingsUsersByUserId.g.cs @@ -27,10 +27,12 @@ public partial class BasetenClient }; partial void PrepareGetRoutesSettingsUsersByUserIdArguments( global::System.Net.Http.HttpClient httpClient, + ref string? teamId, ref string userId); partial void PrepareGetRoutesSettingsUsersByUserIdRequest( global::System.Net.Http.HttpClient httpClient, global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string? teamId, string userId); partial void ProcessGetRoutesSettingsUsersByUserIdResponse( global::System.Net.Http.HttpClient httpClient, @@ -43,8 +45,11 @@ partial void ProcessGetRoutesSettingsUsersByUserIdResponseContent( /// /// Gets a user's route settings
- /// Returns the settings that apply to the user, including the spend limit that caps what they can spend on Baseten Code each month: the limit set on the user, their team's per-member limit, and the effective limit for this user. The user limit always overrides the team's per-member limit. + /// Returns the settings that apply to the user, including the spend limit that caps what they can spend on Baseten Code each month: the limit set on the user, their team's per-member limit, and the effective limit for this user. The user limit always overrides the team's per-member limit. The limits are read in `team_id` when given, else in the only team the user has Code spend in this month, else in their only team; they are null when there is none. ///
+ /// + /// 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 @@ -56,11 +61,13 @@ partial void ProcessGetRoutesSettingsUsersByUserIdResponseContent( /// public async global::System.Threading.Tasks.Task GetRoutesSettingsUsersByUserIdAsync( string userId, + string? teamId = default, global::Baseten.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) { var __response = await GetRoutesSettingsUsersByUserIdAsResponseAsync( userId: userId, + teamId: teamId, requestOptions: requestOptions, cancellationToken: cancellationToken ).ConfigureAwait(false); @@ -69,8 +76,11 @@ partial void ProcessGetRoutesSettingsUsersByUserIdResponseContent( } /// /// Gets a user's route settings
- /// Returns the settings that apply to the user, including the spend limit that caps what they can spend on Baseten Code each month: the limit set on the user, their team's per-member limit, and the effective limit for this user. The user limit always overrides the team's per-member limit. + /// Returns the settings that apply to the user, including the spend limit that caps what they can spend on Baseten Code each month: the limit set on the user, their team's per-member limit, and the effective limit for this user. The user limit always overrides the team's per-member limit. The limits are read in `team_id` when given, else in the only team the user has Code spend in this month, else in their only team; they are null when there is none. ///
+ /// + /// 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 @@ -82,6 +92,7 @@ partial void ProcessGetRoutesSettingsUsersByUserIdResponseContent( /// public async global::System.Threading.Tasks.Task> GetRoutesSettingsUsersByUserIdAsResponseAsync( string userId, + string? teamId = default, global::Baseten.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) { @@ -89,6 +100,7 @@ partial void ProcessGetRoutesSettingsUsersByUserIdResponseContent( client: HttpClient); PrepareGetRoutesSettingsUsersByUserIdArguments( httpClient: HttpClient, + teamId: ref teamId, userId: ref userId); @@ -117,6 +129,9 @@ partial void ProcessGetRoutesSettingsUsersByUserIdResponseContent( var __pathBuilder = new global::Baseten.PathBuilder( path: $"/v1/routes/settings/users/{userId}", baseUri: HttpClient.BaseAddress); + __pathBuilder + .AddOptionalParameter("team_id", teamId) + ; var __path = __pathBuilder.ToString(); __path = global::Baseten.AutoSDKRequestOptionsSupport.AppendQueryParameters( path: __path, @@ -157,6 +172,7 @@ partial void ProcessGetRoutesSettingsUsersByUserIdResponseContent( PrepareGetRoutesSettingsUsersByUserIdRequest( httpClient: HttpClient, httpRequestMessage: __httpRequest, + teamId: teamId, userId: userId); return __httpRequest; diff --git a/src/libs/Baseten/Generated/Baseten.IBasetenClient.EditRoutesSettingsTeamsByTeamIdUsersByUserId.g.cs b/src/libs/Baseten/Generated/Baseten.IBasetenClient.EditRoutesSettingsTeamsByTeamIdUsersByUserId.g.cs new file mode 100644 index 0000000..42be6b5 --- /dev/null +++ b/src/libs/Baseten/Generated/Baseten.IBasetenClient.EditRoutesSettingsTeamsByTeamIdUsersByUserId.g.cs @@ -0,0 +1,77 @@ +#nullable enable + +namespace Baseten +{ + public partial interface IBasetenClient + { + /// + /// Updates a user's route settings in a team
+ /// Changes only the fields in the request. Once the user's metered spend in the team in a month reaches the spend limit, requests with Routes keys they created in the team are rejected until the limit is raised or the next month starts. Spend is metered every 15 minutes and can lag, so a user can go over the limit. Requires organization admin. + ///
+ /// + /// + /// + /// 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/settings/teams/{team_id}/users/{user_id} \
+ /// --header "Authorization: Bearer $BASETEN_API_KEY" \
+ /// --data '{
+ /// "spend_limit": null
+ /// }' + ///
+ global::System.Threading.Tasks.Task EditRoutesSettingsTeamsByTeamIdUsersByUserIdAsync( + string teamId, + string userId, + + global::Baseten.UpdateRouteUserSettingsRequestV1 request, + global::Baseten.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Updates a user's route settings in a team
+ /// Changes only the fields in the request. Once the user's metered spend in the team in a month reaches the spend limit, requests with Routes keys they created in the team are rejected until the limit is raised or the next month starts. Spend is metered every 15 minutes and can lag, so a user can go over the limit. Requires organization admin. + ///
+ /// + /// + /// + /// 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/settings/teams/{team_id}/users/{user_id} \
+ /// --header "Authorization: Bearer $BASETEN_API_KEY" \
+ /// --data '{
+ /// "spend_limit": null
+ /// }' + ///
+ global::System.Threading.Tasks.Task> EditRoutesSettingsTeamsByTeamIdUsersByUserIdAsResponseAsync( + string teamId, + string userId, + + global::Baseten.UpdateRouteUserSettingsRequestV1 request, + global::Baseten.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Updates a user's route settings in a team
+ /// Changes only the fields in the request. Once the user's metered spend in the team in a month reaches the spend limit, requests with Routes keys they created in the team are rejected until the limit is raised or the next month starts. Spend is metered every 15 minutes and can lag, so a user can go over the limit. Requires organization admin. + ///
+ /// + /// + /// + /// Spend limit fields to change. Pass null to remove the user's limit; omit to leave it unchanged.
+ /// 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 + /// + global::System.Threading.Tasks.Task EditRoutesSettingsTeamsByTeamIdUsersByUserIdAsync( + string teamId, + string userId, + global::Baseten.UpdateRouteSpendLimitSettingV1? spendLimit = 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.EditRoutesSettingsUsersByUserId.g.cs b/src/libs/Baseten/Generated/Baseten.IBasetenClient.EditRoutesSettingsUsersByUserId.g.cs index 60c9509..b128842 100644 --- a/src/libs/Baseten/Generated/Baseten.IBasetenClient.EditRoutesSettingsUsersByUserId.g.cs +++ b/src/libs/Baseten/Generated/Baseten.IBasetenClient.EditRoutesSettingsUsersByUserId.g.cs @@ -6,7 +6,7 @@ public partial interface IBasetenClient { /// /// Updates a user's route settings
- /// Changes only the fields in the request. Once the user's metered spend in a month reaches the spend limit, requests with Routes keys they created are rejected until the limit is raised or the next month starts. Spend is metered every 15 minutes and can lag, so a user can go over the limit. The user's own limit supersedes their team's per-member limit. + /// Changes only the fields in the request. Once the user's metered spend in a team in a month reaches the spend limit, requests with Routes keys they created in that team are rejected until the limit is raised or the next month starts. Spend is metered every 15 minutes and can lag, so a user can go over the limit. The user's own limit supersedes their team's per-member limit. The limit is set in the only team the user has Code spend in this month, else in their only team; the request fails when there is none. ///
/// /// @@ -29,7 +29,7 @@ public partial interface IBasetenClient global::System.Threading.CancellationToken cancellationToken = default); /// /// Updates a user's route settings
- /// Changes only the fields in the request. Once the user's metered spend in a month reaches the spend limit, requests with Routes keys they created are rejected until the limit is raised or the next month starts. Spend is metered every 15 minutes and can lag, so a user can go over the limit. The user's own limit supersedes their team's per-member limit. + /// Changes only the fields in the request. Once the user's metered spend in a team in a month reaches the spend limit, requests with Routes keys they created in that team are rejected until the limit is raised or the next month starts. Spend is metered every 15 minutes and can lag, so a user can go over the limit. The user's own limit supersedes their team's per-member limit. The limit is set in the only team the user has Code spend in this month, else in their only team; the request fails when there is none. ///
/// /// @@ -52,7 +52,7 @@ public partial interface IBasetenClient global::System.Threading.CancellationToken cancellationToken = default); /// /// Updates a user's route settings
- /// Changes only the fields in the request. Once the user's metered spend in a month reaches the spend limit, requests with Routes keys they created are rejected until the limit is raised or the next month starts. Spend is metered every 15 minutes and can lag, so a user can go over the limit. The user's own limit supersedes their team's per-member limit. + /// Changes only the fields in the request. Once the user's metered spend in a team in a month reaches the spend limit, requests with Routes keys they created in that team are rejected until the limit is raised or the next month starts. Spend is metered every 15 minutes and can lag, so a user can go over the limit. The user's own limit supersedes their team's per-member limit. The limit is set in the only team the user has Code spend in this month, else in their only team; the request fails when there is none. ///
/// /// diff --git a/src/libs/Baseten/Generated/Baseten.IBasetenClient.GetRoutesSettingsTeamsByTeamIdUsers.g.cs b/src/libs/Baseten/Generated/Baseten.IBasetenClient.GetRoutesSettingsTeamsByTeamIdUsers.g.cs new file mode 100644 index 0000000..4d0ef32 --- /dev/null +++ b/src/libs/Baseten/Generated/Baseten.IBasetenClient.GetRoutesSettingsTeamsByTeamIdUsers.g.cs @@ -0,0 +1,42 @@ +#nullable enable + +namespace Baseten +{ + public partial interface IBasetenClient + { + /// + /// Lists users' route settings in a team
+ /// Returns the settings in the team of each user with a role in the team and of anyone with Code spend in the team this month. Requires organization admin. + ///
+ /// + /// 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/settings/teams/{team_id}/users \
+ /// --header "Authorization: Bearer $BASETEN_API_KEY" + ///
+ global::System.Threading.Tasks.Task GetRoutesSettingsTeamsByTeamIdUsersAsync( + string teamId, + global::Baseten.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Lists users' route settings in a team
+ /// Returns the settings in the team of each user with a role in the team and of anyone with Code spend in the team this month. Requires organization admin. + ///
+ /// + /// 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/settings/teams/{team_id}/users \
+ /// --header "Authorization: Bearer $BASETEN_API_KEY" + ///
+ global::System.Threading.Tasks.Task> GetRoutesSettingsTeamsByTeamIdUsersAsResponseAsync( + string teamId, + 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.GetRoutesSettingsTeamsByTeamIdUsersByUserId.g.cs b/src/libs/Baseten/Generated/Baseten.IBasetenClient.GetRoutesSettingsTeamsByTeamIdUsersByUserId.g.cs new file mode 100644 index 0000000..27b394f --- /dev/null +++ b/src/libs/Baseten/Generated/Baseten.IBasetenClient.GetRoutesSettingsTeamsByTeamIdUsersByUserId.g.cs @@ -0,0 +1,46 @@ +#nullable enable + +namespace Baseten +{ + public partial interface IBasetenClient + { + /// + /// Gets a user's route settings in a team
+ /// Returns the user's spend limit for Baseten Code in the team, their spend in the team this month, and whether that spend reached the limit. Members can read their own settings; organization admins can read anyone's. + ///
+ /// + /// + /// 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/settings/teams/{team_id}/users/{user_id} \
+ /// --header "Authorization: Bearer $BASETEN_API_KEY" + ///
+ global::System.Threading.Tasks.Task GetRoutesSettingsTeamsByTeamIdUsersByUserIdAsync( + string teamId, + string userId, + global::Baseten.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Gets a user's route settings in a team
+ /// Returns the user's spend limit for Baseten Code in the team, their spend in the team this month, and whether that spend reached the limit. Members can read their own settings; organization admins can read anyone's. + ///
+ /// + /// + /// 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/settings/teams/{team_id}/users/{user_id} \
+ /// --header "Authorization: Bearer $BASETEN_API_KEY" + ///
+ global::System.Threading.Tasks.Task> GetRoutesSettingsTeamsByTeamIdUsersByUserIdAsResponseAsync( + string teamId, + string userId, + 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.GetRoutesSettingsUsersByUserId.g.cs b/src/libs/Baseten/Generated/Baseten.IBasetenClient.GetRoutesSettingsUsersByUserId.g.cs index fce7ac5..f0cc3d6 100644 --- a/src/libs/Baseten/Generated/Baseten.IBasetenClient.GetRoutesSettingsUsersByUserId.g.cs +++ b/src/libs/Baseten/Generated/Baseten.IBasetenClient.GetRoutesSettingsUsersByUserId.g.cs @@ -6,8 +6,11 @@ public partial interface IBasetenClient { /// /// Gets a user's route settings
- /// Returns the settings that apply to the user, including the spend limit that caps what they can spend on Baseten Code each month: the limit set on the user, their team's per-member limit, and the effective limit for this user. The user limit always overrides the team's per-member limit. + /// Returns the settings that apply to the user, including the spend limit that caps what they can spend on Baseten Code each month: the limit set on the user, their team's per-member limit, and the effective limit for this user. The user limit always overrides the team's per-member limit. The limits are read in `team_id` when given, else in the only team the user has Code spend in this month, else in their only team; they are null when there is none. ///
+ /// + /// 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 @@ -19,12 +22,16 @@ public partial interface IBasetenClient /// global::System.Threading.Tasks.Task GetRoutesSettingsUsersByUserIdAsync( string userId, + string? teamId = default, global::Baseten.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); /// /// Gets a user's route settings
- /// Returns the settings that apply to the user, including the spend limit that caps what they can spend on Baseten Code each month: the limit set on the user, their team's per-member limit, and the effective limit for this user. The user limit always overrides the team's per-member limit. + /// Returns the settings that apply to the user, including the spend limit that caps what they can spend on Baseten Code each month: the limit set on the user, their team's per-member limit, and the effective limit for this user. The user limit always overrides the team's per-member limit. The limits are read in `team_id` when given, else in the only team the user has Code spend in this month, else in their only team; they are null when there is none. ///
+ /// + /// 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 @@ -36,6 +43,7 @@ public partial interface IBasetenClient /// global::System.Threading.Tasks.Task> GetRoutesSettingsUsersByUserIdAsResponseAsync( string userId, + string? teamId = default, global::Baseten.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); } diff --git a/src/libs/Baseten/Generated/Baseten.JsonSerializerContext.g.cs b/src/libs/Baseten/Generated/Baseten.JsonSerializerContext.g.cs index 74fa66d..73d7be7 100644 --- a/src/libs/Baseten/Generated/Baseten.JsonSerializerContext.g.cs +++ b/src/libs/Baseten/Generated/Baseten.JsonSerializerContext.g.cs @@ -652,6 +652,7 @@ internal sealed partial class SourceGenerationContextChunk0 : global::System.Tex [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Baseten.RouteSpendLimitSettingV1))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Baseten.RouteSpendLimitTeamDefaultV1))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Baseten.RouteUserSettingsV1))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Baseten.RouteUserSettingsRequestV1))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Baseten.UpdateRouteSpendLimitSettingV1))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Baseten.UpdateRouteUserSettingsRequestV1))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Baseten.BackgroundHarnessDefaultsV1))] @@ -665,6 +666,9 @@ 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.RouteTeamUserSettingsV1))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Baseten.RouteTeamUserSettingsListV1))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] [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))] @@ -995,6 +999,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))] @@ -1014,12 +1019,22 @@ 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))] + internal sealed partial class SourceGenerationContextChunk1 : global::System.Text.Json.Serialization.JsonSerializerContext + { + } + + /// + /// + /// + [global::System.Text.Json.Serialization.JsonSourceGenerationOptions( + DefaultIgnoreCondition = global::System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingNull + )] [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))] - internal sealed partial class SourceGenerationContextChunk1 : global::System.Text.Json.Serialization.JsonSerializerContext + internal sealed partial class SourceGenerationContextChunk2 : global::System.Text.Json.Serialization.JsonSerializerContext { } /// @@ -2277,7 +2292,7 @@ public override bool CanConvert(global::System.Type typeToConvert) private sealed class LazyChunkResolver : global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver { private readonly object _gate = new(); - private readonly global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver?[] _resolvers = new global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver?[2]; + private readonly global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver?[] _resolvers = new global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver?[3]; public global::System.Text.Json.Serialization.Metadata.JsonTypeInfo? GetTypeInfo( global::System.Type type, @@ -2316,6 +2331,8 @@ private sealed class LazyChunkResolver : global::System.Text.Json.Serialization. 0 => new SourceGenerationContextChunk0(new global::System.Text.Json.JsonSerializerOptions()), 1 => new SourceGenerationContextChunk1(new global::System.Text.Json.JsonSerializerOptions()), + + 2 => new SourceGenerationContextChunk2(new global::System.Text.Json.JsonSerializerOptions()), _ => throw new global::System.ArgumentOutOfRangeException(nameof(index)), }; } diff --git a/src/libs/Baseten/Generated/Baseten.JsonSerializerContextTypes.g.cs b/src/libs/Baseten/Generated/Baseten.JsonSerializerContextTypes.g.cs index d495ea7..3d90f25 100644 --- a/src/libs/Baseten/Generated/Baseten.JsonSerializerContextTypes.g.cs +++ b/src/libs/Baseten/Generated/Baseten.JsonSerializerContextTypes.g.cs @@ -2553,591 +2553,607 @@ public sealed partial class JsonSerializerContextTypes /// /// /// - public global::Baseten.UpdateRouteSpendLimitSettingV1? Type630 { get; set; } + public global::Baseten.RouteUserSettingsRequestV1? Type630 { get; set; } /// /// /// - public global::Baseten.UpdateRouteUserSettingsRequestV1? Type631 { get; set; } + public global::Baseten.UpdateRouteSpendLimitSettingV1? Type631 { get; set; } /// /// /// - public global::Baseten.BackgroundHarnessDefaultsV1? Type632 { get; set; } + public global::Baseten.UpdateRouteUserSettingsRequestV1? Type632 { get; set; } /// /// /// - public global::Baseten.RouteHarnessModelV1? Type633 { get; set; } + public global::Baseten.BackgroundHarnessDefaultsV1? Type633 { get; set; } /// /// /// - public global::Baseten.PrimaryHarnessDefaultsV1? Type634 { get; set; } + public global::Baseten.RouteHarnessModelV1? Type634 { get; set; } /// /// /// - public global::Baseten.RouteHarnessDefaultsV1? Type635 { get; set; } + public global::Baseten.PrimaryHarnessDefaultsV1? Type635 { get; set; } /// /// /// - public global::Baseten.RouteTeamSpendLimitSettingV1? Type636 { get; set; } + public global::Baseten.RouteHarnessDefaultsV1? Type636 { get; set; } /// /// /// - public global::Baseten.RouteTeamSettingsV1? Type637 { get; set; } + public global::Baseten.RouteTeamSpendLimitSettingV1? Type637 { get; set; } /// /// /// - public global::Baseten.UpdateBackgroundHarnessModelsV1? Type638 { get; set; } + public global::Baseten.RouteTeamSettingsV1? Type638 { get; set; } /// /// /// - public global::Baseten.UpdatePrimaryHarnessModelsV1? Type639 { get; set; } + public global::Baseten.UpdateBackgroundHarnessModelsV1? Type639 { get; set; } /// /// /// - public global::Baseten.UpdateRouteHarnessDefaultsV1? Type640 { get; set; } + public global::Baseten.UpdatePrimaryHarnessModelsV1? Type640 { get; set; } /// /// /// - public global::Baseten.UpdateRouteTeamSpendLimitSettingV1? Type641 { get; set; } + public global::Baseten.UpdateRouteHarnessDefaultsV1? Type641 { get; set; } /// /// /// - public global::Baseten.UpdateRouteTeamSettingsRequestV1? Type642 { get; set; } + public global::Baseten.UpdateRouteTeamSpendLimitSettingV1? Type642 { get; set; } /// /// /// - public global::Baseten.RouteConnectionAnthropicV1? Type643 { get; set; } + public global::Baseten.UpdateRouteTeamSettingsRequestV1? Type643 { get; set; } /// /// /// - public global::Baseten.RouteConnectionOpenAIV1? Type644 { get; set; } + public global::Baseten.RouteTeamUserSettingsV1? Type644 { get; set; } /// /// /// - public global::Baseten.RouteConnectionV1? Type645 { get; set; } + public global::Baseten.RouteTeamUserSettingsListV1? Type645 { get; set; } /// /// /// - public global::Baseten.Config? Type646 { get; set; } + public global::System.Collections.Generic.IList? Type646 { get; set; } /// /// /// - public global::Baseten.RouteConnectionXAIV1? Type647 { get; set; } + public global::Baseten.RouteConnectionAnthropicV1? Type647 { get; set; } /// /// /// - public global::Baseten.RouteConnectionV1ConfigDiscriminator? Type648 { get; set; } + public global::Baseten.RouteConnectionOpenAIV1? Type648 { get; set; } /// /// /// - public global::Baseten.RouteConnectionV1ConfigDiscriminatorProvider? Type649 { get; set; } + public global::Baseten.RouteConnectionV1? Type649 { get; set; } /// /// /// - public global::Baseten.RouteConnectionsResponseV1? Type650 { get; set; } + public global::Baseten.Config? Type650 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type651 { get; set; } + public global::Baseten.RouteConnectionXAIV1? Type651 { get; set; } /// /// /// - public global::Baseten.RouteConnectionsRequestV1? Type652 { get; set; } + public global::Baseten.RouteConnectionV1ConfigDiscriminator? Type652 { get; set; } /// /// /// - public global::Baseten.RouteConnectionConfigAnthropicV1? Type653 { get; set; } + public global::Baseten.RouteConnectionV1ConfigDiscriminatorProvider? Type653 { get; set; } /// /// /// - public global::Baseten.RouteConnectionConfigOpenAIV1? Type654 { get; set; } + public global::Baseten.RouteConnectionsResponseV1? Type654 { get; set; } /// /// /// - public global::Baseten.RouteConnectionConfigXAIV1? Type655 { get; set; } + public global::System.Collections.Generic.IList? Type655 { get; set; } /// /// /// - public global::Baseten.CreateRouteConnectionRequestV1? Type656 { get; set; } + public global::Baseten.RouteConnectionsRequestV1? Type656 { get; set; } /// /// /// - public global::Baseten.Config2? Type657 { get; set; } + public global::Baseten.RouteConnectionConfigAnthropicV1? Type657 { get; set; } /// /// /// - public global::Baseten.CreateRouteConnectionRequestV1ConfigDiscriminator? Type658 { get; set; } + public global::Baseten.RouteConnectionConfigOpenAIV1? Type658 { get; set; } /// /// /// - public global::Baseten.CreateRouteConnectionRequestV1ConfigDiscriminatorProvider? Type659 { get; set; } + public global::Baseten.RouteConnectionConfigXAIV1? Type659 { get; set; } /// /// /// - public global::Baseten.RouteConnectionTombstoneV1? Type660 { get; set; } + public global::Baseten.CreateRouteConnectionRequestV1? Type660 { get; set; } /// /// /// - public global::Baseten.UpdateRouteConnectionConfigAnthropicV1? Type661 { get; set; } + public global::Baseten.Config2? Type661 { get; set; } /// /// /// - public global::Baseten.UpdateRouteConnectionConfigOpenAIV1? Type662 { get; set; } + public global::Baseten.CreateRouteConnectionRequestV1ConfigDiscriminator? Type662 { get; set; } /// /// /// - public global::Baseten.UpdateRouteConnectionConfigXAIV1? Type663 { get; set; } + public global::Baseten.CreateRouteConnectionRequestV1ConfigDiscriminatorProvider? Type663 { get; set; } /// /// /// - public global::Baseten.UpdateRouteConnectionRequestV1? Type664 { get; set; } + public global::Baseten.RouteConnectionTombstoneV1? Type664 { get; set; } /// /// /// - public global::Baseten.Config3? Type665 { get; set; } + public global::Baseten.UpdateRouteConnectionConfigAnthropicV1? Type665 { get; set; } /// /// /// - public global::Baseten.UpdateRouteConnectionRequestV1ConfigDiscriminator? Type666 { get; set; } + public global::Baseten.UpdateRouteConnectionConfigOpenAIV1? Type666 { get; set; } /// /// /// - public global::Baseten.UpdateRouteConnectionRequestV1ConfigDiscriminatorProvider? Type667 { get; set; } + public global::Baseten.UpdateRouteConnectionConfigXAIV1? Type667 { get; set; } /// /// /// - public global::Baseten.RouteTombstoneV1? Type668 { get; set; } + public global::Baseten.UpdateRouteConnectionRequestV1? Type668 { get; set; } /// /// /// - public global::Baseten.UpdateRouteRequestV1? Type669 { get; set; } + public global::Baseten.Config3? Type669 { get; set; } /// /// /// - public global::Baseten.TargetVariant1? Type670 { get; set; } + public global::Baseten.UpdateRouteConnectionRequestV1ConfigDiscriminator? Type670 { get; set; } /// /// /// - public global::Baseten.UpdateRouteRequestV1TargetVariant1Discriminator? Type671 { get; set; } + public global::Baseten.UpdateRouteConnectionRequestV1ConfigDiscriminatorProvider? Type671 { get; set; } /// /// /// - public global::Baseten.UpdateRouteRequestV1TargetVariant1DiscriminatorType? Type672 { get; set; } + public global::Baseten.RouteTombstoneV1? Type672 { get; set; } /// /// /// - public global::Baseten.EndpointTargetV1? Type673 { get; set; } + public global::Baseten.UpdateRouteRequestV1? Type673 { get; set; } /// /// /// - public global::Baseten.GatewayProvider? Type674 { get; set; } + public global::Baseten.TargetVariant1? Type674 { get; set; } /// /// /// - public global::Baseten.VertexTargetConfigV1? Type675 { get; set; } + public global::Baseten.UpdateRouteRequestV1TargetVariant1Discriminator? Type675 { get; set; } /// /// /// - public global::Baseten.EndpointV1? Type676 { get; set; } + public global::Baseten.UpdateRouteRequestV1TargetVariant1DiscriminatorType? Type676 { get; set; } /// /// /// - public global::Baseten.SharedEndpointRegionV1? Type677 { get; set; } + public global::Baseten.EndpointTargetV1? Type677 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type678 { get; set; } + public global::Baseten.GatewayProvider? Type678 { get; set; } /// /// /// - public global::Baseten.EndpointsResponseV1? Type679 { get; set; } + public global::Baseten.VertexTargetConfigV1? Type679 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type680 { get; set; } + public global::Baseten.EndpointV1? Type680 { get; set; } /// /// /// - public global::Baseten.EndpointTargetRequestV1? Type681 { get; set; } + public global::Baseten.SharedEndpointRegionV1? Type681 { get; set; } /// /// /// - public global::Baseten.CreateEndpointRequestV1? Type682 { get; set; } + public global::System.Collections.Generic.IList? Type682 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type683 { get; set; } + public global::Baseten.EndpointsResponseV1? Type683 { get; set; } /// /// /// - public global::Baseten.EndpointTombstoneV1? Type684 { get; set; } + public global::System.Collections.Generic.IList? Type684 { get; set; } /// /// /// - public global::Baseten.UpdateEndpointRequestV1? Type685 { get; set; } + public global::Baseten.EndpointTargetRequestV1? Type685 { get; set; } /// /// /// - public global::Baseten.EffectiveModelConfigV1? Type686 { get; set; } + public global::Baseten.CreateEndpointRequestV1? Type686 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type687 { get; set; } + public global::System.Collections.Generic.IList? Type687 { get; set; } /// /// /// - public global::Baseten.EffectiveRateLimitV1? Type688 { get; set; } + public global::Baseten.EndpointTombstoneV1? Type688 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type689 { get; set; } + public global::Baseten.UpdateEndpointRequestV1? Type689 { get; set; } /// /// /// - public global::Baseten.EffectiveUsageLimitV1? Type690 { get; set; } + public global::Baseten.EffectiveModelConfigV1? Type690 { get; set; } /// /// /// - public global::Baseten.UsageLimitUnitV1? Type691 { get; set; } + public global::System.Collections.Generic.IList? Type691 { get; set; } /// /// /// - public global::Baseten.GroupHierarchyV1? Type692 { get; set; } + public global::Baseten.EffectiveRateLimitV1? Type692 { get; set; } /// /// /// - public global::Baseten.LimitEnforcementV1? Type693 { get; set; } + public global::System.Collections.Generic.IList? Type693 { get; set; } /// /// /// - public global::Baseten.GroupMetadataV1? Type694 { get; set; } + public global::Baseten.EffectiveUsageLimitV1? Type694 { get; set; } /// /// /// - public global::Baseten.GroupV1? Type695 { get; set; } + public global::Baseten.UsageLimitUnitV1? Type695 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type696 { get; set; } + public global::Baseten.GroupHierarchyV1? Type696 { get; set; } /// /// /// - public global::Baseten.ModelConfigV1? Type697 { get; set; } + public global::Baseten.LimitEnforcementV1? Type697 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type698 { get; set; } + public global::Baseten.GroupMetadataV1? Type698 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type699 { get; set; } + public global::Baseten.GroupV1? Type699 { get; set; } /// /// /// - public global::Baseten.UsageLimitV1? Type700 { get; set; } + public global::System.Collections.Generic.IList? Type700 { get; set; } /// /// /// - public global::Baseten.GroupsResponseV1? Type701 { get; set; } + public global::Baseten.ModelConfigV1? Type701 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type702 { get; set; } + public global::System.Collections.Generic.IList? Type702 { get; set; } /// /// /// - public global::Baseten.CreateGroupHierarchyV1? Type703 { get; set; } + public global::System.Collections.Generic.IList? Type703 { get; set; } /// /// /// - public global::Baseten.CreateGroupRequestV1? Type704 { get; set; } + public global::Baseten.UsageLimitV1? Type704 { get; set; } /// /// /// - public global::Baseten.UpdateGroupMetadataV1? Type705 { get; set; } + public global::Baseten.GroupsResponseV1? Type705 { get; set; } /// /// /// - public global::Baseten.UpdateGroupRequestV1? Type706 { get; set; } + public global::System.Collections.Generic.IList? Type706 { get; set; } /// /// /// - public global::Baseten.GatewayKeyInfoV1? Type707 { get; set; } + public global::Baseten.CreateGroupHierarchyV1? Type707 { get; set; } /// /// /// - public global::Baseten.KeysForGroupResponseV1? Type708 { get; set; } + public global::Baseten.CreateGroupRequestV1? Type708 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type709 { get; set; } + public global::Baseten.UpdateGroupMetadataV1? Type709 { get; set; } /// /// /// - public global::Baseten.CreateApiKeyForGroupRequestV1? Type710 { get; set; } + public global::Baseten.UpdateGroupRequestV1? Type710 { get; set; } /// /// /// - public global::Baseten.CreateApiKeyForGroupResponseV1? Type711 { get; set; } + public global::Baseten.GatewayKeyInfoV1? Type711 { get; set; } /// /// /// - public global::Baseten.RegisterAPIKeyRequestV1? Type712 { get; set; } + public global::Baseten.KeysForGroupResponseV1? Type712 { get; set; } /// /// /// - public global::Baseten.RegisterAPIKeyResponseV1? Type713 { get; set; } + public global::System.Collections.Generic.IList? Type713 { get; set; } /// /// /// - public global::Baseten.GetSandboxConfigurationResponseV1? Type714 { get; set; } + public global::Baseten.CreateApiKeyForGroupRequestV1? Type714 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type715 { get; set; } + public global::Baseten.CreateApiKeyForGroupResponseV1? Type715 { get; set; } /// /// /// - public global::Baseten.SandboxRegionV1? Type716 { get; set; } + public global::Baseten.RegisterAPIKeyRequestV1? Type716 { get; set; } /// /// /// - public global::Baseten.SandboxRegionV1InfoGeneration? Type717 { get; set; } + public global::Baseten.RegisterAPIKeyResponseV1? Type717 { get; set; } /// /// /// - public global::Baseten.SandboxLogsV1? Type718 { get; set; } + public global::Baseten.GetSandboxConfigurationResponseV1? Type718 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type719 { get; set; } + public global::System.Collections.Generic.IList? Type719 { get; set; } /// /// /// - public global::Baseten.SandboxLogEntryV1? Type720 { get; set; } + public global::Baseten.SandboxRegionV1? Type720 { get; set; } /// /// /// - public global::Baseten.SandboxMetricsV1? Type721 { get; set; } + public global::Baseten.SandboxRegionV1InfoGeneration? Type721 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type722 { get; set; } + public global::Baseten.SandboxLogsV1? Type722 { get; set; } /// /// /// - public global::Baseten.SandboxMetricsPointV1? Type723 { get; set; } + public global::System.Collections.Generic.IList? Type723 { get; set; } /// /// /// - public global::Baseten.SandboxImageBuildLogV1? Type724 { get; set; } + public global::Baseten.SandboxLogEntryV1? Type724 { get; set; } /// /// /// - public global::Baseten.SandboxImageBuildLogsResponseV1? Type725 { get; set; } + public global::Baseten.SandboxMetricsV1? Type725 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type726 { get; set; } + public global::System.Collections.Generic.IList? Type726 { get; set; } /// /// /// - public global::Baseten.SandboxLifecycleV1? Type727 { get; set; } + public global::Baseten.SandboxMetricsPointV1? Type727 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type728 { get; set; } + public global::Baseten.SandboxImageBuildLogV1? Type728 { get; set; } /// /// /// - public global::Baseten.SandboxExpirationPolicyV1? Type729 { get; set; } + public global::Baseten.SandboxImageBuildLogsResponseV1? Type729 { get; set; } /// /// /// - public global::Baseten.SandboxTTLIdleExpirationPolicyV1? Type730 { get; set; } + public global::System.Collections.Generic.IList? Type730 { get; set; } /// /// /// - public global::Baseten.SandboxTTLMaxAgeExpirationPolicyV1? Type731 { get; set; } + public global::Baseten.SandboxLifecycleV1? Type731 { get; set; } /// /// /// - public global::Baseten.SandboxDateExpirationPolicyV1? Type732 { get; set; } + public global::System.Collections.Generic.IList? Type732 { get; set; } /// /// /// - public global::Baseten.SandboxExpirationPolicyV1Discriminator? Type733 { get; set; } + public global::Baseten.SandboxExpirationPolicyV1? Type733 { get; set; } /// /// /// - public global::Baseten.SandboxExpirationPolicyV1DiscriminatorType? Type734 { get; set; } + public global::Baseten.SandboxTTLIdleExpirationPolicyV1? Type734 { get; set; } /// /// /// - public global::Baseten.SandboxTTLIdleExpirationPolicyV1Action? Type735 { get; set; } + public global::Baseten.SandboxTTLMaxAgeExpirationPolicyV1? Type735 { get; set; } /// /// /// - public global::Baseten.SandboxTTLIdleExpirationPolicyV1Type? Type736 { get; set; } + public global::Baseten.SandboxDateExpirationPolicyV1? Type736 { get; set; } /// /// /// - public global::Baseten.SandboxTTLMaxAgeExpirationPolicyV1Action? Type737 { get; set; } + public global::Baseten.SandboxExpirationPolicyV1Discriminator? Type737 { get; set; } /// /// /// - public global::Baseten.SandboxTTLMaxAgeExpirationPolicyV1Type? Type738 { get; set; } + public global::Baseten.SandboxExpirationPolicyV1DiscriminatorType? Type738 { get; set; } /// /// /// - public global::Baseten.SandboxDateExpirationPolicyV1Action? Type739 { get; set; } + public global::Baseten.SandboxTTLIdleExpirationPolicyV1Action? Type739 { get; set; } /// /// /// - public global::Baseten.SandboxDateExpirationPolicyV1Type? Type740 { get; set; } + public global::Baseten.SandboxTTLIdleExpirationPolicyV1Type? Type740 { get; set; } /// /// /// - public global::Baseten.SandboxNetworkV1? Type741 { get; set; } + public global::Baseten.SandboxTTLMaxAgeExpirationPolicyV1Action? Type741 { get; set; } /// /// /// - public global::Baseten.SandboxProxyConfigV1? Type742 { get; set; } + public global::Baseten.SandboxTTLMaxAgeExpirationPolicyV1Type? Type742 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type743 { get; set; } + public global::Baseten.SandboxDateExpirationPolicyV1Action? Type743 { get; set; } /// /// /// - public global::Baseten.SandboxProxyTargetV1? Type744 { get; set; } + public global::Baseten.SandboxDateExpirationPolicyV1Type? Type744 { get; set; } /// /// /// - public global::Baseten.SandboxEnvV1? Type745 { get; set; } + public global::Baseten.SandboxNetworkV1? Type745 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type746 { get; set; } + public global::Baseten.SandboxProxyConfigV1? Type746 { get; set; } /// /// /// - public global::Baseten.SandboxPortV1? Type747 { get; set; } + public global::System.Collections.Generic.IList? Type747 { get; set; } /// /// /// - public global::Baseten.SandboxPortV1Protocol? Type748 { get; set; } + public global::Baseten.SandboxProxyTargetV1? Type748 { get; set; } /// /// /// - public global::Baseten.SandboxConfigurationV1? Type749 { get; set; } + public global::Baseten.SandboxEnvV1? Type749 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type750 { get; set; } + public global::System.Collections.Generic.IList? Type750 { get; set; } /// /// /// - public global::Baseten.CreateSandboxRequestV1? Type751 { get; set; } + public global::Baseten.SandboxPortV1? Type751 { get; set; } /// /// /// - public global::Baseten.UpdateSandboxRequestV1? Type752 { get; set; } + public global::Baseten.SandboxPortV1Protocol? Type752 { get; set; } /// /// /// - public global::Baseten.SandboxV1? Type753 { get; set; } + public global::Baseten.SandboxConfigurationV1? Type753 { get; set; } /// /// /// - public global::Baseten.SandboxV1Variant2? Type754 { get; set; } + public global::System.Collections.Generic.IList? Type754 { get; set; } /// /// /// - public global::Baseten.SandboxStatusV1? Type755 { get; set; } + public global::Baseten.CreateSandboxRequestV1? Type755 { get; set; } /// /// /// - public global::Baseten.SandboxApiPaginationV1? Type756 { get; set; } + public global::Baseten.UpdateSandboxRequestV1? Type756 { get; set; } /// /// /// - public global::Baseten.ListSandboxesResponseV1? Type757 { get; set; } + public global::Baseten.SandboxV1? Type757 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type758 { get; set; } + public global::Baseten.SandboxV1Variant2? Type758 { get; set; } /// /// /// - public global::Baseten.ListSandboxImagesResponseV1? Type759 { get; set; } + public global::Baseten.SandboxStatusV1? Type759 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type760 { get; set; } + public global::Baseten.SandboxApiPaginationV1? Type760 { get; set; } /// /// /// - public global::Baseten.SandboxImageSummaryV1? Type761 { get; set; } + public global::Baseten.ListSandboxesResponseV1? Type761 { get; set; } /// /// /// - public global::Baseten.ListSandboxImageTagsResponseV1? Type762 { get; set; } + public global::System.Collections.Generic.IList? Type762 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type763 { get; set; } + public global::Baseten.ListSandboxImagesResponseV1? Type763 { get; set; } /// /// /// - public global::Baseten.SandboxImageTagV1? Type764 { get; set; } + public global::System.Collections.Generic.IList? Type764 { get; set; } /// /// /// - public global::Baseten.SandboxImageStatusV1? Type765 { get; set; } + public global::Baseten.SandboxImageSummaryV1? Type765 { get; set; } /// /// /// - public global::Baseten.SandboxImageV1? Type766 { get; set; } + public global::Baseten.ListSandboxImageTagsResponseV1? Type766 { get; set; } /// /// /// - public global::Baseten.SandboxImageV1Variant2? Type767 { get; set; } + public global::System.Collections.Generic.IList? Type767 { get; set; } /// /// /// - public global::Baseten.PushSandboxImageRequestV1? Type768 { get; set; } + public global::Baseten.SandboxImageTagV1? Type768 { get; set; } /// /// /// - public global::Baseten.PushSandboxImageResponseV1? Type769 { get; set; } + public global::Baseten.SandboxImageStatusV1? Type769 { get; set; } /// /// /// - public global::Baseten.SandboxLibraryImageVolumeV1? Type770 { get; set; } + public global::Baseten.SandboxImageV1? Type770 { get; set; } /// /// /// - public global::Baseten.SandboxLibraryImageCreationOptionsV1? Type771 { get; set; } + public global::Baseten.SandboxImageV1Variant2? Type771 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type772 { get; set; } + public global::Baseten.PushSandboxImageRequestV1? Type772 { get; set; } /// /// /// - public global::Baseten.SandboxLibraryImageV1? Type773 { get; set; } + public global::Baseten.PushSandboxImageResponseV1? Type773 { get; set; } /// /// /// - public global::Baseten.ListSandboxLibraryImagesResponseV1? Type774 { get; set; } + public global::Baseten.SandboxLibraryImageVolumeV1? Type774 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type775 { get; set; } + public global::Baseten.SandboxLibraryImageCreationOptionsV1? Type775 { get; set; } /// /// /// - public global::Baseten.CleanupSandboxImagesResponseV1? Type776 { get; set; } + public global::System.Collections.Generic.IList? Type776 { get; set; } + /// + /// + /// + public global::Baseten.SandboxLibraryImageV1? Type777 { get; set; } + /// + /// + /// + public global::Baseten.ListSandboxLibraryImagesResponseV1? Type778 { get; set; } + /// + /// + /// + public global::System.Collections.Generic.IList? Type779 { get; set; } + /// + /// + /// + public global::Baseten.CleanupSandboxImagesResponseV1? Type780 { get; set; } /// /// @@ -3514,98 +3530,102 @@ 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; } /// /// /// - public global::System.Collections.Generic.List? ListType103 { get; set; } + public global::System.Collections.Generic.List? ListType104 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType104 { get; set; } + public global::System.Collections.Generic.List? ListType105 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType105 { get; set; } + public global::System.Collections.Generic.List? ListType106 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType106 { get; set; } + public global::System.Collections.Generic.List? ListType107 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType107 { get; set; } + public global::System.Collections.Generic.List? ListType108 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType108 { get; set; } + public global::System.Collections.Generic.List? ListType109 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType109 { get; set; } + public global::System.Collections.Generic.List? ListType110 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType110 { get; set; } + public global::System.Collections.Generic.List? ListType111 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType111 { get; set; } + public global::System.Collections.Generic.List? ListType112 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType112 { get; set; } + public global::System.Collections.Generic.List? ListType113 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType113 { get; set; } + public global::System.Collections.Generic.List? ListType114 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType114 { get; set; } + public global::System.Collections.Generic.List? ListType115 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType115 { get; set; } + public global::System.Collections.Generic.List? ListType116 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType116 { get; set; } + public global::System.Collections.Generic.List? ListType117 { get; set; } } } \ No newline at end of file diff --git a/src/libs/Baseten/Generated/Baseten.Models.RouteSpendLimitSettingV1.g.cs b/src/libs/Baseten/Generated/Baseten.Models.RouteSpendLimitSettingV1.g.cs index 72d98cf..cc756c1 100644 --- a/src/libs/Baseten/Generated/Baseten.Models.RouteSpendLimitSettingV1.g.cs +++ b/src/libs/Baseten/Generated/Baseten.Models.RouteSpendLimitSettingV1.g.cs @@ -9,13 +9,19 @@ namespace Baseten public sealed partial class RouteSpendLimitSettingV1 { /// - /// Standing spend limit in USD for each UTC calendar month set on the user. Null when the user has no limit of their own. + /// Standing spend limit in USD for each UTC calendar month set on the user in the team. Null when the user has no limit of their own there. /// [global::System.Text.Json.Serialization.JsonPropertyName("user_monthly_limit_usd")] public string? UserMonthlyLimitUsd { get; set; } /// - /// Per-member limit of the team the user's active Code key belongs to. This limit applies when the user has no limit of their own. Null when there is none. + /// Spend limit in USD for the current UTC calendar month set on the user in the team, which supersedes their standing limit. Null when there is none. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("month_override_usd")] + public string? MonthOverrideUsd { get; set; } + + /// + /// Per-member limit of the team. This limit applies when the user has no limit of their own. Null when there is none. /// [global::System.Text.Json.Serialization.JsonPropertyName("team_default")] public global::Baseten.RouteSpendLimitTeamDefaultV1? TeamDefault { get; set; } @@ -40,10 +46,13 @@ public sealed partial class RouteSpendLimitSettingV1 /// The effective limit enforced for the current month. /// /// - /// Standing spend limit in USD for each UTC calendar month set on the user. Null when the user has no limit of their own. + /// Standing spend limit in USD for each UTC calendar month set on the user in the team. Null when the user has no limit of their own there. + /// + /// + /// Spend limit in USD for the current UTC calendar month set on the user in the team, which supersedes their standing limit. Null when there is none. /// /// - /// Per-member limit of the team the user's active Code key belongs to. This limit applies when the user has no limit of their own. Null when there is none. + /// Per-member limit of the team. This limit applies when the user has no limit of their own. Null when there is none. /// #if NET7_0_OR_GREATER [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] @@ -51,9 +60,11 @@ public sealed partial class RouteSpendLimitSettingV1 public RouteSpendLimitSettingV1( global::Baseten.RouteEffectiveSpendLimitV1 effective, string? userMonthlyLimitUsd, + string? monthOverrideUsd, global::Baseten.RouteSpendLimitTeamDefaultV1? teamDefault) { this.UserMonthlyLimitUsd = userMonthlyLimitUsd; + this.MonthOverrideUsd = monthOverrideUsd; this.TeamDefault = teamDefault; this.Effective = effective ?? throw new global::System.ArgumentNullException(nameof(effective)); } diff --git a/src/libs/Baseten/Generated/Baseten.Models.RouteSpendLimitTeamDefaultV1.g.cs b/src/libs/Baseten/Generated/Baseten.Models.RouteSpendLimitTeamDefaultV1.g.cs index 1b138c1..a6bdadc 100644 --- a/src/libs/Baseten/Generated/Baseten.Models.RouteSpendLimitTeamDefaultV1.g.cs +++ b/src/libs/Baseten/Generated/Baseten.Models.RouteSpendLimitTeamDefaultV1.g.cs @@ -9,7 +9,7 @@ namespace Baseten public sealed partial class RouteSpendLimitTeamDefaultV1 { /// - /// ID of the team the user's active Code key belongs to. + /// ID of the team whose per-member limit this is. /// [global::System.Text.Json.Serialization.JsonPropertyName("team_id")] [global::System.Text.Json.Serialization.JsonRequired] @@ -32,7 +32,7 @@ public sealed partial class RouteSpendLimitTeamDefaultV1 /// Initializes a new instance of the class. /// /// - /// ID of the team the user's active Code key belongs to. + /// ID of the team whose per-member limit this is. /// /// /// The team's per-member spend limit in USD for each UTC calendar month. diff --git a/src/libs/Baseten/Generated/Baseten.Models.RouteTeamSettingsV1.g.cs b/src/libs/Baseten/Generated/Baseten.Models.RouteTeamSettingsV1.g.cs index ee58cb2..6821b1c 100644 --- a/src/libs/Baseten/Generated/Baseten.Models.RouteTeamSettingsV1.g.cs +++ b/src/libs/Baseten/Generated/Baseten.Models.RouteTeamSettingsV1.g.cs @@ -23,7 +23,7 @@ public sealed partial class RouteTeamSettingsV1 public required global::Baseten.RouteHarnessDefaultsV1 HarnessDefaults { get; set; } /// - /// Spend limits for Baseten Code for members whose active Code key belongs to this team. + /// Spend limits for Baseten Code for members' spend in this team. /// [global::System.Text.Json.Serialization.JsonPropertyName("spend_limit")] [global::System.Text.Json.Serialization.JsonRequired] @@ -45,7 +45,7 @@ public sealed partial class RouteTeamSettingsV1 /// Route for each model role of each coding harness. A role with no route set by a team admin uses the default chosen from the team's Model API routes: the recommended model for `primary` and the lowest-priced model for `background`. These defaults never use external-provider routes. /// /// - /// Spend limits for Baseten Code for members whose active Code key belongs to this team. + /// Spend limits for Baseten Code for members' spend in this team. /// #if NET7_0_OR_GREATER [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/libs/Baseten/Generated/Baseten.Models.RouteTeamSpendLimitSettingV1.g.cs b/src/libs/Baseten/Generated/Baseten.Models.RouteTeamSpendLimitSettingV1.g.cs index bd461e5..964a3db 100644 --- a/src/libs/Baseten/Generated/Baseten.Models.RouteTeamSpendLimitSettingV1.g.cs +++ b/src/libs/Baseten/Generated/Baseten.Models.RouteTeamSpendLimitSettingV1.g.cs @@ -9,7 +9,7 @@ namespace Baseten public sealed partial class RouteTeamSpendLimitSettingV1 { /// - /// Spend limit in USD for each UTC calendar month that applies to each member whose active Code key belongs to this team, unless the member has a limit of their own. Returned as an exact decimal string. Null when the team has no per-member limit. + /// Spend limit in USD for each UTC calendar month that applies to each member's Code spend in this team, unless the member has a limit of their own. Returned as an exact decimal string. Null when the team has no per-member limit. /// [global::System.Text.Json.Serialization.JsonPropertyName("per_member_monthly_limit_usd")] public string? PerMemberMonthlyLimitUsd { get; set; } @@ -24,7 +24,7 @@ public sealed partial class RouteTeamSpendLimitSettingV1 /// Initializes a new instance of the class. /// /// - /// Spend limit in USD for each UTC calendar month that applies to each member whose active Code key belongs to this team, unless the member has a limit of their own. Returned as an exact decimal string. Null when the team has no per-member limit. + /// Spend limit in USD for each UTC calendar month that applies to each member's Code spend in this team, unless the member has a limit of their own. Returned as an exact decimal string. Null when the team has no per-member limit. /// #if NET7_0_OR_GREATER [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/libs/Baseten/Generated/Baseten.Models.RouteTeamUserSettingsListV1.Json.g.cs b/src/libs/Baseten/Generated/Baseten.Models.RouteTeamUserSettingsListV1.Json.g.cs new file mode 100644 index 0000000..727abbe --- /dev/null +++ b/src/libs/Baseten/Generated/Baseten.Models.RouteTeamUserSettingsListV1.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Baseten +{ + public sealed partial class RouteTeamUserSettingsListV1 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.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.RouteTeamUserSettingsListV1? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Baseten.RouteTeamUserSettingsListV1), + jsonSerializerContext) as global::Baseten.RouteTeamUserSettingsListV1; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Baseten.RouteTeamUserSettingsListV1? 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.RouteTeamUserSettingsListV1? 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.RouteTeamUserSettingsListV1), + jsonSerializerContext).ConfigureAwait(false)) as global::Baseten.RouteTeamUserSettingsListV1; + } + + /// + /// Deserializes a 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.RouteTeamUserSettingsListV1.g.cs b/src/libs/Baseten/Generated/Baseten.Models.RouteTeamUserSettingsListV1.g.cs new file mode 100644 index 0000000..6890d7e --- /dev/null +++ b/src/libs/Baseten/Generated/Baseten.Models.RouteTeamUserSettingsListV1.g.cs @@ -0,0 +1,47 @@ + +#nullable enable + +namespace Baseten +{ + /// + /// + /// + public sealed partial class RouteTeamUserSettingsListV1 + { + /// + /// Settings of each user with a role in the team and of anyone with Code spend in the team this month. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("users")] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::System.Collections.Generic.IList Users { 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. + /// + /// + /// Settings of each user with a role in the team and of anyone with Code spend in the team this month. + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public RouteTeamUserSettingsListV1( + global::System.Collections.Generic.IList users) + { + this.Users = users ?? throw new global::System.ArgumentNullException(nameof(users)); + } + + /// + /// Initializes a new instance of the class. + /// + public RouteTeamUserSettingsListV1() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Baseten/Generated/Baseten.Models.RouteTeamUserSettingsV1.Json.g.cs b/src/libs/Baseten/Generated/Baseten.Models.RouteTeamUserSettingsV1.Json.g.cs new file mode 100644 index 0000000..0ef51d9 --- /dev/null +++ b/src/libs/Baseten/Generated/Baseten.Models.RouteTeamUserSettingsV1.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Baseten +{ + public sealed partial class RouteTeamUserSettingsV1 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.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.RouteTeamUserSettingsV1? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Baseten.RouteTeamUserSettingsV1), + jsonSerializerContext) as global::Baseten.RouteTeamUserSettingsV1; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Baseten.RouteTeamUserSettingsV1? 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.RouteTeamUserSettingsV1? 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.RouteTeamUserSettingsV1), + jsonSerializerContext).ConfigureAwait(false)) as global::Baseten.RouteTeamUserSettingsV1; + } + + /// + /// Deserializes a 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.RouteTeamUserSettingsV1.g.cs b/src/libs/Baseten/Generated/Baseten.Models.RouteTeamUserSettingsV1.g.cs new file mode 100644 index 0000000..65d3376 --- /dev/null +++ b/src/libs/Baseten/Generated/Baseten.Models.RouteTeamUserSettingsV1.g.cs @@ -0,0 +1,106 @@ + +#nullable enable + +namespace Baseten +{ + /// + /// + /// + public sealed partial class RouteTeamUserSettingsV1 + { + /// + /// ID of the team. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("team_id")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string TeamId { get; set; } + + /// + /// ID of the user. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("user_id")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string UserId { get; set; } + + /// + /// Email address of the user. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("email")] + public string? Email { get; set; } + + /// + /// Spend limit for Baseten Code in the team. Applies to requests with Routes keys the user created in the team; personal API keys are not limited. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("spend_limit")] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::Baseten.RouteSpendLimitSettingV1 SpendLimit { get; set; } + + /// + /// The user's metered Code spend in USD in the team this UTC calendar month, returned as an exact decimal string. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("month_spend_usd")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string MonthSpendUsd { get; set; } + + /// + /// Whether the user's spend this month reached their limit, so requests with Routes keys they created in the team are rejected. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("is_blocked")] + [global::System.Text.Json.Serialization.JsonRequired] + public required bool IsBlocked { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// ID of the team. + /// + /// + /// ID of the user. + /// + /// + /// Spend limit for Baseten Code in the team. Applies to requests with Routes keys the user created in the team; personal API keys are not limited. + /// + /// + /// The user's metered Code spend in USD in the team this UTC calendar month, returned as an exact decimal string. + /// + /// + /// Whether the user's spend this month reached their limit, so requests with Routes keys they created in the team are rejected. + /// + /// + /// Email address of the user. + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public RouteTeamUserSettingsV1( + string teamId, + string userId, + global::Baseten.RouteSpendLimitSettingV1 spendLimit, + string monthSpendUsd, + bool isBlocked, + string? email) + { + this.TeamId = teamId ?? throw new global::System.ArgumentNullException(nameof(teamId)); + this.UserId = userId ?? throw new global::System.ArgumentNullException(nameof(userId)); + this.Email = email; + this.SpendLimit = spendLimit ?? throw new global::System.ArgumentNullException(nameof(spendLimit)); + this.MonthSpendUsd = monthSpendUsd ?? throw new global::System.ArgumentNullException(nameof(monthSpendUsd)); + this.IsBlocked = isBlocked; + } + + /// + /// Initializes a new instance of the class. + /// + public RouteTeamUserSettingsV1() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Baseten/Generated/Baseten.Models.RouteUserSettingsRequestV1.Json.g.cs b/src/libs/Baseten/Generated/Baseten.Models.RouteUserSettingsRequestV1.Json.g.cs new file mode 100644 index 0000000..d1ae6ad --- /dev/null +++ b/src/libs/Baseten/Generated/Baseten.Models.RouteUserSettingsRequestV1.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Baseten +{ + public sealed partial class RouteUserSettingsRequestV1 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.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.RouteUserSettingsRequestV1? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Baseten.RouteUserSettingsRequestV1), + jsonSerializerContext) as global::Baseten.RouteUserSettingsRequestV1; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Baseten.RouteUserSettingsRequestV1? 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.RouteUserSettingsRequestV1? 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.RouteUserSettingsRequestV1), + jsonSerializerContext).ConfigureAwait(false)) as global::Baseten.RouteUserSettingsRequestV1; + } + + /// + /// Deserializes a 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.RouteUserSettingsRequestV1.g.cs b/src/libs/Baseten/Generated/Baseten.Models.RouteUserSettingsRequestV1.g.cs new file mode 100644 index 0000000..6c20646 --- /dev/null +++ b/src/libs/Baseten/Generated/Baseten.Models.RouteUserSettingsRequestV1.g.cs @@ -0,0 +1,48 @@ + +#nullable enable + +namespace Baseten +{ + /// + /// + /// + public sealed partial class RouteUserSettingsRequestV1 + { + /// + /// ID of the team to read the user's spend limit in. Defaults to the only team the user has Code spend in this month, else their only team.
+ /// 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. + /// + /// + /// ID of the team to read the user's spend limit in. Defaults to the only team the user has Code spend in this month, else their only team.
+ /// Default Value: openapi-json-null-sentinel-value-2BF93600-0FE4-4250-987A-E5DDB203E464 + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public RouteUserSettingsRequestV1( + string? teamId) + { + this.TeamId = teamId; + } + + /// + /// Initializes a new instance of the class. + /// + public RouteUserSettingsRequestV1() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Baseten/Generated/Baseten.Models.UpdateRouteSpendLimitSettingV1.g.cs b/src/libs/Baseten/Generated/Baseten.Models.UpdateRouteSpendLimitSettingV1.g.cs index 81696e6..282d9b3 100644 --- a/src/libs/Baseten/Generated/Baseten.Models.UpdateRouteSpendLimitSettingV1.g.cs +++ b/src/libs/Baseten/Generated/Baseten.Models.UpdateRouteSpendLimitSettingV1.g.cs @@ -15,6 +15,13 @@ public sealed partial class UpdateRouteSpendLimitSettingV1 [global::System.Text.Json.Serialization.JsonPropertyName("user_monthly_limit_usd")] public string? UserMonthlyLimitUsd { get; set; } + /// + /// Spend limit in USD for the current UTC calendar month, which supersedes the standing limit. Send null to remove it; omit to leave it unchanged.
+ /// Default Value: openapi-json-null-sentinel-value-2BF93600-0FE4-4250-987A-E5DDB203E464 + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("month_override_usd")] + public string? MonthOverrideUsd { get; set; } + /// /// Additional properties that are not explicitly defined in the schema /// @@ -28,13 +35,19 @@ public sealed partial class UpdateRouteSpendLimitSettingV1 /// Standing spend limit in USD for each UTC calendar month. Send null to remove the limit; omit to leave it unchanged.
/// Default Value: openapi-json-null-sentinel-value-2BF93600-0FE4-4250-987A-E5DDB203E464 /// + /// + /// Spend limit in USD for the current UTC calendar month, which supersedes the standing limit. Send null to remove it; omit to leave it unchanged.
+ /// Default Value: openapi-json-null-sentinel-value-2BF93600-0FE4-4250-987A-E5DDB203E464 + /// #if NET7_0_OR_GREATER [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] #endif public UpdateRouteSpendLimitSettingV1( - string? userMonthlyLimitUsd) + string? userMonthlyLimitUsd, + string? monthOverrideUsd) { this.UserMonthlyLimitUsd = userMonthlyLimitUsd; + this.MonthOverrideUsd = monthOverrideUsd; } /// diff --git a/src/libs/Baseten/Generated/Baseten.Models.UpdateRouteTeamSpendLimitSettingV1.g.cs b/src/libs/Baseten/Generated/Baseten.Models.UpdateRouteTeamSpendLimitSettingV1.g.cs index 7fd9732..9fd2626 100644 --- a/src/libs/Baseten/Generated/Baseten.Models.UpdateRouteTeamSpendLimitSettingV1.g.cs +++ b/src/libs/Baseten/Generated/Baseten.Models.UpdateRouteTeamSpendLimitSettingV1.g.cs @@ -9,7 +9,7 @@ namespace Baseten public sealed partial class UpdateRouteTeamSpendLimitSettingV1 { /// - /// Spend limit in USD for each UTC calendar month that applies to each member whose active Code key belongs to this team, unless the member has a limit of their own. Send null to remove it; omit to leave it unchanged.
+ /// Spend limit in USD for each UTC calendar month that applies to each member's Code spend in this team, unless the member has a limit of their own. Send null to remove it; omit to leave it unchanged.
/// Default Value: openapi-json-null-sentinel-value-2BF93600-0FE4-4250-987A-E5DDB203E464 ///
[global::System.Text.Json.Serialization.JsonPropertyName("per_member_monthly_limit_usd")] @@ -25,7 +25,7 @@ public sealed partial class UpdateRouteTeamSpendLimitSettingV1 /// Initializes a new instance of the class. ///
/// - /// Spend limit in USD for each UTC calendar month that applies to each member whose active Code key belongs to this team, unless the member has a limit of their own. Send null to remove it; omit to leave it unchanged.
+ /// Spend limit in USD for each UTC calendar month that applies to each member's Code spend in this team, unless the member has a limit of their own. Send null to remove it; omit to leave it unchanged.
/// Default Value: openapi-json-null-sentinel-value-2BF93600-0FE4-4250-987A-E5DDB203E464 /// #if NET7_0_OR_GREATER diff --git a/src/libs/Baseten/openapi.yaml b/src/libs/Baseten/openapi.yaml index 9233ae2..bf47b8a 100644 --- a/src/libs/Baseten/openapi.yaml +++ b/src/libs/Baseten/openapi.yaml @@ -9766,10 +9766,33 @@ }, { "lang": "python", - "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"\")\nurl = \"https://api.baseten.co/v1/routes/settings/users/{user_id}\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n \"GET\",\n url,\n headers=headers,\n json={}\n)\n\nprint(response.text)" + "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"\")\nurl = \"https://api.baseten.co/v1/routes/settings/users/{user_id}\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n \"GET\",\n url,\n headers=headers,\n params={'team_id': 'abc1234'}\n)\n\nprint(response.text)" + } + ], + "description": "Returns the settings that apply to the user, including the spend limit that caps what they can spend on Baseten Code each month: the limit set on the user, their team's per-member limit, and the effective limit for this user. The user limit always overrides the team's per-member limit. The limits are read in `team_id` when given, else in the only team the user has Code spend in this month, else in their only team; they are null when there is none.", + "parameters": [ + { + "name": "team_id", + "in": "query", + "required": false, + "description": "ID of the team to read the user's spend limit in. Defaults to the only team the user has Code spend in this month, else their only team.", + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "examples": [ + "abc1234" + ], + "title": "Team Id" + } } ], - "description": "Returns the settings that apply to the user, including the spend limit that caps what they can spend on Baseten Code each month: the limit set on the user, their team's per-member limit, and the effective limit for this user. The user limit always overrides the team's per-member limit.", "responses": { "200": { "description": "", @@ -9801,7 +9824,7 @@ "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"\")\nurl = \"https://api.baseten.co/v1/routes/settings/users/{user_id}\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n \"PATCH\",\n url,\n headers=headers,\n json={'spend_limit': None}\n)\n\nprint(response.text)" } ], - "description": "Changes only the fields in the request. Once the user's metered spend in a month reaches the spend limit, requests with Routes keys they created are rejected until the limit is raised or the next month starts. Spend is metered every 15 minutes and can lag, so a user can go over the limit. The user's own limit supersedes their team's per-member limit.", + "description": "Changes only the fields in the request. Once the user's metered spend in a team in a month reaches the spend limit, requests with Routes keys they created in that team are rejected until the limit is raised or the next month starts. Spend is metered every 15 minutes and can lag, so a user can go over the limit. The user's own limit supersedes their team's per-member limit. The limit is set in the only team the user has Code spend in this month, else in their only team; the request fails when there is none.", "requestBody": { "content": { "application/json": { @@ -9898,6 +9921,114 @@ "x-stability": "unstable" } }, + "/v1/routes/settings/teams/{team_id}/users": { + "get": { + "summary": "Lists users' route settings in a team", + "x-codeSamples": [ + { + "lang": "bash", + "source": "curl --request GET \\\n--url https://api.baseten.co/v1/routes/settings/teams/{team_id}/users \\\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/settings/teams/{team_id}/users\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n \"GET\",\n url,\n headers=headers,\n json={}\n)\n\nprint(response.text)" + } + ], + "description": "Returns the settings in the team of each user with a role in the team and of anyone with Code spend in the team this month. Requires organization admin.", + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RouteTeamUserSettingsListV1" + } + } + } + } + }, + "x-stability": "unstable" + }, + "parameters": [ + { + "$ref": "#/components/parameters/team_id" + } + ] + }, + "/v1/routes/settings/teams/{team_id}/users/{user_id}": { + "get": { + "summary": "Gets a user's route settings in a team", + "x-codeSamples": [ + { + "lang": "bash", + "source": "curl --request GET \\\n--url https://api.baseten.co/v1/routes/settings/teams/{team_id}/users/{user_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/settings/teams/{team_id}/users/{user_id}\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n \"GET\",\n url,\n headers=headers,\n json={}\n)\n\nprint(response.text)" + } + ], + "description": "Returns the user's spend limit for Baseten Code in the team, their spend in the team this month, and whether that spend reached the limit. Members can read their own settings; organization admins can read anyone's.", + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RouteTeamUserSettingsV1" + } + } + } + } + }, + "x-stability": "unstable" + }, + "parameters": [ + { + "$ref": "#/components/parameters/team_id" + }, + { + "$ref": "#/components/parameters/user_id" + } + ], + "patch": { + "summary": "Updates a user's route settings in a team", + "x-codeSamples": [ + { + "lang": "bash", + "source": "curl --request PATCH \\\n--url https://api.baseten.co/v1/routes/settings/teams/{team_id}/users/{user_id} \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\" \\\n--data '{\n \"spend_limit\": null\n}'" + }, + { + "lang": "python", + "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"\")\nurl = \"https://api.baseten.co/v1/routes/settings/teams/{team_id}/users/{user_id}\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n \"PATCH\",\n url,\n headers=headers,\n json={'spend_limit': None}\n)\n\nprint(response.text)" + } + ], + "description": "Changes only the fields in the request. Once the user's metered spend in the team in a month reaches the spend limit, requests with Routes keys they created in the team are rejected until the limit is raised or the next month starts. Spend is metered every 15 minutes and can lag, so a user can go over the limit. Requires organization admin.", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UpdateRouteUserSettingsRequestV1" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RouteTeamUserSettingsV1" + } + } + } + } + }, + "x-stability": "unstable" + } + }, "/v1/routes/connections": { "get": { "summary": "Lists connections", @@ -32992,12 +33123,27 @@ "type": "null" } ], - "description": "Standing spend limit in USD for each UTC calendar month set on the user. Null when the user has no limit of their own.", + "description": "Standing spend limit in USD for each UTC calendar month set on the user in the team. Null when the user has no limit of their own there.", "examples": [ "200" ], "title": "User Monthly Limit Usd" }, + "month_override_usd": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "Spend limit in USD for the current UTC calendar month set on the user in the team, which supersedes their standing limit. Null when there is none.", + "examples": [ + "300" + ], + "title": "Month Override Usd" + }, "team_default": { "anyOf": [ { @@ -33007,7 +33153,7 @@ "type": "null" } ], - "description": "Per-member limit of the team the user's active Code key belongs to. This limit applies when the user has no limit of their own. Null when there is none." + "description": "Per-member limit of the team. This limit applies when the user has no limit of their own. Null when there is none." }, "effective": { "$ref": "#/components/schemas/RouteEffectiveSpendLimitV1", @@ -33016,6 +33162,7 @@ }, "required": [ "user_monthly_limit_usd", + "month_override_usd", "team_default", "effective" ], @@ -33025,7 +33172,7 @@ "RouteSpendLimitTeamDefaultV1": { "properties": { "team_id": { - "description": "ID of the team the user's active Code key belongs to.", + "description": "ID of the team whose per-member limit this is.", "examples": [ "abc1234" ], @@ -33086,6 +33233,28 @@ "title": "RouteUserSettingsV1", "type": "object" }, + "RouteUserSettingsRequestV1": { + "properties": { + "team_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "description": "ID of the team to read the user's spend limit in. Defaults to the only team the user has Code spend in this month, else their only team.", + "examples": [ + "abc1234" + ], + "title": "Team Id" + } + }, + "title": "RouteUserSettingsRequestV1", + "type": "object" + }, "UpdateRouteSpendLimitSettingV1": { "additionalProperties": false, "minProperties": 1, @@ -33106,6 +33275,23 @@ ], "title": "User Monthly Limit Usd", "x-null-distinct": true + }, + "month_override_usd": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "description": "Spend limit in USD for the current UTC calendar month, which supersedes the standing limit. Send null to remove it; omit to leave it unchanged.", + "examples": [ + "300" + ], + "title": "Month Override Usd", + "x-null-distinct": true } }, "title": "UpdateRouteSpendLimitSettingV1", @@ -33241,7 +33427,7 @@ "type": "null" } ], - "description": "Spend limit in USD for each UTC calendar month that applies to each member whose active Code key belongs to this team, unless the member has a limit of their own. Returned as an exact decimal string. Null when the team has no per-member limit.", + "description": "Spend limit in USD for each UTC calendar month that applies to each member's Code spend in this team, unless the member has a limit of their own. Returned as an exact decimal string. Null when the team has no per-member limit.", "examples": [ "200" ], @@ -33270,7 +33456,7 @@ }, "spend_limit": { "$ref": "#/components/schemas/RouteTeamSpendLimitSettingV1", - "description": "Spend limits for Baseten Code for members whose active Code key belongs to this team." + "description": "Spend limits for Baseten Code for members' spend in this team." } }, "required": [ @@ -33425,7 +33611,7 @@ } ], "default": null, - "description": "Spend limit in USD for each UTC calendar month that applies to each member whose active Code key belongs to this team, unless the member has a limit of their own. Send null to remove it; omit to leave it unchanged.", + "description": "Spend limit in USD for each UTC calendar month that applies to each member's Code spend in this team, unless the member has a limit of their own. Send null to remove it; omit to leave it unchanged.", "examples": [ "200" ], @@ -33470,6 +33656,85 @@ "title": "UpdateRouteTeamSettingsRequestV1", "type": "object" }, + "RouteTeamUserSettingsV1": { + "properties": { + "team_id": { + "description": "ID of the team.", + "examples": [ + "abc1234" + ], + "title": "Team Id", + "type": "string" + }, + "user_id": { + "description": "ID of the user.", + "examples": [ + "abc1234" + ], + "title": "User Id", + "type": "string" + }, + "email": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "Email address of the user.", + "examples": [ + "dev@example.com" + ], + "title": "Email" + }, + "spend_limit": { + "$ref": "#/components/schemas/RouteSpendLimitSettingV1", + "description": "Spend limit for Baseten Code in the team. Applies to requests with Routes keys the user created in the team; personal API keys are not limited." + }, + "month_spend_usd": { + "description": "The user's metered Code spend in USD in the team this UTC calendar month, returned as an exact decimal string.", + "examples": [ + "12.5" + ], + "title": "Month Spend Usd", + "type": "string" + }, + "is_blocked": { + "description": "Whether the user's spend this month reached their limit, so requests with Routes keys they created in the team are rejected.", + "title": "Is Blocked", + "type": "boolean" + } + }, + "required": [ + "team_id", + "user_id", + "email", + "spend_limit", + "month_spend_usd", + "is_blocked" + ], + "title": "RouteTeamUserSettingsV1", + "type": "object" + }, + "RouteTeamUserSettingsListV1": { + "properties": { + "users": { + "description": "Settings of each user with a role in the team and of anyone with Code spend in the team this month.", + "items": { + "$ref": "#/components/schemas/RouteTeamUserSettingsV1" + }, + "title": "Users", + "type": "array" + } + }, + "required": [ + "users" + ], + "title": "RouteTeamUserSettingsListV1", + "type": "object" + }, "RouteConnectionAnthropicV1": { "properties": { "provider": {