Skip to content

Commit 50741e6

Browse files
waqas/update_p2p_2fa_models (#220)
- update p2p 2fa models
1 parent f138463 commit 50741e6

7 files changed

+78
-7
lines changed

binary-websocket-api

lib/api/response/p2p_order_confirm_response_result.dart

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -71,40 +71,49 @@ enum StatusEnum {
7171
abstract class P2pOrderConfirmModel {
7272
/// Initializes P2p order confirm model class .
7373
const P2pOrderConfirmModel({
74-
required this.status,
7574
required this.id,
75+
this.dryRun,
76+
this.status,
7677
});
7778

78-
/// The new status of the order.
79-
final StatusEnum status;
80-
8179
/// The unique identifier for the order.
8280
final String id;
81+
82+
/// The `dry_run` was successful.
83+
final int? dryRun;
84+
85+
/// The new status of the order.
86+
final StatusEnum? status;
8387
}
8488

8589
/// P2p order confirm class.
8690
class P2pOrderConfirm extends P2pOrderConfirmModel {
8791
/// Initializes P2p order confirm class.
8892
const P2pOrderConfirm({
8993
required String id,
90-
required StatusEnum status,
94+
int? dryRun,
95+
StatusEnum? status,
9196
}) : super(
9297
id: id,
98+
dryRun: dryRun,
9399
status: status,
94100
);
95101

96102
/// Creates an instance from JSON.
97103
factory P2pOrderConfirm.fromJson(Map<String, dynamic> json) =>
98104
P2pOrderConfirm(
99105
id: json['id'],
100-
status: statusEnumMapper[json['status']]!,
106+
dryRun: json['dry_run'],
107+
status:
108+
json['status'] == null ? null : statusEnumMapper[json['status']],
101109
);
102110

103111
/// Converts an instance to JSON.
104112
Map<String, dynamic> toJson() {
105113
final Map<String, dynamic> resultMap = <String, dynamic>{};
106114

107115
resultMap['id'] = id;
116+
resultMap['dry_run'] = dryRun;
108117
resultMap['status'] = statusEnumMapper.entries
109118
.firstWhere(
110119
(MapEntry<String, StatusEnum> entry) => entry.value == status)
@@ -116,10 +125,12 @@ class P2pOrderConfirm extends P2pOrderConfirmModel {
116125
/// Creates a copy of instance with given parameters.
117126
P2pOrderConfirm copyWith({
118127
String? id,
128+
int? dryRun,
119129
StatusEnum? status,
120130
}) =>
121131
P2pOrderConfirm(
122132
id: id ?? this.id,
133+
dryRun: dryRun ?? this.dryRun,
123134
status: status ?? this.status,
124135
);
125136
}

lib/api/response/p2p_order_create_response_result.dart

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,7 @@ enum StatusEnum {
184184
abstract class P2pOrderCreateModel {
185185
/// Initializes P2p order create model class .
186186
const P2pOrderCreateModel({
187+
required this.verificationPending,
187188
required this.type,
188189
required this.status,
189190
required this.rateDisplay,
@@ -210,6 +211,9 @@ abstract class P2pOrderCreateModel {
210211
this.paymentMethodDetails,
211212
});
212213

214+
/// Indicates that an email has been sent to verify confirmation of the order.
215+
final bool verificationPending;
216+
213217
/// Type of the order.
214218
final TypeEnum type;
215219

@@ -309,6 +313,7 @@ class P2pOrderCreate extends P2pOrderCreateModel {
309313
required String rateDisplay,
310314
required StatusEnum status,
311315
required TypeEnum type,
316+
required bool verificationPending,
312317
String? paymentMethod,
313318
Map<String, PaymentMethodDetailsProperty>? paymentMethodDetails,
314319
}) : super(
@@ -334,6 +339,7 @@ class P2pOrderCreate extends P2pOrderCreateModel {
334339
rateDisplay: rateDisplay,
335340
status: status,
336341
type: type,
342+
verificationPending: verificationPending,
337343
paymentMethod: paymentMethod,
338344
paymentMethodDetails: paymentMethodDetails,
339345
);
@@ -363,6 +369,7 @@ class P2pOrderCreate extends P2pOrderCreateModel {
363369
rateDisplay: json['rate_display'],
364370
status: statusEnumMapper[json['status']]!,
365371
type: typeEnumMapper[json['type']]!,
372+
verificationPending: getBool(json['verification_pending'])!,
366373
paymentMethod: json['payment_method'],
367374
paymentMethodDetails: json['payment_method_details'] == null
368375
? null
@@ -412,6 +419,7 @@ class P2pOrderCreate extends P2pOrderCreateModel {
412419
resultMap['type'] = typeEnumMapper.entries
413420
.firstWhere((MapEntry<String, TypeEnum> entry) => entry.value == type)
414421
.key;
422+
resultMap['verification_pending'] = verificationPending;
415423
resultMap['payment_method'] = paymentMethod;
416424
resultMap['payment_method_details'] = paymentMethodDetails;
417425

@@ -442,6 +450,7 @@ class P2pOrderCreate extends P2pOrderCreateModel {
442450
String? rateDisplay,
443451
StatusEnum? status,
444452
TypeEnum? type,
453+
bool? verificationPending,
445454
String? paymentMethod,
446455
Map<String, PaymentMethodDetailsProperty>? paymentMethodDetails,
447456
}) =>
@@ -468,6 +477,7 @@ class P2pOrderCreate extends P2pOrderCreateModel {
468477
rateDisplay: rateDisplay ?? this.rateDisplay,
469478
status: status ?? this.status,
470479
type: type ?? this.type,
480+
verificationPending: verificationPending ?? this.verificationPending,
471481
paymentMethod: paymentMethod ?? this.paymentMethod,
472482
paymentMethodDetails: paymentMethodDetails ?? this.paymentMethodDetails,
473483
);

lib/api/response/p2p_order_dispute_response_result.dart

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,7 @@ enum StatusEnum {
119119
abstract class P2pOrderDisputeModel {
120120
/// Initializes P2p order dispute model class .
121121
const P2pOrderDisputeModel({
122+
required this.verificationPending,
122123
required this.type,
123124
required this.status,
124125
required this.rateDisplay,
@@ -143,6 +144,9 @@ abstract class P2pOrderDisputeModel {
143144
required this.accountCurrency,
144145
});
145146

147+
/// Indicates that an email has been sent to verify confirmation of the order.
148+
final bool verificationPending;
149+
146150
/// Whether this is a buy or a sell.
147151
final TypeEnum type;
148152

@@ -236,6 +240,7 @@ class P2pOrderDispute extends P2pOrderDisputeModel {
236240
required String rateDisplay,
237241
required StatusEnum status,
238242
required TypeEnum type,
243+
required bool verificationPending,
239244
}) : super(
240245
accountCurrency: accountCurrency,
241246
advertDetails: advertDetails,
@@ -259,6 +264,7 @@ class P2pOrderDispute extends P2pOrderDisputeModel {
259264
rateDisplay: rateDisplay,
260265
status: status,
261266
type: type,
267+
verificationPending: verificationPending,
262268
);
263269

264270
/// Creates an instance from JSON.
@@ -287,6 +293,7 @@ class P2pOrderDispute extends P2pOrderDisputeModel {
287293
rateDisplay: json['rate_display'],
288294
status: statusEnumMapper[json['status']]!,
289295
type: typeEnumMapper[json['type']]!,
296+
verificationPending: getBool(json['verification_pending'])!,
290297
);
291298

292299
/// Converts an instance to JSON.
@@ -324,6 +331,7 @@ class P2pOrderDispute extends P2pOrderDisputeModel {
324331
resultMap['type'] = typeEnumMapper.entries
325332
.firstWhere((MapEntry<String, TypeEnum> entry) => entry.value == type)
326333
.key;
334+
resultMap['verification_pending'] = verificationPending;
327335

328336
return resultMap;
329337
}
@@ -352,6 +360,7 @@ class P2pOrderDispute extends P2pOrderDisputeModel {
352360
String? rateDisplay,
353361
StatusEnum? status,
354362
TypeEnum? type,
363+
bool? verificationPending,
355364
}) =>
356365
P2pOrderDispute(
357366
accountCurrency: accountCurrency ?? this.accountCurrency,
@@ -376,6 +385,7 @@ class P2pOrderDispute extends P2pOrderDisputeModel {
376385
rateDisplay: rateDisplay ?? this.rateDisplay,
377386
status: status ?? this.status,
378387
type: type ?? this.type,
388+
verificationPending: verificationPending ?? this.verificationPending,
379389
);
380390
}
381391
/// Advert details model class.

lib/api/response/p2p_order_info_response_result.dart

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -314,6 +314,7 @@ enum StatusEnum {
314314
abstract class P2pOrderInfoModel {
315315
/// Initializes P2p order info model class .
316316
const P2pOrderInfoModel({
317+
required this.verificationPending,
317318
required this.type,
318319
required this.status,
319320
required this.rateDisplay,
@@ -342,6 +343,9 @@ abstract class P2pOrderInfoModel {
342343
this.reviewDetails,
343344
});
344345

346+
/// Indicates that an email has been sent to verify confirmation of the order.
347+
final bool verificationPending;
348+
345349
/// Whether this is a buy or a sell.
346350
final TypeEnum type;
347351

@@ -447,6 +451,7 @@ class P2pOrderInfo extends P2pOrderInfoModel {
447451
required String rateDisplay,
448452
required StatusEnum status,
449453
required TypeEnum type,
454+
required bool verificationPending,
450455
DateTime? completionTime,
451456
String? paymentMethod,
452457
Map<String, PaymentMethodDetailsProperty>? paymentMethodDetails,
@@ -474,6 +479,7 @@ class P2pOrderInfo extends P2pOrderInfoModel {
474479
rateDisplay: rateDisplay,
475480
status: status,
476481
type: type,
482+
verificationPending: verificationPending,
477483
completionTime: completionTime,
478484
paymentMethod: paymentMethod,
479485
paymentMethodDetails: paymentMethodDetails,
@@ -505,6 +511,7 @@ class P2pOrderInfo extends P2pOrderInfoModel {
505511
rateDisplay: json['rate_display'],
506512
status: statusEnumMapper[json['status']]!,
507513
type: typeEnumMapper[json['type']]!,
514+
verificationPending: getBool(json['verification_pending'])!,
508515
completionTime: getDateTime(json['completion_time']),
509516
paymentMethod: json['payment_method'],
510517
paymentMethodDetails: json['payment_method_details'] == null
@@ -558,6 +565,7 @@ class P2pOrderInfo extends P2pOrderInfoModel {
558565
resultMap['type'] = typeEnumMapper.entries
559566
.firstWhere((MapEntry<String, TypeEnum> entry) => entry.value == type)
560567
.key;
568+
resultMap['verification_pending'] = verificationPending;
561569
resultMap['completion_time'] = getSecondsSinceEpochDateTime(completionTime);
562570
resultMap['payment_method'] = paymentMethod;
563571
resultMap['payment_method_details'] = paymentMethodDetails;
@@ -592,6 +600,7 @@ class P2pOrderInfo extends P2pOrderInfoModel {
592600
String? rateDisplay,
593601
StatusEnum? status,
594602
TypeEnum? type,
603+
bool? verificationPending,
595604
DateTime? completionTime,
596605
String? paymentMethod,
597606
Map<String, PaymentMethodDetailsProperty>? paymentMethodDetails,
@@ -620,6 +629,7 @@ class P2pOrderInfo extends P2pOrderInfoModel {
620629
rateDisplay: rateDisplay ?? this.rateDisplay,
621630
status: status ?? this.status,
622631
type: type ?? this.type,
632+
verificationPending: verificationPending ?? this.verificationPending,
623633
completionTime: completionTime ?? this.completionTime,
624634
paymentMethod: paymentMethod ?? this.paymentMethod,
625635
paymentMethodDetails: paymentMethodDetails ?? this.paymentMethodDetails,

lib/api/response/p2p_order_list_response_result.dart

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -269,6 +269,7 @@ class P2pOrderList extends P2pOrderListModel {
269269
abstract class ListItemModel {
270270
/// Initializes List item model class .
271271
const ListItemModel({
272+
required this.verificationPending,
272273
required this.type,
273274
required this.status,
274275
required this.rateDisplay,
@@ -297,6 +298,9 @@ abstract class ListItemModel {
297298
this.reviewDetails,
298299
});
299300

301+
/// Indicates that an email has been sent to verify confirmation of the order.
302+
final bool verificationPending;
303+
300304
/// Whether this is a buy or a sell.
301305
final TypeEnum type;
302306

@@ -401,6 +405,7 @@ class ListItem extends ListItemModel {
401405
required String rateDisplay,
402406
required StatusEnum status,
403407
required TypeEnum type,
408+
required bool verificationPending,
404409
ClientDetails? clientDetails,
405410
DateTime? completionTime,
406411
String? paymentMethod,
@@ -428,6 +433,7 @@ class ListItem extends ListItemModel {
428433
rateDisplay: rateDisplay,
429434
status: status,
430435
type: type,
436+
verificationPending: verificationPending,
431437
clientDetails: clientDetails,
432438
completionTime: completionTime,
433439
paymentMethod: paymentMethod,
@@ -459,6 +465,7 @@ class ListItem extends ListItemModel {
459465
rateDisplay: json['rate_display'],
460466
status: statusEnumMapper[json['status']]!,
461467
type: typeEnumMapper[json['type']]!,
468+
verificationPending: getBool(json['verification_pending'])!,
462469
clientDetails: json['client_details'] == null
463470
? null
464471
: ClientDetails.fromJson(json['client_details']),
@@ -509,6 +516,7 @@ class ListItem extends ListItemModel {
509516
resultMap['type'] = typeEnumMapper.entries
510517
.firstWhere((MapEntry<String, TypeEnum> entry) => entry.value == type)
511518
.key;
519+
resultMap['verification_pending'] = verificationPending;
512520
if (clientDetails != null) {
513521
resultMap['client_details'] = clientDetails!.toJson();
514522
}
@@ -551,6 +559,7 @@ class ListItem extends ListItemModel {
551559
String? rateDisplay,
552560
StatusEnum? status,
553561
TypeEnum? type,
562+
bool? verificationPending,
554563
ClientDetails? clientDetails,
555564
DateTime? completionTime,
556565
String? paymentMethod,
@@ -579,6 +588,7 @@ class ListItem extends ListItemModel {
579588
rateDisplay: rateDisplay ?? this.rateDisplay,
580589
status: status ?? this.status,
581590
type: type ?? this.type,
591+
verificationPending: verificationPending ?? this.verificationPending,
582592
clientDetails: clientDetails ?? this.clientDetails,
583593
completionTime: completionTime ?? this.completionTime,
584594
paymentMethod: paymentMethod ?? this.paymentMethod,

0 commit comments

Comments
 (0)