Class: Vapi::KeypadInputPlan
- Inherits:
-
Object
- Object
- Vapi::KeypadInputPlan
- Defined in:
- lib/vapi_server_sdk/types/keypad_input_plan.rb
Constant Summary collapse
- OMIT =
Object.new
Instance Attribute Summary collapse
-
#additional_properties ⇒ OpenStruct
readonly
Additional properties unmapped to the current class definition.
-
#delimiters ⇒ Vapi::KeypadInputPlanDelimiters
readonly
This is the delimiter(s) that will be used to process the input.
-
#enabled ⇒ Boolean
readonly
This keeps track of whether the user has enabled keypad input.
-
#timeout_seconds ⇒ Float
readonly
This is the time in seconds to wait before processing the input.
Class Method Summary collapse
-
.from_json(json_object:) ⇒ Vapi::KeypadInputPlan
Deserialize a JSON object to an instance of KeypadInputPlan.
-
.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.
Instance Method Summary collapse
- #initialize(enabled: OMIT, timeout_seconds: OMIT, delimiters: OMIT, additional_properties: nil) ⇒ Vapi::KeypadInputPlan constructor
-
#to_json(*_args) ⇒ String
Serialize an instance of KeypadInputPlan to a JSON object.
Constructor Details
#initialize(enabled: OMIT, timeout_seconds: OMIT, delimiters: OMIT, additional_properties: nil) ⇒ Vapi::KeypadInputPlan
42 43 44 45 46 47 48 49 50 51 52 53 54 |
# File 'lib/vapi_server_sdk/types/keypad_input_plan.rb', line 42 def initialize(enabled: OMIT, timeout_seconds: OMIT, delimiters: OMIT, additional_properties: nil) @enabled = enabled if enabled != OMIT @timeout_seconds = timeout_seconds if timeout_seconds != OMIT @delimiters = delimiters if delimiters != OMIT @additional_properties = additional_properties @_field_set = { "enabled": enabled, "timeoutSeconds": timeout_seconds, "delimiters": delimiters }.reject do |_k, v| v == OMIT end end |
Instance Attribute Details
#additional_properties ⇒ OpenStruct (readonly)
Returns Additional properties unmapped to the current class definition.
23 24 25 |
# File 'lib/vapi_server_sdk/types/keypad_input_plan.rb', line 23 def additional_properties @additional_properties end |
#delimiters ⇒ Vapi::KeypadInputPlanDelimiters (readonly)
Returns This is the delimiter(s) that will be used to process the input. Can be ‘#’, ‘*’, or an empty array.
21 22 23 |
# File 'lib/vapi_server_sdk/types/keypad_input_plan.rb', line 21 def delimiters @delimiters end |
#enabled ⇒ Boolean (readonly)
Returns This keeps track of whether the user has enabled keypad input. By default, it is off. @default false.
12 13 14 |
# File 'lib/vapi_server_sdk/types/keypad_input_plan.rb', line 12 def enabled @enabled end |
#timeout_seconds ⇒ Float (readonly)
Returns This is the time in seconds to wait before processing the input. If the input is not received within this time, the input will be ignored. If set to “off”, the input will be processed when the user enters a delimiter or immediately if no delimiter is used. @default 2.
18 19 20 |
# File 'lib/vapi_server_sdk/types/keypad_input_plan.rb', line 18 def timeout_seconds @timeout_seconds end |
Class Method Details
.from_json(json_object:) ⇒ Vapi::KeypadInputPlan
Deserialize a JSON object to an instance of KeypadInputPlan
60 61 62 63 64 65 66 67 68 69 70 71 72 |
# File 'lib/vapi_server_sdk/types/keypad_input_plan.rb', line 60 def self.from_json(json_object:) struct = JSON.parse(json_object, object_class: OpenStruct) parsed_json = JSON.parse(json_object) enabled = parsed_json["enabled"] timeout_seconds = parsed_json["timeoutSeconds"] delimiters = parsed_json["delimiters"] new( enabled: enabled, timeout_seconds: timeout_seconds, delimiters: delimiters, 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.
87 88 89 90 91 |
# File 'lib/vapi_server_sdk/types/keypad_input_plan.rb', line 87 def self.validate_raw(obj:) obj.enabled&.is_a?(Boolean) != false || raise("Passed value for field obj.enabled is not the expected type, validation failed.") obj.timeout_seconds&.is_a?(Float) != false || raise("Passed value for field obj.timeout_seconds is not the expected type, validation failed.") obj.delimiters&.is_a?(Vapi::KeypadInputPlanDelimiters) != false || raise("Passed value for field obj.delimiters is not the expected type, validation failed.") end |
Instance Method Details
#to_json(*_args) ⇒ String
Serialize an instance of KeypadInputPlan to a JSON object
77 78 79 |
# File 'lib/vapi_server_sdk/types/keypad_input_plan.rb', line 77 def to_json(*_args) @_field_set&.to_json end |