openai_types/websocket/_gen.rs
1// AUTO-GENERATED by py2rust — do not edit.
2// Re-generate: python3 scripts/py2rust.py sync <python_dir> <rust_dir>
3// Domain: websocket
4
5use serde::{Deserialize, Serialize};
6
7/// WebSocket connection options copied from `websockets`.
8#[derive(Debug, Clone, Serialize, Deserialize)]
9#[cfg_attr(feature = "structured", derive(schemars::JsonSchema))]
10pub struct WebSocketConnectionOptions {
11 /// List of supported extensions, in order in which they should be negotiated and run.
12 #[serde(skip_serializing_if = "Option::is_none", default)]
13 pub extensions: Option<Vec<serde_json::Value>>,
14 /// List of supported subprotocols, in order of decreasing preference.
15 #[serde(skip_serializing_if = "Option::is_none", default)]
16 pub subprotocols: Option<Vec<serde_json::Value>>,
17 /// 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.
18 #[serde(skip_serializing_if = "Option::is_none", default)]
19 pub compression: Option<String>,
20 /// Maximum size of incoming messages in bytes. None disables the limit.
21 #[serde(skip_serializing_if = "Option::is_none", default)]
22 pub max_size: Option<i64>,
23 /// 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.
24 #[serde(skip_serializing_if = "Option::is_none", default)]
25 pub max_queue: Option<serde_json::Value>,
26 /// 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.
27 #[serde(skip_serializing_if = "Option::is_none", default)]
28 pub write_limit: Option<serde_json::Value>,
29}
30
31pub type WebsocketConnectionOptions = WebSocketConnectionOptions;