Class: Vapi::UpdateTwilioCredentialDto
- Inherits:
-
Object
- Object
- Vapi::UpdateTwilioCredentialDto
- Defined in:
- lib/vapi_server_sdk/types/update_twilio_credential_dto.rb
Constant Summary collapse
- OMIT =
Object.new
Instance Attribute Summary collapse
- #account_sid ⇒ String readonly
-
#additional_properties ⇒ OpenStruct
readonly
Additional properties unmapped to the current class definition.
-
#api_key ⇒ String
readonly
This is not returned in the API.
-
#api_secret ⇒ String
readonly
This is not returned in the API.
-
#auth_token ⇒ String
readonly
This is not returned in the API.
-
#name ⇒ String
readonly
This is the name of credential.
Class Method Summary collapse
-
.from_json(json_object:) ⇒ Vapi::UpdateTwilioCredentialDto
Deserialize a JSON object to an instance of UpdateTwilioCredentialDto.
-
.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(auth_token: OMIT, api_key: OMIT, api_secret: OMIT, name: OMIT, account_sid: OMIT, additional_properties: nil) ⇒ Vapi::UpdateTwilioCredentialDto constructor
-
#to_json(*_args) ⇒ String
Serialize an instance of UpdateTwilioCredentialDto to a JSON object.
Constructor Details
#initialize(auth_token: OMIT, api_key: OMIT, api_secret: OMIT, name: OMIT, account_sid: OMIT, additional_properties: nil) ⇒ Vapi::UpdateTwilioCredentialDto
33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 |
# File 'lib/vapi_server_sdk/types/update_twilio_credential_dto.rb', line 33 def initialize(auth_token: OMIT, api_key: OMIT, api_secret: OMIT, name: OMIT, account_sid: OMIT, additional_properties: nil) @auth_token = auth_token if auth_token != OMIT @api_key = api_key if api_key != OMIT @api_secret = api_secret if api_secret != OMIT @name = name if name != OMIT @account_sid = account_sid if account_sid != OMIT @additional_properties = additional_properties @_field_set = { "authToken": auth_token, "apiKey": api_key, "apiSecret": api_secret, "name": name, "accountSid": account_sid }.reject do |_k, v| v == OMIT end end |
Instance Attribute Details
#account_sid ⇒ String (readonly)
17 18 19 |
# File 'lib/vapi_server_sdk/types/update_twilio_credential_dto.rb', line 17 def account_sid @account_sid end |
#additional_properties ⇒ OpenStruct (readonly)
Returns Additional properties unmapped to the current class definition.
19 20 21 |
# File 'lib/vapi_server_sdk/types/update_twilio_credential_dto.rb', line 19 def additional_properties @additional_properties end |
#api_key ⇒ String (readonly)
Returns This is not returned in the API.
11 12 13 |
# File 'lib/vapi_server_sdk/types/update_twilio_credential_dto.rb', line 11 def api_key @api_key end |
#api_secret ⇒ String (readonly)
Returns This is not returned in the API.
13 14 15 |
# File 'lib/vapi_server_sdk/types/update_twilio_credential_dto.rb', line 13 def api_secret @api_secret end |
#auth_token ⇒ String (readonly)
Returns This is not returned in the API.
9 10 11 |
# File 'lib/vapi_server_sdk/types/update_twilio_credential_dto.rb', line 9 def auth_token @auth_token end |
#name ⇒ String (readonly)
Returns This is the name of credential. This is just for your reference.
15 16 17 |
# File 'lib/vapi_server_sdk/types/update_twilio_credential_dto.rb', line 15 def name @name end |
Class Method Details
.from_json(json_object:) ⇒ Vapi::UpdateTwilioCredentialDto
Deserialize a JSON object to an instance of UpdateTwilioCredentialDto
56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 |
# File 'lib/vapi_server_sdk/types/update_twilio_credential_dto.rb', line 56 def self.from_json(json_object:) struct = JSON.parse(json_object, object_class: OpenStruct) parsed_json = JSON.parse(json_object) auth_token = parsed_json["authToken"] api_key = parsed_json["apiKey"] api_secret = parsed_json["apiSecret"] name = parsed_json["name"] account_sid = parsed_json["accountSid"] new( auth_token: auth_token, api_key: api_key, api_secret: api_secret, name: name, account_sid: account_sid, 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.
87 88 89 90 91 92 93 |
# File 'lib/vapi_server_sdk/types/update_twilio_credential_dto.rb', line 87 def self.validate_raw(obj:) obj.auth_token&.is_a?(String) != false || raise("Passed value for field obj.auth_token is not the expected type, validation failed.") obj.api_key&.is_a?(String) != false || raise("Passed value for field obj.api_key is not the expected type, validation failed.") obj.api_secret&.is_a?(String) != false || raise("Passed value for field obj.api_secret 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.account_sid&.is_a?(String) != false || raise("Passed value for field obj.account_sid is not the expected type, validation failed.") end |
Instance Method Details
#to_json(*_args) ⇒ String
Serialize an instance of UpdateTwilioCredentialDto to a JSON object
77 78 79 |
# File 'lib/vapi_server_sdk/types/update_twilio_credential_dto.rb', line 77 def to_json(*_args) @_field_set&.to_json end |