/*
* 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).
*
* 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 WebhookPayloadWhatsAppTemplateStatusUpdatedTemplate {
/// Meta's `message_template_id`, returned as a string.
#[serde(rename = "templateId")]
pub template_id: String,
/// Meta's `message_template_name`.
#[serde(rename = "name")]
pub name: String,
/// Meta's `message_template_language` (e.g. `en_US`).
#[serde(rename = "language")]
pub language: String,
/// New status. Forwarded verbatim from Meta's `event` field. `PENDING_DELETION` is the 24h-grace state after a delete request before the template is actually removed.
#[serde(rename = "status")]
pub status: Status,
/// Meta's free-form reason for the transition. `\"NONE\"` on approval; an explanation string on rejection.
#[serde(rename = "reason")]
pub reason: String,
}
impl WebhookPayloadWhatsAppTemplateStatusUpdatedTemplate {
pub fn new(
template_id: String,
name: String,
language: String,
status: Status,
reason: String,
) -> WebhookPayloadWhatsAppTemplateStatusUpdatedTemplate {
WebhookPayloadWhatsAppTemplateStatusUpdatedTemplate {
template_id,
name,
language,
status,
reason,
}
}
}
/// New status. Forwarded verbatim from Meta's `event` field. `PENDING_DELETION` is the 24h-grace state after a delete request before the template is actually removed.
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Status {
#[serde(rename = "APPROVED")]
Approved,
#[serde(rename = "REJECTED")]
Rejected,
#[serde(rename = "PENDING")]
Pending,
#[serde(rename = "PAUSED")]
Paused,
#[serde(rename = "DISABLED")]
Disabled,
#[serde(rename = "IN_APPEAL")]
InAppeal,
#[serde(rename = "PENDING_DELETION")]
PendingDeletion,
}
impl Default for Status {
fn default() -> Status {
Self::Approved
}
}