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

Inherits:
Internal::Type::BaseModel show all
Defined in:
lib/openai/models/admin/organization/health/alert_rule_update_params.rb,
sig/openai/models/admin/organization/health/alert_rule_update_params.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(threshold:, window_seconds:, status_class: nil, status_codes: nil, type: :error_rate) ⇒ ErrorRate

Returns a new instance of ErrorRate.

Parameters:

  • window_seconds —

    Evaluation window in seconds. Must be 300, 900, or 1800 (5, 15, or 30 minutes).

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


# File 'lib/openai/models/admin/organization/health/alert_rule_update_params.rb', line 132

Instance Attribute Details

#status_class ⇒ Symbol, ...

Parameters:

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

Returns:



120
121
122
123
124
125
# File 'lib/openai/models/admin/organization/health/alert_rule_update_params.rb', line 120

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

#status_codes ⇒ Array<Integer>?

Parameters:

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

Returns:

  • (Array<Integer>, nil)


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

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

#threshold ⇒ Float

Parameters:

  • value (Float)

Returns:

  • (Float)


104
# File 'lib/openai/models/admin/organization/health/alert_rule_update_params.rb', line 104

required :threshold, Float

#type ⇒ Symbol, :error_rate

Parameters:

  • value (:error_rate)

Returns:

  • (Symbol, :error_rate)


109
# File 'lib/openai/models/admin/organization/health/alert_rule_update_params.rb', line 109

required :type, const: :error_rate

#window_seconds ⇒ Integer

Evaluation window in seconds. Must be 300, 900, or 1800 (5, 15, or 30 minutes).

Returns:

  • (Integer)


115
# File 'lib/openai/models/admin/organization/health/alert_rule_update_params.rb', line 115

required :window_seconds, Integer

Instance Method Details

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

Returns:

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


258
259
260
261
262
263
264
# File 'sig/openai/models/admin/organization/health/alert_rule_update_params.rbs', line 258

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