deriv_api_schema/
balance_response.rs

1
2// Generated automatically by schema_generator.rs - DO NOT EDIT.
3// Source: ./deriv-api-docs/config/v3/balance/receive.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::subscription::Subscription;
13use crate::balance::Balance;
14
15/// Return details of user account balance
16#[derive(Debug, Clone, Serialize, Deserialize)]
17#[serde(rename_all = "snake_case")]
18pub struct BalanceResponse {
19    /// Current balance of one or more accounts.\n
20    // Correct serde attribute construction - Use helper
21    #[serde(skip_serializing_if = "Option::is_none")] 
22    pub balance: Option<Balance>,
23    /// Echo of the request made.\n
24    // Correct serde attribute construction - Use helper
25    
26    pub echo_req: Value,
27    /// Action name of the request made.\n
28    // Correct serde attribute construction - Use helper
29    
30    pub msg_type: String,
31    /// Optional field sent in request to map to response, present only when request contains `req_id`.\n
32    // Correct serde attribute construction - Use helper
33    #[serde(skip_serializing_if = "Option::is_none")] 
34    pub req_id: Option<i64>,
35    /// For subscription requests only.\n
36    // Correct serde attribute construction - Use helper
37    #[serde(skip_serializing_if = "Option::is_none")] 
38    pub subscription: Option<Subscription>,
39}
40