Class: Vapi::TransferPlan
- Inherits:
-
Object
- Object
- Vapi::TransferPlan
- Defined in:
- lib/vapi_server_sdk/types/transfer_plan.rb
Constant Summary collapse
- OMIT =
Object.new
Instance Attribute Summary collapse
-
#additional_properties ⇒ OpenStruct
readonly
Additional properties unmapped to the current class definition.
-
#message ⇒ Vapi::TransferPlanMessage
readonly
This is the message the assistant will deliver to the destination party before connecting the customer.
-
#mode ⇒ Vapi::TransferPlanMode
readonly
This configures how transfer is executed and the experience of the destination party receiving the call.
-
#sip_verb ⇒ Hash{String => Object}
readonly
This specifies the SIP verb to use while transferring the call.
-
#summary_plan ⇒ Vapi::SummaryPlan
readonly
This is the plan for generating a summary of the call to present to the destination party.
Class Method Summary collapse
-
.from_json(json_object:) ⇒ Vapi::TransferPlan
Deserialize a JSON object to an instance of TransferPlan.
-
.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(mode:, message: OMIT, sip_verb: OMIT, summary_plan: OMIT, additional_properties: nil) ⇒ Vapi::TransferPlan constructor
-
#to_json(*_args) ⇒ String
Serialize an instance of TransferPlan to a JSON object.
Constructor Details
#initialize(mode:, message: OMIT, sip_verb: OMIT, summary_plan: OMIT, additional_properties: nil) ⇒ Vapi::TransferPlan
95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 |
# File 'lib/vapi_server_sdk/types/transfer_plan.rb', line 95 def initialize(mode:, message: OMIT, sip_verb: OMIT, summary_plan: OMIT, additional_properties: nil) @mode = mode @message = if != OMIT @sip_verb = sip_verb if sip_verb != OMIT @summary_plan = summary_plan if summary_plan != OMIT @additional_properties = additional_properties @_field_set = { "mode": mode, "message": , "sipVerb": sip_verb, "summaryPlan": summary_plan }.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_plan.rb', line 51 def additional_properties @additional_properties end |
#message ⇒ Vapi::TransferPlanMessage (readonly)
Returns This is the message the assistant will deliver to the destination party before connecting the customer. Usage:
-
Used only when
modeisblind-transfer-add-summary-to-sip-header,
warm-transfer-say-message or warm-transfer-wait-for-operator-to-speak-first-and-then-say-message.
38 39 40 |
# File 'lib/vapi_server_sdk/types/transfer_plan.rb', line 38 def @message end |
#mode ⇒ Vapi::TransferPlanMode (readonly)
Returns This configures how transfer is executed and the experience of the destination party receiving the call. Usage:
-
blind-transfer: The assistant forwards the call to the destination without
any message or summary.
-
blind-transfer-add-summary-to-sip-header: The assistant forwards the call to
the destination and adds a SIP header X-Transfer-Summary to the call to include the summary.
-
warm-transfer-say-message: The assistant dials the destination, delivers the
message to the destination party, connects the customer, and leaves the call.
-
warm-transfer-say-summary: The assistant dials the destination, provides a
summary of the call to the destination party, connects the customer, and leaves the call.
-
warm-transfer-wait-for-operator-to-speak-first-and-then-say-message: The
assistant dials the destination, waits for the operator to speak, delivers the message to the destination party, and then connects the customer.
-
warm-transfer-wait-for-operator-to-speak-first-and-then-say-summary: The
assistant dials the destination, waits for the operator to speak, provides a summary of the call to the destination party, and then connects the customer. @default ‘blind-transfer’.
31 32 33 |
# File 'lib/vapi_server_sdk/types/transfer_plan.rb', line 31 def mode @mode end |
#sip_verb ⇒ Hash{String => Object} (readonly)
Returns This specifies the SIP verb to use while transferring the call.
-
‘refer’: Uses SIP REFER to transfer the call (default)
-
‘bye’: Ends current call with SIP BYE.
42 43 44 |
# File 'lib/vapi_server_sdk/types/transfer_plan.rb', line 42 def sip_verb @sip_verb end |
#summary_plan ⇒ Vapi::SummaryPlan (readonly)
Returns This is the plan for generating a summary of the call to present to the destination party. Usage:
-
Used only when
modeisblind-transfer-add-summary-to-sip-headeror
warm-transfer-say-summary or warm-transfer-wait-for-operator-to-speak-first-and-then-say-summary.
49 50 51 |
# File 'lib/vapi_server_sdk/types/transfer_plan.rb', line 49 def summary_plan @summary_plan end |
Class Method Details
.from_json(json_object:) ⇒ Vapi::TransferPlan
Deserialize a JSON object to an instance of TransferPlan
115 116 117 118 119 120 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_plan.rb', line 115 def self.from_json(json_object:) struct = JSON.parse(json_object, object_class: OpenStruct) parsed_json = JSON.parse(json_object) mode = parsed_json["mode"] if parsed_json["message"].nil? = nil else = parsed_json["message"].to_json = Vapi::TransferPlanMessage.from_json(json_object: ) end sip_verb = parsed_json["sipVerb"] if parsed_json["summaryPlan"].nil? summary_plan = nil else summary_plan = parsed_json["summaryPlan"].to_json summary_plan = Vapi::SummaryPlan.from_json(json_object: summary_plan) end new( mode: mode, message: , sip_verb: sip_verb, summary_plan: summary_plan, 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 |
# File 'lib/vapi_server_sdk/types/transfer_plan.rb', line 154 def self.validate_raw(obj:) obj.mode.is_a?(Vapi::TransferPlanMode) != false || raise("Passed value for field obj.mode is not the expected type, validation failed.") obj..nil? || Vapi::TransferPlanMessage.validate_raw(obj: obj.) obj.sip_verb&.is_a?(Hash) != false || raise("Passed value for field obj.sip_verb is not the expected type, validation failed.") obj.summary_plan.nil? || Vapi::SummaryPlan.validate_raw(obj: obj.summary_plan) end |
Instance Method Details
#to_json(*_args) ⇒ String
Serialize an instance of TransferPlan to a JSON object
144 145 146 |
# File 'lib/vapi_server_sdk/types/transfer_plan.rb', line 144 def to_json(*_args) @_field_set&.to_json end |