Class: Vapi::CreateCustomerDto
- Inherits:
-
Object
- Object
- Vapi::CreateCustomerDto
- Defined in:
- lib/vapi_server_sdk/types/create_customer_dto.rb
Constant Summary collapse
- OMIT =
Object.new
Instance Attribute Summary collapse
-
#additional_properties ⇒ OpenStruct
readonly
Additional properties unmapped to the current class definition.
-
#assistant_overrides ⇒ Vapi::AssistantOverrides
readonly
These are the overrides for the assistant’s settings and template variables specific to this customer.
-
#email ⇒ String
readonly
This is the email of the customer.
-
#extension ⇒ String
readonly
This is the extension that will be dialed after the call is answered.
-
#external_id ⇒ String
readonly
This is the external ID of the customer.
-
#name ⇒ String
readonly
This is the name of the customer.
-
#number ⇒ String
readonly
This is the number of the customer.
-
#number_e_164_check_enabled ⇒ Boolean
readonly
This is the flag to toggle the E164 check for the ‘number` field.
-
#sip_uri ⇒ String
readonly
This is the SIP URI of the customer.
Class Method Summary collapse
-
.from_json(json_object:) ⇒ Vapi::CreateCustomerDto
Deserialize a JSON object to an instance of CreateCustomerDto.
-
.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_e_164_check_enabled: OMIT, extension: OMIT, assistant_overrides: OMIT, number: OMIT, sip_uri: OMIT, name: OMIT, email: OMIT, external_id: OMIT, additional_properties: nil) ⇒ Vapi::CreateCustomerDto constructor
-
#to_json(*_args) ⇒ String
Serialize an instance of CreateCustomerDto to a JSON object.
Constructor Details
#initialize(number_e_164_check_enabled: OMIT, extension: OMIT, assistant_overrides: OMIT, number: OMIT, sip_uri: OMIT, name: OMIT, email: OMIT, external_id: OMIT, additional_properties: nil) ⇒ Vapi::CreateCustomerDto
71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 |
# File 'lib/vapi_server_sdk/types/create_customer_dto.rb', line 71 def initialize(number_e_164_check_enabled: OMIT, extension: OMIT, assistant_overrides: OMIT, number: OMIT, sip_uri: OMIT, name: OMIT, email: OMIT, external_id: OMIT, additional_properties: nil) @number_e_164_check_enabled = number_e_164_check_enabled if number_e_164_check_enabled != OMIT @extension = extension if extension != OMIT @assistant_overrides = assistant_overrides if assistant_overrides != OMIT @number = number if number != OMIT @sip_uri = sip_uri if sip_uri != OMIT @name = name if name != OMIT @email = email if email != OMIT @external_id = external_id if external_id != OMIT @additional_properties = additional_properties @_field_set = { "numberE164CheckEnabled": number_e_164_check_enabled, "extension": extension, "assistantOverrides": assistant_overrides, "number": number, "sipUri": sip_uri, "name": name, "email": email, "externalId": external_id }.reject do |_k, v| v == OMIT end end |
Instance Attribute Details
#additional_properties ⇒ OpenStruct (readonly)
40 41 42 |
# File 'lib/vapi_server_sdk/types/create_customer_dto.rb', line 40 def additional_properties @additional_properties end |
#assistant_overrides ⇒ Vapi::AssistantOverrides (readonly)
26 27 28 |
# File 'lib/vapi_server_sdk/types/create_customer_dto.rb', line 26 def assistant_overrides @assistant_overrides end |
#email ⇒ String (readonly)
36 37 38 |
# File 'lib/vapi_server_sdk/types/create_customer_dto.rb', line 36 def email @email end |
#extension ⇒ String (readonly)
21 22 23 |
# File 'lib/vapi_server_sdk/types/create_customer_dto.rb', line 21 def extension @extension end |
#external_id ⇒ String (readonly)
38 39 40 |
# File 'lib/vapi_server_sdk/types/create_customer_dto.rb', line 38 def external_id @external_id end |
#name ⇒ String (readonly)
34 35 36 |
# File 'lib/vapi_server_sdk/types/create_customer_dto.rb', line 34 def name @name end |
#number ⇒ String (readonly)
28 29 30 |
# File 'lib/vapi_server_sdk/types/create_customer_dto.rb', line 28 def number @number end |
#number_e_164_check_enabled ⇒ Boolean (readonly)
19 20 21 |
# File 'lib/vapi_server_sdk/types/create_customer_dto.rb', line 19 def number_e_164_check_enabled @number_e_164_check_enabled end |
#sip_uri ⇒ String (readonly)
30 31 32 |
# File 'lib/vapi_server_sdk/types/create_customer_dto.rb', line 30 def sip_uri @sip_uri end |
Class Method Details
.from_json(json_object:) ⇒ Vapi::CreateCustomerDto
Deserialize a JSON object to an instance of CreateCustomerDto
100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 |
# File 'lib/vapi_server_sdk/types/create_customer_dto.rb', line 100 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"] extension = parsed_json["extension"] if parsed_json["assistantOverrides"].nil? assistant_overrides = nil else assistant_overrides = parsed_json["assistantOverrides"].to_json assistant_overrides = Vapi::AssistantOverrides.from_json(json_object: assistant_overrides) end number = parsed_json["number"] sip_uri = parsed_json["sipUri"] name = parsed_json["name"] email = parsed_json["email"] external_id = parsed_json["externalId"] new( number_e_164_check_enabled: number_e_164_check_enabled, extension: extension, assistant_overrides: assistant_overrides, number: number, sip_uri: sip_uri, name: name, email: email, external_id: external_id, 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.
142 143 144 145 146 147 148 149 150 151 |
# File 'lib/vapi_server_sdk/types/create_customer_dto.rb', line 142 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.extension&.is_a?(String) != false || raise("Passed value for field obj.extension is not the expected type, validation failed.") obj.assistant_overrides.nil? || Vapi::AssistantOverrides.validate_raw(obj: obj.assistant_overrides) obj.number&.is_a?(String) != false || raise("Passed value for field obj.number is not the expected type, validation failed.") obj.sip_uri&.is_a?(String) != false || raise("Passed value for field obj.sip_uri is not the expected type, validation failed.") obj.name&.is_a?(String) != false || raise("Passed value for field obj.name is not the expected type, validation failed.") obj.email&.is_a?(String) != false || raise("Passed value for field obj.email is not the expected type, validation failed.") obj.external_id&.is_a?(String) != false || raise("Passed value for field obj.external_id is not the expected type, validation failed.") end |
Instance Method Details
#to_json(*_args) ⇒ String
Serialize an instance of CreateCustomerDto to a JSON object
132 133 134 |
# File 'lib/vapi_server_sdk/types/create_customer_dto.rb', line 132 def to_json(*_args) @_field_set&.to_json end |