1import type * as sdb from "@distilled.cloud/aws/simpledb";
2import type * as Effect from "effect/Effect";
3import * as Binding from "../../Binding.ts";
4import type { RuntimeContext } from "../../RuntimeContext.ts";
5import type { Domain } from "./Domain.ts";
6
7export 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 */
31export 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> {}
46export const GetAttributes = Binding.Service<GetAttributes>(
47 "AWS.SimpleDB.GetAttributes",
48);