| 1 | import type * as kafka from "@distilled.cloud/aws/kafka"; |
| 2 | import type * as Effect from "effect/Effect"; |
| 3 | import * as Binding from "../../Binding.ts"; |
| 4 | import type { ServerlessCluster } from "./ServerlessCluster.ts"; |
| 5 | |
| 6 | /** |
| 7 | * Runtime binding for the `UpdateTopic` operation (IAM action |
| 8 | * `kafka:UpdateTopic`), scoped to one {@link ServerlessCluster}. |
| 9 | * |
| 10 | * Updates a topic's configuration or increases its partition count through |
| 11 | * the MSK control plane. Provide the implementation with |
| 12 | * `Effect.provide(AWS.Kafka.UpdateTopicHttp)`. |
| 13 | * ### Managing Topics |
| 14 | * **Example:** Grow a Topic's Partitions |
| 15 | * ```typescript |
| 16 | * const updateTopic = yield* Kafka.UpdateTopic(cluster); |
| 17 | * |
| 18 | * yield* updateTopic({ TopicName: "orders", PartitionCount: 6 }); |
| 19 | * ``` |
| 20 | * |
| 21 | * @binding |
| 22 | */ |
| 23 | export interface UpdateTopic extends Binding.Service< |
| 24 | UpdateTopic, |
| 25 | "AWS.Kafka.UpdateTopic", |
| 26 | ( |
| 27 | cluster: ServerlessCluster, |
| 28 | ) => Effect.Effect< |
| 29 | ( |
| 30 | request: Omit<kafka.UpdateTopicRequest, "ClusterArn">, |
| 31 | ) => Effect.Effect<kafka.UpdateTopicResponse, kafka.UpdateTopicError> |
| 32 | > |
| 33 | > {} |
| 34 | export const UpdateTopic = Binding.Service<UpdateTopic>( |
| 35 | "AWS.Kafka.UpdateTopic", |
| 36 | ); |