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 TransportCost {
    /// This is the type of cost, always 'transport' for this class.
    #[serde(rename = "type")]
    pub r#type: TypeTrue,
    #[serde(rename = "provider", skip_serializing_if = "Option::is_none")]
    pub provider: Option<ProviderTrue>,
    /// This is the minutes of `transport` usage. This should match `call.endedAt` - `call.startedAt`.
    #[serde(rename = "minutes")]
    pub minutes: f64,
    /// This is the cost of the component in USD.
    #[serde(rename = "cost")]
    pub cost: f64,
}

impl TransportCost {
    pub fn new(r#type: TypeTrue, minutes: f64, cost: f64) -> TransportCost {
        TransportCost {
            r#type,
            provider: None,
            minutes,
            cost,
        }
    }
}
/// This is the type of cost, always 'transport' for this class.
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum TypeTrue {
    #[serde(rename = "transport")]
    Transport,
}

impl Default for TypeTrue {
    fn default() -> TypeTrue {
        Self::Transport
    }
}
///
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum ProviderTrue {
    #[serde(rename = "twilio")]
    Twilio,
    #[serde(rename = "vonage")]
    Vonage,
    #[serde(rename = "vapi")]
    Vapi,
}

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