| 1 | import type * as datazone from "@distilled.cloud/aws/datazone"; |
| 2 | import type * as Effect from "effect/Effect"; |
| 3 | import * as Binding from "../../Binding.ts"; |
| 4 | import type { Domain } from "./Domain.ts"; |
| 5 | |
| 6 | export interface GetDataSourceRunRequest extends Omit< |
| 7 | datazone.GetDataSourceRunInput, |
| 8 | "domainIdentifier" |
| 9 | > {} |
| 10 | |
| 11 | /** |
| 12 | * Runtime binding for `datazone:GetDataSourceRun`. |
| 13 | * |
| 14 | * Reads the status of a data source run in the bound domain. The domain id is injected from the binding. |
| 15 | * Provide the implementation with |
| 16 | * `Effect.provide(AWS.DataZone.GetDataSourceRunHttp)`. |
| 17 | * ### Data Source Runs |
| 18 | * **Example:** Poll a Run to Completion |
| 19 | * ```typescript |
| 20 | * // init — bind the operation to the domain |
| 21 | * const getDataSourceRun = yield* AWS.DataZone.GetDataSourceRun(domain); |
| 22 | * |
| 23 | * // runtime |
| 24 | * const run = yield* getDataSourceRun({ identifier: runId }); |
| 25 | * if (run.status === "FAILED") { yield* Effect.logError(run.errorMessage); } |
| 26 | * ``` |
| 27 | * |
| 28 | * @binding |
| 29 | */ |
| 30 | export interface GetDataSourceRun extends Binding.Service< |
| 31 | GetDataSourceRun, |
| 32 | "AWS.DataZone.GetDataSourceRun", |
| 33 | ( |
| 34 | domain: Domain, |
| 35 | ) => Effect.Effect< |
| 36 | ( |
| 37 | request: GetDataSourceRunRequest, |
| 38 | ) => Effect.Effect< |
| 39 | datazone.GetDataSourceRunOutput, |
| 40 | datazone.GetDataSourceRunError |
| 41 | > |
| 42 | > |
| 43 | > {} |
| 44 | export const GetDataSourceRun = Binding.Service<GetDataSourceRun>( |
| 45 | "AWS.DataZone.GetDataSourceRun", |
| 46 | ); |