| 1 | import type * as kafka from "@distilled.cloud/gcp/managedkafka_v1"; |
| 2 | import type * as Effect from "effect/Effect"; |
| 3 | import * as Binding from "../../Binding.ts"; |
| 4 | import type { RuntimeContext } from "../../RuntimeContext.ts"; |
| 5 | import type { SchemaRegistry } from "./SchemaRegistry.ts"; |
| 6 | |
| 7 | export 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 | */ |
| 32 | export 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 | |
| 48 | export const GetSchemaRegistry = Binding.Service<GetSchemaRegistry>( |
| 49 | "GCP.ManagedKafka.GetSchemaRegistry", |
| 50 | ); |