Class: Vapi::VoicemailDetectionBackoffPlan

Inherits:
Object
  • Object
show all
Defined in:
lib/vapi_server_sdk/types/voicemail_detection_backoff_plan.rb

Constant Summary collapse

OMIT =
Object.new

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(start_at_seconds: OMIT, frequency_seconds: OMIT, max_retries: OMIT, additional_properties: nil) ⇒ Vapi::VoicemailDetectionBackoffPlan

Parameters:

  • start_at_seconds (Float) (defaults to: OMIT)

    This is the number of seconds to wait before starting the first retry attempt.

  • frequency_seconds (Float) (defaults to: OMIT)

    This is the interval in seconds between retry attempts.

  • max_retries (Float) (defaults to: OMIT)

    This is the maximum number of retry attempts before giving up.

  • additional_properties (OpenStruct) (defaults to: nil)

    Additional properties unmapped to the current class definition



27
28
29
30
31
32
33
34
35
36
37
38
39
# File 'lib/vapi_server_sdk/types/voicemail_detection_backoff_plan.rb', line 27

def initialize(start_at_seconds: OMIT, frequency_seconds: OMIT, max_retries: OMIT, additional_properties: nil)
  @start_at_seconds = start_at_seconds if start_at_seconds != OMIT
  @frequency_seconds = frequency_seconds if frequency_seconds != OMIT
  @max_retries = max_retries if max_retries != OMIT
  @additional_properties = additional_properties
  @_field_set = {
    "startAtSeconds": start_at_seconds,
    "frequencySeconds": frequency_seconds,
    "maxRetries": max_retries
  }.reject do |_k, v|
    v == OMIT
  end
end

Instance Attribute Details

#additional_propertiesOpenStruct (readonly)

Returns Additional properties unmapped to the current class definition.

Returns:

  • (OpenStruct)

    Additional properties unmapped to the current class definition



15
16
17
# File 'lib/vapi_server_sdk/types/voicemail_detection_backoff_plan.rb', line 15

def additional_properties
  @additional_properties
end

#frequency_secondsFloat (readonly)

Returns This is the interval in seconds between retry attempts.

Returns:

  • (Float)

    This is the interval in seconds between retry attempts.



11
12
13
# File 'lib/vapi_server_sdk/types/voicemail_detection_backoff_plan.rb', line 11

def frequency_seconds
  @frequency_seconds
end

#max_retriesFloat (readonly)

Returns This is the maximum number of retry attempts before giving up.

Returns:

  • (Float)

    This is the maximum number of retry attempts before giving up.



13
14
15
# File 'lib/vapi_server_sdk/types/voicemail_detection_backoff_plan.rb', line 13

def max_retries
  @max_retries
end

#start_at_secondsFloat (readonly)

Returns This is the number of seconds to wait before starting the first retry attempt.

Returns:

  • (Float)

    This is the number of seconds to wait before starting the first retry attempt.



9
10
11
# File 'lib/vapi_server_sdk/types/voicemail_detection_backoff_plan.rb', line 9

def start_at_seconds
  @start_at_seconds
end

Class Method Details

.from_json(json_object:) ⇒ Vapi::VoicemailDetectionBackoffPlan

Deserialize a JSON object to an instance of VoicemailDetectionBackoffPlan

Parameters:

  • json_object (String)

Returns:



45
46
47
48
49
50
51
52
53
54
55
56
57
# File 'lib/vapi_server_sdk/types/voicemail_detection_backoff_plan.rb', line 45

def self.from_json(json_object:)
  struct = JSON.parse(json_object, object_class: OpenStruct)
  parsed_json = JSON.parse(json_object)
  start_at_seconds = parsed_json["startAtSeconds"]
  frequency_seconds = parsed_json["frequencySeconds"]
  max_retries = parsed_json["maxRetries"]
  new(
    start_at_seconds: start_at_seconds,
    frequency_seconds: frequency_seconds,
    max_retries: max_retries,
    additional_properties: struct
  )
end

.validate_raw(obj:) ⇒ Void

Leveraged for Union-type generation, validate_raw attempts to parse the given

hash and check each fields type against the current object's property
definitions.

Parameters:

  • obj (Object)

Returns:

  • (Void)


72
73
74
75
76
# File 'lib/vapi_server_sdk/types/voicemail_detection_backoff_plan.rb', line 72

def self.validate_raw(obj:)
  obj.start_at_seconds&.is_a?(Float) != false || raise("Passed value for field obj.start_at_seconds is not the expected type, validation failed.")
  obj.frequency_seconds&.is_a?(Float) != false || raise("Passed value for field obj.frequency_seconds is not the expected type, validation failed.")
  obj.max_retries&.is_a?(Float) != false || raise("Passed value for field obj.max_retries is not the expected type, validation failed.")
end

Instance Method Details

#to_json(*_args) ⇒ String

Serialize an instance of VoicemailDetectionBackoffPlan to a JSON object

Returns:

  • (String)


62
63
64
# File 'lib/vapi_server_sdk/types/voicemail_detection_backoff_plan.rb', line 62

def to_json(*_args)
  @_field_set&.to_json
end