1import type * as bigqueryconnection from "@distilled.cloud/gcp/bigqueryconnection_v1";
2import type * as Effect from "effect/Effect";
3import * as Binding from "../../Binding.ts";
4import type { RuntimeContext } from "../../RuntimeContext.ts";
5import type { Connection } from "./Connection.ts";
6
7export interface GetConnectionRequest extends Omit<
8 bigqueryconnection.GetProjectsLocationsConnectionsRequest,
9 "name"
10> {}
11
12/**
13 * Runtime binding for BigQuery Connection `connections.get`.
14 *
15 * Bind this operation to a {@link Connection} in a Function/Action init
16 * phase. Provide {@link GetConnectionHttp}.
17 *
18 * ### Reading a Connection
19 * **Example:** Get the bound connection
20 * ```typescript
21 * const getConnection = yield* GCP.BigQueryConnection.GetConnection(gcs);
22 * const live = yield* getConnection();
23 * ```
24 *
25 * @binding
26 * @category BigQueryConnection
27 */
28export interface GetConnection extends Binding.Service<
29 GetConnection,
30 "GCP.BigQueryConnection.GetConnection",
31 (
32 connection: Connection,
33 ) => Effect.Effect<
34 (
35 request?: GetConnectionRequest,
36 ) => Effect.Effect<
37 bigqueryconnection.Connection,
38 bigqueryconnection.GetProjectsLocationsConnectionsError,
39 RuntimeContext
40 >
41 >
42> {}
43
44export const GetConnection = Binding.Service<GetConnection>(
45 "GCP.BigQueryConnection.GetConnection",
46);