1import type * as personalizeevents from "@distilled.cloud/aws/personalize-events";
2import type * as Effect from "effect/Effect";
3import * as Binding from "../../Binding.ts";
4import type { Dataset } from "./Dataset.ts";
5
6/**
7 * `PutItems` request with `datasetArn` injected from the bound dataset.
8 */
9export interface PutItemsRequest extends Omit<
10 personalizeevents.PutItemsRequest,
11 "datasetArn"
12> {}
13
14/**
15 * Runtime binding for `personalize:PutItems`, scoped to one {@link Dataset} —
16 * Adds or updates items incrementally in the bound Items {@link Dataset}
17 * — the streaming alternative to a bulk dataset import job for keeping
18 * the catalog fresh.
19 * Provide the implementation with
20 * `Effect.provide(AWS.Personalize.PutItemsHttp)`.
21 *
22 * ### Incremental Imports
23 * **Example:** Upsert an Item
24 * ```typescript
25 * // init
26 * const putItems = yield* Personalize.PutItems(itemsDataset);
27 *
28 * yield* putItems({
29 * items: [{
30 * itemId: "item-42",
31 * properties: JSON.stringify({ category: "books" }),
32 * }],
33 * });
34 * ```
35 *
36 * @binding
37 */
38export interface PutItems extends Binding.Service<
39 PutItems,
40 "AWS.Personalize.PutItems",
41 (
42 dataset: Dataset,
43 ) => Effect.Effect<
44 (
45 request: PutItemsRequest,
46 ) => Effect.Effect<
47 personalizeevents.PutItemsResponse,
48 personalizeevents.PutItemsError
49 >
50 >
51> {}
52export const PutItems = Binding.Service<PutItems>("AWS.Personalize.PutItems");