one-msg-sdk 2.0.3

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:** Pass the channel token in **one** place. The API checks JSON body (`token`), then query string (`?token=`), then `Authorization: Bearer` header (preferred in production).  **Documentation:** https://help.1msg.io/platform-1msg/getting-start/quick-start **API Docs:** https://docs.1msg.io/ 
 *
 * The version of the OpenAPI document: 2.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 CreateFlowsRequest {
    /// Flow name
    #[serde(rename = "name")]
    pub name: String,
    /// One or more Flow categories
    #[serde(rename = "categories")]
    pub categories: Vec<Categories>,
    /// HTTPS endpoint for the Flow data channel
    #[serde(rename = "endpointUri", skip_serializing_if = "Option::is_none")]
    pub endpoint_uri: Option<String>,
    /// Publish immediately after create
    #[serde(rename = "publish", skip_serializing_if = "Option::is_none")]
    pub publish: Option<bool>,
    /// Optional Flow JSON document
    #[serde(rename = "flowJson", skip_serializing_if = "Option::is_none")]
    pub flow_json: Option<std::collections::HashMap<String, serde_json::Value>>,
}

impl CreateFlowsRequest {
    pub fn new(name: String, categories: Vec<Categories>) -> CreateFlowsRequest {
        CreateFlowsRequest {
            name,
            categories,
            endpoint_uri: None,
            publish: None,
            flow_json: None,
        }
    }
}
/// One or more 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
    }
}