@devries-cameron20 / t3code Mirror · read-only
Fork 0

The best way to control Claude Code, Codex and more from any computer or phone

Mirrored from https://github.com/Camo67/t3code.git

Synced Nov 21, 06:00 UTC

main
ts 33 lines 1.23 KB
Raw
1 import { Credentials } from "@distilled.cloud/gcp/Credentials";
2 import * as kafka from "@distilled.cloud/gcp/managedkafka_v1";
3 import * as HttpClient from "effect/http/HttpClient";
4 import * as Layer from "effect/Layer";
5 import { makeManagedKafkaHttpBinding } from "./BindingHttp.ts";
6 import { GetSchemaRegistry } from "./GetSchemaRegistry.ts";
7 import type { SchemaRegistry } from "./SchemaRegistry.ts";
8
9 /**
10 * HTTP implementation of {@link GetSchemaRegistry}.
11 *
12 * @layer
13 * @provides GCP.ManagedKafka.GetSchemaRegistry
14 */
15 export const GetSchemaRegistryHttp: Layer.Layer<
16 GetSchemaRegistry,
17 never,
18 Credentials | HttpClient.HttpClient
19 > = Layer.effect(
20 GetSchemaRegistry,
21 makeManagedKafkaHttpBinding<SchemaRegistry>()<
22 kafka.GetProjectsLocationsSchemaRegistriesRequest,
23 kafka.SchemaRegistry,
24 kafka.GetProjectsLocationsSchemaRegistriesError
25 >({
26 tag: "GCP.ManagedKafka.GetSchemaRegistry",
27 // Schema-registry permission checks do not match a resource-name IAM
28 // Condition on the registry (the conditioned grant stayed denied live),
29 // so the read-only viewer role is granted on the project.
30 iam: { role: "roles/managedkafka.schemaRegistryViewer" },
31 operation: kafka.getProjectsLocationsSchemaRegistries,
32 }),
33 );