1import type * as bcm from "@distilled.cloud/aws/bcm-data-exports";
2import type * as Effect from "effect/Effect";
3import * as Binding from "../../Binding.ts";
4import type { Export } from "./Export.ts";
5
6/**
7 * Request for {@link GetExecution} — the bound export's ARN is injected
8 * automatically.
9 */
10export interface GetExecutionRequest extends Omit<
11 bcm.GetExecutionRequest,
12 "ExportArn"
13> {}
14
15/**
16 * Runtime binding for `bcm-data-exports:GetExecution`.
17 *
18 * Bind this operation to an {@link Export} to read the status of one export
19 * execution (delivery run) — its status code, reason, and timestamps — from
20 * inside a function runtime. Useful for delivery monitors that alert when a
21 * refresh fails. Provide the implementation with
22 * `Effect.provide(AWS.BCMDataExports.GetExecutionHttp)`.
23 * ### Monitoring Executions
24 * **Example:** Check an Execution's Status
25 * ```typescript
26 * // init — bind the operation to the export
27 * const getExecution = yield* AWS.BCMDataExports.GetExecution(cur);
28 *
29 * // runtime
30 * const result = yield* getExecution({ ExecutionId: executionId });
31 * const status = result.ExecutionStatus?.StatusCode;
32 * ```
33 *
34 * @binding
35 */
36export interface GetExecution extends Binding.Service<
37 GetExecution,
38 "AWS.BCMDataExports.GetExecution",
39 (
40 dataExport: Export,
41 ) => Effect.Effect<
42 (
43 request: GetExecutionRequest,
44 ) => Effect.Effect<bcm.GetExecutionResponse, bcm.GetExecutionError>
45 >
46> {}
47
48export const GetExecution = Binding.Service<GetExecution>(
49 "AWS.BCMDataExports.GetExecution",
50);