vapi-client 0.4.2

Unofficial crate for Vapi - Voice AI for developers.
Documentation
/*
 * Vapi API
 *
 * Voice AI for developers.
 *
 * The version of the OpenAPI document: 1.0
 *
 * Generated by: https://openapi-generator.tech
 */

use crate::models;
use serde::{Deserialize, Serialize};

#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct CloudflareCredential {
    /// Credential provider. Only allowed value is cloudflare
    #[serde(rename = "provider")]
    pub provider: ProviderTrue,
    /// Cloudflare Account Id.
    #[serde(rename = "accountId", skip_serializing_if = "Option::is_none")]
    pub account_id: Option<String>,
    /// Cloudflare API Key / Token.
    #[serde(rename = "apiKey", skip_serializing_if = "Option::is_none")]
    pub api_key: Option<String>,
    /// Cloudflare Account Email.
    #[serde(rename = "accountEmail", skip_serializing_if = "Option::is_none")]
    pub account_email: Option<String>,
    /// This is the order in which this storage provider is tried during upload retries. Lower numbers are tried first in increasing order.
    #[serde(rename = "fallbackIndex", skip_serializing_if = "Option::is_none")]
    pub fallback_index: Option<f64>,
    /// This is the unique identifier for the credential.
    #[serde(rename = "id")]
    pub id: String,
    /// This is the unique identifier for the org that this credential belongs to.
    #[serde(rename = "orgId")]
    pub org_id: String,
    /// This is the ISO 8601 date-time string of when the credential was created.
    #[serde(rename = "createdAt")]
    pub created_at: String,
    /// This is the ISO 8601 date-time string of when the assistant was last updated.
    #[serde(rename = "updatedAt")]
    pub updated_at: String,
    /// This is the name of credential. This is just for your reference.
    #[serde(rename = "name", skip_serializing_if = "Option::is_none")]
    pub name: Option<String>,
    /// This is the bucket plan that can be provided to store call artifacts in R2
    #[serde(rename = "bucketPlan", skip_serializing_if = "Option::is_none")]
    pub bucket_plan: Option<models::CloudflareR2BucketPlan>,
}

impl CloudflareCredential {
    pub fn new(
        provider: ProviderTrue,
        id: String,
        org_id: String,
        created_at: String,
        updated_at: String,
    ) -> CloudflareCredential {
        CloudflareCredential {
            provider,
            account_id: None,
            api_key: None,
            account_email: None,
            fallback_index: None,
            id,
            org_id,
            created_at,
            updated_at,
            name: None,
            bucket_plan: None,
        }
    }
}
/// Credential provider. Only allowed value is cloudflare
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum ProviderTrue {
    #[serde(rename = "cloudflare")]
    Cloudflare,
}

impl Default for ProviderTrue {
    fn default() -> ProviderTrue {
        Self::Cloudflare
    }
}