sailfork / t3code-github / .repos/ alchemy-effect/ packages/ aws/ src/ Glue/ BatchUpdatePartition.ts

import type * as glue from "@distilled.cloud/aws/glue";
import * as Binding from "alchemy/Binding";
import type * as Effect from "effect/Effect";
import type { Table } from "./Table.ts";

export interface BatchUpdatePartitionRequest extends Omit<
  glue.BatchUpdatePartitionRequest,
  "DatabaseName" | "TableName" | "CatalogId"
> {}

/**
 * Runtime binding for `glue:BatchUpdatePartition`.
 *
 * Rewrites up to 100 partitions of the bound {@link Table} in one call — the
 * bulk variant of `UpdatePartition`. Per-partition failures come back in the
 * response's `Errors` list. The database/table names and catalog id are
 * injected from the binding. Provide the implementation with
 * `Effect.provide(AWS.Glue.BatchUpdatePartitionHttp)`.
 * ### Managing Partitions
 * **Example:** Bulk-Update Partition Parameters
 * ```typescript
 * // init
 * const batchUpdatePartition = yield* AWS.Glue.BatchUpdatePartition(table);
 *
 * // runtime
 * const { Errors } = yield* batchUpdatePartition({
 *   Entries: [
 *     {
 *       PartitionValueList: ["2026-01-01"],
 *       PartitionInput: {
 *         Values: ["2026-01-01"],
 *         Parameters: { compacted: "true" },
 *       },
 *     },
 *   ],
 * });
 * ```
 *
 * @binding
 */
export interface BatchUpdatePartition extends Binding.Service<
  BatchUpdatePartition,
  "AWS.Glue.BatchUpdatePartition",
  (
    table: Table,
  ) => Effect.Effect<
    (
      request: BatchUpdatePartitionRequest,
    ) => Effect.Effect<glue.BatchUpdatePartitionResponse, glue.BatchUpdatePartitionError>
  >
> {}

export const BatchUpdatePartition = Binding.Service<BatchUpdatePartition>(
  "AWS.Glue.BatchUpdatePartition",
);