Class: Vapi::VoiceLibrary

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

Constant Summary collapse

OMIT =
Object.new

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

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

Parameters:

  • provider (Hash{String => Object}) (defaults to: OMIT)

    This is the voice provider that will be used.

  • provider_id (String) (defaults to: OMIT)

    The ID of the voice provided by the provider.

  • slug (String) (defaults to: OMIT)

    The unique slug of the voice.

  • name (String) (defaults to: OMIT)

    The name of the voice.

  • language (String) (defaults to: OMIT)

    The language of the voice.

  • language_code (String) (defaults to: OMIT)

    The language code of the voice.

  • model (String) (defaults to: OMIT)

    The model of the voice.

  • supported_models (String) (defaults to: OMIT)

    The supported models of the voice.

  • gender (Vapi::VoiceLibraryGender) (defaults to: OMIT)

    The gender of the voice.

  • accent (String) (defaults to: OMIT)

    The accent of the voice.

  • preview_url (String) (defaults to: OMIT)

    The preview URL of the voice.

  • description (String) (defaults to: OMIT)

    The description of the voice.

  • credential_id (String) (defaults to: OMIT)

    The credential ID of the voice.

  • id (String)

    The unique identifier for the voice library.

  • org_id (String)

    The unique identifier for the organization that this voice library belongs to.

  • is_public (Boolean)

    The Public voice is shared accross all the organizations.

  • is_deleted (Boolean)

    The deletion status of the voice.

  • created_at (DateTime)

    The ISO 8601 date-time string of when the voice library was created.

  • updated_at (DateTime)

    The ISO 8601 date-time string of when the voice library was last updated.

  • additional_properties (OpenStruct) (defaults to: nil)

    Additional properties unmapped to the current class definition



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

#accentString (readonly)

Returns The accent of the voice.

Returns:

  • (String)

    The accent of the voice.



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

def accent
  @accent
end

#additional_propertiesOpenStruct (readonly)

Returns Additional properties unmapped to the current class definition.

Returns:

  • (OpenStruct)

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

Returns The ISO 8601 date-time string of when the voice library was created.

Returns:

  • (DateTime)

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

Returns The credential ID of the voice.

Returns:

  • (String)

    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

#descriptionString (readonly)

Returns The description of the voice.

Returns:

  • (String)

    The description of the voice.



33
34
35
# File 'lib/vapi_server_sdk/types/voice_library.rb', line 33

def description
  @description
end

#genderVapi::VoiceLibraryGender (readonly)

Returns The gender of the voice.

Returns:



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

def gender
  @gender
end

#idString (readonly)

Returns The unique identifier for the voice library.

Returns:

  • (String)

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

Returns The deletion status of the voice.

Returns:

  • (Boolean)

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

Returns The Public voice is shared accross all the organizations.

Returns:

  • (Boolean)

    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

#languageString (readonly)

Returns The language of the voice.

Returns:

  • (String)

    The language of the voice.



19
20
21
# File 'lib/vapi_server_sdk/types/voice_library.rb', line 19

def language
  @language
end

#language_codeString (readonly)

Returns The language code of the voice.

Returns:

  • (String)

    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

#modelString (readonly)

Returns The model of the voice.

Returns:

  • (String)

    The model of the voice.



23
24
25
# File 'lib/vapi_server_sdk/types/voice_library.rb', line 23

def model
  @model
end

#nameString (readonly)

Returns The name of the voice.

Returns:

  • (String)

    The name of the voice.



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

def name
  @name
end

#org_idString (readonly)

Returns The unique identifier for the organization that this voice library belongs to.

Returns:

  • (String)

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

Returns The preview URL of the voice.

Returns:

  • (String)

    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

#providerHash{String => Object} (readonly)

Returns This is the voice provider that will be used.

Returns:

  • (Hash{String => Object})

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

Returns The ID of the voice provided by the provider.

Returns:

  • (String)

    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

#slugString (readonly)

Returns The unique slug of the voice.

Returns:

  • (String)

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

Returns The supported models of the voice.

Returns:

  • (String)

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

Returns The ISO 8601 date-time string of when the voice library was last updated.

Returns:

  • (DateTime)

    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

Parameters:

  • json_object (String)

Returns:



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.

Parameters:

  • obj (Object)

Returns:

  • (Void)


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

Returns:

  • (String)


177
178
179
# File 'lib/vapi_server_sdk/types/voice_library.rb', line 177

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