| 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 { Cluster } from "./Cluster.ts"; |
| 6 | |
| 7 | export interface GetClusterRequest extends Omit< |
| 8 | kafka.GetProjectsLocationsClustersRequest, |
| 9 | "name" |
| 10 | > {} |
| 11 | |
| 12 | /** |
| 13 | * Runtime binding for Managed Kafka `clusters.get`. |
| 14 | * |
| 15 | * Bind this operation to a {@link Cluster} in a Function/Action init |
| 16 | * phase. Provide {@link GetClusterHttp}. |
| 17 | * |
| 18 | * ### Observing Clusters |
| 19 | * **Example:** Read the bound cluster |
| 20 | * ```typescript |
| 21 | * const getCluster = yield* GCP.ManagedKafka.GetCluster(cluster); |
| 22 | * const live = yield* getCluster(); |
| 23 | * ``` |
| 24 | * |
| 25 | * @binding |
| 26 | * @category ManagedKafka |
| 27 | */ |
| 28 | export interface GetCluster extends Binding.Service< |
| 29 | GetCluster, |
| 30 | "GCP.ManagedKafka.GetCluster", |
| 31 | ( |
| 32 | cluster: Cluster, |
| 33 | ) => Effect.Effect< |
| 34 | ( |
| 35 | request?: GetClusterRequest, |
| 36 | ) => Effect.Effect< |
| 37 | kafka.Cluster, |
| 38 | kafka.GetProjectsLocationsClustersError, |
| 39 | RuntimeContext |
| 40 | > |
| 41 | > |
| 42 | > {} |
| 43 | |
| 44 | export const GetCluster = Binding.Service<GetCluster>( |
| 45 | "GCP.ManagedKafka.GetCluster", |
| 46 | ); |