| 1 | import type * as iotdata from "@distilled.cloud/aws/iot-data-plane"; |
| 2 | import type * as Effect from "effect/Effect"; |
| 3 | import * as Binding from "../../Binding.ts"; |
| 4 | |
| 5 | export interface DeleteConnectionRequest |
| 6 | extends iotdata.DeleteConnectionRequest {} |
| 7 | |
| 8 | /** |
| 9 | * Runtime binding for the IoT data-plane `DeleteConnection` operation (IAM |
| 10 | * action `iot:DeleteConnection`). |
| 11 | * |
| 12 | * Binding to a client id filter grants `iot:DeleteConnection` on matching |
| 13 | * MQTT client ARNs (or all clients when the filter is omitted) and returns |
| 14 | * a callable that force-disconnects a connected client, optionally cleaning |
| 15 | * its session state. Provide the implementation with |
| 16 | * `Effect.provide(AWS.IoT.DeleteConnectionHttp)`. |
| 17 | * ### MQTT Connections |
| 18 | * **Example:** Kick a Device off the Broker |
| 19 | * ```typescript |
| 20 | * const deleteConnection = yield* AWS.IoT.DeleteConnection("sensor-*"); |
| 21 | * |
| 22 | * yield* deleteConnection({ clientId: "sensor-1", cleanSession: true }); |
| 23 | * ``` |
| 24 | * |
| 25 | * @binding |
| 26 | */ |
| 27 | export interface DeleteConnection extends Binding.Service< |
| 28 | DeleteConnection, |
| 29 | "AWS.IoT.DeleteConnection", |
| 30 | ( |
| 31 | clientIdFilter?: string, |
| 32 | ) => Effect.Effect< |
| 33 | ( |
| 34 | request: DeleteConnectionRequest, |
| 35 | ) => Effect.Effect< |
| 36 | iotdata.DeleteConnectionResponse, |
| 37 | iotdata.DeleteConnectionError |
| 38 | > |
| 39 | > |
| 40 | > {} |
| 41 | |
| 42 | export const DeleteConnection = Binding.Service<DeleteConnection>( |
| 43 | "AWS.IoT.DeleteConnection", |
| 44 | ); |