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