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 `GetTableMaintenanceJobStatus` operation (IAM
8 * action `s3tables:GetTableMaintenanceJobStatus` on the table ARN).
9 *
10 * Reads the status of the bound {@link Table}'s managed maintenance jobs —
11 * Iceberg compaction and snapshot management — including when each job last
12 * ran and whether it succeeded. Useful for compute that monitors table
13 * health at runtime. Provide the implementation with
14 * `Effect.provide(AWS.S3Tables.GetTableMaintenanceJobStatusHttp)`.
15 * ### Monitoring Maintenance
16 * **Example:** Inspect maintenance job statuses
17 * ```typescript
18 * const getTableMaintenanceJobStatus =
19 * yield* AWS.S3Tables.GetTableMaintenanceJobStatus(table);
20 *
21 * const { status } = yield* getTableMaintenanceJobStatus();
22 * for (const [job, state] of Object.entries(status)) {
23 * yield* Effect.log(`${job}: ${state?.status}`);
24 * }
25 * ```
26 *
27 * @binding
28 */
29export interface GetTableMaintenanceJobStatus extends Binding.Service<
30 GetTableMaintenanceJobStatus,
31 "AWS.S3Tables.GetTableMaintenanceJobStatus",
32 (
33 table: Table,
34 ) => Effect.Effect<
35 () => Effect.Effect<
36 s3tables.GetTableMaintenanceJobStatusResponse,
37 s3tables.GetTableMaintenanceJobStatusError
38 >
39 >
40> {}
41export const GetTableMaintenanceJobStatus =
42 Binding.Service<GetTableMaintenanceJobStatus>(
43 "AWS.S3Tables.GetTableMaintenanceJobStatus",
44 );