- Navigation GuideYou are on a Command (operation) page with structural examples. Use the navigation breadcrumb if you would like to return to the Client landing page.
GetGeofenceCommand
Retrieves the geofence details from a geofence collection.
The returned geometry will always match the geometry format used when the geofence was created.
Example Syntax
Use a bare-bones client and the command you need to make an API call.
import { LocationClient, GetGeofenceCommand } from "@aws-sdk/client-location"; // ES Modules import
// const { LocationClient, GetGeofenceCommand } = require("@aws-sdk/client-location"); // CommonJS import
const client = new LocationClient(config);
const input = { // GetGeofenceRequest
CollectionName: "STRING_VALUE", // required
GeofenceId: "STRING_VALUE", // required
};
const command = new GetGeofenceCommand(input);
const response = await client.send(command);
// { // GetGeofenceResponse
// GeofenceId: "STRING_VALUE", // required
// Geometry: { // GeofenceGeometry
// Polygon: [ // LinearRings
// [ // LinearRing
// [ // Position
// Number("double"),
// ],
// ],
// ],
// Circle: { // Circle
// Center: [ // required
// Number("double"),
// ],
// Radius: Number("double"), // required
// },
// Geobuf: new Uint8Array(),
// },
// Status: "STRING_VALUE", // required
// CreateTime: new Date("TIMESTAMP"), // required
// UpdateTime: new Date("TIMESTAMP"), // required
// GeofenceProperties: { // PropertyMap
// "<keys>": "STRING_VALUE",
// },
// };
GetGeofenceCommand Input
Parameter | Type | Description |
---|
Parameter | Type | Description |
---|---|---|
CollectionName Required | string | undefined | The geofence collection storing the target geofence. |
GeofenceId Required | string | undefined | The geofence you're retrieving details for. |
GetGeofenceCommand Output
Parameter | Type | Description |
---|
Parameter | Type | Description |
---|---|---|
$metadata Required | ResponseMetadata | Metadata pertaining to this request. |
CreateTime Required | Date | undefined | The timestamp for when the geofence collection was created in ISO 8601 format: |
GeofenceId Required | string | undefined | The geofence identifier. |
Geometry Required | GeofenceGeometry | undefined | Contains the geofence geometry details describing a polygon or a circle. |
Status Required | string | undefined | Identifies the state of the geofence. A geofence will hold one of the following states:
|
UpdateTime Required | Date | undefined | The timestamp for when the geofence collection was last updated in ISO 8601 format: |
GeofenceProperties | Record<string, string> | undefined | User defined properties of the geofence. A property is a key-value pair stored with the geofence and added to any geofence event triggered with that geofence. Format: |
Throws
Name | Fault | Details |
---|
Name | Fault | Details |
---|---|---|
AccessDeniedException | client | The request was denied because of insufficient access or permissions. Check with an administrator to verify your permissions. |
InternalServerException | server | The request has failed to process because of an unknown server error, exception, or failure. |
ResourceNotFoundException | client | The resource that you've entered was not found in your AWS account. |
ThrottlingException | client | The request was denied because of request throttling. |
ValidationException | client | The input failed to meet the constraints specified by the AWS service. |
LocationServiceException | Base exception class for all service exceptions from Location service. |