vapi_client/models/
gcp_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 GcpCredential {
17    #[serde(rename = "provider")]
18    pub provider: Provider,
19    /// This is the unique identifier for the credential.
20    #[serde(rename = "id")]
21    pub id: String,
22    /// This is the unique identifier for the org that this credential belongs to.
23    #[serde(rename = "orgId")]
24    pub org_id: String,
25    /// This is the ISO 8601 date-time string of when the credential was created.
26    #[serde(rename = "createdAt")]
27    pub created_at: String,
28    /// This is the ISO 8601 date-time string of when the assistant was last updated.
29    #[serde(rename = "updatedAt")]
30    pub updated_at: String,
31    /// This is the name of credential. This is just for your reference.
32    #[serde(rename = "name", skip_serializing_if = "Option::is_none")]
33    pub name: Option<String>,
34    /// This is the GCP key. This is the JSON that can be generated in the Google Cloud Console at https://console.cloud.google.com/iam-admin/serviceaccounts/details/<service-account-id>/keys.  The schema is identical to the JSON that GCP outputs.
35    #[serde(rename = "gcpKey")]
36    pub gcp_key: models::GcpKey,
37    /// This is the bucket plan that can be provided to store call artifacts in GCP.
38    #[serde(rename = "bucketPlan", skip_serializing_if = "Option::is_none")]
39    pub bucket_plan: Option<models::BucketPlan>,
40}
41
42impl GcpCredential {
43    pub fn new(
44        provider: Provider,
45        id: String,
46        org_id: String,
47        created_at: String,
48        updated_at: String,
49        gcp_key: models::GcpKey,
50    ) -> GcpCredential {
51        GcpCredential {
52            provider,
53            id,
54            org_id,
55            created_at,
56            updated_at,
57            name: None,
58            gcp_key,
59            bucket_plan: None,
60        }
61    }
62}
63///
64#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
65pub enum Provider {
66    #[serde(rename = "gcp")]
67    Gcp,
68}
69
70impl Default for Provider {
71    fn default() -> Provider {
72        Self::Gcp
73    }
74}