1import * as kafka from "@distilled.cloud/gcp/managedkafka_v1";
2import { Credentials } from "@distilled.cloud/gcp/Credentials";
3import * as Layer from "effect/Layer";
4import * as HttpClient from "effect/http/HttpClient";
5import { makeManagedKafkaHttpBinding } from "./BindingHttp.ts";
6import type { ClustersTopic } from "./ClustersTopic.ts";
7import { GetTopic } from "./GetTopic.ts";
8
9/**
10 * HTTP implementation of {@link GetTopic}.
11 *
12 * @layer
13 * @provides GCP.ManagedKafka.GetTopic
14 */
15export const GetTopicHttp: Layer.Layer<
16 GetTopic,
17 never,
18 Credentials | HttpClient.HttpClient
19> = Layer.effect(
20 GetTopic,
21 makeManagedKafkaHttpBinding<ClustersTopic>()<
22 kafka.GetProjectsLocationsClustersTopicsRequest,
23 kafka.Topic,
24 kafka.GetProjectsLocationsClustersTopicsError
25 >({
26 tag: "GCP.ManagedKafka.GetTopic",
27 iam: { role: "roles/managedkafka.viewer", scopeByCondition: true },
28 operation: kafka.getProjectsLocationsClustersTopics,
29 }),
30);