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 ⇒ String
readonly
This is the message to say before transferring the call 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
43 44 45 46 47 48 49 50 51 |
# File 'lib/vapi_server_sdk/types/transfer_destination_step.rb', line 43 def initialize(step_name:, message: OMIT, description: OMIT, additional_properties: nil) @step_name = step_name @message = if != OMIT @description = description if description != OMIT @additional_properties = additional_properties @_field_set = { "stepName": step_name, "message": , "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.
23 24 25 |
# File 'lib/vapi_server_sdk/types/transfer_destination_step.rb', line 23 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.
21 22 23 |
# File 'lib/vapi_server_sdk/types/transfer_destination_step.rb', line 21 def description @description end |
#message ⇒ String (readonly)
Returns This is the message to say before transferring the call to the destination. 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.
18 19 20 |
# File 'lib/vapi_server_sdk/types/transfer_destination_step.rb', line 18 def @message end |
#step_name ⇒ String (readonly)
Returns This is the step to transfer to.
9 10 11 |
# File 'lib/vapi_server_sdk/types/transfer_destination_step.rb', line 9 def step_name @step_name end |
Class Method Details
.from_json(json_object:) ⇒ Vapi::TransferDestinationStep
Deserialize a JSON object to an instance of TransferDestinationStep
57 58 59 60 61 62 63 64 65 66 67 68 69 |
# File 'lib/vapi_server_sdk/types/transfer_destination_step.rb', line 57 def self.from_json(json_object:) struct = JSON.parse(json_object, object_class: OpenStruct) parsed_json = JSON.parse(json_object) step_name = parsed_json["stepName"] = parsed_json["message"] description = parsed_json["description"] new( step_name: step_name, message: , 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.
84 85 86 87 88 |
# File 'lib/vapi_server_sdk/types/transfer_destination_step.rb', line 84 def self.validate_raw(obj:) obj.step_name.is_a?(String) != false || raise("Passed value for field obj.step_name is not the expected type, validation failed.") obj.&.is_a?(String) != false || raise("Passed value for field obj.message 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
74 75 76 |
# File 'lib/vapi_server_sdk/types/transfer_destination_step.rb', line 74 def to_json(*_args) @_field_set&.to_json end |