esimsGetCatalog method

Future<EsimCatalogPage?> esimsGetCatalog({
  1. String? countryCode,
  2. String? category,
  3. String? region,
  4. int? validityDays,
  5. bool? isUnlimited,
  6. String? currency,
  7. String? cursor,
  8. int? limit,
  9. Future<void>? abortTrigger,
})

eSIM catalog

Returns every destination with its plans, page by page, for partner inventory. Returns { items, nextCursor }, ordered by destination ID, with the search filters except iccid. Continue with nextCursor as cursor, the same filters and the same currency until it is null. A cursor reused with other filters or another currency gives 400 / 10001. Quote confirms the final price and availability.

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, regional or global destinations.

  • String region: Keep the destinations of this region, in display or slug form, for example North America or north-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 currency: Price currency, three letters in either case; the API key's currency when omitted. An unsupported code gives 404 / 10004.

  • String cursor: The nextCursor of the previous page; omit it for the first page. Reuse it only with the same filters and currency.

  • int limit: Page size, 1 to 100; default 100.

Implementation

Future<EsimCatalogPage?> esimsGetCatalog({ String? countryCode, String? category, String? region, int? validityDays, bool? isUnlimited, String? currency, String? cursor, int? limit, Future<void>? abortTrigger, }) async {
  final response = await esimsGetCatalogWithHttpInfo(countryCode: countryCode, category: category, region: region, validityDays: validityDays, isUnlimited: isUnlimited, currency: currency, cursor: cursor, limit: limit, abortTrigger: abortTrigger,);
  if (response.statusCode >= HttpStatus.badRequest) {
    throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  }
  // When a remote server returns no body with a status of 204, we shall not decode it.
  // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
  // FormatException when trying to decode an empty string.
  if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
    return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'EsimCatalogPage',) as EsimCatalogPage;

  }
  return null;
}