| 1 | import * as kafka from "@distilled.cloud/gcp/managedkafka_v1"; |
| 2 | import { Credentials } from "@distilled.cloud/gcp/Credentials"; |
| 3 | import * as Layer from "effect/Layer"; |
| 4 | import * as HttpClient from "effect/http/HttpClient"; |
| 5 | import { makeManagedKafkaHttpBinding } from "./BindingHttp.ts"; |
| 6 | import type { ClustersTopic } from "./ClustersTopic.ts"; |
| 7 | import { GetTopic } from "./GetTopic.ts"; |
| 8 | |
| 9 | /** |
| 10 | * HTTP implementation of {@link GetTopic}. |
| 11 | * |
| 12 | * @layer |
| 13 | * @provides GCP.ManagedKafka.GetTopic |
| 14 | */ |
| 15 | export 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 | ); |