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 UpdatePartitionRequest extends Omit<
7 glue.UpdatePartitionRequest,
8 "DatabaseName" | "TableName" | "CatalogId"
9> {}
10
11/**
12 * Runtime binding for `glue:UpdatePartition`.
13 *
14 * Replaces the definition of one partition of the bound {@link Table} —
15 * `PartitionValueList` addresses the existing partition and
16 * `PartitionInput` is its new definition (location, parameters, schema).
17 * The database/table names and catalog id are injected from the binding.
18 * Provide the implementation with
19 * `Effect.provide(AWS.Glue.UpdatePartitionHttp)`.
20 * ### Managing Partitions
21 * **Example:** Move a Partition's Location
22 * ```typescript
23 * // init
24 * const updatePartition = yield* AWS.Glue.UpdatePartition(table);
25 *
26 * // runtime
27 * yield* updatePartition({
28 * PartitionValueList: ["2026-01-01"],
29 * PartitionInput: {
30 * Values: ["2026-01-01"],
31 * StorageDescriptor: { Location: "s3://my-data-lake/v2/dt=2026-01-01/" },
32 * },
33 * });
34 * ```
35 *
36 * @binding
37 */
38export interface UpdatePartition extends Binding.Service<
39 UpdatePartition,
40 "AWS.Glue.UpdatePartition",
41 (
42 table: Table,
43 ) => Effect.Effect<
44 (
45 request: UpdatePartitionRequest,
46 ) => Effect.Effect<glue.UpdatePartitionResponse, glue.UpdatePartitionError>
47 >
48> {}
49
50export const UpdatePartition = Binding.Service<UpdatePartition>(
51 "AWS.Glue.UpdatePartition",
52);