| 1 | import type * as featurestore from "@distilled.cloud/aws/sagemaker-featurestore-runtime"; |
| 2 | import type * as Effect from "effect/Effect"; |
| 3 | import * as Binding from "../../Binding.ts"; |
| 4 | import type { FeatureGroup } from "./FeatureGroup.ts"; |
| 5 | |
| 6 | export interface DeleteRecordRequest extends Omit< |
| 7 | featurestore.DeleteRecordRequest, |
| 8 | "FeatureGroupName" |
| 9 | > {} |
| 10 | |
| 11 | /** |
| 12 | * Runtime binding for `sagemaker:DeleteRecord` — delete a record from a |
| 13 | * `FeatureGroup`'s online store. |
| 14 | * |
| 15 | * Bind this operation to a `FeatureGroup` inside a function runtime to get a |
| 16 | * callable that automatically injects the feature group name. The default |
| 17 | * `SoftDelete` mode nulls the feature columns; `HardDelete` removes the |
| 18 | * record entirely. `EventTime` must be later than the stored record's event |
| 19 | * time for the deletion to take effect. |
| 20 | * ### Deleting Records |
| 21 | * **Example:** Soft-Delete a Record |
| 22 | * ```typescript |
| 23 | * // init |
| 24 | * const deleteRecord = yield* AWS.SageMaker.DeleteRecord(featureGroup); |
| 25 | * |
| 26 | * // runtime |
| 27 | * yield* deleteRecord({ |
| 28 | * RecordIdentifierValueAsString: "user-123", |
| 29 | * EventTime: new Date().toISOString(), |
| 30 | * }); |
| 31 | * ``` |
| 32 | * |
| 33 | * @binding |
| 34 | */ |
| 35 | export interface DeleteRecord extends Binding.Service< |
| 36 | DeleteRecord, |
| 37 | "AWS.SageMaker.DeleteRecord", |
| 38 | <F extends FeatureGroup>( |
| 39 | featureGroup: F, |
| 40 | ) => Effect.Effect< |
| 41 | ( |
| 42 | request: DeleteRecordRequest, |
| 43 | ) => Effect.Effect< |
| 44 | featurestore.DeleteRecordResponse, |
| 45 | featurestore.DeleteRecordError |
| 46 | > |
| 47 | > |
| 48 | > {} |
| 49 | export const DeleteRecord = Binding.Service<DeleteRecord>( |
| 50 | "AWS.SageMaker.DeleteRecord", |
| 51 | ); |