1import type * as datasync from "@distilled.cloud/aws/datasync";
2import type * as Effect from "effect/Effect";
3import * as Binding from "../../Binding.ts";
4import type { Task } from "./Task.ts";
5
6/**
7 * Runtime binding for `datasync:UpdateTaskExecution`.
8 *
9 * Modifies an in-flight execution of the bound {@link Task}. The only
10 * mutable option is `BytesPerSecond` — throttle (or unthrottle with `-1`) a
11 * running transfer without cancelling it. The execution must be launching,
12 * preparing, transferring, or verifying. Address it with the ARN returned
13 * by `StartTaskExecution`; access is granted on the bound task's
14 * executions. Provide the implementation with
15 * `Effect.provide(AWS.DataSync.UpdateTaskExecutionHttp)`.
16 * ### Running Transfers
17 * **Example:** Throttle A Running Transfer
18 * ```typescript
19 * // init — bind the operation to the task
20 * const updateTaskExecution = yield* AWS.DataSync.UpdateTaskExecution(task);
21 *
22 * // runtime — cap the transfer at 1 MiB/s
23 * yield* updateTaskExecution({
24 * TaskExecutionArn: executionArn,
25 * Options: { BytesPerSecond: 1024 * 1024 },
26 * });
27 * ```
28 *
29 * @binding
30 */
31export interface UpdateTaskExecution extends Binding.Service<
32 UpdateTaskExecution,
33 "AWS.DataSync.UpdateTaskExecution",
34 (
35 task: Task,
36 ) => Effect.Effect<
37 (
38 request: datasync.UpdateTaskExecutionRequest,
39 ) => Effect.Effect<
40 datasync.UpdateTaskExecutionResponse,
41 datasync.UpdateTaskExecutionError
42 >
43 >
44> {}
45export const UpdateTaskExecution = Binding.Service<UpdateTaskExecution>(
46 "AWS.DataSync.UpdateTaskExecution",
47);