sailfork / t3code-github / .repos/ alchemy-effect/ packages/ aws/ src/ Athena/ ListPreparedStatements.ts

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

/**
 * Runtime binding for `athena:ListPreparedStatements`.
 *
 * Lists the prepared statements (name + last-modified time) in the bound
 * workgroup — the workgroup name is injected automatically. Provide the
 * implementation with `Effect.provide(AWS.Athena.ListPreparedStatementsHttp)`.
 * ### Prepared Statements
 * **Example:** List the Workgroup's Prepared Statements
 * ```typescript
 * // init — bind the operation to the workgroup
 * const listPreparedStatements =
 *   yield* AWS.Athena.ListPreparedStatements(workGroup);
 *
 * // runtime
 * const res = yield* listPreparedStatements({ MaxResults: 50 });
 * console.log(res.PreparedStatements?.map((s) => s.StatementName));
 * ```
 *
 * @binding
 */
export interface ListPreparedStatements extends Binding.Service<
  ListPreparedStatements,
  "AWS.Athena.ListPreparedStatements",
  (
    workGroup: WorkGroup,
  ) => Effect.Effect<
    (
      request: Omit<athena.ListPreparedStatementsInput, "WorkGroup">,
    ) => Effect.Effect<athena.ListPreparedStatementsOutput, athena.ListPreparedStatementsError>
  >
> {}

export const ListPreparedStatements = Binding.Service<ListPreparedStatements>(
  "AWS.Athena.ListPreparedStatements",
);