| 1 | import * as TSW from "@distilled.cloud/aws/timestream-write"; |
| 2 | import * as Layer from "effect/Layer"; |
| 3 | import { makeWriteTableHttpBinding } from "./BindingHttp.ts"; |
| 4 | import { |
| 5 | CreateBatchLoadTask, |
| 6 | type CreateBatchLoadTaskRequest, |
| 7 | } from "./CreateBatchLoadTask.ts"; |
| 8 | |
| 9 | export const CreateBatchLoadTaskHttp = Layer.effect( |
| 10 | CreateBatchLoadTask, |
| 11 | makeWriteTableHttpBinding({ |
| 12 | tag: "AWS.Timestream.CreateBatchLoadTask", |
| 13 | operation: TSW.createBatchLoadTask, |
| 14 | actions: ["timestream:CreateBatchLoadTask"], |
| 15 | // Batch load authorizes against both the target table and its database. |
| 16 | grantDatabaseArn: true, |
| 17 | toRequest: (request: CreateBatchLoadTaskRequest, names) => ({ |
| 18 | ...request, |
| 19 | TargetDatabaseName: names.DatabaseName, |
| 20 | TargetTableName: names.TableName, |
| 21 | }), |
| 22 | }), |
| 23 | ); |