Class: OpenAI::Models::Realtime::RateLimitsUpdatedEvent::RateLimit

Inherits:
Internal::Type::BaseModel show all
Defined in:
lib/openai/models/realtime/rate_limits_updated_event.rb,
sig/openai/models/realtime/rate_limits_updated_event.rbs

Defined Under Namespace

Modules: Name

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(limit: nil, name: nil, remaining: nil, reset_seconds: nil) ⇒ Object

Parameters:

  • limit (defaults to: nil)

    The maximum allowed value for the rate limit.

  • name (defaults to: nil)

    The name of the rate limit (requests, tokens).

  • remaining (defaults to: nil)

    The remaining value before the limit is reached.

  • reset_seconds (defaults to: nil)

    Seconds until the rate limit resets.



42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
# File 'lib/openai/models/realtime/rate_limits_updated_event.rb', line 42

class RateLimit < OpenAI::Internal::Type::BaseModel
  # @!attribute limit
  #   The maximum allowed value for the rate limit.
  #
  #   @return [Integer, nil]
  optional :limit, Integer

  # @!attribute name
  #   The name of the rate limit (`requests`, `tokens`).
  #
  #   @return [Symbol, OpenAI::Models::Realtime::RateLimitsUpdatedEvent::RateLimit::Name, nil]
  optional :name, enum: -> { OpenAI::Realtime::RateLimitsUpdatedEvent::RateLimit::Name }

  # @!attribute remaining
  #   The remaining value before the limit is reached.
  #
  #   @return [Integer, nil]
  optional :remaining, Integer

  # @!attribute reset_seconds
  #   Seconds until the rate limit resets.
  #
  #   @return [Float, nil]
  optional :reset_seconds, Float

  # @!method initialize(limit: nil, name: nil, remaining: nil, reset_seconds: nil)
  #   @param limit [Integer]
  #     The maximum allowed value for the rate limit.
  #
  #   @param name [Symbol, OpenAI::Models::Realtime::RateLimitsUpdatedEvent::RateLimit::Name]
  #     The name of the rate limit (`requests`, `tokens`).
  #
  #   @param remaining [Integer]
  #     The remaining value before the limit is reached.
  #
  #   @param reset_seconds [Float]
  #     Seconds until the rate limit resets.

  # The name of the rate limit (`requests`, `tokens`).
  #
  # @see OpenAI::Models::Realtime::RateLimitsUpdatedEvent::RateLimit#name
  module Name
    extend OpenAI::Internal::Type::Enum

    REQUESTS = :requests
    TOKENS = :tokens

    # @!method self.values
    #   @return [Array<Symbol>]
  end
end

Instance Attribute Details

#limitInteger?

The maximum allowed value for the rate limit.

Returns:

  • (Integer, nil)


47
# File 'lib/openai/models/realtime/rate_limits_updated_event.rb', line 47

optional :limit, Integer

#nameOpenAI::Models::Realtime::RateLimitsUpdatedEvent::RateLimit::name_?

The name of the rate limit (requests, tokens).

Returns:

  • (OpenAI::Models::Realtime::RateLimitsUpdatedEvent::RateLimit::name_, nil)


53
# File 'lib/openai/models/realtime/rate_limits_updated_event.rb', line 53

optional :name, enum: -> { OpenAI::Realtime::RateLimitsUpdatedEvent::RateLimit::Name }

#remainingInteger?

The remaining value before the limit is reached.

Returns:

  • (Integer, nil)


59
# File 'lib/openai/models/realtime/rate_limits_updated_event.rb', line 59

optional :remaining, Integer

#reset_secondsFloat?

Seconds until the rate limit resets.

Returns:

  • (Float, nil)


65
# File 'lib/openai/models/realtime/rate_limits_updated_event.rb', line 65

optional :reset_seconds, Float

Instance Method Details

#to_hash{

Returns:

  • ({)


89
# File 'sig/openai/models/realtime/rate_limits_updated_event.rbs', line 89

def to_hash: -> {