Module: Anthropic::Models::Organization::SpendLimit::Scope

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

Overview

What the limit applies to. A tagged union on type; each variant carries the identifier for its scope.

See Also:

  • Anthropic::Models::Organization::SpendLimit#scope

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::Organization::SpendLimitUserScope .new(type:, seat_tier:) ⇒ Anthropic::Organization::SpendLimitSeatTierScope .new(type:, rbac_group_id:) ⇒ Anthropic::Organization::SpendLimitRBACGroupScope .new(type:, service:) ⇒ Anthropic::Organization::SpendLimitOrganizationServiceScope .new(type:) ⇒ Anthropic::Organization::SpendLimitOrganizationScope .new(type:, workspace_id:) ⇒ Anthropic::Organization::SpendLimitWorkspaceScope .new(type:) ⇒ Anthropic::Organization::SpendLimitUsageTierScope .new(type:, user_id:, seat_tier:, rbac_group_id:, service:, workspace_id:) ⇒ Anthropic::Models::Organization::SpendLimit::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::Organization::SpendLimitUserScope

    Parameters:

    Returns:

  • .new(type:, seat_tier:) ⇒ Anthropic::Organization::SpendLimitSeatTierScope

    Parameters:

    Returns:

  • .new(type:, rbac_group_id:) ⇒ Anthropic::Organization::SpendLimitRBACGroupScope

    Parameters:

    Returns:

  • .new(type:, service:) ⇒ Anthropic::Organization::SpendLimitOrganizationServiceScope

    Parameters:

    Returns:

  • .new(type:) ⇒ Anthropic::Organization::SpendLimitOrganizationScope

    Parameters:

    Returns:

  • .new(type:, workspace_id:) ⇒ Anthropic::Organization::SpendLimitWorkspaceScope

    Parameters:

    Returns:

  • .new(type:) ⇒ Anthropic::Organization::SpendLimitUsageTierScope

    Parameters:

    Returns:

  • .new(type:, user_id:, seat_tier:, rbac_group_id:, service:, workspace_id:) ⇒ Anthropic::Models::Organization::SpendLimit::scope

    Parameters:

    Returns:

Parameters:

  • Attributes for the chosen variant.

    @option args [String] :user_id Tagged ID of the member the spend limit applies to.

    @option args [String] :seat_tier

    @option args [String] :rbac_group_id

    @option args [String] :service

    @option args [String] :workspace_id Tagged ID of the workspace the spend limit applies to.

Returns:

Raises:



158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
# File 'lib/anthropic/models/organization/spend_limit.rb', line 158

def self.new(type:, **args)
  case type.to_sym
  when :user
    Anthropic::Organization::SpendLimitUserScope.new(**args)
  when :seat_tier
    Anthropic::Organization::SpendLimitSeatTierScope.new(**args)
  when :rbac_group
    Anthropic::Organization::SpendLimitRBACGroupScope.new(**args)
  when :organization_service
    Anthropic::Organization::SpendLimitOrganizationServiceScope.new(**args)
  when :organization
    Anthropic::Organization::SpendLimitOrganizationScope.new(**args)
  when :workspace
    Anthropic::Organization::SpendLimitWorkspaceScope.new(**args)
  when :usage_tier
    Anthropic::Organization::SpendLimitUsageTierScope.new(**args)
  else
    raise ArgumentError, "unknown type: #{type}"
  end
end

.values ⇒ Array<Symbol>

Returns:



# File 'lib/anthropic/models/organization/spend_limit.rb', line 132

.variants ⇒ Array(Anthropic::Models::Organization::SpendLimitUserScope, Anthropic::Models::Organization::SpendLimitSeatTierScope, Anthropic::Models::Organization::SpendLimitRBACGroupScope, Anthropic::Models::Organization::SpendLimitOrganizationServiceScope, Anthropic::Models::Organization::SpendLimitOrganizationScope, Anthropic::Models::Organization::SpendLimitWorkspaceScope, Anthropic::Models::Organization::SpendLimitUsageTierScope)

Returns:



# File 'lib/anthropic/models/organization/spend_limit.rb', line 136