/*
* Zernio API
*
* 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). Request ids: responses carry an X-Request-Id header with the id we log the request under. Quote it when reporting a problem. A valid x-request-id you send is reused as that id.
*
* The version of the OpenAPI document: 1.199.0
* 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 WebhookPayloadWhatsAppAccountStatusUpdatedStatus {
/// `active` only on a reinstatement (DISABLED_UPDATE with ban state REINSTATE).
#[serde(rename = "status")]
pub status: Status,
/// Meta `account_update` event: ACCOUNT_RESTRICTION, ACCOUNT_VIOLATION, ACCOUNT_DELETED or DISABLED_UPDATE.
#[serde(rename = "metaEvent")]
pub meta_event: String,
/// Human-readable summary. Null on reinstatement.
#[serde(rename = "reason", deserialize_with = "Option::deserialize")]
pub reason: Option<String>,
/// ACCOUNT_VIOLATION only, for example SCAM, ADULT.
#[serde(rename = "violationType", deserialize_with = "Option::deserialize")]
pub violation_type: Option<String>,
/// ACCOUNT_RESTRICTION only. Empty otherwise.
#[serde(rename = "restrictions")]
pub restrictions:
Vec<models::WebhookPayloadWhatsAppAccountStatusUpdatedStatusRestrictionsInner>,
/// DISABLED_UPDATE only (for example DISABLE, REINSTATE).
#[serde(rename = "banState", deserialize_with = "Option::deserialize")]
pub ban_state: Option<String>,
/// DISABLED_UPDATE only, as Meta sent it (for example \"September 23, 2026\").
#[serde(rename = "banDate", deserialize_with = "Option::deserialize")]
pub ban_date: Option<String>,
}
impl WebhookPayloadWhatsAppAccountStatusUpdatedStatus {
pub fn new(
status: Status,
meta_event: String,
reason: Option<String>,
violation_type: Option<String>,
restrictions: Vec<
models::WebhookPayloadWhatsAppAccountStatusUpdatedStatusRestrictionsInner,
>,
ban_state: Option<String>,
ban_date: Option<String>,
) -> WebhookPayloadWhatsAppAccountStatusUpdatedStatus {
WebhookPayloadWhatsAppAccountStatusUpdatedStatus {
status,
meta_event,
reason,
violation_type,
restrictions,
ban_state,
ban_date,
}
}
}
/// `active` only on a reinstatement (DISABLED_UPDATE with ban state REINSTATE).
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Status {
#[serde(rename = "restricted")]
Restricted,
#[serde(rename = "active")]
Active,
}
impl Default for Status {
fn default() -> Status {
Self::Restricted
}
}