sailfork / t3code-github / .repos/ alchemy-effect/ packages/ aws/ src/ EntityResolution/ GetMatchId.ts

import type * as entityresolution from "@distilled.cloud/aws/entityresolution";
import * as Binding from "alchemy/Binding";
import type * as Effect from "effect/Effect";
import type { MatchingWorkflow } from "./MatchingWorkflow.ts";

/**
 * Runtime binding for `entityresolution:GetMatchId`.
 *
 * Returns the Match ID of a customer record if it has already been processed
 * by the bound rule-based matching workflow — a read-only dry run of an
 * incremental load. Provide the implementation with
 * `Effect.provide(AWS.EntityResolution.GetMatchIdHttp)`.
 * ### Real-Time Matching
 * **Example:** Look Up a Record's Match ID
 * ```typescript
 * // init — bind the operation to the workflow
 * const getMatchId = yield* AWS.EntityResolution.GetMatchId(workflow);
 *
 * // runtime
 * const { matchId, matchRule } = yield* getMatchId({
 *   record: { id: "1", email: "jane@example.com" },
 * });
 * ```
 *
 * @binding
 */
export interface GetMatchId extends Binding.Service<
  GetMatchId,
  "AWS.EntityResolution.GetMatchId",
  (
    workflow: MatchingWorkflow,
  ) => Effect.Effect<
    (
      request: Omit<entityresolution.GetMatchIdInput, "workflowName">,
    ) => Effect.Effect<entityresolution.GetMatchIdOutput, entityresolution.GetMatchIdError>
  >
> {}

export const GetMatchId = Binding.Service<GetMatchId>("AWS.EntityResolution.GetMatchId");