vapi_client/models/
transport_cost.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 TransportCost {
16    /// This is the type of cost, always 'transport' for this class.
17    #[serde(rename = "type")]
18    pub r#type: Type,
19    #[serde(rename = "provider", skip_serializing_if = "Option::is_none")]
20    pub provider: Option<Provider>,
21    /// This is the minutes of `transport` usage. This should match `call.endedAt` - `call.startedAt`.
22    #[serde(rename = "minutes")]
23    pub minutes: f64,
24    /// This is the cost of the component in USD.
25    #[serde(rename = "cost")]
26    pub cost: f64,
27}
28
29impl TransportCost {
30    pub fn new(r#type: Type, minutes: f64, cost: f64) -> TransportCost {
31        TransportCost {
32            r#type,
33            provider: None,
34            minutes,
35            cost,
36        }
37    }
38}
39/// This is the type of cost, always 'transport' for this class.
40#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
41pub enum Type {
42    #[serde(rename = "transport")]
43    Transport,
44}
45
46impl Default for Type {
47    fn default() -> Type {
48        Self::Transport
49    }
50}
51/// 
52#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
53pub enum Provider {
54    #[serde(rename = "twilio")]
55    Twilio,
56    #[serde(rename = "vonage")]
57    Vonage,
58    #[serde(rename = "vapi")]
59    Vapi,
60}
61
62impl Default for Provider {
63    fn default() -> Provider {
64        Self::Twilio
65    }
66}
67