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

/// InitiateCallRequestSession : WebRTC SDP session (required for connect / pre_accept / accept)
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct InitiateCallRequestSession {
    /// offer for outbound connect; answer for pre_accept/accept
    #[serde(rename = "sdp_type")]
    pub sdp_type: SdpType,
    /// Full SDP (RFC 8866). Replace placeholders with SDP from your WebRTC stack. Must negotiate ICE, DTLS-SRTP, and OPUS for WhatsApp media. 
    #[serde(rename = "sdp")]
    pub sdp: String,
}

impl InitiateCallRequestSession {
    /// WebRTC SDP session (required for connect / pre_accept / accept)
    pub fn new(sdp_type: SdpType, sdp: String) -> InitiateCallRequestSession {
        InitiateCallRequestSession {
            sdp_type,
            sdp,
        }
    }
}
/// offer for outbound connect; answer for pre_accept/accept
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum SdpType {
    #[serde(rename = "offer")]
    Offer,
    #[serde(rename = "answer")]
    Answer,
}

impl Default for SdpType {
    fn default() -> SdpType {
        Self::Offer
    }
}