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