linkbreakers 1.127.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.127.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 = "agentError", skip_serializing_if = "Option::is_none")]
    pub agent_error: Option<Box<models::SocketAgentErrorMessage>>,
    #[serde(rename = "agentProgress", skip_serializing_if = "Option::is_none")]
    pub agent_progress: Option<Box<models::SocketAgentProgressMessage>>,
    #[serde(rename = "agentResponse", skip_serializing_if = "Option::is_none")]
    pub agent_response: Option<Box<models::SocketAgentResponseMessage>>,
    #[serde(rename = "agentSend", skip_serializing_if = "Option::is_none")]
    pub agent_send: Option<Box<models::SocketAgentSendRequest>>,
    #[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 {
            agent_error: None,
            agent_progress: None,
            agent_response: None,
            agent_send: None,
            connected: None,
            event: None,
            ping: None,
            pong: None,
            protocol_version: None,
            subscribe: None,
            subscribe_denied: None,
            subscribed: None,
            unsubscribe: None,
        }
    }
}