Class: Anthropic::Models::Beta::Organization::BetaSpendLimit

Inherits:
Internal::Type::BaseModel show all
Defined in:
lib/anthropic/models/beta/organization/beta_spend_limit.rb,
sig/anthropic/models/beta/organization/beta_spend_limit.rbs

Overview

See Also:

  • Anthropic::Resources::Beta::Organization::SpendLimits#retrieve

Defined Under Namespace

Modules: Scope

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Internal::Type::BaseModel

==, #==, #[], coerce, #deconstruct_keys, #deep_to_h, dump, fields, hash, #hash, inherited, inspect, #inspect, known_fields, optional, recursively_to_h, required, #to_h, #to_json, #to_s, to_sorbet_type, #to_yaml

Methods included from Internal::Type::Converter

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

Methods included from Internal::Util::SorbetRuntimeSupport

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

Constructor Details

#initialize(id:, amount:, created_at:, currency:, is_enabled:, period:, scope:, updated_at:, type: :spend_limit) ⇒ void

A configured spend limit: a cap on metered spend for one scope and period.

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

Parameters:



# File 'lib/anthropic/models/beta/organization/beta_spend_limit.rb', line 69


Instance Attribute Details

#amount ⇒ String?

Limit amount as a non-negative integer decimal string in the minor unit of currency (cents for USD): "50000" is $500.00. null means no numeric cap is configured at this scope — see the effective report for whether a limit applies.

Parameters:

  • value (String, nil)

Returns:

  • (String, nil)


21
# File 'lib/anthropic/models/beta/organization/beta_spend_limit.rb', line 21

required :amount, String, nil?: true

#created_at ⇒ Time

RFC 3339 datetime at which the spend limit was created.

Parameters:

  • value (Time)

Returns:

  • (Time)


27
# File 'lib/anthropic/models/beta/organization/beta_spend_limit.rb', line 27

required :created_at, Time

#currency ⇒ String

ISO 4217 code of the organization's billing currency; the unit for amount.

Parameters:

  • value (String)

Returns:

  • (String)


33
# File 'lib/anthropic/models/beta/organization/beta_spend_limit.rb', line 33

required :currency, String

#id ⇒ String

Unique tagged ID of the spend limit (spl_...).

Parameters:

  • value (String)

Returns:

  • (String)


13
# File 'lib/anthropic/models/beta/organization/beta_spend_limit.rb', line 13

required :id, String

#is_enabled ⇒ Boolean

Read-only. false when extra usage is switched off for this organization (organization limit) or for this member (user limit); amount is kept and applies again when it's switched back on. Always true for other limits.

Parameters:

Returns:



41
# File 'lib/anthropic/models/beta/organization/beta_spend_limit.rb', line 41

required :is_enabled, Anthropic::Internal::Type::Boolean

#period ⇒ Symbol, Anthropic::Models::Beta::Organization::BetaSpendLimitPeriod

Length of the window the limit resets over. amount caps spend within each period.

Parameters:

  • value (Anthropic::Models::Beta::Organization::beta_spend_limit_period)

Returns:



48
# File 'lib/anthropic/models/beta/organization/beta_spend_limit.rb', line 48

required :period, enum: -> { Anthropic::Beta::Organization::BetaSpendLimitPeriod }

#scope ⇒ Anthropic::Models::Beta::Organization::BetaSpendLimitUserScope, ...

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



55
# File 'lib/anthropic/models/beta/organization/beta_spend_limit.rb', line 55

required :scope, union: -> { Anthropic::Beta::Organization::BetaSpendLimit::Scope }

#type ⇒ Symbol, :spend_limit

Object type. Always spend_limit.

Parameters:

  • value (:spend_limit)

Returns:

  • (Symbol, :spend_limit)


61
# File 'lib/anthropic/models/beta/organization/beta_spend_limit.rb', line 61

required :type, const: :spend_limit

#updated_at ⇒ Time

RFC 3339 datetime at which the spend limit was last modified.

Parameters:

  • value (Time)

Returns:

  • (Time)


67
# File 'lib/anthropic/models/beta/organization/beta_spend_limit.rb', line 67

required :updated_at, Time

Instance Method Details

#to_hash ⇒ {

Returns:

  • ({)


49
# File 'sig/anthropic/models/beta/organization/beta_spend_limit.rbs', line 49

def to_hash: -> {