Class: OpenAI::Models::Admin::Organization::OrganizationSpendLimit

Inherits:
Internal::Type::BaseModel show all
Defined in:
lib/openai/models/admin/organization/organization_spend_limit.rb,
sig/openai/models/admin/organization/organization_spend_limit.rbs

Overview

See Also:

  • OpenAI::Resources::Admin::Organization::SpendLimit#retrieve

Defined Under Namespace

Modules: Currency, Interval Classes: Enforcement

Instance Attribute Summary collapse

Attributes inherited from Internal::Type::BaseModel

#last_response

Instance Method Summary collapse

Methods inherited from Internal::Type::BaseModel

==, #==, #[], #_request_id, #_set_last_response, coerce, #deconstruct_keys, #deep_to_h, dump, #encode_with, 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, coerce_with_error, 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(currency:, enforcement:, interval:, threshold_amount:, object: :"organization.spend_limit") ⇒ Object

Parameters:

  • currency —

    The currency for the threshold amount. Currently, only USD is supported.

  • enforcement —

    The current enforcement state of the hard spend limit.

  • interval —

    The time interval for evaluating spend against the threshold. Currently, only month is supported.

  • threshold_amount —

    The hard spend limit amount, in cents.

  • object (defaults to: :"organization.spend_limit") —

    The object type, which is always organization.spend_limit.



# File 'lib/openai/models/admin/organization/organization_spend_limit.rb', line 40

Instance Attribute Details

#currency ⇒ OpenAI::Models::Admin::Organization::OrganizationSpendLimit::currency

The currency for the threshold amount. Currently, only USD is supported.

Returns:

  • (OpenAI::Models::Admin::Organization::OrganizationSpendLimit::currency)


13
# File 'lib/openai/models/admin/organization/organization_spend_limit.rb', line 13

required :currency, union: -> { OpenAI::Admin::Organization::OrganizationSpendLimit::Currency }

#enforcement ⇒ OpenAI::Admin::Organization::OrganizationSpendLimit::Enforcement

The current enforcement state of the hard spend limit.

Returns:

  • (OpenAI::Admin::Organization::OrganizationSpendLimit::Enforcement)


19
# File 'lib/openai/models/admin/organization/organization_spend_limit.rb', line 19

required :enforcement, -> { OpenAI::Admin::Organization::OrganizationSpendLimit::Enforcement }

#interval ⇒ OpenAI::Models::Admin::Organization::OrganizationSpendLimit::interval

The time interval for evaluating spend against the threshold. Currently, only month is supported.

Returns:

  • (OpenAI::Models::Admin::Organization::OrganizationSpendLimit::interval)


26
# File 'lib/openai/models/admin/organization/organization_spend_limit.rb', line 26

required :interval, union: -> { OpenAI::Admin::Organization::OrganizationSpendLimit::Interval }

#object ⇒ :"organization.spend_limit"

The object type, which is always organization.spend_limit.

Returns:

  • (:"organization.spend_limit")


32
# File 'lib/openai/models/admin/organization/organization_spend_limit.rb', line 32

required :object, const: :"organization.spend_limit"

#threshold_amount ⇒ Integer

The hard spend limit amount, in cents.

Returns:

  • (Integer)


38
# File 'lib/openai/models/admin/organization/organization_spend_limit.rb', line 38

required :threshold_amount, Integer

Instance Method Details

#to_hash ⇒ {

Returns:

  • ({)


52
# File 'sig/openai/models/admin/organization/organization_spend_limit.rbs', line 52

def to_hash: -> {