| 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 `DeleteTopic` operation (IAM action |
| 8 | * `kafka:DeleteTopic`), scoped to one {@link ServerlessCluster}. |
| 9 | * |
| 10 | * Deletes a Kafka topic on the bound cluster through the MSK control plane. |
| 11 | * Provide the implementation with `Effect.provide(AWS.Kafka.DeleteTopicHttp)`. |
| 12 | * ### Managing Topics |
| 13 | * **Example:** Delete a Topic |
| 14 | * ```typescript |
| 15 | * const deleteTopic = yield* Kafka.DeleteTopic(cluster); |
| 16 | * |
| 17 | * yield* deleteTopic({ TopicName: "orders" }); |
| 18 | * ``` |
| 19 | * |
| 20 | * @binding |
| 21 | */ |
| 22 | export interface DeleteTopic extends Binding.Service< |
| 23 | DeleteTopic, |
| 24 | "AWS.Kafka.DeleteTopic", |
| 25 | ( |
| 26 | cluster: ServerlessCluster, |
| 27 | ) => Effect.Effect< |
| 28 | ( |
| 29 | request: Omit<kafka.DeleteTopicRequest, "ClusterArn">, |
| 30 | ) => Effect.Effect<kafka.DeleteTopicResponse, kafka.DeleteTopicError> |
| 31 | > |
| 32 | > {} |
| 33 | export const DeleteTopic = Binding.Service<DeleteTopic>( |
| 34 | "AWS.Kafka.DeleteTopic", |
| 35 | ); |