| 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 GetAttributesRequest extends Omit< |
| 8 | sdb.GetAttributesRequest, |
| 9 | "DomainName" |
| 10 | > {} |
| 11 | |
| 12 | /** |
| 13 | * Runtime binding for `sdb:GetAttributes`. |
| 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 | * ### Reading Items |
| 18 | * **Example:** Read an Item's Attributes |
| 19 | * ```typescript |
| 20 | * const getAttributes = yield* AWS.SimpleDB.GetAttributes(domain); |
| 21 | * |
| 22 | * const response = yield* getAttributes({ |
| 23 | * ItemName: "user#123", |
| 24 | * ConsistentRead: true, |
| 25 | * }); |
| 26 | * // response.Attributes: [{ Name: "email", Value: "a@b.com" }, ...] |
| 27 | * ``` |
| 28 | * |
| 29 | * @binding |
| 30 | */ |
| 31 | export interface GetAttributes extends Binding.Service< |
| 32 | GetAttributes, |
| 33 | "AWS.SimpleDB.GetAttributes", |
| 34 | ( |
| 35 | domain: Domain, |
| 36 | ) => Effect.Effect< |
| 37 | ( |
| 38 | request: GetAttributesRequest, |
| 39 | ) => Effect.Effect< |
| 40 | sdb.GetAttributesResponse, |
| 41 | sdb.GetAttributesError, |
| 42 | RuntimeContext |
| 43 | > |
| 44 | > |
| 45 | > {} |
| 46 | export const GetAttributes = Binding.Service<GetAttributes>( |
| 47 | "AWS.SimpleDB.GetAttributes", |
| 48 | ); |