ExAws. Location. Geofences
(ex_aws_location v0.1.0)
Copy Markdown
API calls for Amazon Location Service Geofences.
Geofence collections and the geofences stored in them, plus evaluating and forecasting device positions against those geofences.
Every function returns an operation struct to be passed to ExAws.request/2.
Operations
batch_delete_geofence- BatchDeleteGeofencebatch_evaluate_geofences- BatchEvaluateGeofencesbatch_put_geofence- BatchPutGeofencecreate_geofence_collection- CreateGeofenceCollectiondelete_geofence_collection- DeleteGeofenceCollectiondescribe_geofence_collection- DescribeGeofenceCollectionforecast_geofence_events- ForecastGeofenceEventsget_geofence- GetGeofencelist_geofence_collections- ListGeofenceCollectionslist_geofences- ListGeofencesput_geofence- PutGeofenceupdate_geofence_collection- UpdateGeofenceCollection
See https://docs.aws.amazon.com/location/previous/APIReference/API_Operations.html
Summary
Functions
Deletes a batch of geofences from a geofence collection.
Evaluates device positions against the geofence geometries from a given geofence collection.
A batch request for storing geofence geometries into a given geofence collection, or updates the geometry of an existing geofence if a geofence ID is included in the request.
Creates a geofence collection, which manages and stores geofences.
Deletes a geofence collection from your Amazon Web Services account.
Retrieves the geofence collection details.
This action forecasts future geofence events that are likely to occur within a specified time horizon if a device continues moving at its current speed. Each forecasted event is associated with a geofence from a provided geofence collection. A forecast event can have one of the following states
Retrieves the geofence details from a geofence collection.
Lists geofence collections in your Amazon Web Services account.
Lists geofences stored in a given geofence collection.
Stores a geofence geometry in a given geofence collection, or updates the geometry of an existing geofence if a geofence ID is included in the request.
Updates the specified properties of a given geofence collection.
Types
Functions
@spec batch_delete_geofence(String.t(), [String.t()]) :: ExAws.Operation.JSON.t()
Deletes a batch of geofences from a geofence collection.
This operation deletes the resource permanently.
Parameters
collection_name- The geofence collection storing the geofences to be deleted.geofence_ids- The batch of geofences to be deleted.
See https://docs.aws.amazon.com/location/previous/APIReference/API_BatchDeleteGeofence.html
@spec batch_evaluate_geofences(String.t(), [ExAws.Location.DevicePositionUpdate.t()]) :: ExAws.Operation.JSON.t()
Evaluates device positions against the geofence geometries from a given geofence collection.
This operation always returns an empty response because geofences are asynchronously evaluated. The evaluation determines if the device has entered or exited a geofenced area, and then publishes one of the following events to Amazon EventBridge:
ENTERif Amazon Location determines that the tracked device has entered a geofenced area.EXITif Amazon Location determines that the tracked device has exited a geofenced area.
The last geofence that a device was observed within is tracked for 30 days after the most recent device position update.
Geofence evaluation uses the given device position. It does not account for the optional
Accuracy of a DevicePositionUpdate.
The DeviceID is used as a string to represent the device. You do not need to have a
Tracker associated with the DeviceID.
Parameters
collection_name- The geofence collection used in evaluating the position of devices against its geofences.device_position_updates- Contains device details for each device to be evaluated against the given geofence collection.
See https://docs.aws.amazon.com/location/previous/APIReference/API_BatchEvaluateGeofences.html
@spec batch_put_geofence(String.t(), [ ExAws.Location.Geofences.BatchPutGeofenceRequestEntry.t() ]) :: ExAws.Operation.JSON.t()
A batch request for storing geofence geometries into a given geofence collection, or updates the geometry of an existing geofence if a geofence ID is included in the request.
Parameters
collection_name- The geofence collection storing the geofences.entries- The batch of geofences to be stored in a geofence collection.
See https://docs.aws.amazon.com/location/previous/APIReference/API_BatchPutGeofence.html
@spec create_geofence_collection(String.t(), create_geofence_collection_opts()) :: ExAws.Operation.JSON.t()
Creates a geofence collection, which manages and stores geofences.
Parameters
collection_name- A custom name for the geofence collection.
Options
:description- An optional description for the geofence collection.:kms_key_id- A key identifier for an Amazon Web Services KMS customer managed key. Enter a key ID, key ARN, alias name, or alias ARN.:tags- Applies one or more tags to the geofence collection. 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_CreateGeofenceCollection.html
@spec delete_geofence_collection(String.t()) :: ExAws.Operation.RestQuery.t()
Deletes a geofence collection from your Amazon Web Services account.
This operation deletes the resource permanently. If the geofence collection is the target of a tracker resource, the devices will no longer be monitored.
Parameters
collection_name- The name of the geofence collection to be deleted.
See https://docs.aws.amazon.com/location/previous/APIReference/API_DeleteGeofenceCollection.html
@spec describe_geofence_collection(String.t()) :: ExAws.Operation.RestQuery.t()
Retrieves the geofence collection details.
Parameters
collection_name- The name of the geofence collection.
See https://docs.aws.amazon.com/location/previous/APIReference/API_DescribeGeofenceCollection.html
@spec forecast_geofence_events( String.t(), ExAws.Location.Geofences.ForecastGeofenceEventsDeviceState.t(), forecast_geofence_events_opts() ) :: ExAws.Operation.JSON.t()
This action forecasts future geofence events that are likely to occur within a specified time horizon if a device continues moving at its current speed. Each forecasted event is associated with a geofence from a provided geofence collection. A forecast event can have one of the following states:
ENTER: The device position is outside the referenced geofence, but the device may cross into
the geofence during the forecasting time horizon if it maintains its current speed.
EXIT: The device position is inside the referenced geofence, but the device may leave the
geofence during the forecasted time horizon if the device maintains it's current speed.
IDLE:The device is inside the geofence, and it will remain inside the geofence through the
end of the time horizon if the device maintains it's current speed.
Heading direction is not considered in the current version. The API takes a conservative approach and includes events that can occur for any heading.
Parameters
collection_name- The name of the geofence collection.device_state- Represents the device's state, including its current position and speed. When speed is omitted, this API performs a containment check. The containment check operation returnsIDLEevents for geofences where the device is currently inside of, but no other events.
Options
:distance_unit- The distance unit used for theNearestDistanceproperty returned in a forecasted event. The measurement system must match forDistanceUnitandSpeedUnit; ifKilometersis specified forDistanceUnit, thenSpeedUnitmust beKilometersPerHour. Valid values:Kilometers,Miles.: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.:speed_unit- The speed unit for the device captured by the device state. The measurement system must match forDistanceUnitandSpeedUnit; ifKilometersis specified forDistanceUnit, thenSpeedUnitmust beKilometersPerHour. Valid values:KilometersPerHour,MilesPerHour.:time_horizon_minutes- The forward-looking time window for forecasting, specified in minutes. The API only returns events that are predicted to occur within this time horizon. When no value is specified, this API performs a containment check. The containment check operation returnsIDLEevents for geofences where the device is currently inside of, but no other events.
See https://docs.aws.amazon.com/location/previous/APIReference/API_ForecastGeofenceEvents.html
Retrieves the geofence details from a geofence collection.
The returned geometry will always match the geometry format used when the geofence was created.
Parameters
collection_name- The geofence collection storing the target geofence.geofence_id- The geofence you're retrieving details for.
See https://docs.aws.amazon.com/location/previous/APIReference/API_GetGeofence.html
@spec list_geofence_collections(list_geofence_collections_opts()) :: ExAws.Operation.JSON.t()
Lists geofence collections 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_ListGeofenceCollections.html
@spec list_geofences(String.t(), list_geofences_opts()) :: ExAws.Operation.JSON.t()
Lists geofences stored in a given geofence collection.
Parameters
collection_name- The name of the geofence collection storing the list of geofences.
Options
:max_results- An optional limit for the number of geofences 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_ListGeofences.html
@spec put_geofence( String.t(), String.t(), ExAws.Location.Geofences.GeofenceGeometry.t(), put_geofence_opts() ) :: ExAws.Operation.JSON.t()
Stores a geofence geometry in a given geofence collection, or updates the geometry of an existing geofence if a geofence ID is included in the request.
Parameters
collection_name- The geofence collection to store the geofence in.geofence_id- An identifier for the geofence. For example,ExampleGeofence-1.geometry- Contains the details to specify the position of the geofence. Can be a circle, a polygon, or a multipolygon.PolygonandMultiPolygongeometries can be defined using their respective parameters, or encoded in Geobuf format using theGeobufparameter. Including multiple geometry types in the same request will return a validation error.
Options
:geofence_properties- Associates one of more properties with the geofence. A property is a key-value pair stored with the geofence and added to any geofence event triggered with that geofence.
See https://docs.aws.amazon.com/location/previous/APIReference/API_PutGeofence.html
@spec update_geofence_collection(String.t(), update_geofence_collection_opts()) :: ExAws.Operation.JSON.t()
Updates the specified properties of a given geofence collection.
Parameters
collection_name- The name of the geofence collection to update.
Options
:description- Updates the description for the geofence collection.
See https://docs.aws.amazon.com/location/previous/APIReference/API_UpdateGeofenceCollection.html