/*
 * 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 EnableVoiceOnNumberRequest {
    /// tel:+E164, sip:..., or wss://... destination for inbound calls. Empty string clears the forward (outbound-only); omitted preserves the current one.
    #[serde(rename = "forwardTo", skip_serializing_if = "Option::is_none")]
    pub forward_to: Option<String>,
    #[serde(rename = "recordingEnabled", skip_serializing_if = "Option::is_none")]
    pub recording_enabled: Option<bool>,
    #[serde(
        rename = "transcriptionEnabled",
        skip_serializing_if = "Option::is_none"
    )]
    pub transcription_enabled: Option<bool>,
    #[serde(
        rename = "transcriptionLanguage",
        skip_serializing_if = "Option::is_none"
    )]
    pub transcription_language: Option<TranscriptionLanguage>,
    /// Voicemail is taken when there's no live destination. Default on.
    #[serde(rename = "voicemailEnabled", skip_serializing_if = "Option::is_none")]
    pub voicemail_enabled: Option<bool>,
    /// Custom spoken greeting; empty string restores the default.
    #[serde(rename = "voicemailGreeting", skip_serializing_if = "Option::is_none")]
    pub voicemail_greeting: Option<String>,
    /// Outside the windows, inbound skips the forward and goes to voicemail. Off = 24/7.
    #[serde(
        rename = "businessHoursEnabled",
        skip_serializing_if = "Option::is_none"
    )]
    pub business_hours_enabled: Option<bool>,
    /// IANA timezone the windows are evaluated in.
    #[serde(
        rename = "businessHoursTimezone",
        skip_serializing_if = "Option::is_none"
    )]
    pub business_hours_timezone: Option<String>,
    #[serde(rename = "businessHours", skip_serializing_if = "Option::is_none")]
    pub business_hours: Option<Vec<models::EnableVoiceOnNumberRequestBusinessHoursInner>>,
    /// E.164 numbers rejected before answer. Replaces the whole list; bare 10-digit values are normalized as US numbers.
    #[serde(rename = "blockedCallers", skip_serializing_if = "Option::is_none")]
    pub blocked_callers: Option<Vec<String>>,
    /// Caller ID on the forwarded leg: your number (`business`) or the original caller's (`caller`).
    #[serde(rename = "forwardCallerId", skip_serializing_if = "Option::is_none")]
    pub forward_caller_id: Option<ForwardCallerId>,
    /// IVR menu (supersedes the plain forward within business hours).
    #[serde(rename = "ivrEnabled", skip_serializing_if = "Option::is_none")]
    pub ivr_enabled: Option<bool>,
    #[serde(rename = "ivrPrompt", skip_serializing_if = "Option::is_none")]
    pub ivr_prompt: Option<String>,
    #[serde(rename = "ivrOptions", skip_serializing_if = "Option::is_none")]
    pub ivr_options: Option<Vec<models::EnableVoiceOnNumberRequestIvrOptionsInner>>,
}

impl EnableVoiceOnNumberRequest {
    pub fn new() -> EnableVoiceOnNumberRequest {
        EnableVoiceOnNumberRequest {
            forward_to: None,
            recording_enabled: None,
            transcription_enabled: None,
            transcription_language: None,
            voicemail_enabled: None,
            voicemail_greeting: None,
            business_hours_enabled: None,
            business_hours_timezone: None,
            business_hours: None,
            blocked_callers: None,
            forward_caller_id: None,
            ivr_enabled: None,
            ivr_prompt: None,
            ivr_options: None,
        }
    }
}
///
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum TranscriptionLanguage {
    #[serde(rename = "auto")]
    Auto,
    #[serde(rename = "en")]
    En,
    #[serde(rename = "es")]
    Es,
}

impl Default for TranscriptionLanguage {
    fn default() -> TranscriptionLanguage {
        Self::Auto
    }
}
/// Caller ID on the forwarded leg: your number (`business`) or the original caller's (`caller`).
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum ForwardCallerId {
    #[serde(rename = "business")]
    Business,
    #[serde(rename = "caller")]
    Caller,
}

impl Default for ForwardCallerId {
    fn default() -> ForwardCallerId {
        Self::Business
    }
}
