late 0.0.963

API reference for Zernio. Authenticate with a Bearer API key. Base URL: https://zernio.com/api Versioning and deprecation: all endpoints are versioned in the URL path (current version: /v1). Breaking changes only ship in a new path version; existing versions keep working. Deprecated operations are marked 'deprecated: true' in this spec and announced in the changelog (https://zernio.com/changelog) before removal. Errors: every 4xx/5xx response is application/json with a machine-readable 'code' and a human-readable 'error' message (see the ErrorResponse schema).
Documentation
/*
 * 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
    }
}