1import type * as appflow from "@distilled.cloud/aws/appflow";
2import type * as Effect from "effect/Effect";
3import * as Binding from "../../Binding.ts";
4import type { Flow } from "./Flow.ts";
5
6export interface DescribeFlowExecutionRecordsRequest extends Omit<
7 appflow.DescribeFlowExecutionRecordsRequest,
8 "flowName"
9> {}
10
11/**
12 * Runtime binding for `appflow:DescribeFlowExecutionRecords`.
13 *
14 * Bind this operation to a {@link Flow} in the function's init phase to get a
15 * callable that pages through the flow's run history — each record carries
16 * the `executionId`, status, timing, and record counts of one run. The flow
17 * name is injected automatically and `appflow:DescribeFlowExecutionRecords`
18 * is granted on the flow. Provide the implementation with
19 * `Effect.provide(AWS.AppFlow.DescribeFlowExecutionRecordsHttp)`.
20 * ### Monitoring Flow Runs
21 * **Example:** Check the Status of the Latest Run
22 * ```typescript
23 * // init — bind the operation to the flow
24 * const describeFlowExecutionRecords =
25 * yield* AWS.AppFlow.DescribeFlowExecutionRecords(flow);
26 *
27 * // runtime — read the most recent run
28 * const records = yield* describeFlowExecutionRecords({ maxResults: 1 });
29 * const latest = records.flowExecutions?.[0];
30 * // latest?.executionStatus === "Successful"
31 * ```
32 *
33 * @binding
34 */
35export interface DescribeFlowExecutionRecords extends Binding.Service<
36 DescribeFlowExecutionRecords,
37 "AWS.AppFlow.DescribeFlowExecutionRecords",
38 (
39 flow: Flow,
40 ) => Effect.Effect<
41 (
42 request?: DescribeFlowExecutionRecordsRequest,
43 ) => Effect.Effect<
44 appflow.DescribeFlowExecutionRecordsResponse,
45 appflow.DescribeFlowExecutionRecordsError
46 >
47 >
48> {}
49
50export const DescribeFlowExecutionRecords =
51 Binding.Service<DescribeFlowExecutionRecords>(
52 "AWS.AppFlow.DescribeFlowExecutionRecords",
53 );