Class: Vapi::VoiceLibrary
- Inherits:
-
Object
- Object
- Vapi::VoiceLibrary
- Defined in:
- lib/vapi_server_sdk/types/voice_library.rb
Constant Summary collapse
- OMIT =
Object.new
Instance Attribute Summary collapse
-
#accent ⇒ String
readonly
The accent of the voice.
-
#additional_properties ⇒ OpenStruct
readonly
Additional properties unmapped to the current class definition.
-
#created_at ⇒ DateTime
readonly
The ISO 8601 date-time string of when the voice library was created.
-
#credential_id ⇒ String
readonly
The credential ID of the voice.
-
#description ⇒ String
readonly
The description of the voice.
-
#gender ⇒ Vapi::VoiceLibraryGender
readonly
The gender of the voice.
-
#id ⇒ String
readonly
The unique identifier for the voice library.
-
#is_deleted ⇒ Boolean
readonly
The deletion status of the voice.
-
#is_public ⇒ Boolean
readonly
The Public voice is shared accross all the organizations.
-
#language ⇒ String
readonly
The language of the voice.
-
#language_code ⇒ String
readonly
The language code of the voice.
-
#model ⇒ String
readonly
The model of the voice.
-
#name ⇒ String
readonly
The name of the voice.
-
#org_id ⇒ String
readonly
The unique identifier for the organization that this voice library belongs to.
-
#preview_url ⇒ String
readonly
The preview URL of the voice.
-
#provider ⇒ Hash{String => Object}
readonly
This is the voice provider that will be used.
-
#provider_id ⇒ String
readonly
The ID of the voice provided by the provider.
-
#slug ⇒ String
readonly
The unique slug of the voice.
-
#supported_models ⇒ String
readonly
The supported models of the voice.
-
#updated_at ⇒ DateTime
readonly
The ISO 8601 date-time string of when the voice library was last updated.
Class Method Summary collapse
-
.from_json(json_object:) ⇒ Vapi::VoiceLibrary
Deserialize a JSON object to an instance of VoiceLibrary.
-
.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(id:, org_id:, is_public:, is_deleted:, created_at:, updated_at:, provider: OMIT, provider_id: OMIT, slug: OMIT, name: OMIT, language: OMIT, language_code: OMIT, model: OMIT, supported_models: OMIT, gender: OMIT, accent: OMIT, preview_url: OMIT, description: OMIT, credential_id: OMIT, additional_properties: nil) ⇒ Vapi::VoiceLibrary constructor
-
#to_json(*_args) ⇒ String
Serialize an instance of VoiceLibrary to a JSON object.
Constructor Details
#initialize(id:, org_id:, is_public:, is_deleted:, created_at:, updated_at:, provider: OMIT, provider_id: OMIT, slug: OMIT, name: OMIT, language: OMIT, language_code: OMIT, model: OMIT, supported_models: OMIT, gender: OMIT, accent: OMIT, preview_url: OMIT, description: OMIT, credential_id: OMIT, additional_properties: nil) ⇒ Vapi::VoiceLibrary
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 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 |
# File 'lib/vapi_server_sdk/types/voice_library.rb', line 77 def initialize(id:, org_id:, is_public:, is_deleted:, created_at:, updated_at:, provider: OMIT, provider_id: OMIT, slug: OMIT, name: OMIT, language: OMIT, language_code: OMIT, model: OMIT, supported_models: OMIT, gender: OMIT, accent: OMIT, preview_url: OMIT, description: OMIT, credential_id: OMIT, additional_properties: nil) @provider = provider if provider != OMIT @provider_id = provider_id if provider_id != OMIT @slug = slug if slug != OMIT @name = name if name != OMIT @language = language if language != OMIT @language_code = language_code if language_code != OMIT @model = model if model != OMIT @supported_models = supported_models if supported_models != OMIT @gender = gender if gender != OMIT @accent = accent if accent != OMIT @preview_url = preview_url if preview_url != OMIT @description = description if description != OMIT @credential_id = credential_id if credential_id != OMIT @id = id @org_id = org_id @is_public = is_public @is_deleted = is_deleted @created_at = created_at @updated_at = updated_at @additional_properties = additional_properties @_field_set = { "provider": provider, "providerId": provider_id, "slug": slug, "name": name, "language": language, "languageCode": language_code, "model": model, "supportedModels": supported_models, "gender": gender, "accent": accent, "previewUrl": preview_url, "description": description, "credentialId": credential_id, "id": id, "orgId": org_id, "isPublic": is_public, "isDeleted": is_deleted, "createdAt": created_at, "updatedAt": updated_at }.reject do |_k, v| v == OMIT end end |
Instance Attribute Details
#accent ⇒ String (readonly)
Returns The accent of the voice.
29 30 31 |
# File 'lib/vapi_server_sdk/types/voice_library.rb', line 29 def accent @accent end |
#additional_properties ⇒ OpenStruct (readonly)
Returns Additional properties unmapped to the current class definition.
49 50 51 |
# File 'lib/vapi_server_sdk/types/voice_library.rb', line 49 def additional_properties @additional_properties end |
#created_at ⇒ DateTime (readonly)
Returns The ISO 8601 date-time string of when the voice library was created.
45 46 47 |
# File 'lib/vapi_server_sdk/types/voice_library.rb', line 45 def created_at @created_at end |
#credential_id ⇒ String (readonly)
Returns The credential ID of the voice.
35 36 37 |
# File 'lib/vapi_server_sdk/types/voice_library.rb', line 35 def credential_id @credential_id end |
#description ⇒ String (readonly)
Returns The description of the voice.
33 34 35 |
# File 'lib/vapi_server_sdk/types/voice_library.rb', line 33 def description @description end |
#gender ⇒ Vapi::VoiceLibraryGender (readonly)
Returns The gender of the voice.
27 28 29 |
# File 'lib/vapi_server_sdk/types/voice_library.rb', line 27 def gender @gender end |
#id ⇒ String (readonly)
Returns The unique identifier for the voice library.
37 38 39 |
# File 'lib/vapi_server_sdk/types/voice_library.rb', line 37 def id @id end |
#is_deleted ⇒ Boolean (readonly)
Returns The deletion status of the voice.
43 44 45 |
# File 'lib/vapi_server_sdk/types/voice_library.rb', line 43 def is_deleted @is_deleted end |
#is_public ⇒ Boolean (readonly)
Returns The Public voice is shared accross all the organizations.
41 42 43 |
# File 'lib/vapi_server_sdk/types/voice_library.rb', line 41 def is_public @is_public end |
#language ⇒ String (readonly)
Returns The language of the voice.
19 20 21 |
# File 'lib/vapi_server_sdk/types/voice_library.rb', line 19 def language @language end |
#language_code ⇒ String (readonly)
Returns The language code of the voice.
21 22 23 |
# File 'lib/vapi_server_sdk/types/voice_library.rb', line 21 def language_code @language_code end |
#model ⇒ String (readonly)
Returns The model of the voice.
23 24 25 |
# File 'lib/vapi_server_sdk/types/voice_library.rb', line 23 def model @model end |
#name ⇒ String (readonly)
Returns The name of the voice.
17 18 19 |
# File 'lib/vapi_server_sdk/types/voice_library.rb', line 17 def name @name end |
#org_id ⇒ String (readonly)
Returns The unique identifier for the organization that this voice library belongs to.
39 40 41 |
# File 'lib/vapi_server_sdk/types/voice_library.rb', line 39 def org_id @org_id end |
#preview_url ⇒ String (readonly)
Returns The preview URL of the voice.
31 32 33 |
# File 'lib/vapi_server_sdk/types/voice_library.rb', line 31 def preview_url @preview_url end |
#provider ⇒ Hash{String => Object} (readonly)
Returns This is the voice provider that will be used.
11 12 13 |
# File 'lib/vapi_server_sdk/types/voice_library.rb', line 11 def provider @provider end |
#provider_id ⇒ String (readonly)
Returns The ID of the voice provided by the provider.
13 14 15 |
# File 'lib/vapi_server_sdk/types/voice_library.rb', line 13 def provider_id @provider_id end |
#slug ⇒ String (readonly)
Returns The unique slug of the voice.
15 16 17 |
# File 'lib/vapi_server_sdk/types/voice_library.rb', line 15 def slug @slug end |
#supported_models ⇒ String (readonly)
Returns The supported models of the voice.
25 26 27 |
# File 'lib/vapi_server_sdk/types/voice_library.rb', line 25 def supported_models @supported_models end |
#updated_at ⇒ DateTime (readonly)
Returns The ISO 8601 date-time string of when the voice library was last updated.
47 48 49 |
# File 'lib/vapi_server_sdk/types/voice_library.rb', line 47 def updated_at @updated_at end |
Class Method Details
.from_json(json_object:) ⇒ Vapi::VoiceLibrary
Deserialize a JSON object to an instance of VoiceLibrary
128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 |
# File 'lib/vapi_server_sdk/types/voice_library.rb', line 128 def self.from_json(json_object:) struct = JSON.parse(json_object, object_class: OpenStruct) parsed_json = JSON.parse(json_object) provider = parsed_json["provider"] provider_id = parsed_json["providerId"] slug = parsed_json["slug"] name = parsed_json["name"] language = parsed_json["language"] language_code = parsed_json["languageCode"] model = parsed_json["model"] supported_models = parsed_json["supportedModels"] gender = parsed_json["gender"] accent = parsed_json["accent"] preview_url = parsed_json["previewUrl"] description = parsed_json["description"] credential_id = parsed_json["credentialId"] id = parsed_json["id"] org_id = parsed_json["orgId"] is_public = parsed_json["isPublic"] is_deleted = parsed_json["isDeleted"] 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, provider_id: provider_id, slug: slug, name: name, language: language, language_code: language_code, model: model, supported_models: supported_models, gender: gender, accent: accent, preview_url: preview_url, description: description, credential_id: credential_id, id: id, org_id: org_id, is_public: is_public, is_deleted: is_deleted, 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.
187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 |
# File 'lib/vapi_server_sdk/types/voice_library.rb', line 187 def self.validate_raw(obj:) obj.provider&.is_a?(Hash) != false || raise("Passed value for field obj.provider is not the expected type, validation failed.") obj.provider_id&.is_a?(String) != false || raise("Passed value for field obj.provider_id is not the expected type, validation failed.") obj.slug&.is_a?(String) != false || raise("Passed value for field obj.slug 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.language&.is_a?(String) != false || raise("Passed value for field obj.language is not the expected type, validation failed.") obj.language_code&.is_a?(String) != false || raise("Passed value for field obj.language_code is not the expected type, validation failed.") obj.model&.is_a?(String) != false || raise("Passed value for field obj.model is not the expected type, validation failed.") obj.supported_models&.is_a?(String) != false || raise("Passed value for field obj.supported_models is not the expected type, validation failed.") obj.gender&.is_a?(Vapi::VoiceLibraryGender) != false || raise("Passed value for field obj.gender is not the expected type, validation failed.") obj.accent&.is_a?(String) != false || raise("Passed value for field obj.accent is not the expected type, validation failed.") obj.preview_url&.is_a?(String) != false || raise("Passed value for field obj.preview_url is not the expected type, validation failed.") obj.description&.is_a?(String) != false || raise("Passed value for field obj.description is not the expected type, validation failed.") obj.credential_id&.is_a?(String) != false || raise("Passed value for field obj.credential_id 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.is_public.is_a?(Boolean) != false || raise("Passed value for field obj.is_public is not the expected type, validation failed.") obj.is_deleted.is_a?(Boolean) != false || raise("Passed value for field obj.is_deleted 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 VoiceLibrary to a JSON object
177 178 179 |
# File 'lib/vapi_server_sdk/types/voice_library.rb', line 177 def to_json(*_args) @_field_set&.to_json end |