/*
 * 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 CreateVoiceCallRequest {
    /// Destination to dial, E.164 with leading +.
    #[serde(rename = "to")]
    pub to: String,
    /// Which of your voice-enabled numbers to dial from. Optional when you have exactly one.
    #[serde(rename = "fromNumber", skip_serializing_if = "Option::is_none")]
    pub from_number: Option<String>,
    /// Per-call agent override (tel:+E164, sip:..., or wss://...); defaults to the number's stored forward destination.
    #[serde(rename = "forwardTo", skip_serializing_if = "Option::is_none")]
    pub forward_to: Option<String>,
    /// Spoken to the callee when they answer, before the bridge.
    #[serde(rename = "greeting", skip_serializing_if = "Option::is_none")]
    pub greeting: Option<String>,
    /// Per-call recording toggle; defaults to the number's setting.
    #[serde(rename = "recordOverride", skip_serializing_if = "Option::is_none")]
    pub record_override: Option<bool>,
    /// Per-call transcription toggle; defaults to the number's setting.
    #[serde(rename = "transcribeOverride", skip_serializing_if = "Option::is_none")]
    pub transcribe_override: Option<bool>,
    /// 'auto' derives from the callee's country; 'en'/'es' force it.
    #[serde(
        rename = "transcriptionLanguage",
        skip_serializing_if = "Option::is_none"
    )]
    pub transcription_language: Option<TranscriptionLanguage>,
    /// A retry with the same key returns the original call instead of dialing again.
    #[serde(rename = "idempotencyKey", skip_serializing_if = "Option::is_none")]
    pub idempotency_key: Option<String>,
    /// Answering-machine detection; defers the bridge until human vs machine is known.
    #[serde(rename = "amd", skip_serializing_if = "Option::is_none")]
    pub amd: Option<bool>,
    /// Spoken to a detected machine, then hang up (implies `amd`). For outbound voicemail drops.
    #[serde(
        rename = "voicemailDropMessage",
        skip_serializing_if = "Option::is_none"
    )]
    pub voicemail_drop_message: Option<String>,
}

impl CreateVoiceCallRequest {
    pub fn new(to: String) -> CreateVoiceCallRequest {
        CreateVoiceCallRequest {
            to,
            from_number: None,
            forward_to: None,
            greeting: None,
            record_override: None,
            transcribe_override: None,
            transcription_language: None,
            idempotency_key: None,
            amd: None,
            voicemail_drop_message: None,
        }
    }
}
/// 'auto' derives from the callee's country; 'en'/'es' force it.
#[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
    }
}
