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 VapiCost {
    /// This is the type of cost, always 'vapi' for this class.
    #[serde(rename = "type")]
    pub r#type: TypeTrue,
    /// This is the sub type of the cost.
    #[serde(rename = "subType")]
    pub sub_type: SubTypeTrue,
    /// This is the minutes of Vapi 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 VapiCost {
    pub fn new(r#type: TypeTrue, sub_type: SubTypeTrue, minutes: f64, cost: f64) -> VapiCost {
        VapiCost {
            r#type,
            sub_type,
            minutes,
            cost,
        }
    }
}
/// This is the type of cost, always 'vapi' for this class.
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum TypeTrue {
    #[serde(rename = "vapi")]
    Vapi,
}

impl Default for TypeTrue {
    fn default() -> TypeTrue {
        Self::Vapi
    }
}
/// This is the sub type of the cost.
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum SubTypeTrue {
    #[serde(rename = "normal")]
    Normal,
    #[serde(rename = "overage")]
    Overage,
}

impl Default for SubTypeTrue {
    fn default() -> SubTypeTrue {
        Self::Normal
    }
}