# `ExAws.Location.Trackers`

API calls for Amazon Location Service Trackers.

Tracker resources and the device positions sent to and retrieved from them.

Every function returns an operation struct to be passed to `ExAws.request/2`.

## Operations

* `associate_tracker_consumer` - AssociateTrackerConsumer
* `batch_delete_device_position_history` - BatchDeleteDevicePositionHistory
* `batch_get_device_position` - BatchGetDevicePosition
* `batch_update_device_position` - BatchUpdateDevicePosition
* `create_tracker` - CreateTracker
* `delete_tracker` - DeleteTracker
* `describe_tracker` - DescribeTracker
* `disassociate_tracker_consumer` - DisassociateTrackerConsumer
* `get_device_position` - GetDevicePosition
* `get_device_position_history` - GetDevicePositionHistory
* `list_device_positions` - ListDevicePositions
* `list_tracker_consumers` - ListTrackerConsumers
* `list_trackers` - ListTrackers
* `update_tracker` - UpdateTracker
* `verify_device_position` - VerifyDevicePosition

See https://docs.aws.amazon.com/location/previous/APIReference/API_Operations.html

# `create_tracker_opts`

```elixir
@type create_tracker_opts() :: [
  description: String.t(),
  event_bridge_enabled: boolean(),
  kms_key_enable_geospatial_queries: boolean(),
  kms_key_id: String.t(),
  position_filtering: String.t(),
  tags: %{optional(String.t()) =&gt; String.t()}
]
```

# `get_device_position_history_opts`

```elixir
@type get_device_position_history_opts() :: [
  end_time_exclusive: DateTime.t() | String.t(),
  max_results: integer(),
  next_token: String.t(),
  start_time_inclusive: DateTime.t() | String.t()
]
```

# `list_device_positions_opts`

```elixir
@type list_device_positions_opts() :: [
  filter_geometry: ExAws.Location.Trackers.TrackingFilterGeometry.t(),
  max_results: integer(),
  next_token: String.t()
]
```

# `list_tracker_consumers_opts`

```elixir
@type list_tracker_consumers_opts() :: [
  max_results: integer(),
  next_token: String.t()
]
```

# `list_trackers_opts`

```elixir
@type list_trackers_opts() :: [max_results: integer(), next_token: String.t()]
```

# `update_tracker_opts`

```elixir
@type update_tracker_opts() :: [
  description: String.t(),
  event_bridge_enabled: boolean(),
  kms_key_enable_geospatial_queries: boolean(),
  position_filtering: String.t()
]
```

# `verify_device_position_opts`

```elixir
@type verify_device_position_opts() :: [{:distance_unit, String.t()}]
```

# `associate_tracker_consumer`

```elixir
@spec associate_tracker_consumer(String.t(), String.t()) :: ExAws.Operation.JSON.t()
```

Creates an association between a geofence collection and a tracker resource. This allows the
tracker resource to communicate location data to the linked geofence collection.

You can associate up to five geofence collections to each tracker resource.

Currently not supported — Cross-account configurations, such as creating associations between
a tracker resource in one account and a geofence collection in another account.

## Parameters

* `tracker_name` - The name of the tracker resource to be associated with a geofence
  collection.

* `consumer_arn` - The Amazon Resource Name (ARN) for the geofence collection to be associated
  to tracker resource. Used when you need to specify a resource across all Amazon Web
  Services.

See https://docs.aws.amazon.com/location/previous/APIReference/API_AssociateTrackerConsumer.html

# `batch_delete_device_position_history`

```elixir
@spec batch_delete_device_position_history(String.t(), [String.t()]) ::
  ExAws.Operation.JSON.t()
```

Deletes the position history of one or more devices from a tracker resource.

## Parameters

* `tracker_name` - The name of the tracker resource to delete the device position history
  from.

* `device_ids` - Devices whose position history you want to delete.

See https://docs.aws.amazon.com/location/previous/APIReference/API_BatchDeleteDevicePositionHistory.html

# `batch_get_device_position`

```elixir
@spec batch_get_device_position(String.t(), [String.t()]) :: ExAws.Operation.JSON.t()
```

Lists the latest device positions for requested devices.

## Parameters

* `tracker_name` - The tracker resource retrieving the device position.

* `device_ids` - Devices whose position you want to retrieve.

See https://docs.aws.amazon.com/location/previous/APIReference/API_BatchGetDevicePosition.html

# `batch_update_device_position`

```elixir
@spec batch_update_device_position(String.t(), [
  ExAws.Location.DevicePositionUpdate.t()
]) ::
  ExAws.Operation.JSON.t()
```

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.

Position updates are handled based on the `PositionFiltering` property of the tracker. When
`PositionFiltering` is set to `TimeBased`, updates are evaluated against linked geofence
collections, and location data is stored at a maximum of one position per 30 second interval.
If your update frequency is more often than every 30 seconds, only one update per 30 seconds
is stored for each unique device ID.

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`.

## Parameters

* `tracker_name` - The name of the tracker resource to update.

* `updates` - Contains the position update details for each device, up to 10 devices.

See https://docs.aws.amazon.com/location/previous/APIReference/API_BatchUpdateDevicePosition.html

# `create_tracker`

```elixir
@spec create_tracker(String.t(), create_tracker_opts()) :: ExAws.Operation.JSON.t()
```

Creates a tracker resource in your Amazon Web Services account, which lets you retrieve
current and historical location of devices.

## Parameters

* `tracker_name` - The name for the tracker resource.

## Options

* `:description` - An optional description for the tracker resource.

* `:event_bridge_enabled` - Whether to enable position `UPDATE` events from this tracker to be
  sent to EventBridge.

* `:kms_key_enable_geospatial_queries` - Enables `GeospatialQueries` for a tracker that uses a
  [Amazon Web Services KMS customer managed
  key](https://docs.aws.amazon.com/kms/latest/developerguide/create-keys.html).

* `:kms_key_id` - A key identifier for an [Amazon Web Services KMS customer managed
  key](https://docs.aws.amazon.com/kms/latest/developerguide/create-keys.html). Enter a key
  ID, key ARN, alias name, or alias ARN.

* `:position_filtering` - Specifies the position filtering for the tracker resource. Valid
  values: `TimeBased`, `DistanceBased`, `AccuracyBased`.

* `:tags` - Applies one or more tags to the tracker resource. A tag is a key-value pair helps
  manage, identify, search, and filter your resources by labelling them.

See https://docs.aws.amazon.com/location/previous/APIReference/API_CreateTracker.html

# `delete_tracker`

```elixir
@spec delete_tracker(String.t()) :: ExAws.Operation.RestQuery.t()
```

Deletes a tracker resource from your Amazon Web Services account.

This operation deletes the resource permanently. If the tracker resource is in use, you may
encounter an error. Make sure that the target resource isn't a dependency for your
applications.

## Parameters

* `tracker_name` - The name of the tracker resource to be deleted.

See https://docs.aws.amazon.com/location/previous/APIReference/API_DeleteTracker.html

# `describe_tracker`

```elixir
@spec describe_tracker(String.t()) :: ExAws.Operation.RestQuery.t()
```

Retrieves the tracker resource details.

## Parameters

* `tracker_name` - The name of the tracker resource.

See https://docs.aws.amazon.com/location/previous/APIReference/API_DescribeTracker.html

# `disassociate_tracker_consumer`

```elixir
@spec disassociate_tracker_consumer(String.t(), String.t()) ::
  ExAws.Operation.RestQuery.t()
```

Removes the association between a tracker resource and a geofence collection.

Once you unlink a tracker resource from a geofence collection, the tracker positions will no
longer be automatically evaluated against geofences.

## Parameters

* `tracker_name` - The name of the tracker resource to be dissociated from the consumer.

* `consumer_arn` - The Amazon Resource Name (ARN) for the geofence collection to be
  disassociated from the tracker resource. Used when you need to specify a resource across all
  Amazon Web Services.

See https://docs.aws.amazon.com/location/previous/APIReference/API_DisassociateTrackerConsumer.html

# `get_device_position`

```elixir
@spec get_device_position(String.t(), String.t()) :: ExAws.Operation.RestQuery.t()
```

Retrieves a device's most recent position according to its sample time.

Device positions are deleted after 30 days.

## Parameters

* `tracker_name` - The tracker resource receiving the position update.

* `device_id` - The device whose position you want to retrieve.

See https://docs.aws.amazon.com/location/previous/APIReference/API_GetDevicePosition.html

# `get_device_position_history`

```elixir
@spec get_device_position_history(
  String.t(),
  String.t(),
  get_device_position_history_opts()
) ::
  ExAws.Operation.JSON.t()
```

Retrieves the device position history from a tracker resource within a specified range of
time.

Device positions are deleted after 30 days.

## Parameters

* `tracker_name` - The tracker resource receiving the request for the device position history.

* `device_id` - The device whose position history you want to retrieve.

## Options

* `:end_time_exclusive` - Specify the end time for the position history in [ISO
  8601](https://www.iso.org/iso-8601-date-and-time-format.html) format:
  `YYYY-MM-DDThh:mm:ss.sssZ`. By default, the value will be the time that the request is made.

* `:max_results` - An optional limit for the number of device positions returned in a single
  call.

* `:next_token` - The pagination token specifying which page of results to return in the
  response. If no token is provided, the default page is the first page.

* `:start_time_inclusive` - Specify the start time for the position history in [ISO
  8601](https://www.iso.org/iso-8601-date-and-time-format.html) format:
  `YYYY-MM-DDThh:mm:ss.sssZ`. By default, the value will be 24 hours prior to the time that
  the request is made.

See https://docs.aws.amazon.com/location/previous/APIReference/API_GetDevicePositionHistory.html

# `list_device_positions`

```elixir
@spec list_device_positions(String.t(), list_device_positions_opts()) ::
  ExAws.Operation.JSON.t()
```

A batch request to retrieve all device positions.

## Parameters

* `tracker_name` - The tracker resource containing the requested devices.

## Options

* `:filter_geometry` - The geometry used to filter device positions.

* `:max_results` - An optional limit for the number of entries returned in a single call.

* `:next_token` - The pagination token specifying which page of results to return in the
  response. If no token is provided, the default page is the first page.

See https://docs.aws.amazon.com/location/previous/APIReference/API_ListDevicePositions.html

# `list_tracker_consumers`

```elixir
@spec list_tracker_consumers(String.t(), list_tracker_consumers_opts()) ::
  ExAws.Operation.JSON.t()
```

Lists geofence collections currently associated to the given tracker resource.

## Parameters

* `tracker_name` - The tracker resource whose associated geofence collections you want to
  list.

## Options

* `:max_results` - An optional limit for the number of resources returned in a single call.

* `:next_token` - The pagination token specifying which page of results to return in the
  response. If no token is provided, the default page is the first page.

See https://docs.aws.amazon.com/location/previous/APIReference/API_ListTrackerConsumers.html

# `list_trackers`

```elixir
@spec list_trackers(list_trackers_opts()) :: ExAws.Operation.JSON.t()
```

Lists tracker resources in your Amazon Web Services account.

## Options

* `:max_results` - An optional limit for the number of resources returned in a single call.

* `:next_token` - The pagination token specifying which page of results to return in the
  response. If no token is provided, the default page is the first page.

See https://docs.aws.amazon.com/location/previous/APIReference/API_ListTrackers.html

# `update_tracker`

```elixir
@spec update_tracker(String.t(), update_tracker_opts()) :: ExAws.Operation.JSON.t()
```

Updates the specified properties of a given tracker resource.

## Parameters

* `tracker_name` - The name of the tracker resource to update.

## Options

* `:description` - Updates the description for the tracker resource.

* `:event_bridge_enabled` - Whether to enable position `UPDATE` events from this tracker to be
  sent to EventBridge.

* `:kms_key_enable_geospatial_queries` - Enables `GeospatialQueries` for a tracker that uses a
  [Amazon Web Services KMS customer managed
  key](https://docs.aws.amazon.com/kms/latest/developerguide/create-keys.html).

* `:position_filtering` - Updates the position filtering for the tracker resource. Valid
  values: `TimeBased`, `DistanceBased`, `AccuracyBased`.

See https://docs.aws.amazon.com/location/previous/APIReference/API_UpdateTracker.html

# `verify_device_position`

```elixir
@spec verify_device_position(
  String.t(),
  ExAws.Location.Trackers.DeviceState.t(),
  verify_device_position_opts()
) :: ExAws.Operation.JSON.t()
```

Verifies the integrity of the device's position by determining if it was reported behind a
proxy, and by comparing it to an inferred position estimated based on the device's state.

The Location Integrity SDK provides enhanced features related to device verification, and it
is available for use by request. To get access to the SDK, contact [Sales
Support](https://aws.amazon.com/contact-us/sales-support/?pg=locationprice&cta=herobtn).

## Parameters

* `tracker_name` - The name of the tracker resource to be associated with verification
  request.

* `device_state` - The device's state, including position, IP address, cell signals and Wi-Fi
  access points.

## Options

* `:distance_unit` - The distance unit for the verification request. Valid values:
  `Kilometers`, `Miles`.

See https://docs.aws.amazon.com/location/previous/APIReference/API_VerifyDevicePosition.html

---

*Consult [api-reference.md](api-reference.md) for complete listing*
