1import type * as kafka from "@distilled.cloud/gcp/managedkafka_v1";
2import type * as Effect from "effect/Effect";
3import * as Binding from "../../Binding.ts";
4import type { RuntimeContext } from "../../RuntimeContext.ts";
5import type { ClustersTopic } from "./ClustersTopic.ts";
6
7export interface GetTopicRequest extends Omit<
8 kafka.GetProjectsLocationsClustersTopicsRequest,
9 "name"
10> {}
11
12/**
13 * Runtime binding for Managed Kafka `topics.get`.
14 *
15 * Bind this operation to a {@link ClustersTopic} in a Function/Action
16 * init phase. Provide {@link GetTopicHttp}.
17 *
18 * ### Observing Topics
19 * **Example:** Read the bound topic
20 * ```typescript
21 * const getTopic = yield* GCP.ManagedKafka.GetTopic(topic);
22 * const live = yield* getTopic();
23 * ```
24 *
25 * @binding
26 * @category ManagedKafka
27 */
28export interface GetTopic extends Binding.Service<
29 GetTopic,
30 "GCP.ManagedKafka.GetTopic",
31 (
32 topic: ClustersTopic,
33 ) => Effect.Effect<
34 (
35 request?: GetTopicRequest,
36 ) => Effect.Effect<
37 kafka.Topic,
38 kafka.GetProjectsLocationsClustersTopicsError,
39 RuntimeContext
40 >
41 >
42> {}
43
44export const GetTopic = Binding.Service<GetTopic>("GCP.ManagedKafka.GetTopic");