| 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 { MatchingWorkflow } from "./MatchingWorkflow.ts"; |
| 5 | |
| 6 | /** |
| 7 | * Runtime binding for `entityresolution:GenerateMatchId`. |
| 8 | * |
| 9 | * Generates or retrieves Match IDs for records submitted in real time |
| 10 | * against the bound rule-based matching workflow: existing records return |
| 11 | * their Match IDs, unmatched records get new ones. Provide the |
| 12 | * implementation with `Effect.provide(AWS.EntityResolution.GenerateMatchIdHttp)`. |
| 13 | * ### Real-Time Matching |
| 14 | * **Example:** Generate Match IDs for Records |
| 15 | * ```typescript |
| 16 | * // init — bind the operation to the workflow |
| 17 | * const generateMatchId = yield* AWS.EntityResolution.GenerateMatchId(workflow); |
| 18 | * |
| 19 | * // runtime |
| 20 | * const { matchGroups } = yield* generateMatchId({ |
| 21 | * records: [ |
| 22 | * { |
| 23 | * inputSourceARN: table.tableArn, |
| 24 | * uniqueId: "1", |
| 25 | * recordAttributeMap: { id: "1", email: "jane@example.com" }, |
| 26 | * }, |
| 27 | * ], |
| 28 | * }); |
| 29 | * ``` |
| 30 | * |
| 31 | * @binding |
| 32 | */ |
| 33 | export interface GenerateMatchId extends Binding.Service< |
| 34 | GenerateMatchId, |
| 35 | "AWS.EntityResolution.GenerateMatchId", |
| 36 | ( |
| 37 | workflow: MatchingWorkflow, |
| 38 | ) => Effect.Effect< |
| 39 | ( |
| 40 | request: Omit<entityresolution.GenerateMatchIdInput, "workflowName">, |
| 41 | ) => Effect.Effect< |
| 42 | entityresolution.GenerateMatchIdOutput, |
| 43 | entityresolution.GenerateMatchIdError |
| 44 | > |
| 45 | > |
| 46 | > {} |
| 47 | |
| 48 | export const GenerateMatchId = Binding.Service<GenerateMatchId>( |
| 49 | "AWS.EntityResolution.GenerateMatchId", |
| 50 | ); |