esimsGetUsageHistoryWithHttpInfo method

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

List eSIM usage history

Lists the recorded usage readings of an eSIM, newest first. Returns { items, pagination }, one item per usage reading, with its allowances, remaining amounts and usage and expiry bands. from and to limit the readings by capturedAt, both inclusive. An ICCID that is not one of your eSIMs gives 404 / 10004.

Note: This method returns the HTTP Response.

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 readings captured at or after this UTC time.

  • DateTime to: Only readings captured at or before this UTC time.

Implementation

Future<Response> esimsGetUsageHistoryWithHttpInfo(String iccid, { int? page, int? limit, DateTime? from, DateTime? to, Future<void>? abortTrigger, }) async {
  // ignore: prefer_const_declarations
  final path = r'/api/v1/b2b/esims/{iccid}/usage/history'
    .replaceAll('{iccid}', iccid);

  // ignore: prefer_final_locals
  Object? postBody;

  final queryParams = <QueryParam>[];
  final headerParams = <String, String>{};
  final formParams = <String, String>{};

  if (page != null) {
    queryParams.addAll(_queryParams('', 'page', page));
  }
  if (limit != null) {
    queryParams.addAll(_queryParams('', 'limit', limit));
  }
  if (from != null) {
    queryParams.addAll(_queryParams('', 'from', from));
  }
  if (to != null) {
    queryParams.addAll(_queryParams('', 'to', to));
  }

  const contentTypes = <String>[];


  return apiClient.invokeAPI(
    path,
    'GET',
    queryParams,
    postBody,
    headerParams,
    formParams,
    contentTypes.isEmpty ? null : contentTypes.first,
    abortTrigger: abortTrigger,
  );
}