getDevicePosition method
Retrieves a device's most recent position according to its sample time.
May throw AccessDeniedException.
May throw InternalServerException.
May throw ResourceNotFoundException.
May throw ThrottlingException.
May throw ValidationException.
Parameter deviceId :
The device whose position you want to retrieve.
Parameter trackerName :
The tracker resource receiving the position update.
Implementation
Future<GetDevicePositionResponse> getDevicePosition({
required String deviceId,
required String trackerName,
}) async {
final response = await _protocol.send(
payload: null,
method: 'GET',
requestUri:
'/tracking/v0/trackers/${Uri.encodeComponent(trackerName)}/devices/${Uri.encodeComponent(deviceId)}/positions/latest',
exceptionFnMap: _exceptionFns,
);
return GetDevicePositionResponse.fromJson(response);
}