| 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 BatchGetRecordRequest { |
| 7 | /** |
| 8 | * The record-identifier values to retrieve from the bound feature group. |
| 9 | */ |
| 10 | RecordIdentifiersValueAsString: string[]; |
| 11 | /** |
| 12 | * Restrict the returned features to this subset (all features by default). |
| 13 | */ |
| 14 | FeatureNames?: string[]; |
| 15 | /** |
| 16 | * Include each record's `ExpiresAt` in the response (`"Enabled"`). |
| 17 | */ |
| 18 | ExpirationTimeResponse?: featurestore.ExpirationTimeResponse; |
| 19 | } |
| 20 | |
| 21 | /** |
| 22 | * Runtime binding for `sagemaker:BatchGetRecord` — read a batch of records |
| 23 | * from a `FeatureGroup`'s online store in one call. |
| 24 | * |
| 25 | * Bind this operation to a `FeatureGroup` inside a function runtime to get a |
| 26 | * callable that automatically scopes the batch identifiers to the bound |
| 27 | * feature group. Unknown identifiers are simply absent from `Records` (they |
| 28 | * are not errors). |
| 29 | * ### Reading Records |
| 30 | * **Example:** Batch-Get Records |
| 31 | * ```typescript |
| 32 | * // init |
| 33 | * const batchGetRecord = yield* AWS.SageMaker.BatchGetRecord(featureGroup); |
| 34 | * |
| 35 | * // runtime |
| 36 | * const { Records } = yield* batchGetRecord({ |
| 37 | * RecordIdentifiersValueAsString: ["user-1", "user-2"], |
| 38 | * }); |
| 39 | * ``` |
| 40 | * |
| 41 | * @binding |
| 42 | */ |
| 43 | export interface BatchGetRecord extends Binding.Service< |
| 44 | BatchGetRecord, |
| 45 | "AWS.SageMaker.BatchGetRecord", |
| 46 | <F extends FeatureGroup>( |
| 47 | featureGroup: F, |
| 48 | ) => Effect.Effect< |
| 49 | ( |
| 50 | request: BatchGetRecordRequest, |
| 51 | ) => Effect.Effect< |
| 52 | featurestore.BatchGetRecordResponse, |
| 53 | featurestore.BatchGetRecordError |
| 54 | > |
| 55 | > |
| 56 | > {} |
| 57 | export const BatchGetRecord = Binding.Service<BatchGetRecord>( |
| 58 | "AWS.SageMaker.BatchGetRecord", |
| 59 | ); |