Skip to content

Commit e5bdcdd

Browse files
committed
Merge branch 'master' of github.com:deriv-com/flutter-deriv-api into Ernest/update_crypto_estimations
2 parents 3ee8b1c + e8da245 commit e5bdcdd

6 files changed

+43
-11
lines changed

lib/api/response/get_account_status_response_result.dart

+9-4
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,11 @@ class GetAccountStatusResponse extends GetAccountStatusResponseModel {
5555
///
5656
/// For parameters information refer to [GetAccountStatusRequest].
5757
/// Throws an [BaseAPIException] if API response contains an error.
58-
static Future<GetAccountStatusReceive> fetchAccountStatusRaw() async {
58+
static Future<GetAccountStatusReceive> fetchAccountStatusRaw({
59+
String? loginId,
60+
}) async {
5961
final GetAccountStatusReceive response = await _api.call(
60-
request: const GetAccountStatusRequest(),
62+
request: GetAccountStatusRequest(loginid: loginId),
6163
);
6264

6365
checkException(
@@ -73,8 +75,11 @@ class GetAccountStatusResponse extends GetAccountStatusResponseModel {
7375
///
7476
/// For parameters information refer to [GetAccountStatusRequest].
7577
/// Throws an [BaseAPIException] if API response contains an error.
76-
static Future<GetAccountStatusResponse> fetchAccountStatus() async {
77-
final GetAccountStatusReceive response = await fetchAccountStatusRaw();
78+
static Future<GetAccountStatusResponse> fetchAccountStatus({
79+
String? loginId,
80+
}) async {
81+
final GetAccountStatusReceive response =
82+
await fetchAccountStatusRaw(loginId: loginId);
7883

7984
return GetAccountStatusResponse.fromJson(response.getAccountStatus);
8085
}

lib/api/response/p2p_advert_create_response_result.dart

+5-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
// ignore_for_file: prefer_single_quotes, unnecessary_import, unused_import
22

33
import 'package:equatable/equatable.dart';
4-
5-
import 'package:flutter_deriv_api/api/exceptions/p2p_advert_exception.dart';
4+
import 'package:flutter_deriv_api/api/exceptions/base_api_exception.dart';
65
import 'package:flutter_deriv_api/api/models/base_exception_model.dart';
76
import 'package:flutter_deriv_api/basic_api/generated/p2p_advert_create_receive.dart';
87
import 'package:flutter_deriv_api/basic_api/generated/p2p_advert_create_send.dart';
@@ -239,6 +238,7 @@ enum VisibilityStatusItemEnum {
239238
/// advertiser_temp_ban.
240239
advertiserTempBan,
241240
}
241+
242242
/// P2p advert create model class.
243243
abstract class P2pAdvertCreateModel {
244244
/// Initializes P2p advert create model class .
@@ -742,6 +742,7 @@ class P2pAdvertCreate extends P2pAdvertCreateModel {
742742
visibilityStatus: visibilityStatus ?? this.visibilityStatus,
743743
);
744744
}
745+
745746
/// Advertiser details model class.
746747
abstract class AdvertiserDetailsModel {
747748
/// Initializes Advertiser details model class .
@@ -892,6 +893,7 @@ class AdvertiserDetails extends AdvertiserDetailsModel {
892893
totalCompletionRate: totalCompletionRate ?? this.totalCompletionRate,
893894
);
894895
}
896+
895897
/// Payment method details property model class.
896898
abstract class PaymentMethodDetailsPropertyModel {
897899
/// Initializes Payment method details property model class .
@@ -1020,6 +1022,7 @@ class PaymentMethodDetailsProperty extends PaymentMethodDetailsPropertyModel {
10201022
usedByOrders: usedByOrders ?? this.usedByOrders,
10211023
);
10221024
}
1025+
10231026
/// Fields property model class.
10241027
abstract class FieldsPropertyModel {
10251028
/// Initializes Fields property model class .

lib/api/response/p2p_advert_list_response_result.dart

+4-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
// ignore_for_file: prefer_single_quotes, unnecessary_import, unused_import
22

33
import 'package:equatable/equatable.dart';
4-
5-
import 'package:flutter_deriv_api/api/exceptions/p2p_advert_exception.dart';
4+
import 'package:flutter_deriv_api/api/exceptions/base_api_exception.dart';
65
import 'package:flutter_deriv_api/api/models/base_exception_model.dart';
76
import 'package:flutter_deriv_api/basic_api/generated/p2p_advert_list_receive.dart';
87
import 'package:flutter_deriv_api/basic_api/generated/p2p_advert_list_send.dart';
@@ -226,6 +225,7 @@ enum VisibilityStatusItemEnum {
226225
/// advertiser_temp_ban.
227226
advertiserTempBan,
228227
}
228+
229229
/// P2p advert list model class.
230230
abstract class P2pAdvertListModel {
231231
/// Initializes P2p advert list model class .
@@ -274,6 +274,7 @@ class P2pAdvertList extends P2pAdvertListModel {
274274
list: list ?? this.list,
275275
);
276276
}
277+
277278
/// List item model class.
278279
abstract class ListItemModel {
279280
/// Initializes List item model class .
@@ -817,6 +818,7 @@ class ListItem extends ListItemModel {
817818
visibilityStatus: visibilityStatus ?? this.visibilityStatus,
818819
);
819820
}
821+
820822
/// Advertiser details model class.
821823
abstract class AdvertiserDetailsModel {
822824
/// Initializes Advertiser details model class .
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
{
2-
"methods": "static final BaseAPI _api = Injector()<BaseAPI>(); \n \n /// Gets the account's status. \n /// \n /// For parameters information refer to [GetAccountStatusRequest]. \n /// Throws an [BaseAPIException] if API response contains an error. \n static Future<GetAccountStatusReceive> fetchAccountStatusRaw() async { \n final GetAccountStatusReceive response = await _api.call( \n request: const GetAccountStatusRequest(), \n ); \n \n checkException( \n response: response, \n exceptionCreator: ({BaseExceptionModel? baseExceptionModel}) => \n BaseAPIException(baseExceptionModel: baseExceptionModel), \n ); \n \n return response; \n } \n \n /// Gets the account's status. \n /// \n /// For parameters information refer to [GetAccountStatusRequest]. \n /// Throws an [BaseAPIException] if API response contains an error. \n static Future<GetAccountStatusResponse> fetchAccountStatus() async { \n final GetAccountStatusReceive response = await fetchAccountStatusRaw(); \n \n return GetAccountStatusResponse.fromJson(response.getAccountStatus); \n }",
2+
"methods": "static final BaseAPI _api = Injector()<BaseAPI>(); \n \n /// Gets the account's status. \n /// \n /// For parameters information refer to [GetAccountStatusRequest]. \n /// Throws an [BaseAPIException] if API response contains an error. \n static Future<GetAccountStatusReceive> fetchAccountStatusRaw({String? loginId,}) async { \n final GetAccountStatusReceive response = await _api.call( \n request: GetAccountStatusRequest(loginid: loginId), \n ); \n \n checkException( \n response: response, \n exceptionCreator: ({BaseExceptionModel? baseExceptionModel}) => \n BaseAPIException(baseExceptionModel: baseExceptionModel), \n ); \n \n return response; \n } \n \n /// Gets the account's status. \n /// \n /// For parameters information refer to [GetAccountStatusRequest]. \n /// Throws an [BaseAPIException] if API response contains an error. \n static Future<GetAccountStatusResponse> fetchAccountStatus({String? loginId,}) async { \n final GetAccountStatusReceive response = await fetchAccountStatusRaw(loginId: loginId); \n \n return GetAccountStatusResponse.fromJson(response.getAccountStatus); \n }",
33
"imports": "import 'package:flutter_deriv_api/api/exceptions/exceptions.dart';\nimport 'package:flutter_deriv_api/api/models/base_exception_model.dart';\nimport 'package:flutter_deriv_api/basic_api/generated/get_account_status_receive.dart';\nimport 'package:flutter_deriv_api/basic_api/generated/get_account_status_send.dart';\nimport 'package:flutter_deriv_api/helpers/helpers.dart';\nimport 'package:flutter_deriv_api/services/connection/api_manager/base_api.dart';\nimport 'package:deriv_dependency_injector/dependency_injector.dart';\n"
44
}

lib/services/connection/api_manager/connection_information.dart

+23-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
1+
import 'package:meta/meta.dart';
2+
13
/// Connection information for a single connection.
4+
@immutable
25
class ConnectionInformation {
36
/// Initializes a new instance of the [ConnectionInformation] class.
4-
ConnectionInformation({
7+
const ConnectionInformation({
58
required this.appId,
69
required this.brand,
710
required this.endpoint,
@@ -23,4 +26,23 @@ class ConnectionInformation {
2326

2427
/// API language.
2528
final String language;
29+
30+
@override
31+
bool operator ==(Object other) =>
32+
identical(this, other) ||
33+
other is ConnectionInformation &&
34+
runtimeType == other.runtimeType &&
35+
appId == other.appId &&
36+
brand == other.brand &&
37+
endpoint == other.endpoint &&
38+
authEndpoint == other.authEndpoint &&
39+
language == other.language;
40+
41+
@override
42+
int get hashCode =>
43+
appId.hashCode ^
44+
brand.hashCode ^
45+
endpoint.hashCode ^
46+
authEndpoint.hashCode ^
47+
language.hashCode;
2648
}

pubspec.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ dependencies:
2020
equatable: ^2.0.3
2121
flutter_bloc: ^8.1.2
2222
http: ^0.13.4
23-
intl: ^0.18.0
23+
intl: ^0.19.0
2424
meta: ^1.8.0
2525
recase: ^4.0.0
2626
rxdart: ^0.27.7

0 commit comments

Comments
 (0)