rust_okx/ws/request/
trade.rs1use serde::Serialize;
4
5#[derive(Debug, Clone, PartialEq, Eq, Serialize)]
11#[serde(rename_all = "camelCase")]
12#[non_exhaustive]
13pub struct MassCancelRequest {
14 pub inst_type: String,
16 pub inst_family: String,
18 #[serde(skip_serializing_if = "Option::is_none")]
20 pub lock_interval: Option<String>,
21}
22
23impl MassCancelRequest {
24 pub fn option(inst_family: impl Into<String>) -> Self {
26 Self {
27 inst_type: "OPTION".to_owned(),
28 inst_family: inst_family.into(),
29 lock_interval: None,
30 }
31 }
32
33 pub fn lock_interval(mut self, lock_interval: impl Into<String>) -> Self {
35 self.lock_interval = Some(lock_interval.into());
36 self
37 }
38}