esimsGetEsim method

Future<EsimProfile?> esimsGetEsim(
  1. String iccid, {
  2. Future<void>? abortTrigger,
})

Get an eSIM

Returns one of your eSIMs by its ICCID, with its installation details, plan and top-ups. Returns the eSIM as last recorded, without a live refresh: the SIM details (LPA code, QR code URL and quick-install links), the plan, its data, SMS and voice allowances, and any top-ups. 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.

Implementation

Future<EsimProfile?> esimsGetEsim(String iccid, { Future<void>? abortTrigger, }) async {
  final response = await esimsGetEsimWithHttpInfo(iccid, 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), 'EsimProfile',) as EsimProfile;

  }
  return null;
}