| 1 | import type * as personalizeevents from "@distilled.cloud/aws/personalize-events"; |
| 2 | import type * as Effect from "effect/Effect"; |
| 3 | import * as Binding from "../../Binding.ts"; |
| 4 | import type { Dataset } from "./Dataset.ts"; |
| 5 | |
| 6 | /** |
| 7 | * `PutActions` request with `datasetArn` injected from the bound dataset. |
| 8 | */ |
| 9 | export interface PutActionsRequest extends Omit< |
| 10 | personalizeevents.PutActionsRequest, |
| 11 | "datasetArn" |
| 12 | > {} |
| 13 | |
| 14 | /** |
| 15 | * Runtime binding for `personalize:PutActions`, scoped to one {@link Dataset} — |
| 16 | * Adds or updates actions incrementally in the bound Actions |
| 17 | * {@link Dataset} for the NEXT_BEST_ACTION recipe. |
| 18 | * Provide the implementation with |
| 19 | * `Effect.provide(AWS.Personalize.PutActionsHttp)`. |
| 20 | * |
| 21 | * ### Incremental Imports |
| 22 | * **Example:** Upsert an Action |
| 23 | * ```typescript |
| 24 | * // init |
| 25 | * const putActions = yield* Personalize.PutActions(actionsDataset); |
| 26 | * |
| 27 | * yield* putActions({ actions: [{ actionId: "action-1" }] }); |
| 28 | * ``` |
| 29 | * |
| 30 | * @binding |
| 31 | */ |
| 32 | export interface PutActions extends Binding.Service< |
| 33 | PutActions, |
| 34 | "AWS.Personalize.PutActions", |
| 35 | ( |
| 36 | dataset: Dataset, |
| 37 | ) => Effect.Effect< |
| 38 | ( |
| 39 | request: PutActionsRequest, |
| 40 | ) => Effect.Effect< |
| 41 | personalizeevents.PutActionsResponse, |
| 42 | personalizeevents.PutActionsError |
| 43 | > |
| 44 | > |
| 45 | > {} |
| 46 | export const PutActions = Binding.Service<PutActions>( |
| 47 | "AWS.Personalize.PutActions", |
| 48 | ); |