Module: Anthropic::Models::Beta::Organization::SpendLimitSetParams::Scope

Extended by:
Internal::Type::Union
Defined in:
lib/anthropic/models/beta/organization/spend_limit_set_params.rb,
sig/anthropic/models/beta/organization/spend_limit_set_params.rbs

Overview

What the limit applies to. Claude Enterprise organizations set user limits. Claude Console organizations set organization and workspace limits. Any other combination returns 400. Setting organization and workspace limits through the API is in an early access preview. To request access, contact your Anthropic account team.

Defined Under Namespace

Modules: Type

Class Method Summary collapse

Methods included from Internal::Type::Union

==, ===, coerce, derefed_variants, dump, hash, inspect, to_sorbet_type

Methods included from Internal::Util::SorbetRuntimeSupport

#const_missing, #define_sorbet_constant!, #sorbet_constant_defined?, #to_sorbet_type, to_sorbet_type

Methods included from Internal::Type::Converter

#coerce, coerce, #dump, dump, inspect, #inspect, meta_info, new_coerce_state, type_info

Class Method Details

.new(type:, user_id:) ⇒ Anthropic::Beta::Organization::BetaSpendLimitUserScope .new(type:) ⇒ Anthropic::Beta::Organization::BetaSpendLimitOrganizationScope .new(type:, workspace_id:) ⇒ Anthropic::Beta::Organization::BetaSpendLimitWorkspaceScope .new(type:, user_id:, workspace_id:) ⇒ Anthropic::Models::Beta::Organization::SpendLimitSetParams::scope

Creates a new instance of the variant class whose type matches the given value, passing the remaining arguments to its constructor.

Overloads:

  • .new(type:, user_id:) ⇒ Anthropic::Beta::Organization::BetaSpendLimitUserScope

    Parameters:

    • type: (:user, "user")
    • user_id: (String)

    Returns:

    • (Anthropic::Beta::Organization::BetaSpendLimitUserScope)
  • .new(type:) ⇒ Anthropic::Beta::Organization::BetaSpendLimitOrganizationScope

    Parameters:

    • type: (:organization, "organization")

    Returns:

    • (Anthropic::Beta::Organization::BetaSpendLimitOrganizationScope)
  • .new(type:, workspace_id:) ⇒ Anthropic::Beta::Organization::BetaSpendLimitWorkspaceScope

    Parameters:

    • type: (:workspace, "workspace")
    • workspace_id: (String)

    Returns:

    • (Anthropic::Beta::Organization::BetaSpendLimitWorkspaceScope)
  • .new(type:, user_id:, workspace_id:) ⇒ Anthropic::Models::Beta::Organization::SpendLimitSetParams::scope

    Parameters:

    • type: (Anthropic::Models::Beta::Organization::SpendLimitSetParams::Scope::type_, String)
    • user_id: (String)
    • workspace_id: (String)

    Returns:

    • (Anthropic::Models::Beta::Organization::SpendLimitSetParams::scope)

Parameters:

Returns:

Raises:

  • (ArgumentError)


101
102
103
104
105
106
107
108
109
110
111
112
# File 'lib/anthropic/models/beta/organization/spend_limit_set_params.rb', line 101

def self.new(type:, **args)
  case type.to_sym
  when :user
    Anthropic::Beta::Organization::BetaSpendLimitUserScope.new(**args)
  when :organization
    Anthropic::Beta::Organization::BetaSpendLimitOrganizationScope.new(**args)
  when :workspace
    Anthropic::Beta::Organization::BetaSpendLimitWorkspaceScope.new(**args)
  else
    raise ArgumentError, "unknown type: #{type}"
  end
end

.values ⇒ Array<Symbol>

Returns:

  • (Array<Symbol>)


# File 'lib/anthropic/models/beta/organization/spend_limit_set_params.rb', line 81

.variants ⇒ Array(Anthropic::Models::Beta::Organization::BetaSpendLimitUserScope, Anthropic::Models::Beta::Organization::BetaSpendLimitOrganizationScope, Anthropic::Models::Beta::Organization::BetaSpendLimitWorkspaceScope)



# File 'lib/anthropic/models/beta/organization/spend_limit_set_params.rb', line 85