| 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:DescribeTask`. |
| 8 | * |
| 9 | * Reads the bound {@link Task}'s full detail — status, transfer options, |
| 10 | * filters, schedule (including `ScheduleDetails` with the last disable |
| 11 | * reason), and the ARN of the currently running execution — so an ops |
| 12 | * function can monitor the task's health. The task ARN is injected from the |
| 13 | * binding. Provide the implementation with |
| 14 | * `Effect.provide(AWS.DataSync.DescribeTaskHttp)`. |
| 15 | * ### Monitoring Tasks |
| 16 | * **Example:** Check The Task's Status |
| 17 | * ```typescript |
| 18 | * // init — bind the operation to the task |
| 19 | * const describeTask = yield* AWS.DataSync.DescribeTask(task); |
| 20 | * |
| 21 | * // runtime |
| 22 | * const detail = yield* describeTask(); |
| 23 | * yield* Effect.log(`task ${detail.Name} is ${detail.Status}`); |
| 24 | * ``` |
| 25 | * |
| 26 | * @binding |
| 27 | */ |
| 28 | export interface DescribeTask extends Binding.Service< |
| 29 | DescribeTask, |
| 30 | "AWS.DataSync.DescribeTask", |
| 31 | ( |
| 32 | task: Task, |
| 33 | ) => Effect.Effect< |
| 34 | () => Effect.Effect< |
| 35 | datasync.DescribeTaskResponse, |
| 36 | datasync.DescribeTaskError |
| 37 | > |
| 38 | > |
| 39 | > {} |
| 40 | export const DescribeTask = Binding.Service<DescribeTask>( |
| 41 | "AWS.DataSync.DescribeTask", |
| 42 | ); |