updateResourcePosition method

Future<void> updateResourcePosition({
  1. required String resourceIdentifier,
  2. required PositionResourceType resourceType,
  3. Uint8List? geoJsonPayload,
})

Update the position information of a given wireless device or a wireless gateway resource. The position coordinates are based on 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 updated. 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 updated, which can be a wireless device or a wireless gateway.

Parameter geoJsonPayload : The position information of the resource, displayed as a JSON payload. The payload uses the GeoJSON format, which a format that's used to encode geographic data structures. For more information, see GeoJSON.

Implementation

Future<void> updateResourcePosition({
  required String resourceIdentifier,
  required PositionResourceType resourceType,
  Uint8List? geoJsonPayload,
}) async {
  final $query = <String, List<String>>{
    'resourceType': [resourceType.value],
  };
  final response = await _protocol.send(
    payload: geoJsonPayload,
    method: 'PATCH',
    requestUri:
        '/resource-positions/${Uri.encodeComponent(resourceIdentifier)}',
    queryParams: $query,
    exceptionFnMap: _exceptionFns,
  );
}