/* * 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"; import { WatchlistMatchUpdate, WatchlistMatchUpdate$inboundSchema, WatchlistMatchUpdate$Outbound, WatchlistMatchUpdate$outboundSchema, } from "./watchlistmatchupdate.js"; /** * The screen state of one screening within an investigation, one of: * * @remarks * - `SCREEN_STATE_UNSPECIFIED` - Default/Null value. * - `PENDING` - Screen result is pending. * - `PASSED` - Screen result has passed. * - `FAILED` - Screen result has failed. * - `NEEDS_REVIEW` - Screen result needs manual review. * - `DEFERRED_REVIEW` - Screen result is deferred for review at a later date. * - `OUT_OF_SCOPE` - Screen state is out of scope for this investigation type. */ export enum InvestigationUpdateIdentityVerification { ScreenStateUnspecified = "SCREEN_STATE_UNSPECIFIED", Pending = "PENDING", Passed = "PASSED", Failed = "FAILED", NeedsReview = "NEEDS_REVIEW", DeferredReview = "DEFERRED_REVIEW", OutOfScope = "OUT_OF_SCOPE", } /** * The screen state of one screening within an investigation, one of: * * @remarks * - `SCREEN_STATE_UNSPECIFIED` - Default/Null value. * - `PENDING` - Screen result is pending. * - `PASSED` - Screen result has passed. * - `FAILED` - Screen result has failed. * - `NEEDS_REVIEW` - Screen result needs manual review. * - `DEFERRED_REVIEW` - Screen result is deferred for review at a later date. * - `OUT_OF_SCOPE` - Screen state is out of scope for this investigation type. */ export type InvestigationUpdateIdentityVerificationOpen = OpenEnum< typeof InvestigationUpdateIdentityVerification >; /** * The state of an investigation request, one of: * * @remarks * - `INVESTIGATION_REQUEST_STATE_UNSPECIFIED` - Default/Null value. * - `OPEN` - The investigation request is open. * - `CLOSED` - The investigation request is closed. */ export enum InvestigationUpdateInvestigationRequestState { InvestigationRequestStateUnspecified = "INVESTIGATION_REQUEST_STATE_UNSPECIFIED", Open = "OPEN", Closed = "CLOSED", } /** * The state of an investigation request, one of: * * @remarks * - `INVESTIGATION_REQUEST_STATE_UNSPECIFIED` - Default/Null value. * - `OPEN` - The investigation request is open. * - `CLOSED` - The investigation request is closed. */ export type InvestigationUpdateInvestigationRequestStateOpen = OpenEnum< typeof InvestigationUpdateInvestigationRequestState >; /** * Contains investigation details of corresponding investigation */ export type InvestigationUpdate = { /** * A unique identifier referencing a client The client ID serves as the unique identifier for the apex client positioned above the correspondent within the apex client configurator hierarchy. Moving forward, the account service will internally assign the client ID for all investigations. */ clientId?: string | undefined; /** * Comment relating to why the investigation state was updated */ comment?: string | undefined; /** * The screen state of one screening within an investigation, one of: * * @remarks * - `SCREEN_STATE_UNSPECIFIED` - Default/Null value. * - `PENDING` - Screen result is pending. * - `PASSED` - Screen result has passed. * - `FAILED` - Screen result has failed. * - `NEEDS_REVIEW` - Screen result needs manual review. * - `DEFERRED_REVIEW` - Screen result is deferred for review at a later date. * - `OUT_OF_SCOPE` - Screen state is out of scope for this investigation type. */ identityVerification?: | InvestigationUpdateIdentityVerificationOpen | undefined; /** * The state of an investigation request, one of: * * @remarks * - `INVESTIGATION_REQUEST_STATE_UNSPECIFIED` - Default/Null value. * - `OPEN` - The investigation request is open. * - `CLOSED` - The investigation request is closed. */ investigationRequestState?: | InvestigationUpdateInvestigationRequestStateOpen | undefined; /** * A list of watchlist entries matched against the investigation */ watchlistMatches?: Array | undefined; }; /** @internal */ export const InvestigationUpdateIdentityVerification$inboundSchema: z.ZodType< InvestigationUpdateIdentityVerificationOpen, z.ZodTypeDef, unknown > = z .union([ z.nativeEnum(InvestigationUpdateIdentityVerification), z.string().transform(catchUnrecognizedEnum), ]); /** @internal */ export const InvestigationUpdateIdentityVerification$outboundSchema: z.ZodType< InvestigationUpdateIdentityVerificationOpen, z.ZodTypeDef, InvestigationUpdateIdentityVerificationOpen > = z.union([ z.nativeEnum(InvestigationUpdateIdentityVerification), 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 InvestigationUpdateIdentityVerification$ { /** @deprecated use `InvestigationUpdateIdentityVerification$inboundSchema` instead. */ export const inboundSchema = InvestigationUpdateIdentityVerification$inboundSchema; /** @deprecated use `InvestigationUpdateIdentityVerification$outboundSchema` instead. */ export const outboundSchema = InvestigationUpdateIdentityVerification$outboundSchema; } /** @internal */ export const InvestigationUpdateInvestigationRequestState$inboundSchema: z.ZodType< InvestigationUpdateInvestigationRequestStateOpen, z.ZodTypeDef, unknown > = z .union([ z.nativeEnum(InvestigationUpdateInvestigationRequestState), z.string().transform(catchUnrecognizedEnum), ]); /** @internal */ export const InvestigationUpdateInvestigationRequestState$outboundSchema: z.ZodType< InvestigationUpdateInvestigationRequestStateOpen, z.ZodTypeDef, InvestigationUpdateInvestigationRequestStateOpen > = z.union([ z.nativeEnum(InvestigationUpdateInvestigationRequestState), 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 InvestigationUpdateInvestigationRequestState$ { /** @deprecated use `InvestigationUpdateInvestigationRequestState$inboundSchema` instead. */ export const inboundSchema = InvestigationUpdateInvestigationRequestState$inboundSchema; /** @deprecated use `InvestigationUpdateInvestigationRequestState$outboundSchema` instead. */ export const outboundSchema = InvestigationUpdateInvestigationRequestState$outboundSchema; } /** @internal */ export const InvestigationUpdate$inboundSchema: z.ZodType< InvestigationUpdate, z.ZodTypeDef, unknown > = z.object({ client_id: z.string().optional(), comment: z.string().optional(), identity_verification: InvestigationUpdateIdentityVerification$inboundSchema .optional(), investigation_request_state: InvestigationUpdateInvestigationRequestState$inboundSchema.optional(), watchlist_matches: z.array(WatchlistMatchUpdate$inboundSchema).optional(), }).transform((v) => { return remap$(v, { "client_id": "clientId", "identity_verification": "identityVerification", "investigation_request_state": "investigationRequestState", "watchlist_matches": "watchlistMatches", }); }); /** @internal */ export type InvestigationUpdate$Outbound = { client_id?: string | undefined; comment?: string | undefined; identity_verification?: string | undefined; investigation_request_state?: string | undefined; watchlist_matches?: Array | undefined; }; /** @internal */ export const InvestigationUpdate$outboundSchema: z.ZodType< InvestigationUpdate$Outbound, z.ZodTypeDef, InvestigationUpdate > = z.object({ clientId: z.string().optional(), comment: z.string().optional(), identityVerification: InvestigationUpdateIdentityVerification$outboundSchema .optional(), investigationRequestState: InvestigationUpdateInvestigationRequestState$outboundSchema.optional(), watchlistMatches: z.array(WatchlistMatchUpdate$outboundSchema).optional(), }).transform((v) => { return remap$(v, { clientId: "client_id", identityVerification: "identity_verification", investigationRequestState: "investigation_request_state", watchlistMatches: "watchlist_matches", }); }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace InvestigationUpdate$ { /** @deprecated use `InvestigationUpdate$inboundSchema` instead. */ export const inboundSchema = InvestigationUpdate$inboundSchema; /** @deprecated use `InvestigationUpdate$outboundSchema` instead. */ export const outboundSchema = InvestigationUpdate$outboundSchema; /** @deprecated use `InvestigationUpdate$Outbound` instead. */ export type Outbound = InvestigationUpdate$Outbound; } export function investigationUpdateToJSON( investigationUpdate: InvestigationUpdate, ): string { return JSON.stringify( InvestigationUpdate$outboundSchema.parse(investigationUpdate), ); } export function investigationUpdateFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => InvestigationUpdate$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'InvestigationUpdate' from JSON`, ); }