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