vapi_client/models/
cloudflare_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 CloudflareCredential {
19    /// Credential provider. Only allowed value is cloudflare
20    #[serde(rename = "provider")]
21    pub provider: Provider,
22    /// Cloudflare Account Id.
23    #[serde(rename = "accountId", skip_serializing_if = "Option::is_none")]
24    pub account_id: Option<String>,
25    /// Cloudflare API Key / Token.
26    #[serde(rename = "apiKey", skip_serializing_if = "Option::is_none")]
27    pub api_key: Option<String>,
28    /// Cloudflare Account Email.
29    #[serde(rename = "accountEmail", skip_serializing_if = "Option::is_none")]
30    pub account_email: Option<String>,
31    /// This is the unique identifier for the credential.
32    #[serde(rename = "id")]
33    pub id: String,
34    /// This is the unique identifier for the org that this credential belongs to.
35    #[serde(rename = "orgId")]
36    pub org_id: String,
37    /// This is the ISO 8601 date-time string of when the credential was created.
38    #[serde(rename = "createdAt")]
39    pub created_at: String,
40    /// This is the ISO 8601 date-time string of when the assistant was last updated.
41    #[serde(rename = "updatedAt")]
42    pub updated_at: String,
43    /// This is the name of credential. This is just for your reference.
44    #[serde(rename = "name", skip_serializing_if = "Option::is_none")]
45    pub name: Option<String>,
46    /// This is the bucket plan that can be provided to store call artifacts in R2
47    #[serde(rename = "bucketPlan", skip_serializing_if = "Option::is_none")]
48    pub bucket_plan: Option<models::CloudflareR2BucketPlan>,
49}
50
51impl CloudflareCredential {
52    pub fn new(
53        provider: Provider,
54        id: String,
55        org_id: String,
56        created_at: String,
57        updated_at: String,
58    ) -> CloudflareCredential {
59        CloudflareCredential {
60            provider,
61            account_id: None,
62            api_key: None,
63            account_email: None,
64            id,
65            org_id,
66            created_at,
67            updated_at,
68            name: None,
69            bucket_plan: None,
70        }
71    }
72}
73/// Credential provider. Only allowed value is cloudflare
74#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize, ToSchema)]
75pub enum Provider {
76    #[serde(rename = "cloudflare")]
77    Cloudflare,
78}
79
80impl Default for Provider {
81    fn default() -> Provider {
82        Self::Cloudflare
83    }
84}