getResourcePosition method

Future<GetResourcePositionResponse> getResourcePosition({
  1. required String resourceIdentifier,
  2. required PositionResourceType resourceType,
})

Get the position information for a given wireless device or a wireless gateway resource. The position information uses the World Geodetic System (WGS84).

May throw AccessDeniedException. May throw InternalServerException. May throw ResourceNotFoundException. May throw ThrottlingException. May throw ValidationException.

Parameter resourceIdentifier : The identifier of the resource for which position information is retrieved. It can be the wireless device ID or the wireless gateway ID, depending on the resource type.

Parameter resourceType : The type of resource for which position information is retrieved, which can be a wireless device or a wireless gateway.

Implementation

Future<GetResourcePositionResponse> getResourcePosition({
  required String resourceIdentifier,
  required PositionResourceType resourceType,
}) async {
  final $query = <String, List<String>>{
    'resourceType': [resourceType.value],
  };
  final response = await _protocol.sendRaw(
    payload: null,
    method: 'GET',
    requestUri:
        '/resource-positions/${Uri.encodeComponent(resourceIdentifier)}',
    queryParams: $query,
    exceptionFnMap: _exceptionFns,
  );
  return GetResourcePositionResponse(
    geoJsonPayload: await response.stream.toBytes(),
  );
}