Class: Vapi::TransferDestinationSip
- Inherits:
-
Object
- Object
- Vapi::TransferDestinationSip
- Defined in:
- lib/vapi_server_sdk/types/transfer_destination_sip.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.
-
#sip_uri ⇒ String
readonly
This is the SIP URI to transfer the call to.
Class Method Summary collapse
-
.from_json(json_object:) ⇒ Vapi::TransferDestinationSip
Deserialize a JSON object to an instance of TransferDestinationSip.
-
.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(sip_uri:, message: OMIT, description: OMIT, additional_properties: nil) ⇒ Vapi::TransferDestinationSip constructor
-
#to_json(*_args) ⇒ String
Serialize an instance of TransferDestinationSip to a JSON object.
Constructor Details
#initialize(sip_uri:, message: OMIT, description: OMIT, additional_properties: nil) ⇒ Vapi::TransferDestinationSip
43 44 45 46 47 48 49 50 51 |
# File 'lib/vapi_server_sdk/types/transfer_destination_sip.rb', line 43 def initialize(sip_uri:, message: OMIT, description: OMIT, additional_properties: nil) @sip_uri = sip_uri @message = if != OMIT @description = description if description != OMIT @additional_properties = additional_properties @_field_set = { "sipUri": sip_uri, "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_sip.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_sip.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_sip.rb', line 18 def @message end |
#sip_uri ⇒ String (readonly)
Returns This is the SIP URI to transfer the call to.
9 10 11 |
# File 'lib/vapi_server_sdk/types/transfer_destination_sip.rb', line 9 def sip_uri @sip_uri end |
Class Method Details
.from_json(json_object:) ⇒ Vapi::TransferDestinationSip
Deserialize a JSON object to an instance of TransferDestinationSip
57 58 59 60 61 62 63 64 65 66 67 68 69 |
# File 'lib/vapi_server_sdk/types/transfer_destination_sip.rb', line 57 def self.from_json(json_object:) struct = JSON.parse(json_object, object_class: OpenStruct) parsed_json = JSON.parse(json_object) sip_uri = parsed_json["sipUri"] = parsed_json["message"] description = parsed_json["description"] new( sip_uri: sip_uri, 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_sip.rb', line 84 def self.validate_raw(obj:) obj.sip_uri.is_a?(String) != false || raise("Passed value for field obj.sip_uri 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 TransferDestinationSip to a JSON object
74 75 76 |
# File 'lib/vapi_server_sdk/types/transfer_destination_sip.rb', line 74 def to_json(*_args) @_field_set&.to_json end |