The best way to control Claude Code, Codex and more from any computer or phone
| 1 | import type * as iotdata from "@distilled.cloud/aws/iot-data-plane"; |
| 2 | import * as Binding from "alchemy/Binding"; |
| 3 | import type * as Effect from "effect/Effect"; |
| 4 | |
| 5 | export interface GetConnectionRequest extends iotdata.GetConnectionRequest {} |
| 6 | |
| 7 | /** |
| 8 | * Runtime binding for the IoT data-plane `GetConnection` operation (IAM |
| 9 | * action `iot:GetConnection`). |
| 10 | * |
| 11 | * Binding to a client id filter grants `iot:GetConnection` on matching |
| 12 | * MQTT client ARNs (or all clients when the filter is omitted) and returns |
| 13 | * a callable that reads a client's connection state. Provide the |
| 14 | * implementation with `Effect.provide(AWS.IoT.GetConnectionHttp)`. |
| 15 | * ### MQTT Connections |
| 16 | * **Example:** Check a Device's Connectivity |
| 17 | * ```typescript |
| 18 | * const getConnection = yield* AWS.IoT.GetConnection("sensor-*"); |
| 19 | * |
| 20 | * const { connected } = yield* getConnection({ clientId: "sensor-1" }); |
| 21 | * ``` |
| 22 | * |
| 23 | * @binding |
| 24 | */ |
| 25 | export interface GetConnection extends Binding.Service< |
| 26 | GetConnection, |
| 27 | "AWS.IoT.GetConnection", |
| 28 | ( |
| 29 | clientIdFilter?: string, |
| 30 | ) => Effect.Effect< |
| 31 | ( |
| 32 | request: GetConnectionRequest, |
| 33 | ) => Effect.Effect<iotdata.GetConnectionResponse, iotdata.GetConnectionError> |
| 34 | > |
| 35 | > {} |
| 36 | |
| 37 | export const GetConnection = Binding.Service<GetConnection>("AWS.IoT.GetConnection"); |