| 1 | import type * as glue from "@distilled.cloud/aws/glue"; |
| 2 | import type * as Effect from "effect/Effect"; |
| 3 | import * as Binding from "../../Binding.ts"; |
| 4 | import type { Table } from "./Table.ts"; |
| 5 | |
| 6 | export interface DeletePartitionRequest extends Omit< |
| 7 | glue.DeletePartitionRequest, |
| 8 | "DatabaseName" | "TableName" | "CatalogId" |
| 9 | > {} |
| 10 | |
| 11 | /** |
| 12 | * Runtime binding for `glue:DeletePartition`. |
| 13 | * |
| 14 | * Deregisters one partition of the bound {@link Table} by its partition |
| 15 | * values (the underlying data is untouched). Fails with the typed |
| 16 | * `EntityNotFoundException` when the partition is already gone. The |
| 17 | * database/table names and catalog id are injected from the binding. |
| 18 | * Provide the implementation with |
| 19 | * `Effect.provide(AWS.Glue.DeletePartitionHttp)`. |
| 20 | * ### Managing Partitions |
| 21 | * **Example:** Deregister a Partition |
| 22 | * ```typescript |
| 23 | * // init |
| 24 | * const deletePartition = yield* AWS.Glue.DeletePartition(table); |
| 25 | * |
| 26 | * // runtime — idempotent removal |
| 27 | * yield* deletePartition({ PartitionValues: ["2026-01-01"] }).pipe( |
| 28 | * Effect.catchTag("EntityNotFoundException", () => Effect.void), |
| 29 | * ); |
| 30 | * ``` |
| 31 | * |
| 32 | * @binding |
| 33 | */ |
| 34 | export interface DeletePartition extends Binding.Service< |
| 35 | DeletePartition, |
| 36 | "AWS.Glue.DeletePartition", |
| 37 | ( |
| 38 | table: Table, |
| 39 | ) => Effect.Effect< |
| 40 | ( |
| 41 | request: DeletePartitionRequest, |
| 42 | ) => Effect.Effect<glue.DeletePartitionResponse, glue.DeletePartitionError> |
| 43 | > |
| 44 | > {} |
| 45 | |
| 46 | export const DeletePartition = Binding.Service<DeletePartition>( |
| 47 | "AWS.Glue.DeletePartition", |
| 48 | ); |