deriv_api_schema/exchange_rates_request.rs
1
2// Generated automatically by schema_generator.rs - DO NOT EDIT.
3// Source: ./deriv-api-docs/config/v3/exchange_rates/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
12
13/// Retrieves the exchange rate from a base currency to a target currency supported by the system.
14#[derive(Debug, Clone, Serialize, Deserialize)]
15#[serde(rename_all = "snake_case")]
16pub struct ExchangeRatesRequest {
17 /// Base currency (can be obtained from `payout_currencies` call)\n
18 // Correct serde attribute construction - Use helper
19
20 pub base_currency: String,
21 /// Must be `1`\n
22 // Correct serde attribute construction - Use helper
23
24 pub exchange_rates: i64,
25 /// [Optional] 1 - Request for ask and bid rates along with the spot rate. Only available if target_currency is provided.\n
26 // Correct serde attribute construction - Use helper
27 #[serde(skip_serializing_if = "Option::is_none")]
28 pub include_spread: Option<i64>,
29 /// [Optional] The login id of the user. Mandatory when multiple tokens were provided during authorize.\n
30 // Correct serde attribute construction - Use helper
31 #[serde(skip_serializing_if = "Option::is_none")]
32 pub loginid: Option<String>,
33 /// [Optional] Used to pass data through the websocket, which may be retrieved via the `echo_req` output field.\n
34 // Correct serde attribute construction - Use helper
35 #[serde(skip_serializing_if = "Option::is_none")]
36 pub passthrough: Option<Value>,
37 /// [Optional] Used to map request to response.\n
38 // Correct serde attribute construction - Use helper
39 #[serde(skip_serializing_if = "Option::is_none")]
40 pub req_id: Option<i64>,
41 /// [Optional] 1 - to initiate a realtime stream of exchange rates relative to base currency.\n
42 // Correct serde attribute construction - Use helper
43 #[serde(skip_serializing_if = "Option::is_none")]
44 pub subscribe: Option<i64>,
45 /// [Optional] Target currency for the exchange rate. If subscribe is set, target_currency must be specified as well.\n
46 // Correct serde attribute construction - Use helper
47 #[serde(skip_serializing_if = "Option::is_none")]
48 pub target_currency: Option<String>,
49}
50