deriv_api_schema/balance_request.rs
1
2// Generated automatically by schema_generator.rs - DO NOT EDIT.
3// Source: ./deriv-api-docs/config/v3/balance/send.json
4
5// Use direct crate names for imports
6use serde::{Deserialize, Serialize};
7use serde_json::Value;
8
9
10
11// Import required types from the *same* crate
12use crate::subscribe::Subscribe;
13
14/// Get user account balance
15#[derive(Debug, Clone, Serialize, Deserialize)]
16#[serde(rename_all = "snake_case")]
17pub struct BalanceRequest {
18 /// [Optional] If set to `all`, return the balances of all accounts one by one; if set to `current`, return the balance of current account; if set as an account id, return the balance of that account.\n
19 // Correct serde attribute construction - Use helper
20 #[serde(skip_serializing_if = "Option::is_none")]
21 pub account: Option<String>,
22 /// Must be `1`\n
23 // Correct serde attribute construction - Use helper
24
25 pub balance: i64,
26 /// [Optional] The login id of the user. Mandatory when multiple tokens were provided during authorize.\n
27 // Correct serde attribute construction - Use helper
28 #[serde(skip_serializing_if = "Option::is_none")]
29 pub loginid: Option<String>,
30 /// [Optional] Used to pass data through the websocket, which may be retrieved via the `echo_req` output field.\n
31 // Correct serde attribute construction - Use helper
32 #[serde(skip_serializing_if = "Option::is_none")]
33 pub passthrough: Option<Value>,
34 /// [Optional] Used to map request to response.\n
35 // Correct serde attribute construction - Use helper
36 #[serde(skip_serializing_if = "Option::is_none")]
37 pub req_id: Option<i64>,
38 /// [Optional] If set to 1, will send updates whenever the balance changes.\n
39 // Correct serde attribute construction - Use helper
40 #[serde(skip_serializing_if = "Option::is_none")]
41 pub subscribe: Option<Subscribe>,
42}
43