| 1 | import type * as bcm from "@distilled.cloud/aws/bcm-data-exports"; |
| 2 | import type * as Effect from "effect/Effect"; |
| 3 | import * as Binding from "../../Binding.ts"; |
| 4 | |
| 5 | /** |
| 6 | * Request for {@link GetTable}. |
| 7 | */ |
| 8 | export interface GetTableRequest extends bcm.GetTableRequest {} |
| 9 | |
| 10 | /** |
| 11 | * Runtime binding for `bcm-data-exports:GetTable`. |
| 12 | * |
| 13 | * An account-level operation (the table dictionary is not tied to any |
| 14 | * export) that reads the schema of a Data Exports table — its columns, |
| 15 | * data types, and descriptions for the given table properties. Useful for |
| 16 | * query builders that validate an SQL statement's columns before calling |
| 17 | * `UpdateExport`. Provide the implementation with |
| 18 | * `Effect.provide(AWS.BCMDataExports.GetTableHttp)`. |
| 19 | * ### Browsing the Table Dictionary |
| 20 | * **Example:** Read a Table's Schema |
| 21 | * ```typescript |
| 22 | * // init — account-level binding takes no resource |
| 23 | * const getTable = yield* AWS.BCMDataExports.GetTable(); |
| 24 | * |
| 25 | * // runtime |
| 26 | * const table = yield* getTable({ TableName: "COST_AND_USAGE_REPORT" }); |
| 27 | * const columns = (table.Schema ?? []).map((column) => column.Name); |
| 28 | * ``` |
| 29 | * |
| 30 | * @binding |
| 31 | */ |
| 32 | export interface GetTable extends Binding.Service< |
| 33 | GetTable, |
| 34 | "AWS.BCMDataExports.GetTable", |
| 35 | () => Effect.Effect< |
| 36 | ( |
| 37 | request: GetTableRequest, |
| 38 | ) => Effect.Effect<bcm.GetTableResponse, bcm.GetTableError> |
| 39 | > |
| 40 | > {} |
| 41 | |
| 42 | export const GetTable = Binding.Service<GetTable>( |
| 43 | "AWS.BCMDataExports.GetTable", |
| 44 | ); |