Skip to main content

rust_okx/api/status/
responses.rs

1use serde::Deserialize;
2
3use crate::model::NumberString;
4
5/// A single system-maintenance record returned by
6/// [`get_status`](crate::api::status::Status::get_status).
7///
8/// OKX docs: <https://www.okx.com/docs-v5/en/#rest-api-status-get-system-status>
9#[derive(Debug, Clone, Default, Deserialize)]
10#[serde(rename_all = "camelCase")]
11#[non_exhaustive]
12pub struct StatusItem {
13    /// Title of the system maintenance event.
14    #[serde(default)]
15    pub title: String,
16    /// Current maintenance state.
17    ///
18    /// Documented values: `scheduled`, `ongoing`, `pre_open`, `completed`, `canceled`.
19    #[serde(default)]
20    pub state: String,
21    /// Maintenance start time (Unix milliseconds).
22    #[serde(default)]
23    pub begin: NumberString,
24    /// Maintenance end time (Unix milliseconds).
25    ///
26    /// Expected end time before `completed`; actual end time after `completed`.
27    #[serde(default)]
28    pub end: NumberString,
29    /// Pre-open phase start time (Unix milliseconds).
30    ///
31    /// Empty string when the event has no pre-open phase.
32    #[serde(default)]
33    pub pre_open_begin: NumberString,
34    /// URL for system maintenance details. Empty string when not provided.
35    #[serde(default)]
36    pub href: String,
37    /// Affected service type.
38    ///
39    /// Documented values: `0` WebSocket; `5` Trading service; `6` Block trading;
40    /// `7` Trading bot; `8` Trading service (in batches of accounts);
41    /// `9` Trading service (in batches of products); `10` Spread trading;
42    /// `11` Copy trading; `99` Others.
43    #[serde(default)]
44    pub service_type: String,
45    /// System affected by the maintenance. Documented values: `unified` Trading account.
46    #[serde(default)]
47    pub system: String,
48    /// Rescheduled description.
49    #[serde(default)]
50    pub sche_desc: String,
51    /// Maintenance type.
52    ///
53    /// Documented values: `1` Scheduled maintenance; `2` Unscheduled maintenance;
54    /// `3` System disruption.
55    #[serde(default)]
56    pub maint_type: String,
57    /// Environment: `1` Production Trading; `2` Demo Trading.
58    #[serde(default)]
59    pub env: String,
60}