esimsGetLocationEvents method

Future<EsimLocationEventList?> esimsGetLocationEvents(
  1. String iccid, {
  2. int? page,
  3. int? limit,
  4. DateTime? from,
  5. DateTime? to,
  6. Future<void>? abortTrigger,
})

List eSIM location events

Lists the networks and locations where an eSIM registered, newest first. Returns { items, pagination }, one item per registration with its MCC, MNC, location, network and occurredAt. from and to limit the events by occurredAt, both inclusive. An ICCID that is not one of your eSIMs gives 404 / 10004.

Parameters:

  • String iccid (required): The eSIM's ICCID, from the order item's fulfillment.result.details.iccid.

  • int page: Page number, from 1; default 1.

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

  • DateTime from: Only events that occurred at or after this UTC time.

  • DateTime to: Only events that occurred at or before this UTC time.

Implementation

Future<EsimLocationEventList?> esimsGetLocationEvents(String iccid, { int? page, int? limit, DateTime? from, DateTime? to, Future<void>? abortTrigger, }) async {
  final response = await esimsGetLocationEventsWithHttpInfo(iccid, page: page, limit: limit, from: from, to: to, 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), 'EsimLocationEventList',) as EsimLocationEventList;

  }
  return null;
}