deriv_api_schema/
authorize_request.rs

1
2// Generated automatically by schema_generator.rs - DO NOT EDIT.
3// Source: ./deriv-api-docs/config/v3/authorize/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::add_to_login_history::AddToLoginHistory;
13
14/// Authorize current WebSocket session to act on behalf of the owner of a given token. Must precede requests that need to access client account, for example purchasing and selling contracts or viewing portfolio.
15#[derive(Debug, Clone, Serialize, Deserialize)]
16#[serde(rename_all = "snake_case")]
17pub struct AuthorizeRequest {
18    /// [Optional] Send this when you use api tokens for authorization and want to track activity using `login_history` call.\n
19    // Correct serde attribute construction - Use helper
20    #[serde(skip_serializing_if = "Option::is_none")] 
21    pub add_to_login_history: Option<AddToLoginHistory>,
22    /// Authentication token. May be retrieved from https://www.binary.com/en/user/security/api_tokenws.html. Set to MULTI when using multiple tokens.\n
23    // Correct serde attribute construction - Use helper
24    
25    pub authorize: String,
26    /// [Optional] Used to pass data through the websocket, which may be retrieved via the `echo_req` output field.\n
27    // Correct serde attribute construction - Use helper
28    #[serde(skip_serializing_if = "Option::is_none")] 
29    pub passthrough: Option<Value>,
30    /// [Optional] Used to map request to response.\n
31    // Correct serde attribute construction - Use helper
32    #[serde(skip_serializing_if = "Option::is_none")] 
33    pub req_id: Option<i64>,
34    /// Additional Authentication tokens of authorized user that may be used in this session. Upto 25 tokens.\n
35    // Correct serde attribute construction - Use helper
36    #[serde(skip_serializing_if = "Option::is_none")] 
37    pub tokens: Option<Vec<String>>,
38}
39