| 1 | import type * as datasync from "@distilled.cloud/aws/datasync"; |
| 2 | import type * as Effect from "effect/Effect"; |
| 3 | import * as Binding from "../../Binding.ts"; |
| 4 | import type { Task } from "./Task.ts"; |
| 5 | |
| 6 | /** |
| 7 | * Runtime binding for `datasync:DescribeTaskExecution`. |
| 8 | * |
| 9 | * Reads one execution of the bound {@link Task} — status, bytes/files |
| 10 | * transferred, per-phase results — to monitor an ongoing transfer or check |
| 11 | * a finished one. Address the execution with the ARN returned by |
| 12 | * `StartTaskExecution`; access is granted on the bound task's executions. |
| 13 | * Provide the implementation with |
| 14 | * `Effect.provide(AWS.DataSync.DescribeTaskExecutionHttp)`. |
| 15 | * ### Running Transfers |
| 16 | * **Example:** Watch A Transfer's Progress |
| 17 | * ```typescript |
| 18 | * // init — bind the operation to the task |
| 19 | * const describeTaskExecution = yield* AWS.DataSync.DescribeTaskExecution(task); |
| 20 | * |
| 21 | * // runtime |
| 22 | * const execution = yield* describeTaskExecution({ |
| 23 | * TaskExecutionArn: executionArn, |
| 24 | * }); |
| 25 | * yield* Effect.log(`${execution.Status}: ${execution.BytesTransferred} bytes`); |
| 26 | * ``` |
| 27 | * |
| 28 | * @binding |
| 29 | */ |
| 30 | export interface DescribeTaskExecution extends Binding.Service< |
| 31 | DescribeTaskExecution, |
| 32 | "AWS.DataSync.DescribeTaskExecution", |
| 33 | ( |
| 34 | task: Task, |
| 35 | ) => Effect.Effect< |
| 36 | ( |
| 37 | request: datasync.DescribeTaskExecutionRequest, |
| 38 | ) => Effect.Effect< |
| 39 | datasync.DescribeTaskExecutionResponse, |
| 40 | datasync.DescribeTaskExecutionError |
| 41 | > |
| 42 | > |
| 43 | > {} |
| 44 | export const DescribeTaskExecution = Binding.Service<DescribeTaskExecution>( |
| 45 | "AWS.DataSync.DescribeTaskExecution", |
| 46 | ); |