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