getMappingStatus method

Future<MappingStatus> getMappingStatus(
  1. String requestId
)

Gets the status of User Node mapping request.

Will throw an exception when there is a failure containing a description of the failure.

Implementation

Future<MappingStatus> getMappingStatus(String requestId) async {
  final uri = _urlBase.getPath(_nodeMapping, {
    'request_id': requestId,
  });

  final resp = await get(
    uri,
    headers: {
      URLBase.authHeader: accessToken,
    },
  );
  final Map<String, dynamic> bodyResp =
      await JsonIsolate().decodeJson(resp.body);
  if (resp.statusCode != 200) {
    throw bodyResp['description'];
  }

  return MappingStatus.fromJson(bodyResp);
}