1import type * as bigquery from "@distilled.cloud/gcp/bigquery_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 ListTabledataRequest extends Omit<
8 bigquery.ListTabledataRequest,
9 "projectId" | "datasetId" | "tableId"
10> {}
11
12/**
13 * Runtime binding for BigQuery `tabledata.list`.
14 *
15 * Bind this operation to a {@link Table} in a Function/Action init phase.
16 * Provide {@link ListTabledataHttp}.
17 *
18 * ### Listing Rows
19 * **Example:** List table rows
20 * ```typescript
21 * const listRows = yield* GCP.BigQuery.ListTabledata(events);
22 * const page = yield* listRows({ maxResults: 100 });
23 * ```
24 *
25 * @binding
26 * @category BigQuery
27 */
28export interface ListTabledata extends Binding.Service<
29 ListTabledata,
30 "GCP.BigQuery.ListTabledata",
31 (
32 table: Table,
33 ) => Effect.Effect<
34 (
35 request?: ListTabledataRequest,
36 ) => Effect.Effect<
37 bigquery.TableDataList,
38 bigquery.ListTabledataError,
39 RuntimeContext
40 >
41 >
42> {}
43
44export const ListTabledata = Binding.Service<ListTabledata>(
45 "GCP.BigQuery.ListTabledata",
46);