1import type * as transfer from "@distilled.cloud/aws/transfer";
2import type * as Effect from "effect/Effect";
3import * as Binding from "../../Binding.ts";
4
5/**
6 * Runtime binding for `transfer:SendWorkflowStepState`.
7 *
8 * Reports a custom workflow step's outcome back to Transfer Family. A
9 * managed workflow's custom step invokes a Lambda with the workflow id,
10 * execution id, and a callback token; the Lambda MUST call this operation
11 * with `SUCCESS` or `FAILURE` or the step hangs until its timeout. The
12 * action authorizes on the workflow's own ARN, which arrives at runtime
13 * inside the step event, so the grant is on `*`. Provide the
14 * implementation with
15 * `Effect.provide(AWS.Transfer.SendWorkflowStepStateHttp)`.
16 * ### Custom Workflow Steps
17 * **Example:** Complete a Custom Step
18 * ```typescript
19 * // init — account-level binding, no resource argument
20 * const sendWorkflowStepState = yield* AWS.Transfer.SendWorkflowStepState();
21 *
22 * // runtime — inside the Lambda invoked by the workflow's custom step
23 * yield* sendWorkflowStepState({
24 * WorkflowId: event.serviceMetadata.executionDetails.workflowId,
25 * ExecutionId: event.serviceMetadata.executionDetails.executionId,
26 * Token: event.token,
27 * Status: "SUCCESS",
28 * });
29 * ```
30 *
31 * @binding
32 */
33export interface SendWorkflowStepState extends Binding.Service<
34 SendWorkflowStepState,
35 "AWS.Transfer.SendWorkflowStepState",
36 () => Effect.Effect<
37 (
38 request: transfer.SendWorkflowStepStateRequest,
39 ) => Effect.Effect<
40 transfer.SendWorkflowStepStateResponse,
41 transfer.SendWorkflowStepStateError
42 >
43 >
44> {}
45export const SendWorkflowStepState = Binding.Service<SendWorkflowStepState>(
46 "AWS.Transfer.SendWorkflowStepState",
47);