/*
 * 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 CreateWhatsAppFlowRequest {
    /// WhatsApp social account ID
    #[serde(rename = "accountId")]
    pub account_id: String,
    /// Flow display name
    #[serde(rename = "name")]
    pub name: String,
    /// Flow categories
    #[serde(rename = "categories")]
    pub categories: Vec<Categories>,
    /// Optional: ID of an existing flow to clone the Flow JSON from
    #[serde(rename = "cloneFlowId", skip_serializing_if = "Option::is_none")]
    pub clone_flow_id: Option<String>,
    /// When cloning, true keeps the clone in cloneFlowId's version lineage (auto-numbered next version); false/absent creates an independent flow. Ignored without cloneFlowId.
    #[serde(rename = "asVersion", skip_serializing_if = "Option::is_none")]
    pub as_version: Option<bool>,
}

impl CreateWhatsAppFlowRequest {
    pub fn new(
        account_id: String,
        name: String,
        categories: Vec<Categories>,
    ) -> CreateWhatsAppFlowRequest {
        CreateWhatsAppFlowRequest {
            account_id,
            name,
            categories,
            clone_flow_id: None,
            as_version: None,
        }
    }
}
/// Flow categories
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Categories {
    #[serde(rename = "SIGN_UP")]
    SignUp,
    #[serde(rename = "SIGN_IN")]
    SignIn,
    #[serde(rename = "APPOINTMENT_BOOKING")]
    AppointmentBooking,
    #[serde(rename = "LEAD_GENERATION")]
    LeadGeneration,
    #[serde(rename = "CONTACT_US")]
    ContactUs,
    #[serde(rename = "CUSTOMER_SUPPORT")]
    CustomerSupport,
    #[serde(rename = "SURVEY")]
    Survey,
    #[serde(rename = "OTHER")]
    Other,
}

impl Default for Categories {
    fn default() -> Categories {
        Self::SignUp
    }
}
