Class: Vapi::TransferDestinationNumber
- Inherits:
-
Object
- Object
- Vapi::TransferDestinationNumber
- Defined in:
- lib/vapi_server_sdk/types/transfer_destination_number.rb
Constant Summary collapse
- OMIT =
Object.new
Instance Attribute Summary collapse
-
#additional_properties ⇒ OpenStruct
readonly
Additional properties unmapped to the current class definition.
-
#caller_id ⇒ String
readonly
This is the caller ID to use when transferring the call to the ‘number`.
-
#description ⇒ String
readonly
This is the description of the destination, used by the AI to choose when and how to transfer the call.
-
#extension ⇒ String
readonly
This is the extension to dial after transferring the call to the ‘number`.
-
#message ⇒ String
readonly
This is the message to say before transferring the call to the destination.
-
#number ⇒ String
readonly
This is the phone number to transfer the call to.
-
#number_e_164_check_enabled ⇒ Boolean
readonly
This is the flag to toggle the E164 check for the ‘number` field.
Class Method Summary collapse
-
.from_json(json_object:) ⇒ Vapi::TransferDestinationNumber
Deserialize a JSON object to an instance of TransferDestinationNumber.
-
.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(number:, number_e_164_check_enabled: OMIT, extension: OMIT, caller_id: OMIT, message: OMIT, description: OMIT, additional_properties: nil) ⇒ Vapi::TransferDestinationNumber constructor
-
#to_json(*_args) ⇒ String
Serialize an instance of TransferDestinationNumber to a JSON object.
Constructor Details
#initialize(number:, number_e_164_check_enabled: OMIT, extension: OMIT, caller_id: OMIT, message: OMIT, description: OMIT, additional_properties: nil) ⇒ Vapi::TransferDestinationNumber
96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 |
# File 'lib/vapi_server_sdk/types/transfer_destination_number.rb', line 96 def initialize(number:, number_e_164_check_enabled: OMIT, extension: OMIT, caller_id: OMIT, message: OMIT, description: OMIT, additional_properties: nil) @number_e_164_check_enabled = number_e_164_check_enabled if number_e_164_check_enabled != OMIT @number = number @extension = extension if extension != OMIT @caller_id = caller_id if caller_id != OMIT @message = if != OMIT @description = description if description != OMIT @additional_properties = additional_properties @_field_set = { "numberE164CheckEnabled": number_e_164_check_enabled, "number": number, "extension": extension, "callerId": caller_id, "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.
51 52 53 |
# File 'lib/vapi_server_sdk/types/transfer_destination_number.rb', line 51 def additional_properties @additional_properties end |
#caller_id ⇒ String (readonly)
Returns This is the caller ID to use when transferring the call to the ‘number`. Usage:
-
If not provided, the caller ID will be the number the call is coming from.
Example, 14151111111 calls in to and the assistant transfers out to 16470000000. 16470000000 will see 14151111111 as the caller.
-
To change this behavior, provide a ‘callerId`.
-
Set to ‘Vapi::TransferDestinationNumber.{customer{customer.number}’ to always use the customer’s number as the caller
ID.
-
Set to ‘Vapi::TransferDestinationNumber.{phoneNumber{phoneNumber.number}’ to always use the phone number of the
assistant as the caller ID.
-
Set to any E164 number to always use that number as the caller ID. This needs
to be a number that is owned or verified by your Transport provider like Twilio. For Twilio, you can read up more here: www.twilio.com/docs/voice/twiml/dial#callerid.
37 38 39 |
# File 'lib/vapi_server_sdk/types/transfer_destination_number.rb', line 37 def caller_id @caller_id 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.
49 50 51 |
# File 'lib/vapi_server_sdk/types/transfer_destination_number.rb', line 49 def description @description end |
#extension ⇒ String (readonly)
Returns This is the extension to dial after transferring the call to the ‘number`.
22 23 24 |
# File 'lib/vapi_server_sdk/types/transfer_destination_number.rb', line 22 def extension @extension 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.
46 47 48 |
# File 'lib/vapi_server_sdk/types/transfer_destination_number.rb', line 46 def @message end |
#number ⇒ String (readonly)
Returns This is the phone number to transfer the call to.
20 21 22 |
# File 'lib/vapi_server_sdk/types/transfer_destination_number.rb', line 20 def number @number end |
#number_e_164_check_enabled ⇒ Boolean (readonly)
Returns This is the flag to toggle the E164 check for the ‘number` field. This is an advanced property which should be used if you know your use case requires it. Use cases:
-
‘false`: To allow non-E164 numbers like `+001234567890`, `1234`, or `abc`.
This is useful for dialing out to non-E164 numbers on your SIP trunks.
-
‘true` (default): To allow only E164 numbers like `+14155551234`. This is
standard for PSTN calls. If ‘false`, the `number` is still required to only contain alphanumeric characters (regex: `/^+?[a-zA-Z0-9]+$/`). @default true (E164 check is enabled).
18 19 20 |
# File 'lib/vapi_server_sdk/types/transfer_destination_number.rb', line 18 def number_e_164_check_enabled @number_e_164_check_enabled end |
Class Method Details
.from_json(json_object:) ⇒ Vapi::TransferDestinationNumber
Deserialize a JSON object to an instance of TransferDestinationNumber
121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 |
# File 'lib/vapi_server_sdk/types/transfer_destination_number.rb', line 121 def self.from_json(json_object:) struct = JSON.parse(json_object, object_class: OpenStruct) parsed_json = JSON.parse(json_object) number_e_164_check_enabled = parsed_json["numberE164CheckEnabled"] number = parsed_json["number"] extension = parsed_json["extension"] caller_id = parsed_json["callerId"] = parsed_json["message"] description = parsed_json["description"] new( number_e_164_check_enabled: number_e_164_check_enabled, number: number, extension: extension, caller_id: caller_id, 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.
154 155 156 157 158 159 160 161 |
# File 'lib/vapi_server_sdk/types/transfer_destination_number.rb', line 154 def self.validate_raw(obj:) obj.number_e_164_check_enabled&.is_a?(Boolean) != false || raise("Passed value for field obj.number_e_164_check_enabled is not the expected type, validation failed.") obj.number.is_a?(String) != false || raise("Passed value for field obj.number is not the expected type, validation failed.") obj.extension&.is_a?(String) != false || raise("Passed value for field obj.extension is not the expected type, validation failed.") obj.caller_id&.is_a?(String) != false || raise("Passed value for field obj.caller_id 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 TransferDestinationNumber to a JSON object
144 145 146 |
# File 'lib/vapi_server_sdk/types/transfer_destination_number.rb', line 144 def to_json(*_args) @_field_set&.to_json end |