deriv_api_schema/
mt5_new_account_request.rs

1
2// Generated automatically by schema_generator.rs - DO NOT EDIT.
3// Source: ./deriv-api-docs/config/v3/mt5_new_account/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::mt5_account_type::Mt5AccountType;
13use crate::sub_account_category::SubAccountCategory;
14use crate::product::Product;
15use crate::mt5_account_category::Mt5AccountCategory;
16use crate::sub_account_type::SubAccountType;
17use crate::account_type::AccountType;
18use crate::dry_run::DryRun;
19
20/// This call creates new MT5 user, either demo or real money user.
21#[derive(Debug, Clone, Serialize, Deserialize)]
22#[serde(rename_all = "snake_case")]
23pub struct Mt5NewAccountRequest {
24    /// Account type. If set to 'financial', setting 'mt5_account_type' is also required.\n
25    // Correct serde attribute construction - Use helper
26    
27    pub account_type: AccountType,
28    /// [Optional] The address of the user. The maximum length of this address field is 128 characters.\n
29    // Correct serde attribute construction - Use helper
30    #[serde(skip_serializing_if = "Option::is_none")] 
31    pub address: Option<String>,
32    /// [Optional] User's city of residence.\n
33    // Correct serde attribute construction - Use helper
34    #[serde(skip_serializing_if = "Option::is_none")] 
35    pub city: Option<String>,
36    /// [Optional] Name of the client's company. The maximum length of the company name is 64 characters.\n
37    // Correct serde attribute construction - Use helper
38    #[serde(skip_serializing_if = "Option::is_none")] 
39    pub company: Option<String>,
40    /// [Optional] 2-letter country code (value received from `residence_list` call).\n
41    // Correct serde attribute construction - Use helper
42    #[serde(skip_serializing_if = "Option::is_none")] 
43    pub country: Option<String>,
44    /// [Optional] MT5 account currency, the default value will be the qualified account currency.\n
45    // Correct serde attribute construction - Use helper
46    #[serde(skip_serializing_if = "Option::is_none")] 
47    pub currency: Option<String>,
48    /// [Optional] If set to 1, only validation is performed.\n
49    // Correct serde attribute construction - Use helper
50    #[serde(skip_serializing_if = "Option::is_none")] 
51    pub dry_run: Option<DryRun>,
52    /// Email address\n
53    // Correct serde attribute construction - Use helper
54    
55    pub email: String,
56    /// [Optional] The investor password of the account. For validation (Accepts any printable ASCII character. Must be within 8-25 characters, and include numbers, lowercase and uppercase letters. Must not be the same as the user's email address).\n
57    // Correct serde attribute construction - Use helper
58    #[serde(rename = "investPassword", skip_serializing_if = "Option::is_none")] 
59    pub invest_password: Option<String>,
60    /// Client leverage (from 1 to 1000).\n
61    // Correct serde attribute construction - Use helper
62    
63    pub leverage: f64,
64    /// [Optional] The login id of the user. Mandatory when multiple tokens were provided during authorize.\n
65    // Correct serde attribute construction - Use helper
66    #[serde(skip_serializing_if = "Option::is_none")] 
67    pub loginid: Option<String>,
68    /// The master password of the account. For validation (Accepts any printable ASCII character. Must be within 8-25 characters, and include numbers, lowercase and uppercase letters. Must not be the same as the user's email address). This field is required.\n
69    // Correct serde attribute construction - Use helper
70    #[serde(rename = "mainPassword")] 
71    pub main_password: String,
72    /// [Optional] Indicates whether the user would like to migrate his account to other jurisdiction.\n
73    // Correct serde attribute construction - Use helper
74    #[serde(skip_serializing_if = "Option::is_none")] 
75    pub migrate: Option<bool>,
76    /// [Optional] To choose whether account is conventional or swap_free. Unavailable for financial_stp MT5_account_type\n
77    // Correct serde attribute construction - Use helper
78    #[serde(skip_serializing_if = "Option::is_none")] 
79    pub mt5_account_category: Option<Mt5AccountCategory>,
80    /// [Optional] Financial: Variable spreads, High leverage. Financial STP: Variable spreads, Medium Leverage, more products. If 'account_type' set to 'financial', setting 'mt5_account_type' is also required.\n
81    // Correct serde attribute construction - Use helper
82    #[serde(skip_serializing_if = "Option::is_none")] 
83    pub mt5_account_type: Option<Mt5AccountType>,
84    /// Field 'mt5_new_account' mapped to Value due to complexity/potential issues.\n
85    // Correct serde attribute construction - Use helper
86    
87    pub mt5_new_account: Value,
88    /// Client's name. The maximum length here is 101 characters.\n
89    // Correct serde attribute construction - Use helper
90    
91    pub name: String,
92    /// [Optional] Used to pass data through the websocket, which may be retrieved via the `echo_req` output field.\n
93    // Correct serde attribute construction - Use helper
94    #[serde(skip_serializing_if = "Option::is_none")] 
95    pub passthrough: Option<Value>,
96    /// [Optional] User's phone number.\n
97    // Correct serde attribute construction - Use helper
98    #[serde(skip_serializing_if = "Option::is_none")] 
99    pub phone: Option<Value>,
100    /// [Optional] The user's phone password.\n
101    // Correct serde attribute construction - Use helper
102    #[serde(rename = "phonePassword", skip_serializing_if = "Option::is_none")] 
103    pub phone_password: Option<String>,
104    /// Product name that Deriv offer\n
105    // Correct serde attribute construction - Use helper
106    #[serde(skip_serializing_if = "Option::is_none")] 
107    pub product: Option<Product>,
108    /// [Optional] Used to map request to response.\n
109    // Correct serde attribute construction - Use helper
110    #[serde(skip_serializing_if = "Option::is_none")] 
111    pub req_id: Option<i64>,
112    /// [Optional] Trade server.\n
113    // Correct serde attribute construction - Use helper
114    #[serde(skip_serializing_if = "Option::is_none")] 
115    pub server: Option<Value>,
116    /// [Optional] User's state (region) of residence.\n
117    // Correct serde attribute construction - Use helper
118    #[serde(skip_serializing_if = "Option::is_none")] 
119    pub state: Option<String>,
120    /// [Optional] Indicate the additional risk management for each account\n
121    // Correct serde attribute construction - Use helper
122    #[serde(skip_serializing_if = "Option::is_none")] 
123    pub sub_account_category: Option<SubAccountCategory>,
124    /// [Optional] Indicate the different offerings for mt5 account\n
125    // Correct serde attribute construction - Use helper
126    #[serde(skip_serializing_if = "Option::is_none")] 
127    pub sub_account_type: Option<SubAccountType>,
128    /// [Optional] User's zip code.\n
129    // Correct serde attribute construction - Use helper
130    #[serde(rename = "zipCode", skip_serializing_if = "Option::is_none")] 
131    pub zip_code: Option<String>,
132}
133