/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod"; import { remap as remap$ } from "../../lib/primitives.js"; import { safeParse } from "../../lib/schemas.js"; import { catchUnrecognizedEnum, OpenEnum, Unrecognized, } from "../../types/enums.js"; import { Result as SafeParseResult } from "../../types/fp.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; /** * The match state for a profile, one of: * * @remarks * - `MATCH_UNSPECIFIED` - Default/Null value. * - `CONFIRMED_MATCH` - Match is confirmed. * - `POTENTIAL_MATCH` - Match is a potential. * - `NO_MATCH` - Match is confirmed not to be a match. * - `INCONCLUSIVE` - Match is deemed to be inconclusive. */ export enum WatchlistMatchUpdateMatchState { MatchUnspecified = "MATCH_UNSPECIFIED", ConfirmedMatch = "CONFIRMED_MATCH", PotentialMatch = "POTENTIAL_MATCH", NoMatch = "NO_MATCH", Inconclusive = "INCONCLUSIVE", } /** * The match state for a profile, one of: * * @remarks * - `MATCH_UNSPECIFIED` - Default/Null value. * - `CONFIRMED_MATCH` - Match is confirmed. * - `POTENTIAL_MATCH` - Match is a potential. * - `NO_MATCH` - Match is confirmed not to be a match. * - `INCONCLUSIVE` - Match is deemed to be inconclusive. */ export type WatchlistMatchUpdateMatchStateOpen = OpenEnum< typeof WatchlistMatchUpdateMatchState >; /** * Matched profile details */ export type WatchlistMatchUpdate = { /** * Identifies that a confirmed watchlist match can be excluded when calculating the related screen state */ excludeFromScreening?: boolean | undefined; /** * The match state for a profile, one of: * * @remarks * - `MATCH_UNSPECIFIED` - Default/Null value. * - `CONFIRMED_MATCH` - Match is confirmed. * - `POTENTIAL_MATCH` - Match is a potential. * - `NO_MATCH` - Match is confirmed not to be a match. * - `INCONCLUSIVE` - Match is deemed to be inconclusive. */ matchState?: WatchlistMatchUpdateMatchStateOpen | undefined; /** * Indicates the watchlist source for a given match */ watchlistId?: string | undefined; /** * Identification number for the watchlist item that was matched */ watchlistItemId?: number | undefined; }; /** @internal */ export const WatchlistMatchUpdateMatchState$inboundSchema: z.ZodType< WatchlistMatchUpdateMatchStateOpen, z.ZodTypeDef, unknown > = z .union([ z.nativeEnum(WatchlistMatchUpdateMatchState), z.string().transform(catchUnrecognizedEnum), ]); /** @internal */ export const WatchlistMatchUpdateMatchState$outboundSchema: z.ZodType< WatchlistMatchUpdateMatchStateOpen, z.ZodTypeDef, WatchlistMatchUpdateMatchStateOpen > = z.union([ z.nativeEnum(WatchlistMatchUpdateMatchState), z.string().and(z.custom>()), ]); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace WatchlistMatchUpdateMatchState$ { /** @deprecated use `WatchlistMatchUpdateMatchState$inboundSchema` instead. */ export const inboundSchema = WatchlistMatchUpdateMatchState$inboundSchema; /** @deprecated use `WatchlistMatchUpdateMatchState$outboundSchema` instead. */ export const outboundSchema = WatchlistMatchUpdateMatchState$outboundSchema; } /** @internal */ export const WatchlistMatchUpdate$inboundSchema: z.ZodType< WatchlistMatchUpdate, z.ZodTypeDef, unknown > = z.object({ exclude_from_screening: z.boolean().optional(), match_state: WatchlistMatchUpdateMatchState$inboundSchema.optional(), watchlist_id: z.string().optional(), watchlist_item_id: z.number().int().optional(), }).transform((v) => { return remap$(v, { "exclude_from_screening": "excludeFromScreening", "match_state": "matchState", "watchlist_id": "watchlistId", "watchlist_item_id": "watchlistItemId", }); }); /** @internal */ export type WatchlistMatchUpdate$Outbound = { exclude_from_screening?: boolean | undefined; match_state?: string | undefined; watchlist_id?: string | undefined; watchlist_item_id?: number | undefined; }; /** @internal */ export const WatchlistMatchUpdate$outboundSchema: z.ZodType< WatchlistMatchUpdate$Outbound, z.ZodTypeDef, WatchlistMatchUpdate > = z.object({ excludeFromScreening: z.boolean().optional(), matchState: WatchlistMatchUpdateMatchState$outboundSchema.optional(), watchlistId: z.string().optional(), watchlistItemId: z.number().int().optional(), }).transform((v) => { return remap$(v, { excludeFromScreening: "exclude_from_screening", matchState: "match_state", watchlistId: "watchlist_id", watchlistItemId: "watchlist_item_id", }); }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace WatchlistMatchUpdate$ { /** @deprecated use `WatchlistMatchUpdate$inboundSchema` instead. */ export const inboundSchema = WatchlistMatchUpdate$inboundSchema; /** @deprecated use `WatchlistMatchUpdate$outboundSchema` instead. */ export const outboundSchema = WatchlistMatchUpdate$outboundSchema; /** @deprecated use `WatchlistMatchUpdate$Outbound` instead. */ export type Outbound = WatchlistMatchUpdate$Outbound; } export function watchlistMatchUpdateToJSON( watchlistMatchUpdate: WatchlistMatchUpdate, ): string { return JSON.stringify( WatchlistMatchUpdate$outboundSchema.parse(watchlistMatchUpdate), ); } export function watchlistMatchUpdateFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => WatchlistMatchUpdate$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'WatchlistMatchUpdate' from JSON`, ); }