batchUpdateDevicePosition method

Future<BatchUpdateDevicePositionResponse> batchUpdateDevicePosition({
  1. required String trackerName,
  2. required List<DevicePositionUpdate> updates,
})

Uploads position update data for one or more devices to a tracker resource (up to 10 devices per batch). Amazon Location uses the data when it reports the last known device position and position history. Amazon Location retains location data for 30 days.

When PositionFiltering is set to DistanceBased filtering, location data is stored and evaluated against linked geofence collections only if the device has moved more than 30 m (98.4 ft).

When PositionFiltering is set to AccuracyBased filtering, location data is stored and evaluated against linked geofence collections only if the device has moved more than the measured accuracy. For example, if two consecutive updates from a device have a horizontal accuracy of 5 m and 10 m, the second update is neither stored or evaluated if the device has moved less than 15 m. If PositionFiltering is set to AccuracyBased filtering, Amazon Location uses the default value { "Horizontal": 0} when accuracy is not provided on a DevicePositionUpdate.

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

Parameter trackerName : The name of the tracker resource to update.

Parameter updates : Contains the position update details for each device, up to 10 devices.

Implementation

Future<BatchUpdateDevicePositionResponse> batchUpdateDevicePosition({
  required String trackerName,
  required List<DevicePositionUpdate> updates,
}) async {
  final $payload = <String, dynamic>{
    'Updates': updates,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'POST',
    requestUri:
        '/tracking/v0/trackers/${Uri.encodeComponent(trackerName)}/positions',
    exceptionFnMap: _exceptionFns,
  );
  return BatchUpdateDevicePositionResponse.fromJson(response);
}