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

/// SendContactRequestContact : Simple contact card. Use this or `contacts`.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct SendContactRequestContact {
    #[serde(rename = "name")]
    pub name: Box<models::SendContactRequestContactName>,
    /// Contact phone in E.164 (`+79181976551`), not a timestamp
    #[serde(rename = "phone")]
    pub phone: String,
    #[serde(rename = "email", skip_serializing_if = "Option::is_none")]
    pub email: Option<String>,
    #[serde(rename = "org", skip_serializing_if = "Option::is_none")]
    pub org: Option<std::collections::HashMap<String, serde_json::Value>>,
    #[serde(rename = "url", skip_serializing_if = "Option::is_none")]
    pub url: Option<String>,
}

impl SendContactRequestContact {
    /// Simple contact card. Use this or `contacts`.
    pub fn new(name: models::SendContactRequestContactName, phone: String) -> SendContactRequestContact {
        SendContactRequestContact {
            name: Box::new(name),
            phone,
            email: None,
            org: None,
            url: None,
        }
    }
}