vapi_client/models/
deepgram_credential.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 DeepgramCredential {
17    #[serde(rename = "provider")]
18    pub provider: Provider,
19    /// This is not returned in the API.
20    #[serde(rename = "apiKey")]
21    pub api_key: String,
22    /// This is the unique identifier for the credential.
23    #[serde(rename = "id")]
24    pub id: String,
25    /// This is the unique identifier for the org that this credential belongs to.
26    #[serde(rename = "orgId")]
27    pub org_id: String,
28    /// This is the ISO 8601 date-time string of when the credential was created.
29    #[serde(rename = "createdAt")]
30    pub created_at: String,
31    /// This is the ISO 8601 date-time string of when the assistant was last updated.
32    #[serde(rename = "updatedAt")]
33    pub updated_at: String,
34    /// This is the name of credential. This is just for your reference.
35    #[serde(rename = "name", skip_serializing_if = "Option::is_none")]
36    pub name: Option<String>,
37    /// This can be used to point to an onprem Deepgram instance. Defaults to api.deepgram.com.
38    #[serde(rename = "apiUrl", skip_serializing_if = "Option::is_none")]
39    pub api_url: Option<String>,
40}
41
42impl DeepgramCredential {
43    pub fn new(
44        provider: Provider,
45        api_key: String,
46        id: String,
47        org_id: String,
48        created_at: String,
49        updated_at: String,
50    ) -> DeepgramCredential {
51        DeepgramCredential {
52            provider,
53            api_key,
54            id,
55            org_id,
56            created_at,
57            updated_at,
58            name: None,
59            api_url: None,
60        }
61    }
62}
63///
64#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
65pub enum Provider {
66    #[serde(rename = "deepgram")]
67    Deepgram,
68}
69
70impl Default for Provider {
71    fn default() -> Provider {
72        Self::Deepgram
73    }
74}