| 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:StartTaskExecution`. |
| 8 | * |
| 9 | * Starts a run of the bound {@link Task} — the moment data actually moves. |
| 10 | * The task ARN is injected from the binding; pass `OverrideOptions`, |
| 11 | * `Includes`/`Excludes`, or a `ManifestConfig` to shape the individual run. |
| 12 | * Returns the new execution's ARN for use with `DescribeTaskExecution` / |
| 13 | * `CancelTaskExecution`. Provide the implementation with |
| 14 | * `Effect.provide(AWS.DataSync.StartTaskExecutionHttp)`. |
| 15 | * ### Running Transfers |
| 16 | * **Example:** Kick Off A Transfer |
| 17 | * ```typescript |
| 18 | * // init — bind the operation to the task |
| 19 | * const startTaskExecution = yield* AWS.DataSync.StartTaskExecution(task); |
| 20 | * |
| 21 | * // runtime |
| 22 | * const { TaskExecutionArn } = yield* startTaskExecution(); |
| 23 | * yield* Effect.log(`transfer started: ${TaskExecutionArn}`); |
| 24 | * ``` |
| 25 | * |
| 26 | * @binding |
| 27 | */ |
| 28 | export interface StartTaskExecution extends Binding.Service< |
| 29 | StartTaskExecution, |
| 30 | "AWS.DataSync.StartTaskExecution", |
| 31 | ( |
| 32 | task: Task, |
| 33 | ) => Effect.Effect< |
| 34 | ( |
| 35 | request?: Omit<datasync.StartTaskExecutionRequest, "TaskArn">, |
| 36 | ) => Effect.Effect< |
| 37 | datasync.StartTaskExecutionResponse, |
| 38 | datasync.StartTaskExecutionError |
| 39 | > |
| 40 | > |
| 41 | > {} |
| 42 | export const StartTaskExecution = Binding.Service<StartTaskExecution>( |
| 43 | "AWS.DataSync.StartTaskExecution", |
| 44 | ); |