1import type * as iotdata from "@distilled.cloud/aws/iot-data-plane";
2import type * as Effect from "effect/Effect";
3import * as Binding from "../../Binding.ts";
4
5export interface GetRetainedMessageRequest
6 extends iotdata.GetRetainedMessageRequest {}
7
8/**
9 * Runtime binding for the IoT data-plane `GetRetainedMessage` operation (IAM
10 * action `iot:GetRetainedMessage`).
11 *
12 * Binding to a topic filter grants `iot:GetRetainedMessage` on matching
13 * topics (or all topics when the filter is omitted) and returns a callable
14 * that reads the retained MQTT message for a concrete topic. Provide the
15 * implementation with `Effect.provide(AWS.IoT.GetRetainedMessageHttp)`.
16 * ### Retained Messages
17 * **Example:** Read a Retained Message
18 * ```typescript
19 * const getRetained = yield* AWS.IoT.GetRetainedMessage("sensors/*");
20 *
21 * const { payload } = yield* getRetained({ topic: "sensors/1/state" });
22 * ```
23 *
24 * @binding
25 */
26export interface GetRetainedMessage extends Binding.Service<
27 GetRetainedMessage,
28 "AWS.IoT.GetRetainedMessage",
29 (
30 topicFilter?: string,
31 ) => Effect.Effect<
32 (
33 request: GetRetainedMessageRequest,
34 ) => Effect.Effect<
35 iotdata.GetRetainedMessageResponse,
36 iotdata.GetRetainedMessageError
37 >
38 >
39> {}
40
41export const GetRetainedMessage = Binding.Service<GetRetainedMessage>(
42 "AWS.IoT.GetRetainedMessage",
43);