| 1 | import * as iotfleetwise from "@distilled.cloud/aws/iotfleetwise"; |
| 2 | import * as Layer from "effect/Layer"; |
| 3 | import { AssociateVehicleFleet } from "./AssociateVehicleFleet.ts"; |
| 4 | import { makeFleetWiseResourceHttpBinding } from "./BindingHttp.ts"; |
| 5 | import type { Fleet } from "./Fleet.ts"; |
| 6 | |
| 7 | export const AssociateVehicleFleetHttp = Layer.effect( |
| 8 | AssociateVehicleFleet, |
| 9 | makeFleetWiseResourceHttpBinding({ |
| 10 | tag: "AWS.IoTFleetWise.AssociateVehicleFleet", |
| 11 | operation: iotfleetwise.associateVehicleFleet, |
| 12 | actions: ["iotfleetwise:AssociateVehicleFleet"], |
| 13 | requestKey: "fleetId", |
| 14 | identifier: (fleet: Fleet) => fleet.fleetId, |
| 15 | // The action authorizes on both the fleet and the vehicle; the vehicle |
| 16 | // is a runtime argument, so its grant is the account-wide pattern. |
| 17 | resources: (fleet: Fleet) => [ |
| 18 | fleet.fleetArn, |
| 19 | "arn:aws:iotfleetwise:*:*:vehicle/*", |
| 20 | ], |
| 21 | }), |
| 22 | ); |