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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
/*
* 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 S3Credential {
/// Credential provider. Only allowed value is s3
#[serde(rename = "provider")]
pub provider: ProviderTrue,
/// AWS access key ID.
#[serde(rename = "awsAccessKeyId")]
pub aws_access_key_id: String,
/// AWS access key secret. This is not returned in the API.
#[serde(rename = "awsSecretAccessKey")]
pub aws_secret_access_key: String,
/// AWS region in which the S3 bucket is located.
#[serde(rename = "region")]
pub region: String,
/// AWS S3 bucket name.
#[serde(rename = "s3BucketName")]
pub s3_bucket_name: String,
/// The path prefix for the uploaded recording. Ex. \"recordings/\"
#[serde(rename = "s3PathPrefix")]
pub s3_path_prefix: String,
/// 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>,
}
impl S3Credential {
pub fn new(
provider: ProviderTrue,
aws_access_key_id: String,
aws_secret_access_key: String,
region: String,
s3_bucket_name: String,
s3_path_prefix: String,
id: String,
org_id: String,
created_at: String,
updated_at: String,
) -> S3Credential {
S3Credential {
provider,
aws_access_key_id,
aws_secret_access_key,
region,
s3_bucket_name,
s3_path_prefix,
fallback_index: None,
id,
org_id,
created_at,
updated_at,
name: None,
}
}
}
/// Credential provider. Only allowed value is s3
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum ProviderTrue {
#[serde(rename = "s3")]
S3,
}
impl Default for ProviderTrue {
fn default() -> ProviderTrue {
Self::S3
}
}