Class: Vapi::TransferPhoneNumberHookAction
- Inherits:
-
Object
- Object
- Vapi::TransferPhoneNumberHookAction
- Defined in:
- lib/vapi_server_sdk/types/transfer_phone_number_hook_action.rb
Constant Summary collapse
- OMIT =
Object.new
Instance Attribute Summary collapse
-
#additional_properties ⇒ OpenStruct
readonly
Additional properties unmapped to the current class definition.
-
#destination ⇒ Vapi::TransferPhoneNumberHookActionDestination
readonly
This is the destination details for the transfer - can be a phone number or SIP URI.
Class Method Summary collapse
-
.from_json(json_object:) ⇒ Vapi::TransferPhoneNumberHookAction
Deserialize a JSON object to an instance of TransferPhoneNumberHookAction.
-
.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(destination: OMIT, additional_properties: nil) ⇒ Vapi::TransferPhoneNumberHookAction constructor
-
#to_json(*_args) ⇒ String
Serialize an instance of TransferPhoneNumberHookAction to a JSON object.
Constructor Details
#initialize(destination: OMIT, additional_properties: nil) ⇒ Vapi::TransferPhoneNumberHookAction
24 25 26 27 28 29 30 |
# File 'lib/vapi_server_sdk/types/transfer_phone_number_hook_action.rb', line 24 def initialize(destination: OMIT, additional_properties: nil) @destination = destination if destination != OMIT @additional_properties = additional_properties @_field_set = { "destination": destination }.reject do |_k, v| v == OMIT end end |
Instance Attribute Details
#additional_properties ⇒ OpenStruct (readonly)
Returns Additional properties unmapped to the current class definition.
13 14 15 |
# File 'lib/vapi_server_sdk/types/transfer_phone_number_hook_action.rb', line 13 def additional_properties @additional_properties end |
#destination ⇒ Vapi::TransferPhoneNumberHookActionDestination (readonly)
Returns This is the destination details for the transfer - can be a phone number or SIP URI.
11 12 13 |
# File 'lib/vapi_server_sdk/types/transfer_phone_number_hook_action.rb', line 11 def destination @destination end |
Class Method Details
.from_json(json_object:) ⇒ Vapi::TransferPhoneNumberHookAction
Deserialize a JSON object to an instance of TransferPhoneNumberHookAction
36 37 38 39 40 41 42 43 44 45 46 |
# File 'lib/vapi_server_sdk/types/transfer_phone_number_hook_action.rb', line 36 def self.from_json(json_object:) struct = JSON.parse(json_object, object_class: OpenStruct) parsed_json = JSON.parse(json_object) if parsed_json["destination"].nil? destination = nil else destination = parsed_json["destination"].to_json destination = Vapi::TransferPhoneNumberHookActionDestination.from_json(json_object: destination) end new(destination: destination, 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.
61 62 63 |
# File 'lib/vapi_server_sdk/types/transfer_phone_number_hook_action.rb', line 61 def self.validate_raw(obj:) obj.destination.nil? || Vapi::TransferPhoneNumberHookActionDestination.validate_raw(obj: obj.destination) end |
Instance Method Details
#to_json(*_args) ⇒ String
Serialize an instance of TransferPhoneNumberHookAction to a JSON object
51 52 53 |
# File 'lib/vapi_server_sdk/types/transfer_phone_number_hook_action.rb', line 51 def to_json(*_args) @_field_set&.to_json end |