| 1 | import * as sqs from "@distilled.cloud/aws/sqs"; |
| 2 | import * as Effect from "effect/Effect"; |
| 3 | import * as Binding from "../../Binding.ts"; |
| 4 | import type { Queue } from "./Queue.ts"; |
| 5 | |
| 6 | export 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 | */ |
| 33 | export 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 | |
| 48 | export const ListDeadLetterSourceQueues = |
| 49 | Binding.Service<ListDeadLetterSourceQueues>( |
| 50 | "AWS.SQS.ListDeadLetterSourceQueues", |
| 51 | ); |