linkbreakers 1.137.1

Official Rust SDK for the Linkbreakers API
Documentation
/*
 * Linkbreakers API
 *
 * This is a documentation of all the APIs of Linkbreakers
 *
 * The version of the OpenAPI document: 1.137.1
 * 
 * Generated by: https://openapi-generator.tech
 */

use crate::models;
use serde::{Deserialize, Serialize};

/// SocketContract : SocketContract names every frame the socket carries.  Its fields are what put these messages in the generated clients: a websocket has no HTTP operation of its own, and a message no operation mentions is not emitted. The endpoint answers with the protocol version; the rest of this message is the schema both sides are generated from.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct SocketContract {
    #[serde(rename = "assistantError", skip_serializing_if = "Option::is_none")]
    pub assistant_error: Option<Box<models::SocketAssistantErrorMessage>>,
    #[serde(rename = "assistantProgress", skip_serializing_if = "Option::is_none")]
    pub assistant_progress: Option<Box<models::SocketAssistantProgressMessage>>,
    #[serde(rename = "assistantResponse", skip_serializing_if = "Option::is_none")]
    pub assistant_response: Option<Box<models::SocketAssistantResponseMessage>>,
    #[serde(rename = "assistantSend", skip_serializing_if = "Option::is_none")]
    pub assistant_send: Option<Box<models::SocketAssistantSendRequest>>,
    #[serde(rename = "connected", skip_serializing_if = "Option::is_none")]
    pub connected: Option<Box<models::SocketConnectedMessage>>,
    #[serde(rename = "event", skip_serializing_if = "Option::is_none")]
    pub event: Option<Box<models::SocketEventMessage>>,
    #[serde(rename = "ping", skip_serializing_if = "Option::is_none")]
    pub ping: Option<Box<models::SocketPingRequest>>,
    #[serde(rename = "pong", skip_serializing_if = "Option::is_none")]
    pub pong: Option<Box<models::SocketPongMessage>>,
    #[serde(rename = "protocolVersion", skip_serializing_if = "Option::is_none")]
    pub protocol_version: Option<String>,
    #[serde(rename = "subscribe", skip_serializing_if = "Option::is_none")]
    pub subscribe: Option<Box<models::SocketSubscribeRequest>>,
    #[serde(rename = "subscribeDenied", skip_serializing_if = "Option::is_none")]
    pub subscribe_denied: Option<Box<models::SocketSubscribeDeniedMessage>>,
    #[serde(rename = "subscribed", skip_serializing_if = "Option::is_none")]
    pub subscribed: Option<Box<models::SocketSubscribedMessage>>,
    #[serde(rename = "unsubscribe", skip_serializing_if = "Option::is_none")]
    pub unsubscribe: Option<Box<models::SocketUnsubscribeRequest>>,
}

impl SocketContract {
    /// SocketContract names every frame the socket carries.  Its fields are what put these messages in the generated clients: a websocket has no HTTP operation of its own, and a message no operation mentions is not emitted. The endpoint answers with the protocol version; the rest of this message is the schema both sides are generated from.
    pub fn new() -> SocketContract {
        SocketContract {
            assistant_error: None,
            assistant_progress: None,
            assistant_response: None,
            assistant_send: None,
            connected: None,
            event: None,
            ping: None,
            pong: None,
            protocol_version: None,
            subscribe: None,
            subscribe_denied: None,
            subscribed: None,
            unsubscribe: None,
        }
    }
}