| 1 | import type * as location from "@distilled.cloud/aws/location"; |
| 2 | import type * as Effect from "effect/Effect"; |
| 3 | import * as Binding from "../../Binding.ts"; |
| 4 | import type { GeofenceCollection } from "./GeofenceCollection.ts"; |
| 5 | |
| 6 | /** |
| 7 | * `BatchEvaluateGeofences` request with `CollectionName` injected from the bound |
| 8 | * resource. |
| 9 | */ |
| 10 | export interface BatchEvaluateGeofencesRequest extends Omit< |
| 11 | location.BatchEvaluateGeofencesRequest, |
| 12 | "CollectionName" |
| 13 | > {} |
| 14 | |
| 15 | /** |
| 16 | * Evaluates device positions against the collection's geofences, emitting ENTER/EXIT events to EventBridge for linked trackers. |
| 17 | * |
| 18 | * Runtime binding for the `BatchEvaluateGeofences` operation (IAM action |
| 19 | * `geo:BatchEvaluateGeofences`), scoped to one {@link GeofenceCollection}. Provide the implementation with |
| 20 | * `Effect.provide(AWS.Location.BatchEvaluateGeofencesHttp)`. |
| 21 | * |
| 22 | * ### Evaluating Positions Against Geofences |
| 23 | * **Example:** Evaluate Positions |
| 24 | * ```typescript |
| 25 | * const evaluate = yield* Location.BatchEvaluateGeofences(collection); |
| 26 | * |
| 27 | * yield* evaluate({ |
| 28 | * DevicePositionUpdates: [ |
| 29 | * { |
| 30 | * DeviceId: "vehicle-1", |
| 31 | * Position: [-122.3493, 47.6205], |
| 32 | * SampleTime: new Date(), |
| 33 | * }, |
| 34 | * ], |
| 35 | * }); |
| 36 | * ``` |
| 37 | * |
| 38 | * @binding |
| 39 | */ |
| 40 | export interface BatchEvaluateGeofences extends Binding.Service< |
| 41 | BatchEvaluateGeofences, |
| 42 | "AWS.Location.BatchEvaluateGeofences", |
| 43 | ( |
| 44 | collection: GeofenceCollection, |
| 45 | ) => Effect.Effect< |
| 46 | ( |
| 47 | request: BatchEvaluateGeofencesRequest, |
| 48 | ) => Effect.Effect< |
| 49 | location.BatchEvaluateGeofencesResponse, |
| 50 | location.BatchEvaluateGeofencesError |
| 51 | > |
| 52 | > |
| 53 | > {} |
| 54 | export const BatchEvaluateGeofences = Binding.Service<BatchEvaluateGeofences>( |
| 55 | "AWS.Location.BatchEvaluateGeofences", |
| 56 | ); |