| 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 { Tracker } from "./Tracker.ts"; |
| 5 | |
| 6 | /** |
| 7 | * `ListDevicePositions` request with `TrackerName` injected from the bound |
| 8 | * resource. |
| 9 | */ |
| 10 | export interface ListDevicePositionsRequest extends Omit< |
| 11 | location.ListDevicePositionsRequest, |
| 12 | "TrackerName" |
| 13 | > {} |
| 14 | |
| 15 | /** |
| 16 | * Lists the latest position of every device reported to the tracker, optionally filtered by a polygon. |
| 17 | * |
| 18 | * Runtime binding for the `ListDevicePositions` operation (IAM action |
| 19 | * `geo:ListDevicePositions`), scoped to one {@link Tracker}. Provide the implementation with |
| 20 | * `Effect.provide(AWS.Location.ListDevicePositionsHttp)`. |
| 21 | * |
| 22 | * ### Reading Device Positions |
| 23 | * **Example:** List All Device Positions |
| 24 | * ```typescript |
| 25 | * const listPositions = yield* Location.ListDevicePositions(tracker); |
| 26 | * |
| 27 | * const page = yield* listPositions(); |
| 28 | * // page.Entries → [{ DeviceId, Position, SampleTime }, …] |
| 29 | * ``` |
| 30 | * |
| 31 | * @binding |
| 32 | */ |
| 33 | export interface ListDevicePositions extends Binding.Service< |
| 34 | ListDevicePositions, |
| 35 | "AWS.Location.ListDevicePositions", |
| 36 | ( |
| 37 | tracker: Tracker, |
| 38 | ) => Effect.Effect< |
| 39 | ( |
| 40 | request?: ListDevicePositionsRequest, |
| 41 | ) => Effect.Effect< |
| 42 | location.ListDevicePositionsResponse, |
| 43 | location.ListDevicePositionsError |
| 44 | > |
| 45 | > |
| 46 | > {} |
| 47 | export const ListDevicePositions = Binding.Service<ListDevicePositions>( |
| 48 | "AWS.Location.ListDevicePositions", |
| 49 | ); |