| 1 | import type * as entityresolution from "@distilled.cloud/aws/entityresolution"; |
| 2 | import type * as Effect from "effect/Effect"; |
| 3 | import * as Binding from "../../Binding.ts"; |
| 4 | import type { IdMappingWorkflow } from "./IdMappingWorkflow.ts"; |
| 5 | |
| 6 | /** |
| 7 | * Runtime binding for `entityresolution:GetIdMappingJob`. |
| 8 | * |
| 9 | * Reads the status, metrics, and errors of an ID mapping job run of the |
| 10 | * bound workflow. Provide the implementation with |
| 11 | * `Effect.provide(AWS.EntityResolution.GetIdMappingJobHttp)`. |
| 12 | * ### Running ID Mapping Jobs |
| 13 | * **Example:** Poll a Job's Status |
| 14 | * ```typescript |
| 15 | * // init — bind the operation to the workflow |
| 16 | * const getIdMappingJob = yield* AWS.EntityResolution.GetIdMappingJob(workflow); |
| 17 | * |
| 18 | * // runtime |
| 19 | * const job = yield* getIdMappingJob({ jobId }); |
| 20 | * console.log(job.status, job.metrics?.totalMappedRecords); |
| 21 | * ``` |
| 22 | * |
| 23 | * @binding |
| 24 | */ |
| 25 | export interface GetIdMappingJob extends Binding.Service< |
| 26 | GetIdMappingJob, |
| 27 | "AWS.EntityResolution.GetIdMappingJob", |
| 28 | ( |
| 29 | workflow: IdMappingWorkflow, |
| 30 | ) => Effect.Effect< |
| 31 | ( |
| 32 | request: Omit<entityresolution.GetIdMappingJobInput, "workflowName">, |
| 33 | ) => Effect.Effect< |
| 34 | entityresolution.GetIdMappingJobOutput, |
| 35 | entityresolution.GetIdMappingJobError |
| 36 | > |
| 37 | > |
| 38 | > {} |
| 39 | |
| 40 | export const GetIdMappingJob = Binding.Service<GetIdMappingJob>( |
| 41 | "AWS.EntityResolution.GetIdMappingJob", |
| 42 | ); |