getRequestStatus method

Future<RequestStatus?> getRequestStatus(
  1. CapabilityLink capabilityLink
)

Implementation

Future<RequestStatus?> getRequestStatus(
  CapabilityLink capabilityLink,
) async {
  final resp = await get('/request/${capabilityLink.value}/status');

  if (resp.statusCode == HttpStatus.ok) {
    return RequestStatus.fromJson(json.decode(resp.body));
  } else if (resp.statusCode == HttpStatus.notFound) {
    return null;
  }

  return Future.error(HttpResponseError(resp.statusCode, resp.body));
}