1import type * as mwaa from "@distilled.cloud/aws/mwaa-serverless";
2import type * as Effect from "effect/Effect";
3import * as Binding from "../../Binding.ts";
4import type { Workflow } from "./Workflow.ts";
5
6/**
7 * Request accepted by the {@link StopWorkflowRun} runtime callable. The
8 * `WorkflowArn` is injected from the bound {@link Workflow}.
9 */
10export type StopWorkflowRunInput = Omit<
11 mwaa.StopWorkflowRunRequest,
12 "WorkflowArn"
13>;
14
15/**
16 * Runtime binding for `airflow-serverless:StopWorkflowRun`.
17 *
18 * Stops an in-flight run of the bound {@link Workflow}. Provide the
19 * implementation with `Effect.provide(AWS.MWAAServerless.StopWorkflowRunHttp)`.
20 * ### Running Workflows
21 * **Example:** Stop A Run
22 * ```typescript
23 * // init — bind the operation to the workflow
24 * const stopWorkflowRun = yield* AWS.MWAAServerless.StopWorkflowRun(workflow);
25 *
26 * // runtime
27 * const stopped = yield* stopWorkflowRun({ RunId: runId });
28 * yield* Effect.log(`run ${stopped.RunId} -> ${stopped.Status}`);
29 * ```
30 *
31 * @binding
32 */
33export interface StopWorkflowRun extends Binding.Service<
34 StopWorkflowRun,
35 "AWS.MWAAServerless.StopWorkflowRun",
36 (
37 workflow: Workflow,
38 ) => Effect.Effect<
39 (
40 request: StopWorkflowRunInput,
41 ) => Effect.Effect<mwaa.StopWorkflowRunResponse, mwaa.StopWorkflowRunError>
42 >
43> {}
44export const StopWorkflowRun = Binding.Service<StopWorkflowRun>(
45 "AWS.MWAAServerless.StopWorkflowRun",
46);