/*
 * Zernio API
 *
 * API reference for Zernio. Authenticate with a Bearer API key. Base URL: https://zernio.com/api
 *
 * The version of the OpenAPI document: 1.0.4
 * Contact: support@zernio.com
 * Generated by: https://openapi-generator.tech
 */

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

#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct ListWhatsAppCalls200ResponseCallsInner {
    #[serde(rename = "_id", skip_serializing_if = "Option::is_none")]
    pub _id: Option<String>,
    #[serde(rename = "direction", skip_serializing_if = "Option::is_none")]
    pub direction: Option<Direction>,
    #[serde(rename = "from", skip_serializing_if = "Option::is_none")]
    pub from: Option<String>,
    #[serde(rename = "to", skip_serializing_if = "Option::is_none")]
    pub to: Option<String>,
    #[serde(rename = "status", skip_serializing_if = "Option::is_none")]
    pub status: Option<Status>,
    #[serde(rename = "startedAt", skip_serializing_if = "Option::is_none")]
    pub started_at: Option<String>,
    #[serde(rename = "endedAt", skip_serializing_if = "Option::is_none")]
    pub ended_at: Option<String>,
    #[serde(rename = "durationSeconds", skip_serializing_if = "Option::is_none")]
    pub duration_seconds: Option<i32>,
    #[serde(rename = "endReason", skip_serializing_if = "Option::is_none")]
    pub end_reason: Option<EndReason>,
    #[serde(rename = "recordingUrl", skip_serializing_if = "Option::is_none")]
    pub recording_url: Option<String>,
    #[serde(rename = "billing", skip_serializing_if = "Option::is_none")]
    pub billing: Option<Box<models::ListWhatsAppCalls200ResponseCallsInnerBilling>>,
}

impl ListWhatsAppCalls200ResponseCallsInner {
    pub fn new() -> ListWhatsAppCalls200ResponseCallsInner {
        ListWhatsAppCalls200ResponseCallsInner {
            _id: None,
            direction: None,
            from: None,
            to: None,
            status: None,
            started_at: None,
            ended_at: None,
            duration_seconds: None,
            end_reason: None,
            recording_url: None,
            billing: None,
        }
    }
}
///
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Direction {
    #[serde(rename = "inbound")]
    Inbound,
    #[serde(rename = "outbound")]
    Outbound,
}

impl Default for Direction {
    fn default() -> Direction {
        Self::Inbound
    }
}
///
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Status {
    #[serde(rename = "ringing")]
    Ringing,
    #[serde(rename = "answered")]
    Answered,
    #[serde(rename = "ended")]
    Ended,
    #[serde(rename = "failed")]
    Failed,
}

impl Default for Status {
    fn default() -> Status {
        Self::Ringing
    }
}
///
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum EndReason {
    #[serde(rename = "hangup")]
    Hangup,
    #[serde(rename = "no_answer")]
    NoAnswer,
    #[serde(rename = "rejected")]
    Rejected,
    #[serde(rename = "error")]
    Error,
}

impl Default for EndReason {
    fn default() -> EndReason {
        Self::Hangup
    }
}
