Class: Vapi::TransferFallbackPlan
- Inherits:
-
Object
- Object
- Vapi::TransferFallbackPlan
- Defined in:
- lib/vapi_server_sdk/types/transfer_fallback_plan.rb
Constant Summary collapse
- OMIT =
Object.new
Instance Attribute Summary collapse
-
#additional_properties ⇒ OpenStruct
readonly
Additional properties unmapped to the current class definition.
-
#end_call_enabled ⇒ Boolean
readonly
This controls what happens after delivering the failure message to the customer.
-
#message ⇒ Vapi::TransferFallbackPlanMessage
readonly
This is the message the assistant will deliver to the customer if the transfer fails.
Class Method Summary collapse
-
.from_json(json_object:) ⇒ Vapi::TransferFallbackPlan
Deserialize a JSON object to an instance of TransferFallbackPlan.
-
.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(message:, end_call_enabled: OMIT, additional_properties: nil) ⇒ Vapi::TransferFallbackPlan constructor
-
#to_json(*_args) ⇒ String
Serialize an instance of TransferFallbackPlan to a JSON object.
Constructor Details
#initialize(message:, end_call_enabled: OMIT, additional_properties: nil) ⇒ Vapi::TransferFallbackPlan
35 36 37 38 39 40 41 42 |
# File 'lib/vapi_server_sdk/types/transfer_fallback_plan.rb', line 35 def initialize(message:, end_call_enabled: OMIT, additional_properties: nil) = @end_call_enabled = end_call_enabled if end_call_enabled != OMIT @additional_properties = additional_properties @_field_set = { "message": , "endCallEnabled": end_call_enabled }.reject do |_k, v| v == OMIT end end |
Instance Attribute Details
#additional_properties ⇒ OpenStruct (readonly)
Returns Additional properties unmapped to the current class definition.
19 20 21 |
# File 'lib/vapi_server_sdk/types/transfer_fallback_plan.rb', line 19 def additional_properties @additional_properties end |
#end_call_enabled ⇒ Boolean (readonly)
Returns This controls what happens after delivering the failure message to the customer.
-
true: End the call after delivering the failure message (default)
-
false: Keep the assistant on the call to continue handling the customer’s
request @default true.
17 18 19 |
# File 'lib/vapi_server_sdk/types/transfer_fallback_plan.rb', line 17 def end_call_enabled @end_call_enabled end |
#message ⇒ Vapi::TransferFallbackPlanMessage (readonly)
Returns This is the message the assistant will deliver to the customer if the transfer fails.
11 12 13 |
# File 'lib/vapi_server_sdk/types/transfer_fallback_plan.rb', line 11 def end |
Class Method Details
.from_json(json_object:) ⇒ Vapi::TransferFallbackPlan
Deserialize a JSON object to an instance of TransferFallbackPlan
48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 |
# File 'lib/vapi_server_sdk/types/transfer_fallback_plan.rb', line 48 def self.from_json(json_object:) struct = JSON.parse(json_object, object_class: OpenStruct) parsed_json = JSON.parse(json_object) if parsed_json["message"].nil? = nil else = parsed_json["message"].to_json = Vapi::TransferFallbackPlanMessage.from_json(json_object: ) end end_call_enabled = parsed_json["endCallEnabled"] new( message: , end_call_enabled: end_call_enabled, 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.
78 79 80 81 |
# File 'lib/vapi_server_sdk/types/transfer_fallback_plan.rb', line 78 def self.validate_raw(obj:) Vapi::TransferFallbackPlanMessage.validate_raw(obj: obj.) obj.end_call_enabled&.is_a?(Boolean) != false || raise("Passed value for field obj.end_call_enabled is not the expected type, validation failed.") end |
Instance Method Details
#to_json(*_args) ⇒ String
Serialize an instance of TransferFallbackPlan to a JSON object
68 69 70 |
# File 'lib/vapi_server_sdk/types/transfer_fallback_plan.rb', line 68 def to_json(*_args) @_field_set&.to_json end |