1import type * as workstations from "@distilled.cloud/gcp/workstations_v1";
2import type * as Effect from "effect/Effect";
3import * as Binding from "../../Binding.ts";
4import type { RuntimeContext } from "../../RuntimeContext.ts";
5import type { WorkstationCluster } from "./WorkstationCluster.ts";
6
7export interface GetWorkstationClusterRequest extends Omit<
8 workstations.GetProjectsLocationsWorkstationClustersRequest,
9 "name"
10> {}
11
12/**
13 * Runtime binding for Cloud Workstations `workstationClusters.get`.
14 *
15 * Bind this operation to a {@link WorkstationCluster} in a Function/Action
16 * init phase. Provide {@link GetWorkstationClusterHttp}.
17 *
18 * Grants `roles/workstations.viewer` on the project because workstation
19 * clusters have no IAM policy of their own.
20 *
21 * ### Observing Clusters
22 * **Example:** Read the bound cluster
23 * ```typescript
24 * const getCluster = yield* GCP.Workstations.GetWorkstationCluster(cluster);
25 * const live = yield* getCluster();
26 * ```
27 *
28 * @binding
29 * @category Workstations
30 */
31export interface GetWorkstationCluster extends Binding.Service<
32 GetWorkstationCluster,
33 "GCP.Workstations.GetWorkstationCluster",
34 (
35 cluster: WorkstationCluster,
36 ) => Effect.Effect<
37 (
38 request?: GetWorkstationClusterRequest,
39 ) => Effect.Effect<
40 workstations.WorkstationCluster,
41 workstations.GetProjectsLocationsWorkstationClustersError,
42 RuntimeContext
43 >
44 >
45> {}
46
47export const GetWorkstationCluster = Binding.Service<GetWorkstationCluster>(
48 "GCP.Workstations.GetWorkstationCluster",
49);