vapi_client/models/
voice_library.rs

1/*
2 * Vapi API
3 *
4 * API for building voice assistants
5 *
6 * The version of the OpenAPI document: 1.0
7 *
8 * Generated by: https://openapi-generator.tech
9 */
10
11use serde::{Deserialize, Serialize};
12
13use crate::models;
14
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct VoiceLibrary {
17    /// This is the voice provider that will be used.
18    #[serde(rename = "provider", skip_serializing_if = "Option::is_none")]
19    pub provider: Option<Provider>,
20    /// The ID of the voice provided by the provider.
21    #[serde(rename = "providerId", skip_serializing_if = "Option::is_none")]
22    pub provider_id: Option<String>,
23    /// The unique slug of the voice.
24    #[serde(rename = "slug", skip_serializing_if = "Option::is_none")]
25    pub slug: Option<String>,
26    /// The name of the voice.
27    #[serde(rename = "name", skip_serializing_if = "Option::is_none")]
28    pub name: Option<String>,
29    /// The language of the voice.
30    #[serde(rename = "language", skip_serializing_if = "Option::is_none")]
31    pub language: Option<String>,
32    /// The language code of the voice.
33    #[serde(rename = "languageCode", skip_serializing_if = "Option::is_none")]
34    pub language_code: Option<String>,
35    /// The model of the voice.
36    #[serde(rename = "model", skip_serializing_if = "Option::is_none")]
37    pub model: Option<String>,
38    /// The supported models of the voice.
39    #[serde(rename = "supportedModels", skip_serializing_if = "Option::is_none")]
40    pub supported_models: Option<String>,
41    /// The gender of the voice.
42    #[serde(rename = "gender", skip_serializing_if = "Option::is_none")]
43    pub gender: Option<Gender>,
44    /// The accent of the voice.
45    #[serde(rename = "accent", skip_serializing_if = "Option::is_none")]
46    pub accent: Option<String>,
47    /// The preview URL of the voice.
48    #[serde(rename = "previewUrl", skip_serializing_if = "Option::is_none")]
49    pub preview_url: Option<String>,
50    /// The description of the voice.
51    #[serde(rename = "description", skip_serializing_if = "Option::is_none")]
52    pub description: Option<String>,
53    /// The credential ID of the voice.
54    #[serde(rename = "credentialId", skip_serializing_if = "Option::is_none")]
55    pub credential_id: Option<String>,
56    /// The unique identifier for the voice library.
57    #[serde(rename = "id")]
58    pub id: String,
59    /// The unique identifier for the organization that this voice library belongs to.
60    #[serde(rename = "orgId")]
61    pub org_id: String,
62    /// The Public voice is shared accross all the organizations.
63    #[serde(rename = "isPublic")]
64    pub is_public: bool,
65    /// The deletion status of the voice.
66    #[serde(rename = "isDeleted")]
67    pub is_deleted: bool,
68    /// The ISO 8601 date-time string of when the voice library was created.
69    #[serde(rename = "createdAt")]
70    pub created_at: String,
71    /// The ISO 8601 date-time string of when the voice library was last updated.
72    #[serde(rename = "updatedAt")]
73    pub updated_at: String,
74}
75
76impl VoiceLibrary {
77    pub fn new(
78        id: String,
79        org_id: String,
80        is_public: bool,
81        is_deleted: bool,
82        created_at: String,
83        updated_at: String,
84    ) -> VoiceLibrary {
85        VoiceLibrary {
86            provider: None,
87            provider_id: None,
88            slug: None,
89            name: None,
90            language: None,
91            language_code: None,
92            model: None,
93            supported_models: None,
94            gender: None,
95            accent: None,
96            preview_url: None,
97            description: None,
98            credential_id: None,
99            id,
100            org_id,
101            is_public,
102            is_deleted,
103            created_at,
104            updated_at,
105        }
106    }
107}
108/// This is the voice provider that will be used.
109#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
110pub enum Provider {
111    #[serde(rename = "vapi")]
112    Vapi,
113    #[serde(rename = "11labs")]
114    Variant11labs,
115    #[serde(rename = "azure")]
116    Azure,
117    #[serde(rename = "cartesia")]
118    Cartesia,
119    #[serde(rename = "custom-voice")]
120    CustomVoice,
121    #[serde(rename = "deepgram")]
122    Deepgram,
123    #[serde(rename = "hume")]
124    Hume,
125    #[serde(rename = "lmnt")]
126    Lmnt,
127    #[serde(rename = "neets")]
128    Neets,
129    #[serde(rename = "neuphonic")]
130    Neuphonic,
131    #[serde(rename = "openai")]
132    Openai,
133    #[serde(rename = "playht")]
134    Playht,
135    #[serde(rename = "rime-ai")]
136    RimeAi,
137    #[serde(rename = "smallest-ai")]
138    SmallestAi,
139    #[serde(rename = "tavus")]
140    Tavus,
141}
142
143impl Default for Provider {
144    fn default() -> Provider {
145        Self::Vapi
146    }
147}
148/// The gender of the voice.
149#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
150pub enum Gender {
151    #[serde(rename = "male")]
152    Male,
153    #[serde(rename = "female")]
154    Female,
155}
156
157impl Default for Gender {
158    fn default() -> Gender {
159        Self::Male
160    }
161}