one-msg-sdk 2.0.1

Official Rust SDK for the 1msg WhatsApp Business API
/*
 * 1MSG WhatsApp Business API (Public)
 *
 * Public client API for sending messages, managing groups, flows, and templates.  This is the API exposed to end customers via platform.1msg.io  **Authentication:** All requests require `token` query parameter with JWT or API key.  **Documentation:** https://help.1msg.io/platform-1msg/getting-start/quick-start **API Docs:** https://docs.1msg.io/ 
 *
 * The version of the OpenAPI document: 1.0.0
 * Contact: support@1msg.io
 * Generated by: https://openapi-generator.tech
 */

use crate::models;
use serde::{Deserialize, Serialize};

#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct SendFlowRequest1 {
    #[serde(rename = "body")]
    pub body: String,
    #[serde(rename = "header", skip_serializing_if = "Option::is_none")]
    pub header: Option<Box<models::SendFlowRequest1Header>>,
    #[serde(rename = "footer", skip_serializing_if = "Option::is_none")]
    pub footer: Option<String>,
    #[serde(rename = "flowId")]
    pub flow_id: String,
    #[serde(rename = "flowToken")]
    pub flow_token: String,
    #[serde(rename = "flowCta")]
    pub flow_cta: String,
    #[serde(rename = "flowAction", skip_serializing_if = "Option::is_none")]
    pub flow_action: Option<FlowAction>,
    #[serde(rename = "flowActionPayload", skip_serializing_if = "Option::is_none")]
    pub flow_action_payload: Option<serde_json::Value>,
    #[serde(rename = "flowMessageVersion", skip_serializing_if = "Option::is_none")]
    pub flow_message_version: Option<String>,
    #[serde(rename = "mode", skip_serializing_if = "Option::is_none")]
    pub mode: Option<Mode>,
    #[serde(rename = "flowActionData", skip_serializing_if = "Option::is_none")]
    pub flow_action_data: Option<serde_json::Value>,
    #[serde(rename = "flowActionScreen", skip_serializing_if = "Option::is_none")]
    pub flow_action_screen: Option<String>,
    #[serde(rename = "quotedMsgId", skip_serializing_if = "Option::is_none")]
    pub quoted_msg_id: Option<String>,
    #[serde(rename = "chatId", skip_serializing_if = "Option::is_none")]
    pub chat_id: Option<String>,
    #[serde(rename = "phone", skip_serializing_if = "Option::is_none")]
    pub phone: Option<i32>,
}

impl SendFlowRequest1 {
    pub fn new(body: String, flow_id: String, flow_token: String, flow_cta: String) -> SendFlowRequest1 {
        SendFlowRequest1 {
            body,
            header: None,
            footer: None,
            flow_id,
            flow_token,
            flow_cta,
            flow_action: None,
            flow_action_payload: None,
            flow_message_version: None,
            mode: None,
            flow_action_data: None,
            flow_action_screen: None,
            quoted_msg_id: None,
            chat_id: None,
            phone: None,
        }
    }
}
/// 
#[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
    }
}
/// 
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Mode {
    #[serde(rename = "draft")]
    Draft,
    #[serde(rename = "published")]
    Published,
}

impl Default for Mode {
    fn default() -> Mode {
        Self::Draft
    }
}