| 1 | import type * as cloudrun from "@distilled.cloud/gcp/run_v2"; |
| 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 { WorkerPool } from "./WorkerPool.ts"; |
| 6 | |
| 7 | export interface GetWorkerPoolRequest extends Omit< |
| 8 | cloudrun.GetProjectsLocationsWorkerPoolsRequest, |
| 9 | "name" |
| 10 | > {} |
| 11 | |
| 12 | /** |
| 13 | * Runtime binding for Cloud Run `workerPools.get`. |
| 14 | * |
| 15 | * Bind this operation to a {@link WorkerPool} in a Function/Action init |
| 16 | * phase. Provide {@link GetWorkerPoolHttp}. |
| 17 | * |
| 18 | * ### Reading a Worker Pool |
| 19 | * **Example:** Get the bound worker pool |
| 20 | * ```typescript |
| 21 | * const getWorkerPool = yield* GCP.Run.GetWorkerPool(pool); |
| 22 | * const live = yield* getWorkerPool(); |
| 23 | * ``` |
| 24 | * |
| 25 | * @binding |
| 26 | * @category Run |
| 27 | */ |
| 28 | export interface GetWorkerPool extends Binding.Service< |
| 29 | GetWorkerPool, |
| 30 | "GCP.Run.GetWorkerPool", |
| 31 | ( |
| 32 | pool: WorkerPool, |
| 33 | ) => Effect.Effect< |
| 34 | ( |
| 35 | request?: GetWorkerPoolRequest, |
| 36 | ) => Effect.Effect< |
| 37 | cloudrun.GoogleCloudRunV2WorkerPool, |
| 38 | cloudrun.GetProjectsLocationsWorkerPoolsError, |
| 39 | RuntimeContext |
| 40 | > |
| 41 | > |
| 42 | > {} |
| 43 | |
| 44 | export const GetWorkerPool = Binding.Service<GetWorkerPool>( |
| 45 | "GCP.Run.GetWorkerPool", |
| 46 | ); |