Class: Vapi::CartesiaCredential
- Inherits:
-
Object
- Object
- Vapi::CartesiaCredential
- Defined in:
- lib/vapi_server_sdk/types/cartesia_credential.rb
Constant Summary collapse
- OMIT =
Object.new
Instance Attribute Summary collapse
-
#additional_properties ⇒ OpenStruct
readonly
Additional properties unmapped to the current class definition.
-
#api_key ⇒ String
readonly
This is not returned in the API.
-
#created_at ⇒ DateTime
readonly
This is the ISO 8601 date-time string of when the credential was created.
-
#id ⇒ String
readonly
This is the unique identifier for the credential.
-
#org_id ⇒ String
readonly
This is the unique identifier for the org that this credential belongs to.
- #provider ⇒ String readonly
-
#updated_at ⇒ DateTime
readonly
This is the ISO 8601 date-time string of when the assistant was last updated.
Class Method Summary collapse
-
.from_json(json_object:) ⇒ Vapi::CartesiaCredential
Deserialize a JSON object to an instance of CartesiaCredential.
-
.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(provider:, api_key:, id:, org_id:, created_at:, updated_at:, additional_properties: nil) ⇒ Vapi::CartesiaCredential constructor
-
#to_json(*_args) ⇒ String
Serialize an instance of CartesiaCredential to a JSON object.
Constructor Details
#initialize(provider:, api_key:, id:, org_id:, created_at:, updated_at:, additional_properties: nil) ⇒ Vapi::CartesiaCredential
37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 |
# File 'lib/vapi_server_sdk/types/cartesia_credential.rb', line 37 def initialize(provider:, api_key:, id:, org_id:, created_at:, updated_at:, additional_properties: nil) @provider = provider @api_key = api_key @id = id @org_id = org_id @created_at = created_at @updated_at = updated_at @additional_properties = additional_properties @_field_set = { "provider": provider, "apiKey": api_key, "id": id, "orgId": org_id, "createdAt": created_at, "updatedAt": updated_at } end |
Instance Attribute Details
#additional_properties ⇒ OpenStruct (readonly)
Returns Additional properties unmapped to the current class definition.
22 23 24 |
# File 'lib/vapi_server_sdk/types/cartesia_credential.rb', line 22 def additional_properties @additional_properties end |
#api_key ⇒ String (readonly)
Returns This is not returned in the API.
12 13 14 |
# File 'lib/vapi_server_sdk/types/cartesia_credential.rb', line 12 def api_key @api_key end |
#created_at ⇒ DateTime (readonly)
Returns This is the ISO 8601 date-time string of when the credential was created.
18 19 20 |
# File 'lib/vapi_server_sdk/types/cartesia_credential.rb', line 18 def created_at @created_at end |
#id ⇒ String (readonly)
Returns This is the unique identifier for the credential.
14 15 16 |
# File 'lib/vapi_server_sdk/types/cartesia_credential.rb', line 14 def id @id end |
#org_id ⇒ String (readonly)
Returns This is the unique identifier for the org that this credential belongs to.
16 17 18 |
# File 'lib/vapi_server_sdk/types/cartesia_credential.rb', line 16 def org_id @org_id end |
#provider ⇒ String (readonly)
10 11 12 |
# File 'lib/vapi_server_sdk/types/cartesia_credential.rb', line 10 def provider @provider end |
#updated_at ⇒ DateTime (readonly)
Returns This is the ISO 8601 date-time string of when the assistant was last updated.
20 21 22 |
# File 'lib/vapi_server_sdk/types/cartesia_credential.rb', line 20 def updated_at @updated_at end |
Class Method Details
.from_json(json_object:) ⇒ Vapi::CartesiaCredential
Deserialize a JSON object to an instance of CartesiaCredential
59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 |
# File 'lib/vapi_server_sdk/types/cartesia_credential.rb', line 59 def self.from_json(json_object:) struct = JSON.parse(json_object, object_class: OpenStruct) parsed_json = JSON.parse(json_object) provider = parsed_json["provider"] api_key = parsed_json["apiKey"] 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?) new( provider: provider, api_key: api_key, id: id, org_id: org_id, created_at: created_at, updated_at: updated_at, 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.
92 93 94 95 96 97 98 99 |
# File 'lib/vapi_server_sdk/types/cartesia_credential.rb', line 92 def self.validate_raw(obj:) obj.provider.is_a?(String) != false || raise("Passed value for field obj.provider 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.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.") end |
Instance Method Details
#to_json(*_args) ⇒ String
Serialize an instance of CartesiaCredential to a JSON object
82 83 84 |
# File 'lib/vapi_server_sdk/types/cartesia_credential.rb', line 82 def to_json(*_args) @_field_set&.to_json end |