| 1 | import type * as forecast from "@distilled.cloud/aws/forecast"; |
| 2 | import type * as Effect from "effect/Effect"; |
| 3 | import * as Binding from "../../Binding.ts"; |
| 4 | |
| 5 | /** |
| 6 | * Runtime binding for `forecast:DescribeDatasetImportJob` — poll an import |
| 7 | * job started by {@link CreateDatasetImportJob} until its `Status` reaches |
| 8 | * `ACTIVE` (or `CREATE_FAILED`), and read its field statistics. |
| 9 | * |
| 10 | * Import-job ARNs are created at runtime, so the binding takes no arguments |
| 11 | * and grants `forecast:DescribeDatasetImportJob` on `*`. Provide the |
| 12 | * implementation with |
| 13 | * `Effect.provide(AWS.Forecast.DescribeDatasetImportJobHttp)`. |
| 14 | * |
| 15 | * ### Importing Data |
| 16 | * **Example:** Poll an Import Job |
| 17 | * ```typescript |
| 18 | * // init |
| 19 | * const describeDatasetImportJob = yield* AWS.Forecast.DescribeDatasetImportJob(); |
| 20 | * |
| 21 | * // runtime |
| 22 | * const detail = yield* describeDatasetImportJob({ |
| 23 | * DatasetImportJobArn: job.DatasetImportJobArn!, |
| 24 | * }); |
| 25 | * if (detail.Status === "CREATE_FAILED") { |
| 26 | * yield* Effect.logError(`import failed: ${detail.Message}`); |
| 27 | * } |
| 28 | * ``` |
| 29 | * |
| 30 | * @binding |
| 31 | */ |
| 32 | export interface DescribeDatasetImportJob extends Binding.Service< |
| 33 | DescribeDatasetImportJob, |
| 34 | "AWS.Forecast.DescribeDatasetImportJob", |
| 35 | () => Effect.Effect< |
| 36 | ( |
| 37 | request: forecast.DescribeDatasetImportJobRequest, |
| 38 | ) => Effect.Effect< |
| 39 | forecast.DescribeDatasetImportJobResponse, |
| 40 | forecast.DescribeDatasetImportJobError |
| 41 | > |
| 42 | > |
| 43 | > {} |
| 44 | export const DescribeDatasetImportJob = |
| 45 | Binding.Service<DescribeDatasetImportJob>( |
| 46 | "AWS.Forecast.DescribeDatasetImportJob", |
| 47 | ); |