Class: Vapi::UpdateTwilioCredentialDto

Inherits:
Object
  • Object
show all
Defined in:
lib/vapi_server_sdk/types/update_twilio_credential_dto.rb

Constant Summary collapse

OMIT =
Object.new

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(auth_token: OMIT, api_key: OMIT, api_secret: OMIT, name: OMIT, account_sid: OMIT, additional_properties: nil) ⇒ Vapi::UpdateTwilioCredentialDto

Parameters:

  • auth_token (String) (defaults to: OMIT)

    This is not returned in the API.

  • api_key (String) (defaults to: OMIT)

    This is not returned in the API.

  • api_secret (String) (defaults to: OMIT)

    This is not returned in the API.

  • name (String) (defaults to: OMIT)

    This is the name of credential. This is just for your reference.

  • account_sid (String) (defaults to: OMIT)
  • additional_properties (OpenStruct) (defaults to: nil)

    Additional properties unmapped to the current class definition



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 =  if  != OMIT
  @additional_properties = additional_properties
  @_field_set = {
    "authToken": auth_token,
    "apiKey": api_key,
    "apiSecret": api_secret,
    "name": name,
    "accountSid": 
  }.reject do |_k, v|
    v == OMIT
  end
end

Instance Attribute Details

#account_sidString (readonly)

Returns:

  • (String)


17
18
19
# File 'lib/vapi_server_sdk/types/update_twilio_credential_dto.rb', line 17

def 
  @account_sid
end

#additional_propertiesOpenStruct (readonly)

Returns Additional properties unmapped to the current class definition.

Returns:

  • (OpenStruct)

    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_keyString (readonly)

Returns This is not returned in the API.

Returns:

  • (String)

    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_secretString (readonly)

Returns This is not returned in the API.

Returns:

  • (String)

    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_tokenString (readonly)

Returns This is not returned in the API.

Returns:

  • (String)

    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

#nameString (readonly)

Returns This is the name of credential. This is just for your reference.

Returns:

  • (String)

    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

Parameters:

  • json_object (String)

Returns:



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"]
   = parsed_json["accountSid"]
  new(
    auth_token: auth_token,
    api_key: api_key,
    api_secret: api_secret,
    name: name,
    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.

Parameters:

  • obj (Object)

Returns:

  • (Void)


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.&.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

Returns:

  • (String)


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