vapi_client/models/
cloudflare_credential.rs

1/*
2 * Vapi API
3 *
4 * Voice AI for developers.
5 *
6 * The version of the OpenAPI document: 1.0
7 *
8 * Generated by: https://openapi-generator.tech
9 */
10
11use crate::models;
12use serde::{Deserialize, Serialize};
13
14#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
15pub struct CloudflareCredential {
16    /// Credential provider. Only allowed value is cloudflare
17    #[serde(rename = "provider")]
18    pub provider: ProviderTrue,
19    /// Cloudflare Account Id.
20    #[serde(rename = "accountId", skip_serializing_if = "Option::is_none")]
21    pub account_id: Option<String>,
22    /// Cloudflare API Key / Token.
23    #[serde(rename = "apiKey", skip_serializing_if = "Option::is_none")]
24    pub api_key: Option<String>,
25    /// Cloudflare Account Email.
26    #[serde(rename = "accountEmail", skip_serializing_if = "Option::is_none")]
27    pub account_email: Option<String>,
28    /// This is the order in which this storage provider is tried during upload retries. Lower numbers are tried first in increasing order.
29    #[serde(rename = "fallbackIndex", skip_serializing_if = "Option::is_none")]
30    pub fallback_index: Option<f64>,
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: ProviderTrue,
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            fallback_index: None,
65            id,
66            org_id,
67            created_at,
68            updated_at,
69            name: None,
70            bucket_plan: None,
71        }
72    }
73}
74/// Credential provider. Only allowed value is cloudflare
75#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
76pub enum ProviderTrue {
77    #[serde(rename = "cloudflare")]
78    Cloudflare,
79}
80
81impl Default for ProviderTrue {
82    fn default() -> ProviderTrue {
83        Self::Cloudflare
84    }
85}