/*
 * 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.1
 * 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 BulkUpdateWhatsAppContactsRequest {
    /// Bulk action to perform
    #[serde(rename = "action")]
    pub action: Action,
    /// Contact IDs to update (max 500)
    #[serde(rename = "contactIds")]
    pub contact_ids: Vec<String>,
    /// Tags to add or remove (required for addTags/removeTags)
    #[serde(rename = "tags", skip_serializing_if = "Option::is_none")]
    pub tags: Option<Vec<String>>,
    /// Groups to add or remove (required for addGroups/removeGroups)
    #[serde(rename = "groups", skip_serializing_if = "Option::is_none")]
    pub groups: Option<Vec<String>>,
}

impl BulkUpdateWhatsAppContactsRequest {
    pub fn new(action: Action, contact_ids: Vec<String>) -> BulkUpdateWhatsAppContactsRequest {
        BulkUpdateWhatsAppContactsRequest {
            action,
            contact_ids,
            tags: None,
            groups: None,
        }
    }
}
/// Bulk action to perform
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Action {
    #[serde(rename = "addTags")]
    AddTags,
    #[serde(rename = "removeTags")]
    RemoveTags,
    #[serde(rename = "addGroups")]
    AddGroups,
    #[serde(rename = "removeGroups")]
    RemoveGroups,
    #[serde(rename = "optIn")]
    OptIn,
    #[serde(rename = "optOut")]
    OptOut,
    #[serde(rename = "block")]
    Block,
    #[serde(rename = "unblock")]
    Unblock,
}

impl Default for Action {
    fn default() -> Action {
        Self::AddTags
    }
}
