| 1 | import type * as sdb from "@distilled.cloud/aws/simpledb"; |
| 2 | import type * as Effect from "effect/Effect"; |
| 3 | import * as Binding from "../../Binding.ts"; |
| 4 | import type { RuntimeContext } from "../../RuntimeContext.ts"; |
| 5 | import type { Domain } from "./Domain.ts"; |
| 6 | |
| 7 | export interface PutAttributesRequest extends Omit< |
| 8 | sdb.PutAttributesRequest, |
| 9 | "DomainName" |
| 10 | > {} |
| 11 | |
| 12 | /** |
| 13 | * Runtime binding for `sdb:PutAttributes`. |
| 14 | * |
| 15 | * Bind this operation to a {@link Domain} inside a function runtime to get a |
| 16 | * callable that automatically injects the domain name. |
| 17 | * ### Writing Items |
| 18 | * **Example:** Put Attributes on an Item |
| 19 | * ```typescript |
| 20 | * const putAttributes = yield* AWS.SimpleDB.PutAttributes(domain); |
| 21 | * |
| 22 | * yield* putAttributes({ |
| 23 | * ItemName: "user#123", |
| 24 | * Attributes: [ |
| 25 | * { Name: "email", Value: "a@b.com", Replace: true }, |
| 26 | * { Name: "plan", Value: "pro", Replace: true }, |
| 27 | * ], |
| 28 | * }); |
| 29 | * ``` |
| 30 | * |
| 31 | * @binding |
| 32 | */ |
| 33 | export interface PutAttributes extends Binding.Service< |
| 34 | PutAttributes, |
| 35 | "AWS.SimpleDB.PutAttributes", |
| 36 | ( |
| 37 | domain: Domain, |
| 38 | ) => Effect.Effect< |
| 39 | ( |
| 40 | request: PutAttributesRequest, |
| 41 | ) => Effect.Effect< |
| 42 | sdb.PutAttributesResponse, |
| 43 | sdb.PutAttributesError, |
| 44 | RuntimeContext |
| 45 | > |
| 46 | > |
| 47 | > {} |
| 48 | export const PutAttributes = Binding.Service<PutAttributes>( |
| 49 | "AWS.SimpleDB.PutAttributes", |
| 50 | ); |