| 1 | import type * as appflow from "@distilled.cloud/aws/appflow"; |
| 2 | import type * as Effect from "effect/Effect"; |
| 3 | import * as Binding from "../../Binding.ts"; |
| 4 | import type { Flow } from "./Flow.ts"; |
| 5 | |
| 6 | export interface CancelFlowExecutionsRequest extends Omit< |
| 7 | appflow.CancelFlowExecutionsRequest, |
| 8 | "flowName" |
| 9 | > {} |
| 10 | |
| 11 | /** |
| 12 | * Runtime binding for `appflow:CancelFlowExecutions`. |
| 13 | * |
| 14 | * Bind this operation to a {@link Flow} in the function's init phase to get a |
| 15 | * callable that cancels in-progress runs of the flow — all active runs when |
| 16 | * called with no arguments, or only the given `executionIds`. Executions that |
| 17 | * cannot be canceled (already finished, unknown) are returned in |
| 18 | * `invalidExecutions`. The flow name is injected automatically and |
| 19 | * `appflow:CancelFlowExecutions` is granted on the flow. Provide the |
| 20 | * implementation with `Effect.provide(AWS.AppFlow.CancelFlowExecutionsHttp)`. |
| 21 | * ### Running Flows |
| 22 | * **Example:** Cancel Specific Flow Runs |
| 23 | * ```typescript |
| 24 | * // init — bind the operation to the flow |
| 25 | * const cancelFlowExecutions = yield* AWS.AppFlow.CancelFlowExecutions(flow); |
| 26 | * |
| 27 | * // runtime — cancel a run by execution id |
| 28 | * const result = yield* cancelFlowExecutions({ |
| 29 | * executionIds: [executionId], |
| 30 | * }); |
| 31 | * // result.invalidExecutions lists ids that could not be canceled |
| 32 | * ``` |
| 33 | * |
| 34 | * @binding |
| 35 | */ |
| 36 | export interface CancelFlowExecutions extends Binding.Service< |
| 37 | CancelFlowExecutions, |
| 38 | "AWS.AppFlow.CancelFlowExecutions", |
| 39 | ( |
| 40 | flow: Flow, |
| 41 | ) => Effect.Effect< |
| 42 | ( |
| 43 | request?: CancelFlowExecutionsRequest, |
| 44 | ) => Effect.Effect< |
| 45 | appflow.CancelFlowExecutionsResponse, |
| 46 | appflow.CancelFlowExecutionsError |
| 47 | > |
| 48 | > |
| 49 | > {} |
| 50 | |
| 51 | export const CancelFlowExecutions = Binding.Service<CancelFlowExecutions>( |
| 52 | "AWS.AppFlow.CancelFlowExecutions", |
| 53 | ); |