forked from deriv-com/flutter-deriv-api
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtrading_platform_accounts_send.dart
75 lines (65 loc) · 2.35 KB
/
trading_platform_accounts_send.dart
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
/// Generated automatically from flutter_deriv_api|lib/basic_api/generated/trading_platform_accounts_send.json.
// ignore_for_file: always_put_required_named_parameters_first
import '../request.dart';
/// Trading platform accounts request class.
class TradingPlatformAccountsRequest extends Request {
/// Initialize TradingPlatformAccountsRequest.
const TradingPlatformAccountsRequest({
this.loginid,
required this.platform,
this.tradingPlatformAccounts = true,
super.msgType = 'trading_platform_accounts',
super.passthrough,
super.reqId,
});
/// Creates an instance from JSON.
factory TradingPlatformAccountsRequest.fromJson(Map<String, dynamic> json) =>
TradingPlatformAccountsRequest(
loginid: json['loginid'] as String?,
platform: json['platform'] as String?,
tradingPlatformAccounts: json['trading_platform_accounts'] == null
? null
: json['trading_platform_accounts'] == 1,
passthrough: json['passthrough'] as Map<String, dynamic>?,
reqId: json['req_id'] as int?,
);
/// [Optional] The login id of the user. Mandatory when multiple tokens were provided during authorize.
final String? loginid;
/// Trading platform name
final String? platform;
/// Must be `true`
final bool? tradingPlatformAccounts;
/// Converts this instance to JSON
@override
Map<String, dynamic> toJson() => <String, dynamic>{
'loginid': loginid,
'platform': platform,
'trading_platform_accounts': tradingPlatformAccounts == null
? null
: tradingPlatformAccounts!
? 1
: 0,
'passthrough': passthrough,
'req_id': reqId,
};
/// Creates a copy of instance with given parameters
@override
TradingPlatformAccountsRequest copyWith({
String? loginid,
String? platform,
bool? tradingPlatformAccounts,
Map<String, dynamic>? passthrough,
int? reqId,
}) =>
TradingPlatformAccountsRequest(
loginid: loginid ?? this.loginid,
platform: platform ?? this.platform,
tradingPlatformAccounts:
tradingPlatformAccounts ?? this.tradingPlatformAccounts,
passthrough: passthrough ?? this.passthrough,
reqId: reqId ?? this.reqId,
);
/// Override equatable class.
@override
List<Object?> get props => <Object?>[];
}