| 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:ListTaskExecutions`. |
| 8 | * |
| 9 | * Enumerates the bound {@link Task}'s executions (most recent first) so an |
| 10 | * ops function can audit run history or find the latest run's ARN. The task |
| 11 | * ARN is injected from the binding; pass `MaxResults`/`NextToken` to page. |
| 12 | * Provide the implementation with |
| 13 | * `Effect.provide(AWS.DataSync.ListTaskExecutionsHttp)`. |
| 14 | * ### Monitoring Tasks |
| 15 | * **Example:** List The Task's Runs |
| 16 | * ```typescript |
| 17 | * // init — bind the operation to the task |
| 18 | * const listTaskExecutions = yield* AWS.DataSync.ListTaskExecutions(task); |
| 19 | * |
| 20 | * // runtime |
| 21 | * const { TaskExecutions } = yield* listTaskExecutions(); |
| 22 | * for (const execution of TaskExecutions ?? []) { |
| 23 | * yield* Effect.log(`${execution.TaskExecutionArn}: ${execution.Status}`); |
| 24 | * } |
| 25 | * ``` |
| 26 | * |
| 27 | * @binding |
| 28 | */ |
| 29 | export interface ListTaskExecutions extends Binding.Service< |
| 30 | ListTaskExecutions, |
| 31 | "AWS.DataSync.ListTaskExecutions", |
| 32 | ( |
| 33 | task: Task, |
| 34 | ) => Effect.Effect< |
| 35 | ( |
| 36 | request?: Omit<datasync.ListTaskExecutionsRequest, "TaskArn">, |
| 37 | ) => Effect.Effect< |
| 38 | datasync.ListTaskExecutionsResponse, |
| 39 | datasync.ListTaskExecutionsError |
| 40 | > |
| 41 | > |
| 42 | > {} |
| 43 | export const ListTaskExecutions = Binding.Service<ListTaskExecutions>( |
| 44 | "AWS.DataSync.ListTaskExecutions", |
| 45 | ); |