1import type * as glue from "@distilled.cloud/aws/glue";
2import type * as Effect from "effect/Effect";
3import * as Binding from "../../Binding.ts";
4import type { Table } from "./Table.ts";
5
6export interface BatchDeletePartitionRequest extends Omit<
7 glue.BatchDeletePartitionRequest,
8 "DatabaseName" | "TableName" | "CatalogId"
9> {}
10
11/**
12 * Runtime binding for `glue:BatchDeletePartition`.
13 *
14 * Deletes up to 25 partitions of the bound {@link Table} in one call — the
15 * bulk variant of `DeletePartition` for retention sweeps. Per-partition
16 * failures come back in the response's `Errors` list. The database/table
17 * names and catalog id are injected from the binding. Provide the
18 * implementation with `Effect.provide(AWS.Glue.BatchDeletePartitionHttp)`.
19 * ### Managing Partitions
20 * **Example:** Expire Old Partitions
21 * ```typescript
22 * // init
23 * const batchDeletePartition = yield* AWS.Glue.BatchDeletePartition(table);
24 *
25 * // runtime
26 * const { Errors } = yield* batchDeletePartition({
27 * PartitionsToDelete: expired.map((dt) => ({ Values: [dt] })),
28 * });
29 * ```
30 *
31 * @binding
32 */
33export interface BatchDeletePartition extends Binding.Service<
34 BatchDeletePartition,
35 "AWS.Glue.BatchDeletePartition",
36 (
37 table: Table,
38 ) => Effect.Effect<
39 (
40 request: BatchDeletePartitionRequest,
41 ) => Effect.Effect<
42 glue.BatchDeletePartitionResponse,
43 glue.BatchDeletePartitionError
44 >
45 >
46> {}
47
48export const BatchDeletePartition = Binding.Service<BatchDeletePartition>(
49 "AWS.Glue.BatchDeletePartition",
50);