vapi_client/models/
s3_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 S3Credential {
17    /// Credential provider. Only allowed value is s3
18    #[serde(rename = "provider")]
19    pub provider: Provider,
20    /// AWS access key ID.
21    #[serde(rename = "awsAccessKeyId")]
22    pub aws_access_key_id: String,
23    /// AWS access key secret. This is not returned in the API.
24    #[serde(rename = "awsSecretAccessKey")]
25    pub aws_secret_access_key: String,
26    /// AWS region in which the S3 bucket is located.
27    #[serde(rename = "region")]
28    pub region: String,
29    /// AWS S3 bucket name.
30    #[serde(rename = "s3BucketName")]
31    pub s3_bucket_name: String,
32    /// The path prefix for the uploaded recording. Ex. \"recordings/\"
33    #[serde(rename = "s3PathPrefix")]
34    pub s3_path_prefix: String,
35    /// This is the unique identifier for the credential.
36    #[serde(rename = "id")]
37    pub id: String,
38    /// This is the unique identifier for the org that this credential belongs to.
39    #[serde(rename = "orgId")]
40    pub org_id: String,
41    /// This is the ISO 8601 date-time string of when the credential was created.
42    #[serde(rename = "createdAt")]
43    pub created_at: String,
44    /// This is the ISO 8601 date-time string of when the assistant was last updated.
45    #[serde(rename = "updatedAt")]
46    pub updated_at: String,
47    /// This is the name of credential. This is just for your reference.
48    #[serde(rename = "name", skip_serializing_if = "Option::is_none")]
49    pub name: Option<String>,
50}
51
52impl S3Credential {
53    pub fn new(
54        provider: Provider,
55        aws_access_key_id: String,
56        aws_secret_access_key: String,
57        region: String,
58        s3_bucket_name: String,
59        s3_path_prefix: String,
60        id: String,
61        org_id: String,
62        created_at: String,
63        updated_at: String,
64    ) -> S3Credential {
65        S3Credential {
66            provider,
67            aws_access_key_id,
68            aws_secret_access_key,
69            region,
70            s3_bucket_name,
71            s3_path_prefix,
72            id,
73            org_id,
74            created_at,
75            updated_at,
76            name: None,
77        }
78    }
79}
80/// Credential provider. Only allowed value is s3
81#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
82pub enum Provider {
83    #[serde(rename = "s3")]
84    S3,
85}
86
87impl Default for Provider {
88    fn default() -> Provider {
89        Self::S3
90    }
91}