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