1import type * as featurestore from "@distilled.cloud/aws/sagemaker-featurestore-runtime";
2import type * as Effect from "effect/Effect";
3import * as Binding from "../../Binding.ts";
4import type { FeatureGroup } from "./FeatureGroup.ts";
5
6export interface GetRecordRequest extends Omit<
7 featurestore.GetRecordRequest,
8 "FeatureGroupName"
9> {}
10
11/**
12 * Runtime binding for `sagemaker:GetRecord` — read the latest record for an
13 * identifier from a `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. If no record
17 * exists for the identifier, the response's `Record` is empty.
18 * ### Reading Records
19 * **Example:** Get a Record
20 * ```typescript
21 * // init
22 * const getRecord = yield* AWS.SageMaker.GetRecord(featureGroup);
23 *
24 * // runtime
25 * const { Record } = yield* getRecord({
26 * RecordIdentifierValueAsString: "user-123",
27 * });
28 * ```
29 *
30 * @binding
31 */
32export interface GetRecord extends Binding.Service<
33 GetRecord,
34 "AWS.SageMaker.GetRecord",
35 <F extends FeatureGroup>(
36 featureGroup: F,
37 ) => Effect.Effect<
38 (
39 request: GetRecordRequest,
40 ) => Effect.Effect<
41 featurestore.GetRecordResponse,
42 featurestore.GetRecordError
43 >
44 >
45> {}
46export const GetRecord = Binding.Service<GetRecord>("AWS.SageMaker.GetRecord");