| 1 | import * as featurestore from "@distilled.cloud/aws/sagemaker-featurestore-runtime"; |
| 2 | import * as Layer from "effect/Layer"; |
| 3 | import { |
| 4 | BatchWriteRecord, |
| 5 | type BatchWriteRecordRequest, |
| 6 | } from "./BatchWriteRecord.ts"; |
| 7 | import { makeFeatureGroupHttpBinding } from "./BindingHttp.ts"; |
| 8 | |
| 9 | export const BatchWriteRecordHttp = Layer.effect( |
| 10 | BatchWriteRecord, |
| 11 | makeFeatureGroupHttpBinding({ |
| 12 | tag: "AWS.SageMaker.BatchWriteRecord", |
| 13 | operation: featurestore.batchWriteRecord, |
| 14 | actions: ["sagemaker:BatchWriteRecord"], |
| 15 | // The wire request identifies the feature group per entry — scope every |
| 16 | // entry to the bound feature group. |
| 17 | prepare: (request: BatchWriteRecordRequest, featureGroupName) => ({ |
| 18 | Entries: request.Entries.map((entry) => ({ |
| 19 | ...entry, |
| 20 | FeatureGroupName: featureGroupName, |
| 21 | })), |
| 22 | TtlDuration: request.TtlDuration, |
| 23 | }), |
| 24 | }), |
| 25 | ); |