1import type * as s3tables from "@distilled.cloud/aws/s3tables";
2import type * as Effect from "effect/Effect";
3import * as Binding from "../../Binding.ts";
4import type { Table } from "./Table.ts";
5
6/**
7 * Runtime binding for the `GetTable` operation (IAM action
8 * `s3tables:GetTable` on the table ARN).
9 *
10 * Reads the bound {@link Table}'s details — its current `versionToken`,
11 * `metadataLocation`, `warehouseLocation`, and format. The version token and
12 * metadata location are the inputs to the Iceberg commit protocol (see
13 * {@link UpdateTableMetadataLocation}). Provide the implementation with
14 * `Effect.provide(AWS.S3Tables.GetTableHttp)`.
15 * ### Reading Table Metadata
16 * **Example:** Read the table's current version
17 * ```typescript
18 * const getTable = yield* AWS.S3Tables.GetTable(table);
19 *
20 * const { versionToken, metadataLocation, warehouseLocation } =
21 * yield* getTable();
22 * ```
23 *
24 * @binding
25 */
26export interface GetTable extends Binding.Service<
27 GetTable,
28 "AWS.S3Tables.GetTable",
29 (
30 table: Table,
31 ) => Effect.Effect<
32 () => Effect.Effect<s3tables.GetTableResponse, s3tables.GetTableError>
33 >
34> {}
35export const GetTable = Binding.Service<GetTable>("AWS.S3Tables.GetTable");