1import * as sqs from "@distilled.cloud/aws/sqs";
2import * as Effect from "effect/Effect";
3import * as Binding from "../../Binding.ts";
4import type { Queue } from "./Queue.ts";
5
6export interface ListDeadLetterSourceQueuesRequest extends Omit<
7 sqs.ListDeadLetterSourceQueuesRequest,
8 "QueueUrl"
9> {}
10
11/**
12 * Runtime binding for `sqs:ListDeadLetterSourceQueues`.
13 *
14 * Bind this operation to a dead-letter {@link Queue} inside a function
15 * runtime to enumerate the source queues whose `redrivePolicy` targets it.
16 * The binding grants the host function `sqs:ListDeadLetterSourceQueues` on
17 * the queue. Provide the `ListDeadLetterSourceQueuesHttp` layer on the
18 * Function to implement the binding.
19 * ### Dead-Letter Queue Redrive
20 * **Example:** List Source Queues of a Dead-Letter Queue
21 * ```typescript
22 * // init (provide SQS.ListDeadLetterSourceQueuesHttp on the Function)
23 * const listDeadLetterSourceQueues =
24 * yield* SQS.ListDeadLetterSourceQueues(dlq);
25 *
26 * // runtime
27 * const result = yield* listDeadLetterSourceQueues();
28 * // result.queueUrls: URLs of every queue using `dlq` as its DLQ
29 * ```
30 *
31 * @binding
32 */
33export interface ListDeadLetterSourceQueues extends Binding.Service<
34 ListDeadLetterSourceQueues,
35 "AWS.SQS.ListDeadLetterSourceQueues",
36 (
37 queue: Queue,
38 ) => Effect.Effect<
39 (
40 request?: ListDeadLetterSourceQueuesRequest,
41 ) => Effect.Effect<
42 sqs.ListDeadLetterSourceQueuesResult,
43 sqs.ListDeadLetterSourceQueuesError
44 >
45 >
46> {}
47
48export const ListDeadLetterSourceQueues =
49 Binding.Service<ListDeadLetterSourceQueues>(
50 "AWS.SQS.ListDeadLetterSourceQueues",
51 );