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