/*
 * 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 CreateWhatsAppGroupChatRequest {
    /// WhatsApp social account ID
    #[serde(rename = "accountId")]
    pub account_id: String,
    /// Group name (max 128 characters)
    #[serde(rename = "subject")]
    pub subject: String,
    /// Group description (max 2048 characters)
    #[serde(rename = "description", skip_serializing_if = "Option::is_none")]
    pub description: Option<String>,
    /// Whether users need approval to join via invite link
    #[serde(rename = "joinApprovalMode", skip_serializing_if = "Option::is_none")]
    pub join_approval_mode: Option<JoinApprovalMode>,
}

impl CreateWhatsAppGroupChatRequest {
    pub fn new(account_id: String, subject: String) -> CreateWhatsAppGroupChatRequest {
        CreateWhatsAppGroupChatRequest {
            account_id,
            subject,
            description: None,
            join_approval_mode: None,
        }
    }
}
/// Whether users need approval to join via invite link
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum JoinApprovalMode {
    #[serde(rename = "approval_required")]
    ApprovalRequired,
    #[serde(rename = "auto_approve")]
    AutoApprove,
}

impl Default for JoinApprovalMode {
    fn default() -> JoinApprovalMode {
        Self::ApprovalRequired
    }
}
