1import type * as cloudrun from "@distilled.cloud/gcp/run_v2";
2import type * as Effect from "effect/Effect";
3import * as Binding from "../../Binding.ts";
4import type { RuntimeContext } from "../../RuntimeContext.ts";
5import type { Service } from "./Service.ts";
6
7export 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 */
28export 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
44export const GetService = Binding.Service<GetService>("GCP.Run.GetService");