/*
* 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 CreateWhatsAppFlowRequest {
/// WhatsApp social account ID
#[serde(rename = "accountId")]
pub account_id: String,
/// Flow display name
#[serde(rename = "name")]
pub name: String,
/// Flow categories
#[serde(rename = "categories")]
pub categories: Vec<Categories>,
/// Optional: ID of an existing flow to clone the Flow JSON from
#[serde(rename = "cloneFlowId", skip_serializing_if = "Option::is_none")]
pub clone_flow_id: Option<String>,
/// When cloning, true keeps the clone in cloneFlowId's version lineage (auto-numbered next version); false/absent creates an independent flow. Ignored without cloneFlowId.
#[serde(rename = "asVersion", skip_serializing_if = "Option::is_none")]
pub as_version: Option<bool>,
/// HTTPS-only data exchange endpoint for the flow. Settable only while the flow is in DRAFT, and the flow's uploaded Flow JSON must declare data_api_version \"3.0\" for the endpoint to be used.
#[serde(rename = "endpointUri", skip_serializing_if = "Option::is_none")]
pub endpoint_uri: Option<String>,
}
impl CreateWhatsAppFlowRequest {
pub fn new(
account_id: String,
name: String,
categories: Vec<Categories>,
) -> CreateWhatsAppFlowRequest {
CreateWhatsAppFlowRequest {
account_id,
name,
categories,
clone_flow_id: None,
as_version: None,
endpoint_uri: None,
}
}
}
/// Flow categories
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Categories {
#[serde(rename = "SIGN_UP")]
SignUp,
#[serde(rename = "SIGN_IN")]
SignIn,
#[serde(rename = "APPOINTMENT_BOOKING")]
AppointmentBooking,
#[serde(rename = "LEAD_GENERATION")]
LeadGeneration,
#[serde(rename = "CONTACT_US")]
ContactUs,
#[serde(rename = "CUSTOMER_SUPPORT")]
CustomerSupport,
#[serde(rename = "SURVEY")]
Survey,
#[serde(rename = "OTHER")]
Other,
}
impl Default for Categories {
fn default() -> Categories {
Self::SignUp
}
}