openai-types 0.1.3

Typed OpenAI API models — zero dependencies beyond serde
Documentation
// AUTO-GENERATED by py2rust — do not edit.
// Re-generate: python3 scripts/py2rust.py sync <python_dir> <rust_dir>
// Domain: websocket

use serde::{Deserialize, Serialize};

/// WebSocket connection options copied from `websockets`.
#[derive(Debug, Clone, Serialize, Deserialize)]
#[cfg_attr(feature = "structured", derive(schemars::JsonSchema))]
pub struct WebSocketConnectionOptions {
    /// List of supported extensions, in order in which they should be negotiated and run.
    #[serde(skip_serializing_if = "Option::is_none", default)]
    pub extensions: Option<Vec<serde_json::Value>>,
    /// List of supported subprotocols, in order of decreasing preference.
    #[serde(skip_serializing_if = "Option::is_none", default)]
    pub subprotocols: Option<Vec<serde_json::Value>>,
    /// The “permessage-deflate” extension is enabled by default. Set compression to None to disable it. See the [compression guide](https://websockets.readthedocs.io/en/stable/topics/compression.html) for details.
    #[serde(skip_serializing_if = "Option::is_none", default)]
    pub compression: Option<String>,
    /// Maximum size of incoming messages in bytes. None disables the limit.
    #[serde(skip_serializing_if = "Option::is_none", default)]
    pub max_size: Option<i64>,
    /// High-water mark of the buffer where frames are received. It defaults to 16 frames. The low-water mark defaults to max_queue // 4. You may pass a (high, low) tuple to set the high-water and low-water marks. If you want to disable flow control entirely, you may set it to None, although that’s a bad idea.
    #[serde(skip_serializing_if = "Option::is_none", default)]
    pub max_queue: Option<serde_json::Value>,
    /// High-water mark of write buffer in bytes. It is passed to set_write_buffer_limits(). It defaults to 32 KiB. You may pass a (high, low) tuple to set the high-water and low-water marks.
    #[serde(skip_serializing_if = "Option::is_none", default)]
    pub write_limit: Option<serde_json::Value>,
}

pub type WebsocketConnectionOptions = WebSocketConnectionOptions;