/*
* 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.226.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 CreateBroadcastRequestMessage {
/// Required on every platform except WhatsApp (which sends `template`) and an SMS broadcast that carries attachments.
#[serde(rename = "text", skip_serializing_if = "Option::is_none")]
pub text: Option<String>,
/// SMS only: sent as MMS media, one media_url per attachment. Each url must be public http(s); JPEG, PNG, GIF, WEBP, MP4 or 3GPP under 1 MB (checked at create when the host answers a HEAD request; Telnyx enforces the 1 MB total per message at send).
#[serde(rename = "attachments", skip_serializing_if = "Option::is_none")]
pub attachments: Option<Vec<models::CreateBroadcastRequestMessageAttachmentsInner>>,
/// Instagram and Facebook only. Meta message tag sent with every recipient message (messaging_type MESSAGE_TAG) so the broadcast can reach people outside the 24h window. Instagram accepts HUMAN_AGENT only. Rejected with a 400 on any other platform.
#[serde(rename = "messageTag", skip_serializing_if = "Option::is_none")]
pub message_tag: Option<MessageTag>,
}
impl CreateBroadcastRequestMessage {
pub fn new() -> CreateBroadcastRequestMessage {
CreateBroadcastRequestMessage {
text: None,
attachments: None,
message_tag: None,
}
}
}
/// Instagram and Facebook only. Meta message tag sent with every recipient message (messaging_type MESSAGE_TAG) so the broadcast can reach people outside the 24h window. Instagram accepts HUMAN_AGENT only. Rejected with a 400 on any other platform.
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum MessageTag {
#[serde(rename = "CONFIRMED_EVENT_UPDATE")]
ConfirmedEventUpdate,
#[serde(rename = "POST_PURCHASE_UPDATE")]
PostPurchaseUpdate,
#[serde(rename = "ACCOUNT_UPDATE")]
AccountUpdate,
#[serde(rename = "HUMAN_AGENT")]
HumanAgent,
}
impl Default for MessageTag {
fn default() -> MessageTag {
Self::ConfirmedEventUpdate
}
}