1import type * as iot from "@distilled.cloud/aws/iot";
2import type * as Effect from "effect/Effect";
3import * as Binding from "../../Binding.ts";
4import type { Thing } from "./Thing.ts";
5
6export interface DescribeThingRequest extends Omit<
7 iot.DescribeThingRequest,
8 "thingName"
9> {}
10
11/**
12 * Runtime binding for the `DescribeThing` operation (IAM action
13 * `iot:DescribeThing`).
14 *
15 * Bind it to a {@link Thing} to read the thing's registry entry (attributes,
16 * thing type, version) at runtime — the thing name is injected
17 * automatically. Provide the implementation with
18 * `Effect.provide(AWS.IoT.DescribeThingHttp)`.
19 * ### Registry
20 * **Example:** Read Thing Attributes
21 * ```typescript
22 * const describeThing = yield* AWS.IoT.DescribeThing(thing);
23 *
24 * const { attributes } = yield* describeThing();
25 * ```
26 *
27 * @binding
28 */
29export interface DescribeThing extends Binding.Service<
30 DescribeThing,
31 "AWS.IoT.DescribeThing",
32 (
33 thing: Thing,
34 ) => Effect.Effect<
35 (
36 request?: DescribeThingRequest,
37 ) => Effect.Effect<iot.DescribeThingResponse, iot.DescribeThingError>
38 >
39> {}
40
41export const DescribeThing = Binding.Service<DescribeThing>(
42 "AWS.IoT.DescribeThing",
43);