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, NotificationChannel

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_cached, coerce_with_error, #dump, dump, #inspect, inspect, meta_info, new_coerce_state, resolve_type, 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:, notification_channel: nil, object: :"project.spend_limit") ⇒ ProjectSpendLimit

Returns a new instance of ProjectSpendLimit.

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.

  • notification_channel (defaults to: nil) —

    Email notifications sent when the hard spend limit is reached.

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

    The object type, which is always project.spend_limit.

  • currency: (OpenAI::Models::Admin::Organization::Projects::ProjectSpendLimit::currency)
  • enforcement: (OpenAI::Admin::Organization::Projects::ProjectSpendLimit::Enforcement)
  • interval: (OpenAI::Models::Admin::Organization::Projects::ProjectSpendLimit::interval)
  • threshold_amount: (Integer)
  • notification_channel: (OpenAI::Admin::Organization::Projects::ProjectSpendLimit::NotificationChannel) (defaults to: nil)
  • object: (:"project.spend_limit") (defaults to: :"project.spend_limit")


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

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 }

#notification_channel ⇒ OpenAI::Admin::Organization::Projects::ProjectSpendLimit::NotificationChannel?

Email notifications sent when the hard spend limit is reached.

Returns:

  • (OpenAI::Admin::Organization::Projects::ProjectSpendLimit::NotificationChannel, nil)


45
46
47
48
# File 'lib/openai/models/admin/organization/projects/project_spend_limit.rb', line 45

optional(
  :notification_channel,
  -> { OpenAI::Admin::Organization::Projects::ProjectSpendLimit::NotificationChannel }
)

#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 ⇒ { currency: OpenAI::Models::Admin::Organization::Projects::ProjectSpendLimit::currency, enforcement: OpenAI::Admin::Organization::Projects::ProjectSpendLimit::Enforcement, interval: OpenAI::Models::Admin::Organization::Projects::ProjectSpendLimit::interval, ?object: :"project.spend_limit", threshold_amount: Integer, ?notification_channel: OpenAI::Admin::Organization::Projects::ProjectSpendLimit::NotificationChannel }

Returns:

  • ({ currency: OpenAI::Models::Admin::Organization::Projects::ProjectSpendLimit::currency, enforcement: OpenAI::Admin::Organization::Projects::ProjectSpendLimit::Enforcement, interval: OpenAI::Models::Admin::Organization::Projects::ProjectSpendLimit::interval, ?object: :"project.spend_limit", threshold_amount: Integer, ?notification_channel: OpenAI::Admin::Organization::Projects::ProjectSpendLimit::NotificationChannel })


65
66
67
68
69
70
71
72
# File 'sig/openai/models/admin/organization/projects/project_spend_limit.rbs', line 65

def to_hash: -> {
  currency: OpenAI::Models::Admin::Organization::Projects::ProjectSpendLimit::currency,
  enforcement: OpenAI::Admin::Organization::Projects::ProjectSpendLimit::Enforcement,
  interval: OpenAI::Models::Admin::Organization::Projects::ProjectSpendLimit::interval,
  ?object: :"project.spend_limit",
  threshold_amount: Integer,
  ?notification_channel: OpenAI::Admin::Organization::Projects::ProjectSpendLimit::NotificationChannel
}