| 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 GetPartitionRequest extends Omit< |
| 7 | glue.GetPartitionRequest, |
| 8 | "DatabaseName" | "TableName" | "CatalogId" |
| 9 | > {} |
| 10 | |
| 11 | /** |
| 12 | * Runtime binding for `glue:GetPartition`. |
| 13 | * |
| 14 | * Reads a single partition of the bound {@link Table} by its partition |
| 15 | * values. Fails with the typed `EntityNotFoundException` when the partition |
| 16 | * does not exist. The database/table names and catalog id are injected from |
| 17 | * the binding. Provide the implementation with |
| 18 | * `Effect.provide(AWS.Glue.GetPartitionHttp)`. |
| 19 | * ### Managing Partitions |
| 20 | * **Example:** Read One Partition |
| 21 | * ```typescript |
| 22 | * // init |
| 23 | * const getPartition = yield* AWS.Glue.GetPartition(table); |
| 24 | * |
| 25 | * // runtime |
| 26 | * const { Partition } = yield* getPartition({ |
| 27 | * PartitionValues: ["2026-01-01"], |
| 28 | * }); |
| 29 | * ``` |
| 30 | * |
| 31 | * @binding |
| 32 | */ |
| 33 | export interface GetPartition extends Binding.Service< |
| 34 | GetPartition, |
| 35 | "AWS.Glue.GetPartition", |
| 36 | ( |
| 37 | table: Table, |
| 38 | ) => Effect.Effect< |
| 39 | ( |
| 40 | request: GetPartitionRequest, |
| 41 | ) => Effect.Effect<glue.GetPartitionResponse, glue.GetPartitionError> |
| 42 | > |
| 43 | > {} |
| 44 | |
| 45 | export const GetPartition = Binding.Service<GetPartition>( |
| 46 | "AWS.Glue.GetPartition", |
| 47 | ); |