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 SendDirectMessageRequest
6 extends iotdata.SendDirectMessageRequest {}
7
8/**
9 * Runtime binding for the IoT data-plane `SendDirectMessage` operation (IAM
10 * action `iot:SendDirectMessage`).
11 *
12 * Binding to a client id filter grants `iot:SendDirectMessage` on matching
13 * MQTT client ARNs (or all clients when the filter is omitted) and returns
14 * a callable that delivers a message directly to a connected client without
15 * publishing through a topic. Provide the implementation with
16 * `Effect.provide(AWS.IoT.SendDirectMessageHttp)`.
17 * ### MQTT Connections
18 * **Example:** Send a Command to a Device
19 * ```typescript
20 * const sendDirectMessage = yield* AWS.IoT.SendDirectMessage("sensor-*");
21 *
22 * yield* sendDirectMessage({
23 * clientId: "sensor-1",
24 * topic: "commands/reboot",
25 * payload: JSON.stringify({ at: "now" }),
26 * });
27 * ```
28 *
29 * @binding
30 */
31export interface SendDirectMessage extends Binding.Service<
32 SendDirectMessage,
33 "AWS.IoT.SendDirectMessage",
34 (
35 clientIdFilter?: string,
36 ) => Effect.Effect<
37 (
38 request: SendDirectMessageRequest,
39 ) => Effect.Effect<
40 iotdata.SendDirectMessageResponse,
41 iotdata.SendDirectMessageError
42 >
43 >
44> {}
45
46export const SendDirectMessage = Binding.Service<SendDirectMessage>(
47 "AWS.IoT.SendDirectMessage",
48);