| 1 | import * as Kinesis from "@distilled.cloud/aws/kinesis"; |
| 2 | import * as Effect from "effect/Effect"; |
| 3 | import * as Binding from "../../Binding.ts"; |
| 4 | import type { Stream } from "./Stream.ts"; |
| 5 | |
| 6 | export interface ListStreamConsumersRequest extends Omit< |
| 7 | Kinesis.ListStreamConsumersInput, |
| 8 | "StreamARN" |
| 9 | > {} |
| 10 | |
| 11 | /** |
| 12 | * Runtime binding for `kinesis:ListStreamConsumers`. |
| 13 | * |
| 14 | * Bind this operation to a `Stream` to enumerate the enhanced fan-out |
| 15 | * consumers registered on it — the stream ARN is injected automatically. |
| 16 | * Provide the implementation with |
| 17 | * `Effect.provide(AWS.Kinesis.ListStreamConsumersHttp)`. |
| 18 | * ### Enhanced Fan-Out |
| 19 | * **Example:** List Registered Consumers |
| 20 | * ```typescript |
| 21 | * // init |
| 22 | * const listStreamConsumers = yield* AWS.Kinesis.ListStreamConsumers(stream); |
| 23 | * |
| 24 | * // runtime |
| 25 | * const result = yield* listStreamConsumers(); |
| 26 | * const names = (result.Consumers ?? []).map((c) => c.ConsumerName); |
| 27 | * ``` |
| 28 | * |
| 29 | * @binding |
| 30 | */ |
| 31 | export interface ListStreamConsumers extends Binding.Service< |
| 32 | ListStreamConsumers, |
| 33 | "AWS.Kinesis.ListStreamConsumers", |
| 34 | ( |
| 35 | stream: Stream, |
| 36 | ) => Effect.Effect< |
| 37 | ( |
| 38 | request?: ListStreamConsumersRequest, |
| 39 | ) => Effect.Effect< |
| 40 | Kinesis.ListStreamConsumersOutput, |
| 41 | Kinesis.ListStreamConsumersError |
| 42 | > |
| 43 | > |
| 44 | > {} |
| 45 | |
| 46 | export const ListStreamConsumers = Binding.Service<ListStreamConsumers>( |
| 47 | "AWS.Kinesis.ListStreamConsumers", |
| 48 | ); |