vapi_client/models/
gcp_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 GcpCredential {
16    #[serde(rename = "provider")]
17    pub provider: ProviderTrue,
18    /// This is the order in which this storage provider is tried during upload retries. Lower numbers are tried first in increasing order.
19    #[serde(rename = "fallbackIndex", skip_serializing_if = "Option::is_none")]
20    pub fallback_index: Option<f64>,
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 region of the GCP resource.
40    #[serde(rename = "region", skip_serializing_if = "Option::is_none")]
41    pub region: Option<String>,
42    #[serde(rename = "bucketPlan", skip_serializing_if = "Option::is_none")]
43    pub bucket_plan: Option<models::BucketPlan>,
44}
45
46impl GcpCredential {
47    pub fn new(
48        provider: ProviderTrue,
49        id: String,
50        org_id: String,
51        created_at: String,
52        updated_at: String,
53        gcp_key: models::GcpKey,
54    ) -> GcpCredential {
55        GcpCredential {
56            provider,
57            fallback_index: None,
58            id,
59            org_id,
60            created_at,
61            updated_at,
62            name: None,
63            gcp_key,
64            region: None,
65            bucket_plan: None,
66        }
67    }
68}
69///
70#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
71pub enum ProviderTrue {
72    #[serde(rename = "gcp")]
73    Gcp,
74}
75
76impl Default for ProviderTrue {
77    fn default() -> ProviderTrue {
78        Self::Gcp
79    }
80}