| 1 | import type * as iotfleetwise from "@distilled.cloud/aws/iotfleetwise"; |
| 2 | import type * as Effect from "effect/Effect"; |
| 3 | import * as Binding from "../../Binding.ts"; |
| 4 | import type { Vehicle } from "./Vehicle.ts"; |
| 5 | |
| 6 | /** |
| 7 | * `GetVehicleStatus` request with `vehicleName` injected from the bound |
| 8 | * vehicle. |
| 9 | */ |
| 10 | export interface GetVehicleStatusRequest extends Omit< |
| 11 | iotfleetwise.GetVehicleStatusRequest, |
| 12 | "vehicleName" |
| 13 | > {} |
| 14 | |
| 15 | /** |
| 16 | * Runtime binding for the `GetVehicleStatus` operation (IAM action |
| 17 | * `iotfleetwise:GetVehicleStatus`), scoped to one {@link Vehicle}. |
| 18 | * |
| 19 | * Reads the deployment status of the campaigns, decoder manifests, and |
| 20 | * state templates associated with the bound vehicle. Provide the |
| 21 | * implementation with |
| 22 | * `Effect.provide(AWS.IoTFleetWise.GetVehicleStatusHttp)`. |
| 23 | * |
| 24 | * ### Vehicle Status |
| 25 | * **Example:** Check Campaign Deployment on a Vehicle |
| 26 | * ```typescript |
| 27 | * const getVehicleStatus = yield* IoTFleetWise.GetVehicleStatus(vehicle); |
| 28 | * |
| 29 | * const status = yield* getVehicleStatus(); |
| 30 | * for (const campaign of status.campaigns ?? []) { |
| 31 | * console.log(campaign.campaignName, campaign.status); |
| 32 | * } |
| 33 | * ``` |
| 34 | * |
| 35 | * @binding |
| 36 | */ |
| 37 | export interface GetVehicleStatus extends Binding.Service< |
| 38 | GetVehicleStatus, |
| 39 | "AWS.IoTFleetWise.GetVehicleStatus", |
| 40 | ( |
| 41 | vehicle: Vehicle, |
| 42 | ) => Effect.Effect< |
| 43 | ( |
| 44 | request?: GetVehicleStatusRequest, |
| 45 | ) => Effect.Effect< |
| 46 | iotfleetwise.GetVehicleStatusResponse, |
| 47 | iotfleetwise.GetVehicleStatusError |
| 48 | > |
| 49 | > |
| 50 | > {} |
| 51 | export const GetVehicleStatus = Binding.Service<GetVehicleStatus>( |
| 52 | "AWS.IoTFleetWise.GetVehicleStatus", |
| 53 | ); |