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};

/// SendFileRequest : Send file by URL/base64 or by mediaId
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct SendFileRequest {
    /// File source (required unless mediaId is set): - HTTP/HTTPS URL - Base64 data URI 
    #[serde(rename = "body", skip_serializing_if = "Option::is_none")]
    pub body: Option<String>,
    /// File name with extension (required with body, not with mediaId)
    #[serde(rename = "filename", skip_serializing_if = "Option::is_none")]
    pub filename: Option<String>,
    /// WABA media id from uploadMedia (alternative to body)
    #[serde(rename = "mediaId", skip_serializing_if = "Option::is_none")]
    pub media_id: Option<String>,
    /// Required when using mediaId
    #[serde(rename = "mediaType", skip_serializing_if = "Option::is_none")]
    pub media_type: Option<MediaType>,
    /// Native WhatsApp voice note (audio/ogg only)
    #[serde(rename = "voice", skip_serializing_if = "Option::is_none")]
    pub voice: Option<bool>,
    #[serde(rename = "caption", skip_serializing_if = "Option::is_none")]
    pub caption: 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 SendFileRequest {
    /// Send file by URL/base64 or by mediaId
    pub fn new() -> SendFileRequest {
        SendFileRequest {
            body: None,
            filename: None,
            media_id: None,
            media_type: None,
            voice: None,
            caption: None,
            quoted_msg_id: None,
            chat_id: None,
            phone: None,
        }
    }
}
/// Required when using mediaId
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum MediaType {
    #[serde(rename = "image")]
    Image,
    #[serde(rename = "video")]
    Video,
    #[serde(rename = "audio")]
    Audio,
    #[serde(rename = "document")]
    Document,
}

impl Default for MediaType {
    fn default() -> MediaType {
        Self::Image
    }
}