| 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 { Service } from "./Service.ts"; |
| 6 | |
| 7 | export interface GetServiceRequest extends Omit< |
| 8 | cloudrun.GetProjectsLocationsServicesRequest, |
| 9 | "name" |
| 10 | > {} |
| 11 | |
| 12 | /** |
| 13 | * Runtime binding for Cloud Run `services.get`. |
| 14 | * |
| 15 | * Bind this operation to a {@link Service} in a Function/Action init phase. |
| 16 | * Provide {@link GetServiceHttp}. |
| 17 | * |
| 18 | * ### Reading a Service |
| 19 | * **Example:** Get the bound service |
| 20 | * ```typescript |
| 21 | * const getService = yield* GCP.Run.GetService(api); |
| 22 | * const live = yield* getService(); |
| 23 | * ``` |
| 24 | * |
| 25 | * @binding |
| 26 | * @category Run |
| 27 | */ |
| 28 | export interface GetService extends Binding.Service< |
| 29 | GetService, |
| 30 | "GCP.Run.GetService", |
| 31 | ( |
| 32 | service: Service, |
| 33 | ) => Effect.Effect< |
| 34 | ( |
| 35 | request?: GetServiceRequest, |
| 36 | ) => Effect.Effect< |
| 37 | cloudrun.GoogleCloudRunV2Service, |
| 38 | cloudrun.GetProjectsLocationsServicesError, |
| 39 | RuntimeContext |
| 40 | > |
| 41 | > |
| 42 | > {} |
| 43 | |
| 44 | export const GetService = Binding.Service<GetService>("GCP.Run.GetService"); |