Class: OpenAI::Models::Admin::Organization::Health::HealthAlertRule::Condition::ErrorRate

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

Defined Under Namespace

Modules: StatusClass

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(status_class:, status_codes:, threshold:, window_seconds:, type: :error_rate) ⇒ ErrorRate

Returns a new instance of ErrorRate.

Parameters:

  • status_class (Symbol, OpenAI::Models::Admin::Organization::Health::HealthAlertRule::Condition::ErrorRate::StatusClass)
  • status_codes (Array<Integer>, nil)
  • threshold (Float)
  • window_seconds (Integer)
  • type (Symbol, :error_rate) (defaults to: :error_rate)
  • status_class: (OpenAI::Models::Admin::Organization::Health::HealthAlertRule::Condition::ErrorRate::status_class)
  • status_codes: (::Array[Integer], nil)
  • threshold: (Float)
  • window_seconds: (Integer)
  • type: (:error_rate) (defaults to: :error_rate)


# File 'lib/openai/models/admin/organization/health/health_alert_rule.rb', line 130

Instance Attribute Details

#status_class ⇒ Symbol, OpenAI::Models::Admin::Organization::Health::HealthAlertRule::Condition::ErrorRate::StatusClass

Parameters:

  • value (OpenAI::Models::Admin::Organization::Health::HealthAlertRule::Condition::ErrorRate::status_class)

Returns:



105
106
107
108
# File 'lib/openai/models/admin/organization/health/health_alert_rule.rb', line 105

required(
  :status_class,
  enum: -> { OpenAI::Admin::Organization::Health::HealthAlertRule::Condition::ErrorRate::StatusClass }
)

#status_codes ⇒ Array<Integer>?

Parameters:

  • value (::Array[Integer], nil)

Returns:

  • (Array<Integer>, nil)


113
# File 'lib/openai/models/admin/organization/health/health_alert_rule.rb', line 113

required :status_codes, OpenAI::Internal::Type::ArrayOf[Integer], nil?: true

#threshold ⇒ Float

Parameters:

  • value (Float)

Returns:

  • (Float)


118
# File 'lib/openai/models/admin/organization/health/health_alert_rule.rb', line 118

required :threshold, Float

#type ⇒ Symbol, :error_rate

Parameters:

  • value (:error_rate)

Returns:

  • (Symbol, :error_rate)


123
# File 'lib/openai/models/admin/organization/health/health_alert_rule.rb', line 123

required :type, const: :error_rate

#window_seconds ⇒ Integer

Parameters:

  • value (Integer)

Returns:

  • (Integer)


128
# File 'lib/openai/models/admin/organization/health/health_alert_rule.rb', line 128

required :window_seconds, Integer

Instance Method Details

#to_hash ⇒ { status_class: OpenAI::Models::Admin::Organization::Health::HealthAlertRule::Condition::ErrorRate::status_class, status_codes: ::Array[Integer]?, threshold: Float, ?type: :error_rate, window_seconds: Integer }

Returns:

  • ({ status_class: OpenAI::Models::Admin::Organization::Health::HealthAlertRule::Condition::ErrorRate::status_class, status_codes: ::Array[Integer]?, threshold: Float, ?type: :error_rate, window_seconds: Integer })


111
112
113
114
115
116
117
# File 'sig/openai/models/admin/organization/health/health_alert_rule.rbs', line 111

def to_hash: -> {
  status_class: OpenAI::Models::Admin::Organization::Health::HealthAlertRule::Condition::ErrorRate::status_class,
  status_codes: ::Array[Integer]?,
  threshold: Float,
  ?type: :error_rate,
  window_seconds: Integer
}