@devries-cameron20 / t3code Mirror · read-only
Fork 0

The best way to control Claude Code, Codex and more from any computer or phone

Mirrored from https://github.com/Camo67/t3code.git

Synced Nov 21, 04:45 UTC

main
ts 38 lines 1.43 KB
Raw
1 import type * as kafka from "@distilled.cloud/aws/kafka";
2 import * as Binding from "alchemy/Binding";
3 import type * as Effect from "effect/Effect";
4 import 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 */
25 export 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<kafka.DescribeTopicPartitionsResponse, kafka.DescribeTopicPartitionsError>
34 >
35 > {}
36 export const DescribeTopicPartitions = Binding.Service<DescribeTopicPartitions>(
37 "AWS.Kafka.DescribeTopicPartitions",
38 );