/*
* 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.24.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 SendWhatsAppFlowMessageRequest {
/// WhatsApp account ID
#[serde(rename = "accountId")]
pub account_id: String,
/// Recipient phone number (E.164 format, e.g. +1234567890)
#[serde(rename = "to")]
pub to: String,
/// Published flow ID
#[serde(rename = "flow_id")]
pub flow_id: String,
/// CTA button text (e.g. 'Book Now', 'Sign Up')
#[serde(rename = "flow_cta")]
pub flow_cta: String,
/// Action type: navigate opens a screen directly, data_exchange hits your endpoint first
#[serde(rename = "flow_action", skip_serializing_if = "Option::is_none")]
pub flow_action: Option<FlowAction>,
/// Unique token to correlate responses. If omitted, auto-generated as '<flowId>:<uuid>' so the response can be attributed to this flow in the Flow Responses view.
#[serde(rename = "flow_token", skip_serializing_if = "Option::is_none")]
pub flow_token: Option<String>,
#[serde(
rename = "flow_action_payload",
skip_serializing_if = "Option::is_none"
)]
pub flow_action_payload: Option<Box<models::SendWhatsAppFlowMessageRequestFlowActionPayload>>,
/// Message body text
#[serde(rename = "body")]
pub body: String,
#[serde(rename = "header", skip_serializing_if = "Option::is_none")]
pub header: Option<Box<models::SendWhatsAppFlowMessageRequestHeader>>,
/// Optional footer text
#[serde(rename = "footer", skip_serializing_if = "Option::is_none")]
pub footer: Option<String>,
/// Set true to test an unpublished (DRAFT) flow
#[serde(rename = "draft", skip_serializing_if = "Option::is_none")]
pub draft: Option<bool>,
}
impl SendWhatsAppFlowMessageRequest {
pub fn new(
account_id: String,
to: String,
flow_id: String,
flow_cta: String,
body: String,
) -> SendWhatsAppFlowMessageRequest {
SendWhatsAppFlowMessageRequest {
account_id,
to,
flow_id,
flow_cta,
flow_action: None,
flow_token: None,
flow_action_payload: None,
body,
header: None,
footer: None,
draft: None,
}
}
}
/// Action type: navigate opens a screen directly, data_exchange hits your endpoint first
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum FlowAction {
#[serde(rename = "navigate")]
Navigate,
#[serde(rename = "data_exchange")]
DataExchange,
}
impl Default for FlowAction {
fn default() -> FlowAction {
Self::Navigate
}
}