Class: Vapi::TransferDestinationStep
- Inherits:
-
Object
- Object
- Vapi::TransferDestinationStep
- Defined in:
- lib/vapi_server_sdk/types/transfer_destination_step.rb
Constant Summary collapse
- OMIT =
Object.new
Instance Attribute Summary collapse
-
#additional_properties ⇒ OpenStruct
readonly
Additional properties unmapped to the current class definition.
-
#description ⇒ String
readonly
This is the description of the destination, used by the AI to choose when and how to transfer the call.
-
#message ⇒ Vapi::TransferDestinationStepMessage
readonly
This is spoken to the customer before connecting them to the destination.
-
#step_name ⇒ String
readonly
This is the step to transfer to.
Class Method Summary collapse
-
.from_json(json_object:) ⇒ Vapi::TransferDestinationStep
Deserialize a JSON object to an instance of TransferDestinationStep.
-
.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(step_name:, message: OMIT, description: OMIT, additional_properties: nil) ⇒ Vapi::TransferDestinationStep constructor
-
#to_json(*_args) ⇒ String
Serialize an instance of TransferDestinationStep to a JSON object.
Constructor Details
#initialize(step_name:, message: OMIT, description: OMIT, additional_properties: nil) ⇒ Vapi::TransferDestinationStep
52 53 54 55 56 57 58 59 60 |
# File 'lib/vapi_server_sdk/types/transfer_destination_step.rb', line 52 def initialize(step_name:, message: OMIT, description: OMIT, additional_properties: nil) = if != OMIT @step_name = step_name @description = description if description != OMIT @additional_properties = additional_properties @_field_set = { "message": , "stepName": step_name, "description": description }.reject do |_k, v| v == OMIT end end |
Instance Attribute Details
#additional_properties ⇒ OpenStruct (readonly)
Returns Additional properties unmapped to the current class definition.
28 29 30 |
# File 'lib/vapi_server_sdk/types/transfer_destination_step.rb', line 28 def additional_properties @additional_properties end |
#description ⇒ String (readonly)
Returns This is the description of the destination, used by the AI to choose when and how to transfer the call.
26 27 28 |
# File 'lib/vapi_server_sdk/types/transfer_destination_step.rb', line 26 def description @description end |
#message ⇒ Vapi::TransferDestinationStepMessage (readonly)
Returns This is spoken to the customer before connecting them to the destination. Usage:
-
If this is not provided and transfer tool messages is not provided, default is
“Transferring the call now”.
-
If set to “”, nothing is spoken. This is useful when you want to silently
transfer. This is especially useful when transferring between assistants in a squad. In this scenario, you likely also want to set ‘assistant.firstMessageMode=assistant-speaks-first-with-model-generated-message` for the destination assistant. This accepts a string or a ToolMessageStart class. Latter is useful if you want to specify multiple messages for different languages through the contents field.
21 22 23 |
# File 'lib/vapi_server_sdk/types/transfer_destination_step.rb', line 21 def end |
#step_name ⇒ String (readonly)
Returns This is the step to transfer to.
23 24 25 |
# File 'lib/vapi_server_sdk/types/transfer_destination_step.rb', line 23 def step_name @step_name end |
Class Method Details
.from_json(json_object:) ⇒ Vapi::TransferDestinationStep
Deserialize a JSON object to an instance of TransferDestinationStep
66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 |
# File 'lib/vapi_server_sdk/types/transfer_destination_step.rb', line 66 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::TransferDestinationStepMessage.from_json(json_object: ) end step_name = parsed_json["stepName"] description = parsed_json["description"] new( message: , step_name: step_name, description: description, 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.
98 99 100 101 102 |
# File 'lib/vapi_server_sdk/types/transfer_destination_step.rb', line 98 def self.validate_raw(obj:) obj..nil? || Vapi::TransferDestinationStepMessage.validate_raw(obj: obj.) obj.step_name.is_a?(String) != false || raise("Passed value for field obj.step_name is not the expected type, validation failed.") obj.description&.is_a?(String) != false || raise("Passed value for field obj.description is not the expected type, validation failed.") end |
Instance Method Details
#to_json(*_args) ⇒ String
Serialize an instance of TransferDestinationStep to a JSON object
88 89 90 |
# File 'lib/vapi_server_sdk/types/transfer_destination_step.rb', line 88 def to_json(*_args) @_field_set&.to_json end |