esimsSearchWithHttpInfo method
Search eSIM plans
Searches eSIM destinations and returns them with their plans, one page at a time. Returns { items, pagination }. countryCode keeps the destinations whose coverage includes that country, so local, regional and global destinations can match; category and region select destinations, and validityDays and isUnlimited select plans within them. Pages count destinations with an orderable plan. With iccid it returns the plans that can top up that eSIM instead, under its destination, and takes no filter other than currency (400 / 10001, NOT_ALLOWED); an unknown or foreign ICCID gives 404 / 10004. Prices are indicative, in currency.
Note: This method returns the HTTP Response.
Parameters:
-
String countryCode: Optional ISO 3166-1 alpha-2 country, in either case: keeps the destinations whose coverage includes it, regional and global ones too. A blank value is rejected.
-
String category: Keep
local,regionalorglobaldestinations. -
String region: Keep the destinations of this region, in display or slug form, for example
North Americaornorth-america. -
int validityDays: Keep the plans valid for exactly this many days; at least 1.
-
bool isUnlimited: Keep the unlimited (
true) or the limited (false) plans. -
String iccid: Top-up search: the ICCID (18 to 22 digits) of your eSIM to list the plans that can top it up. No other filter than
currencyis allowed with it. -
String currency: Price currency, three letters in either case; the API key's currency when omitted. An unsupported code gives 404 / 10004.
-
int page: Page number, from 1; default 1.
-
int limit: Page size, 1 to 100; default 10.
Implementation
Future<Response> esimsSearchWithHttpInfo({ String? countryCode, String? category, String? region, int? validityDays, bool? isUnlimited, String? iccid, String? currency, int? page, int? limit, Future<void>? abortTrigger, }) async {
// ignore: prefer_const_declarations
final path = r'/api/v1/b2b/esims/search';
// ignore: prefer_final_locals
Object? postBody;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
if (countryCode != null) {
queryParams.addAll(_queryParams('', 'countryCode', countryCode));
}
if (category != null) {
queryParams.addAll(_queryParams('', 'category', category));
}
if (region != null) {
queryParams.addAll(_queryParams('', 'region', region));
}
if (validityDays != null) {
queryParams.addAll(_queryParams('', 'validityDays', validityDays));
}
if (isUnlimited != null) {
queryParams.addAll(_queryParams('', 'isUnlimited', isUnlimited));
}
if (iccid != null) {
queryParams.addAll(_queryParams('', 'iccid', iccid));
}
if (currency != null) {
queryParams.addAll(_queryParams('', 'currency', currency));
}
if (page != null) {
queryParams.addAll(_queryParams('', 'page', page));
}
if (limit != null) {
queryParams.addAll(_queryParams('', 'limit', limit));
}
const contentTypes = <String>[];
return apiClient.invokeAPI(
path,
'GET',
queryParams,
postBody,
headerParams,
formParams,
contentTypes.isEmpty ? null : contentTypes.first,
abortTrigger: abortTrigger,
);
}