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 { SchemaRegistry } from "./SchemaRegistry.ts";
6
7export interface GetSchemaRegistryRequest extends Omit<
8 kafka.GetProjectsLocationsSchemaRegistriesRequest,
9 "name"
10> {}
11
12/**
13 * Runtime binding for Managed Kafka `schemaRegistries.get`.
14 *
15 * Bind this operation to a {@link SchemaRegistry} in a Function/Action
16 * init phase. Provide {@link GetSchemaRegistryHttp}.
17 *
18 * Grants `roles/managedkafka.schemaRegistryViewer` (read-only) on the
19 * project: schema-registry permission checks do not honor an IAM
20 * Condition scoped to the registry's resource name.
21 *
22 * ### Observing Schema Registries
23 * **Example:** Read the bound registry
24 * ```typescript
25 * const getRegistry = yield* GCP.ManagedKafka.GetSchemaRegistry(registry);
26 * const live = yield* getRegistry();
27 * ```
28 *
29 * @binding
30 * @category ManagedKafka
31 */
32export interface GetSchemaRegistry extends Binding.Service<
33 GetSchemaRegistry,
34 "GCP.ManagedKafka.GetSchemaRegistry",
35 (
36 registry: SchemaRegistry,
37 ) => Effect.Effect<
38 (
39 request?: GetSchemaRegistryRequest,
40 ) => Effect.Effect<
41 kafka.SchemaRegistry,
42 kafka.GetProjectsLocationsSchemaRegistriesError,
43 RuntimeContext
44 >
45 >
46> {}
47
48export const GetSchemaRegistry = Binding.Service<GetSchemaRegistry>(
49 "GCP.ManagedKafka.GetSchemaRegistry",
50);