1import type * as kafka from "@distilled.cloud/aws/kafka";
2import type * as Effect from "effect/Effect";
3import * as Binding from "../../Binding.ts";
4import type { ServerlessCluster } from "./ServerlessCluster.ts";
5
6/**
7 * Runtime binding for the `DescribeTopicPartitions` operation (IAM action
8 * `kafka:DescribeTopicPartitions`), scoped to one {@link ServerlessCluster}.
9 *
10 * Reads per-partition detail (leader, replicas, ISR) for a topic through the
11 * MSK control plane. Pass `NextToken` from the previous page to paginate.
12 * Provide the implementation with
13 * `Effect.provide(AWS.Kafka.DescribeTopicPartitionsHttp)`.
14 * ### Managing Topics
15 * **Example:** Read a Topic's Partitions
16 * ```typescript
17 * const describeTopicPartitions = yield* Kafka.DescribeTopicPartitions(cluster);
18 *
19 * const page = yield* describeTopicPartitions({ TopicName: "orders" });
20 * // page.Partitions → [{ Partition: 0, Leader: …, Isr: […] }, …]
21 * ```
22 *
23 * @binding
24 */
25export interface DescribeTopicPartitions extends Binding.Service<
26 DescribeTopicPartitions,
27 "AWS.Kafka.DescribeTopicPartitions",
28 (
29 cluster: ServerlessCluster,
30 ) => Effect.Effect<
31 (
32 request: Omit<kafka.DescribeTopicPartitionsRequest, "ClusterArn">,
33 ) => Effect.Effect<
34 kafka.DescribeTopicPartitionsResponse,
35 kafka.DescribeTopicPartitionsError
36 >
37 >
38> {}
39export const DescribeTopicPartitions = Binding.Service<DescribeTopicPartitions>(
40 "AWS.Kafka.DescribeTopicPartitions",
41);