1import type * as bigtable from "@distilled.cloud/gcp/bigtableadmin_v2";
2import type * as Effect from "effect/Effect";
3import * as Binding from "../../Binding.ts";
4import type { RuntimeContext } from "../../RuntimeContext.ts";
5import type { Table } from "./Table.ts";
6
7export interface GetTableRequest extends Omit<
8 bigtable.GetProjectsInstancesTablesRequest,
9 "name"
10> {}
11
12/**
13 * Runtime binding for Bigtable Admin `tables.get`.
14 *
15 * Bind this operation to a {@link Table} in a Function/Action init
16 * phase. Provide {@link GetTableHttp}.
17 *
18 * ### Observing Tables
19 * **Example:** Read the bound table
20 * ```typescript
21 * const getTable = yield* GCP.Bigtable.GetTable(users);
22 * const live = yield* getTable({ view: "SCHEMA_VIEW" });
23 * ```
24 *
25 * @binding
26 * @category Bigtable
27 */
28export interface GetTable extends Binding.Service<
29 GetTable,
30 "GCP.Bigtable.GetTable",
31 (
32 table: Table,
33 ) => Effect.Effect<
34 (
35 request?: GetTableRequest,
36 ) => Effect.Effect<
37 bigtable.Table,
38 bigtable.GetProjectsInstancesTablesError,
39 RuntimeContext
40 >
41 >
42> {}
43
44export const GetTable = Binding.Service<GetTable>("GCP.Bigtable.GetTable");