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 `DescribeTopic` operation (IAM action
8 * `kafka:DescribeTopic`), scoped to one {@link ServerlessCluster}.
9 *
10 * Reads a topic's partition count, replication factor, configuration, and
11 * status through the MSK control plane. Provide the implementation with
12 * `Effect.provide(AWS.Kafka.DescribeTopicHttp)`.
13 * ### Managing Topics
14 * **Example:** Describe a Topic
15 * ```typescript
16 * const describeTopic = yield* Kafka.DescribeTopic(cluster);
17 *
18 * const topic = yield* describeTopic({ TopicName: "orders" });
19 * // topic.PartitionCount, topic.Configs, topic.Status
20 * ```
21 *
22 * @binding
23 */
24export interface DescribeTopic extends Binding.Service<
25 DescribeTopic,
26 "AWS.Kafka.DescribeTopic",
27 (
28 cluster: ServerlessCluster,
29 ) => Effect.Effect<
30 (
31 request: Omit<kafka.DescribeTopicRequest, "ClusterArn">,
32 ) => Effect.Effect<kafka.DescribeTopicResponse, kafka.DescribeTopicError>
33 >
34> {}
35export const DescribeTopic = Binding.Service<DescribeTopic>(
36 "AWS.Kafka.DescribeTopic",
37);