esimsGetStatusEvents method

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

List eSIM status events

Lists the status changes of an eSIM, newest first. Returns { items, pagination }, one item per status change with the eSIM status, the profile status 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<EsimStatusEventList?> esimsGetStatusEvents(String iccid, { int? page, int? limit, DateTime? from, DateTime? to, Future<void>? abortTrigger, }) async {
  final response = await esimsGetStatusEventsWithHttpInfo(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), 'EsimStatusEventList',) as EsimStatusEventList;

  }
  return null;
}