1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
/*
* Vapi API
*
* Voice AI for developers.
*
* The version of the OpenAPI document: 1.0
*
* Generated by: https://openapi-generator.tech
*/
use crate::models;
use serde::{Deserialize, Serialize};
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct GcpCredential {
#[serde(rename = "provider")]
pub provider: ProviderTrue,
/// This is the order in which this storage provider is tried during upload retries. Lower numbers are tried first in increasing order.
#[serde(rename = "fallbackIndex", skip_serializing_if = "Option::is_none")]
pub fallback_index: Option<f64>,
/// This is the unique identifier for the credential.
#[serde(rename = "id")]
pub id: String,
/// This is the unique identifier for the org that this credential belongs to.
#[serde(rename = "orgId")]
pub org_id: String,
/// This is the ISO 8601 date-time string of when the credential was created.
#[serde(rename = "createdAt")]
pub created_at: String,
/// This is the ISO 8601 date-time string of when the assistant was last updated.
#[serde(rename = "updatedAt")]
pub updated_at: String,
/// This is the name of credential. This is just for your reference.
#[serde(rename = "name", skip_serializing_if = "Option::is_none")]
pub name: Option<String>,
/// 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.
#[serde(rename = "gcpKey")]
pub gcp_key: models::GcpKey,
/// This is the region of the GCP resource.
#[serde(rename = "region", skip_serializing_if = "Option::is_none")]
pub region: Option<String>,
#[serde(rename = "bucketPlan", skip_serializing_if = "Option::is_none")]
pub bucket_plan: Option<models::BucketPlan>,
}
impl GcpCredential {
pub fn new(
provider: ProviderTrue,
id: String,
org_id: String,
created_at: String,
updated_at: String,
gcp_key: models::GcpKey,
) -> GcpCredential {
GcpCredential {
provider,
fallback_index: None,
id,
org_id,
created_at,
updated_at,
name: None,
gcp_key,
region: None,
bucket_plan: None,
}
}
}
///
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum ProviderTrue {
#[serde(rename = "gcp")]
Gcp,
}
impl Default for ProviderTrue {
fn default() -> ProviderTrue {
Self::Gcp
}
}