ig_client/session/
response.rs

1/// Response structure for session-related API calls
2#[derive(serde::Deserialize)]
3pub struct SessionResp {
4    /// Account ID associated with the session
5    #[serde(alias = "accountId")]
6    #[serde(alias = "currentAccountId")]
7    pub account_id: String,
8
9    /// Client ID provided by the API
10    #[serde(alias = "clientId")]
11    pub client_id: Option<String>,
12    /// Timezone offset in hours
13    #[serde(alias = "timezoneOffset")]
14    pub timezone_offset: Option<i32>,
15}
16
17/// Request model for switching the active account
18#[derive(serde::Serialize)]
19pub struct AccountSwitchRequest {
20    /// The identifier of the account being switched to
21    #[serde(rename = "accountId")]
22    pub account_id: String,
23    /// True if the specified account is to be set as the new default account
24    #[serde(rename = "defaultAccount")]
25    pub default_account: Option<bool>,
26}
27
28/// Response model for account switch operation
29#[derive(serde::Deserialize, Debug)]
30pub struct AccountSwitchResponse {
31    /// Whether dealing is enabled for the account
32    #[serde(rename = "dealingEnabled")]
33    pub dealing_enabled: Option<bool>,
34    /// Whether the user has active demo accounts
35    #[serde(rename = "hasActiveDemoAccounts")]
36    pub has_active_demo_accounts: Option<bool>,
37    /// Whether the user has active live accounts
38    #[serde(rename = "hasActiveLiveAccounts")]
39    pub has_active_live_accounts: Option<bool>,
40    /// Whether trailing stops are enabled for the account
41    #[serde(rename = "trailingStopsEnabled")]
42    pub trailing_stops_enabled: Option<bool>,
43}