one-msg-sdk 2.0.2

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

/// InitiateCallResponse : Successful call action response from upstream, returned as-is. On empty upstream body, 1msg may return `{ \"result\": \"success\" }`. Upstream failures are often wrapped as HTTP 200 `{ \"response\": { \"error\": \"...\" } }`. 
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct InitiateCallResponse {
    #[serde(rename = "messaging_product", skip_serializing_if = "Option::is_none")]
    pub messaging_product: Option<String>,
    #[serde(rename = "success", skip_serializing_if = "Option::is_none")]
    pub success: Option<bool>,
    /// Present on outbound `connect` — contains the new call id
    #[serde(rename = "calls", skip_serializing_if = "Option::is_none")]
    pub calls: Option<Vec<models::InitiateCallResponseCallsInner>>,
    /// Legacy success marker when upstream returns an empty body
    #[serde(rename = "result", skip_serializing_if = "Option::is_none")]
    pub result: Option<String>,
    #[serde(rename = "response", skip_serializing_if = "Option::is_none")]
    pub response: Option<models::InitiateCallResponseResponse>,
}

impl InitiateCallResponse {
    /// Successful call action response from upstream, returned as-is. On empty upstream body, 1msg may return `{ \"result\": \"success\" }`. Upstream failures are often wrapped as HTTP 200 `{ \"response\": { \"error\": \"...\" } }`. 
    pub fn new() -> InitiateCallResponse {
        InitiateCallResponse {
            messaging_product: None,
            success: None,
            calls: None,
            result: None,
            response: None,
        }
    }
}