From b8d01239613b5116984b2cec9b209430eabbbd4c Mon Sep 17 00:00:00 2001 From: raslan-deriv Date: Fri, 27 Dec 2024 09:56:12 +0400 Subject: [PATCH] added raw fetch method on TradingPlatformAvailableAccountsResponseExtended --- ..._available_accounts_response_extended.dart | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/lib/api/response/trading_platform_available_accounts_response_extended.dart b/lib/api/response/trading_platform_available_accounts_response_extended.dart index 7faefd4e8a..98e63176dc 100644 --- a/lib/api/response/trading_platform_available_accounts_response_extended.dart +++ b/lib/api/response/trading_platform_available_accounts_response_extended.dart @@ -27,4 +27,23 @@ class TradingPlatformAvailableAccountsResponseExtended return TradingPlatformAvailableAccountsResponse.fromJson(response.toJson()); } + + /// Fetch available platform accounts in raw format. + /// This method returns the raw response from the API call, which includes + /// all records regardless of already registered products and account types. + /// Returns a [TradingPlatformAvailableAccountsReceive] object containing the raw response. + static Future + fetchAvailableAccountsRaw( + {required TradingPlatformAvailableAccountsRequest request}) async { + final TradingPlatformAvailableAccountsReceive response = + await _api.call(request: request); + + checkException( + response: response, + exceptionCreator: ({BaseExceptionModel? baseExceptionModel}) => + BaseAPIException(baseExceptionModel: baseExceptionModel), + ); + + return response; + } }