Class: OpenAI::Models::Admin::Organization::Projects::ProjectSpendLimit

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

Overview

See Also:

  • OpenAI::Resources::Admin::Organization::Projects::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: :"project.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: :"project.spend_limit") —

    The object type, which is always project.spend_limit.



# File 'lib/openai/models/admin/organization/projects/project_spend_limit.rb', line 41

Instance Attribute Details

#currency ⇒ OpenAI::Models::Admin::Organization::Projects::ProjectSpendLimit::currency

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

Returns:

  • (OpenAI::Models::Admin::Organization::Projects::ProjectSpendLimit::currency)


14
# File 'lib/openai/models/admin/organization/projects/project_spend_limit.rb', line 14

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

#enforcement ⇒ OpenAI::Admin::Organization::Projects::ProjectSpendLimit::Enforcement

The current enforcement state of the hard spend limit.

Returns:

  • (OpenAI::Admin::Organization::Projects::ProjectSpendLimit::Enforcement)


20
# File 'lib/openai/models/admin/organization/projects/project_spend_limit.rb', line 20

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

#interval ⇒ OpenAI::Models::Admin::Organization::Projects::ProjectSpendLimit::interval

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

Returns:

  • (OpenAI::Models::Admin::Organization::Projects::ProjectSpendLimit::interval)


27
# File 'lib/openai/models/admin/organization/projects/project_spend_limit.rb', line 27

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

#object ⇒ :"project.spend_limit"

The object type, which is always project.spend_limit.

Returns:

  • (:"project.spend_limit")


33
# File 'lib/openai/models/admin/organization/projects/project_spend_limit.rb', line 33

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

#threshold_amount ⇒ Integer

The hard spend limit amount, in cents.

Returns:

  • (Integer)


39
# File 'lib/openai/models/admin/organization/projects/project_spend_limit.rb', line 39

required :threshold_amount, Integer

Instance Method Details

#to_hash ⇒ {

Returns:

  • ({)


53
# File 'sig/openai/models/admin/organization/projects/project_spend_limit.rbs', line 53

def to_hash: -> {