vapi_client/models/
vonage_credential.rs

1/*
2 * Vapi API
3 *
4 * Voice AI for developers.
5 *
6 * The version of the OpenAPI document: 1.0
7 *
8 * Generated by: https://openapi-generator.tech
9 */
10
11use crate::models;
12use serde::{Deserialize, Serialize};
13
14#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
15pub struct VonageCredential {
16    /// This is not returned in the API.
17    #[serde(rename = "vonageApplicationPrivateKey")]
18    pub vonage_application_private_key: String,
19    #[serde(rename = "provider")]
20    pub provider: ProviderTrue,
21    /// This is not returned in the API.
22    #[serde(rename = "apiSecret")]
23    pub api_secret: String,
24    /// This is the unique identifier for the credential.
25    #[serde(rename = "id")]
26    pub id: String,
27    /// This is the unique identifier for the org that this credential belongs to.
28    #[serde(rename = "orgId")]
29    pub org_id: String,
30    /// This is the ISO 8601 date-time string of when the credential was created.
31    #[serde(rename = "createdAt")]
32    pub created_at: String,
33    /// This is the ISO 8601 date-time string of when the assistant was last updated.
34    #[serde(rename = "updatedAt")]
35    pub updated_at: String,
36    /// This is the Vonage Application ID for the credential.  Only relevant for Vonage credentials.
37    #[serde(rename = "vonageApplicationId")]
38    pub vonage_application_id: String,
39    /// This is the name of credential. This is just for your reference.
40    #[serde(rename = "name", skip_serializing_if = "Option::is_none")]
41    pub name: Option<String>,
42    #[serde(rename = "apiKey")]
43    pub api_key: String,
44}
45
46impl VonageCredential {
47    pub fn new(
48        vonage_application_private_key: String,
49        provider: ProviderTrue,
50        api_secret: String,
51        id: String,
52        org_id: String,
53        created_at: String,
54        updated_at: String,
55        vonage_application_id: String,
56        api_key: String,
57    ) -> VonageCredential {
58        VonageCredential {
59            vonage_application_private_key,
60            provider,
61            api_secret,
62            id,
63            org_id,
64            created_at,
65            updated_at,
66            vonage_application_id,
67            name: None,
68            api_key,
69        }
70    }
71}
72///
73#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
74pub enum ProviderTrue {
75    #[serde(rename = "vonage")]
76    Vonage,
77}
78
79impl Default for ProviderTrue {
80    fn default() -> ProviderTrue {
81        Self::Vonage
82    }
83}