Module: Anthropic::Models::Beta::Organization::BetaSpendSummary::Actor

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

Overview

See Also:

  • Anthropic::Models::Beta::Organization::BetaSpendSummary#actor

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:, deleted:, email_address:, name:, user_id:) ⇒ Anthropic::Beta::Organization::BetaSpendLimitUserActor .new(type:, scoped_api_key_id:) ⇒ Anthropic::Beta::Organization::BetaSpendLimitScopedAPIKeyActor .new(type:, deleted:, email_address:, name:, user_id:, scoped_api_key_id:) ⇒ Anthropic::Models::Beta::Organization::BetaSpendSummary::actor

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

Some parameter documentations has been truncated, see Anthropic::Models::Beta::Organization::BetaSpendSummary::Actor for more details.

Overloads:

  • .new(type:, deleted:, email_address:, name:, user_id:) ⇒ Anthropic::Beta::Organization::BetaSpendLimitUserActor

    Parameters:

    • type: (:user_actor, "user_actor")
    • deleted: (Boolean)
    • email_address: (String, nil)
    • name: (String, nil)
    • user_id: (String)

    Returns:

    • (Anthropic::Beta::Organization::BetaSpendLimitUserActor)
  • .new(type:, scoped_api_key_id:) ⇒ Anthropic::Beta::Organization::BetaSpendLimitScopedAPIKeyActor

    Parameters:

    • type: (:scoped_api_key_actor, "scoped_api_key_actor")
    • scoped_api_key_id: (String)

    Returns:

    • (Anthropic::Beta::Organization::BetaSpendLimitScopedAPIKeyActor)
  • .new(type:, deleted:, email_address:, name:, user_id:, scoped_api_key_id:) ⇒ Anthropic::Models::Beta::Organization::BetaSpendSummary::actor

    Parameters:

    • type: (Anthropic::Models::Beta::Organization::BetaSpendSummary::Actor::type_, String)
    • deleted: (Boolean)
    • email_address: (String, nil)
    • name: (String, nil)
    • user_id: (String)
    • scoped_api_key_id: (String)

    Returns:

    • (Anthropic::Models::Beta::Organization::BetaSpendSummary::actor)

Parameters:

  • type (Symbol, Anthropic::Models::Beta::Organization::BetaSpendSummary::Actor::Type, String)
  • args (Hash{Symbol=>Object}) —

    Attributes for the chosen variant.

    @option args [Boolean] :deleted True only when the underlying account has been deleted.

    @option args [String, nil] :email_address The user's email address. Null when the account is unavailable or has been delet

    @option args [String, nil] :name The user's current display name. Null when the account is unavailable, has been

    @option args [String] :user_id Tagged ID of the user.

    @option args [String] :scoped_api_key_id

Returns:

Raises:

  • (ArgumentError)


132
133
134
135
136
137
138
139
140
141
# File 'lib/anthropic/models/beta/organization/beta_spend_summary.rb', line 132

def self.new(type:, **args)
  case type.to_sym
  when :user_actor
    Anthropic::Beta::Organization::BetaSpendLimitUserActor.new(**args)
  when :scoped_api_key_actor
    Anthropic::Beta::Organization::BetaSpendLimitScopedAPIKeyActor.new(**args)
  else
    raise ArgumentError, "unknown type: #{type}"
  end
end

.values ⇒ Array<Symbol>

Returns:

  • (Array<Symbol>)


# File 'lib/anthropic/models/beta/organization/beta_spend_summary.rb', line 102

.variants ⇒ Array(Anthropic::Models::Beta::Organization::BetaSpendLimitUserActor, Anthropic::Models::Beta::Organization::BetaSpendLimitScopedAPIKeyActor)



# File 'lib/anthropic/models/beta/organization/beta_spend_summary.rb', line 106