Class: Vapi::VonageCredential

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

Constant Summary collapse

OMIT =
Object.new

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(vonage_application_private_key:, provider:, api_secret:, id:, org_id:, created_at:, updated_at:, vonage_application_id:, api_key:, additional_properties: nil) ⇒ Vapi::VonageCredential

Parameters:

  • vonage_application_private_key (String)

    This is not returned in the API.

  • provider (String)
  • api_secret (String)

    This is not returned in the API.

  • id (String)

    This is the unique identifier for the credential.

  • org_id (String)

    This is the unique identifier for the org that this credential belongs to.

  • created_at (DateTime)

    This is the ISO 8601 date-time string of when the credential was created.

  • updated_at (DateTime)

    This is the ISO 8601 date-time string of when the assistant was last updated.

  • vonage_application_id (String)

    This is the Vonage Application ID for the credential. Only relevant for Vonage credentials.

  • api_key (String)
  • additional_properties (OpenStruct) (defaults to: nil)

    Additional properties unmapped to the current class definition



48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
# File 'lib/vapi_server_sdk/types/vonage_credential.rb', line 48

def initialize(vonage_application_private_key:, provider:, api_secret:, id:, org_id:, created_at:, updated_at:,
               vonage_application_id:, api_key:, additional_properties: nil)
  @vonage_application_private_key = vonage_application_private_key
  @provider = provider
  @api_secret = api_secret
  @id = id
  @org_id = org_id
  @created_at = created_at
  @updated_at = updated_at
  @vonage_application_id = vonage_application_id
  @api_key = api_key
  @additional_properties = additional_properties
  @_field_set = {
    "vonageApplicationPrivateKey": vonage_application_private_key,
    "provider": provider,
    "apiSecret": api_secret,
    "id": id,
    "orgId": org_id,
    "createdAt": created_at,
    "updatedAt": updated_at,
    "vonageApplicationId": vonage_application_id,
    "apiKey": api_key
  }
end

Instance Attribute Details

#additional_propertiesOpenStruct (readonly)

Returns Additional properties unmapped to the current class definition.

Returns:

  • (OpenStruct)

    Additional properties unmapped to the current class definition



29
30
31
# File 'lib/vapi_server_sdk/types/vonage_credential.rb', line 29

def additional_properties
  @additional_properties
end

#api_keyString (readonly)

Returns:

  • (String)


27
28
29
# File 'lib/vapi_server_sdk/types/vonage_credential.rb', line 27

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.



14
15
16
# File 'lib/vapi_server_sdk/types/vonage_credential.rb', line 14

def api_secret
  @api_secret
end

#created_atDateTime (readonly)

Returns This is the ISO 8601 date-time string of when the credential was created.

Returns:

  • (DateTime)

    This is the ISO 8601 date-time string of when the credential was created.



20
21
22
# File 'lib/vapi_server_sdk/types/vonage_credential.rb', line 20

def created_at
  @created_at
end

#idString (readonly)

Returns This is the unique identifier for the credential.

Returns:

  • (String)

    This is the unique identifier for the credential.



16
17
18
# File 'lib/vapi_server_sdk/types/vonage_credential.rb', line 16

def id
  @id
end

#org_idString (readonly)

Returns This is the unique identifier for the org that this credential belongs to.

Returns:

  • (String)

    This is the unique identifier for the org that this credential belongs to.



18
19
20
# File 'lib/vapi_server_sdk/types/vonage_credential.rb', line 18

def org_id
  @org_id
end

#providerString (readonly)

Returns:

  • (String)


12
13
14
# File 'lib/vapi_server_sdk/types/vonage_credential.rb', line 12

def provider
  @provider
end

#updated_atDateTime (readonly)

Returns This is the ISO 8601 date-time string of when the assistant was last updated.

Returns:

  • (DateTime)

    This is the ISO 8601 date-time string of when the assistant was last updated.



22
23
24
# File 'lib/vapi_server_sdk/types/vonage_credential.rb', line 22

def updated_at
  @updated_at
end

#vonage_application_idString (readonly)

Returns This is the Vonage Application ID for the credential. Only relevant for Vonage credentials.

Returns:

  • (String)

    This is the Vonage Application ID for the credential. Only relevant for Vonage credentials.



25
26
27
# File 'lib/vapi_server_sdk/types/vonage_credential.rb', line 25

def vonage_application_id
  @vonage_application_id
end

#vonage_application_private_keyString (readonly)

Returns This is not returned in the API.

Returns:

  • (String)

    This is not returned in the API.



10
11
12
# File 'lib/vapi_server_sdk/types/vonage_credential.rb', line 10

def vonage_application_private_key
  @vonage_application_private_key
end

Class Method Details

.from_json(json_object:) ⇒ Vapi::VonageCredential

Deserialize a JSON object to an instance of VonageCredential

Parameters:

  • json_object (String)

Returns:



77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
# File 'lib/vapi_server_sdk/types/vonage_credential.rb', line 77

def self.from_json(json_object:)
  struct = JSON.parse(json_object, object_class: OpenStruct)
  parsed_json = JSON.parse(json_object)
  vonage_application_private_key = parsed_json["vonageApplicationPrivateKey"]
  provider = parsed_json["provider"]
  api_secret = parsed_json["apiSecret"]
  id = parsed_json["id"]
  org_id = parsed_json["orgId"]
  created_at = (DateTime.parse(parsed_json["createdAt"]) unless parsed_json["createdAt"].nil?)
  updated_at = (DateTime.parse(parsed_json["updatedAt"]) unless parsed_json["updatedAt"].nil?)
  vonage_application_id = parsed_json["vonageApplicationId"]
  api_key = parsed_json["apiKey"]
  new(
    vonage_application_private_key: vonage_application_private_key,
    provider: provider,
    api_secret: api_secret,
    id: id,
    org_id: org_id,
    created_at: created_at,
    updated_at: updated_at,
    vonage_application_id: vonage_application_id,
    api_key: api_key,
    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)


116
117
118
119
120
121
122
123
124
125
126
# File 'lib/vapi_server_sdk/types/vonage_credential.rb', line 116

def self.validate_raw(obj:)
  obj.vonage_application_private_key.is_a?(String) != false || raise("Passed value for field obj.vonage_application_private_key is not the expected type, validation failed.")
  obj.provider.is_a?(String) != false || raise("Passed value for field obj.provider 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.id.is_a?(String) != false || raise("Passed value for field obj.id is not the expected type, validation failed.")
  obj.org_id.is_a?(String) != false || raise("Passed value for field obj.org_id is not the expected type, validation failed.")
  obj.created_at.is_a?(DateTime) != false || raise("Passed value for field obj.created_at is not the expected type, validation failed.")
  obj.updated_at.is_a?(DateTime) != false || raise("Passed value for field obj.updated_at is not the expected type, validation failed.")
  obj.vonage_application_id.is_a?(String) != false || raise("Passed value for field obj.vonage_application_id 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.")
end

Instance Method Details

#to_json(*_args) ⇒ String

Serialize an instance of VonageCredential to a JSON object

Returns:

  • (String)


106
107
108
# File 'lib/vapi_server_sdk/types/vonage_credential.rb', line 106

def to_json(*_args)
  @_field_set&.to_json
end