1import type * as iotw from "@distilled.cloud/aws/iot-wireless";
2import type * as Effect from "effect/Effect";
3import * as Binding from "../../Binding.ts";
4import type { WirelessDevice } from "./WirelessDevice.ts";
5
6/**
7 * Request for {@link DeleteQueuedMessages}. The bound device's id is
8 * injected automatically. Pass `MessageId: "*"` to purge the whole queue.
9 */
10export interface DeleteQueuedMessagesRequest extends Omit<
11 iotw.DeleteQueuedMessagesRequest,
12 "Id"
13> {}
14
15/**
16 * Runtime binding for `iotwireless:DeleteQueuedMessages` — delete queued
17 * downlink messages for the bound wireless device from a deployed Lambda or
18 * Task.
19 *
20 * ### Purging the Downlink Queue
21 * Provide the `DeleteQueuedMessagesHttp` implementation layer on the
22 * Function effect, bind the device in the init phase, then call the
23 * returned client at runtime.
24 *
25 * **Example:** Purge All Pending Downlinks
26 * ```typescript
27 * // init
28 * const deleteQueued = yield* AWS.IoTWireless.DeleteQueuedMessages(device);
29 *
30 * // runtime — "*" deletes every queued message
31 * yield* deleteQueued({ MessageId: "*" });
32 * // on the Function effect:
33 * // .pipe(Effect.provide(AWS.IoTWireless.DeleteQueuedMessagesHttp))
34 * ```
35 *
36 * @binding
37 */
38export interface DeleteQueuedMessages extends Binding.Service<
39 DeleteQueuedMessages,
40 "AWS.IoTWireless.DeleteQueuedMessages",
41 (
42 device: WirelessDevice,
43 ) => Effect.Effect<
44 (
45 request: DeleteQueuedMessagesRequest,
46 ) => Effect.Effect<
47 iotw.DeleteQueuedMessagesResponse,
48 iotw.DeleteQueuedMessagesError
49 >
50 >
51> {}
52export const DeleteQueuedMessages = Binding.Service<DeleteQueuedMessages>(
53 "AWS.IoTWireless.DeleteQueuedMessages",
54);