/* * 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 { Result as SafeParseResult } from "../../types/fp.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; import { AddressDetail, AddressDetail$inboundSchema, AddressDetail$Outbound, AddressDetail$outboundSchema, } from "./addressdetail.js"; import { CountryDetail, CountryDetail$inboundSchema, CountryDetail$Outbound, CountryDetail$outboundSchema, } from "./countrydetail.js"; import { DescriptionDetail, DescriptionDetail$inboundSchema, DescriptionDetail$Outbound, DescriptionDetail$outboundSchema, } from "./descriptiondetail.js"; import { DowJonesDate, DowJonesDate$inboundSchema, DowJonesDate$Outbound, DowJonesDate$outboundSchema, } from "./dowjonesdate.js"; import { IdentificationDetail, IdentificationDetail$inboundSchema, IdentificationDetail$Outbound, IdentificationDetail$outboundSchema, } from "./identificationdetail.js"; import { NameDetail, NameDetail$inboundSchema, NameDetail$Outbound, NameDetail$outboundSchema, } from "./namedetail.js"; import { RelatedProfile, RelatedProfile$inboundSchema, RelatedProfile$Outbound, RelatedProfile$outboundSchema, } from "./relatedprofile.js"; import { RoleDetail, RoleDetail$inboundSchema, RoleDetail$Outbound, RoleDetail$outboundSchema, } from "./roledetail.js"; import { SanctionsListDetail, SanctionsListDetail$inboundSchema, SanctionsListDetail$Outbound, SanctionsListDetail$outboundSchema, } from "./sanctionslistdetail.js"; /** * date this person was added to the DNDB list */ export type CreatedDate = { /** * Day of a month. Must be from 1 to 31 and valid for the year and month, or 0 to specify a year by itself or a year and month where the day isn't significant. */ day?: number | undefined; /** * Month of a year. Must be from 1 to 12, or 0 to specify a year without a month and day. */ month?: number | undefined; /** * Year of the date. Must be from 1 to 9999, or 0 to specify a date without a year. */ year?: number | undefined; }; /** * DNDB persons date of birth */ export type Dob = { /** * Day of a month. Must be from 1 to 31 and valid for the year and month, or 0 to specify a year by itself or a year and month where the day isn't significant. */ day?: number | undefined; /** * Month of a year. Must be from 1 to 12, or 0 to specify a year without a month and day. */ month?: number | undefined; /** * Year of the date. Must be from 1 to 9999, or 0 to specify a date without a year. */ year?: number | undefined; }; /** * date this person will be removed from the DNDB list */ export type EndDate = { /** * Day of a month. Must be from 1 to 31 and valid for the year and month, or 0 to specify a year by itself or a year and month where the day isn't significant. */ day?: number | undefined; /** * Month of a year. Must be from 1 to 12, or 0 to specify a year without a month and day. */ month?: number | undefined; /** * Year of the date. Must be from 1 to 9999, or 0 to specify a date without a year. */ year?: number | undefined; }; /** * Dndb details */ export type DndbDetails = { /** * DNDB persons business name */ businessNm?: string | undefined; /** * reason why person exists in DNDB list */ comments?: string | undefined; /** * person that created this record for the DNDB list */ createUser?: string | undefined; /** * date this person was added to the DNDB list */ createdDate?: CreatedDate | null | undefined; /** * DNDB persons date of birth */ dob?: Dob | null | undefined; /** * DNDB persons email address */ email?: string | undefined; /** * date this person will be removed from the DNDB list */ endDate?: EndDate | null | undefined; /** * DNDB persons first name */ firstNm?: string | undefined; /** * DNDB profile person id */ id?: number | undefined; /** * DNDB persons last name */ lastNm?: string | undefined; /** * DNDB persons middle name */ middleNm?: string | undefined; /** * DNDB persons ssn number */ ssn?: string | undefined; /** * DNDB persons telephone number */ telephone?: string | undefined; /** * DNDB persons tin number */ tin?: string | undefined; }; /** * Date profile was last updated */ export type LastChangedDate = { /** * Day */ day?: string | undefined; /** * Month */ month?: string | undefined; /** * Year */ year?: string | undefined; }; /** * Dow Jones details */ export type DowJonesDetails = { /** * Active status of matched profile */ activeStatus?: string | undefined; /** * Corresponding address details */ addressDetails?: Array | undefined; /** * Dates of birth */ birthDates?: Array | undefined; /** * Corresponding birth places */ birthPlaces?: Array | undefined; /** * Corresponding country details */ countryDetails?: Array | undefined; /** * If corresponding person is deceased */ deceased?: string | undefined; /** * Dates of death */ deceasedDates?: Array | undefined; /** * Corresponding description details */ descriptionDetails?: Array | undefined; /** * Dow Jones profile person id */ dowJonesPersonId?: number | undefined; /** * Gender of person */ gender?: string | undefined; /** * Corresponding identifications */ identifications?: Array | undefined; /** * Images relating to profile */ images?: Array | undefined; /** * Date profile was last updated */ lastChangedDate?: LastChangedDate | null | undefined; /** * Name details associated with profile */ nameDetails?: Array | undefined; /** * Associated profile notes */ profileNotes?: string | undefined; /** * Related profiles */ relatedProfiles?: Array | undefined; /** * Corresponding role details */ roleDetails?: Array | undefined; /** * Corresponding sanctions list details */ sanctionsListDetails?: Array | undefined; /** * Sources relating to profile */ sources?: Array | undefined; }; /** * Watchlist details response */ export type WatchlistItem = { /** * Dndb details */ dndbDetails?: DndbDetails | null | undefined; /** * Dow Jones details */ dowJonesDetails?: DowJonesDetails | null | undefined; /** * The resource identifier for the WatchlistItem The format is "watchlists/{watchlist_id}/items/{watchlist_item_id}" */ name?: string | undefined; /** * Indicates the watchlist source for a given match */ watchlist?: string | undefined; /** * Identification number for the watchlist item that was matched */ watchlistItem?: number | undefined; }; /** @internal */ export const CreatedDate$inboundSchema: z.ZodType< CreatedDate, z.ZodTypeDef, unknown > = z.object({ day: z.number().int().optional(), month: z.number().int().optional(), year: z.number().int().optional(), }); /** @internal */ export type CreatedDate$Outbound = { day?: number | undefined; month?: number | undefined; year?: number | undefined; }; /** @internal */ export const CreatedDate$outboundSchema: z.ZodType< CreatedDate$Outbound, z.ZodTypeDef, CreatedDate > = z.object({ day: z.number().int().optional(), month: z.number().int().optional(), year: z.number().int().optional(), }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace CreatedDate$ { /** @deprecated use `CreatedDate$inboundSchema` instead. */ export const inboundSchema = CreatedDate$inboundSchema; /** @deprecated use `CreatedDate$outboundSchema` instead. */ export const outboundSchema = CreatedDate$outboundSchema; /** @deprecated use `CreatedDate$Outbound` instead. */ export type Outbound = CreatedDate$Outbound; } export function createdDateToJSON(createdDate: CreatedDate): string { return JSON.stringify(CreatedDate$outboundSchema.parse(createdDate)); } export function createdDateFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => CreatedDate$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CreatedDate' from JSON`, ); } /** @internal */ export const Dob$inboundSchema: z.ZodType = z .object({ day: z.number().int().optional(), month: z.number().int().optional(), year: z.number().int().optional(), }); /** @internal */ export type Dob$Outbound = { day?: number | undefined; month?: number | undefined; year?: number | undefined; }; /** @internal */ export const Dob$outboundSchema: z.ZodType = z .object({ day: z.number().int().optional(), month: z.number().int().optional(), year: z.number().int().optional(), }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace Dob$ { /** @deprecated use `Dob$inboundSchema` instead. */ export const inboundSchema = Dob$inboundSchema; /** @deprecated use `Dob$outboundSchema` instead. */ export const outboundSchema = Dob$outboundSchema; /** @deprecated use `Dob$Outbound` instead. */ export type Outbound = Dob$Outbound; } export function dobToJSON(dob: Dob): string { return JSON.stringify(Dob$outboundSchema.parse(dob)); } export function dobFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => Dob$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Dob' from JSON`, ); } /** @internal */ export const EndDate$inboundSchema: z.ZodType = z.object({ day: z.number().int().optional(), month: z.number().int().optional(), year: z.number().int().optional(), }); /** @internal */ export type EndDate$Outbound = { day?: number | undefined; month?: number | undefined; year?: number | undefined; }; /** @internal */ export const EndDate$outboundSchema: z.ZodType< EndDate$Outbound, z.ZodTypeDef, EndDate > = z.object({ day: z.number().int().optional(), month: z.number().int().optional(), year: z.number().int().optional(), }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace EndDate$ { /** @deprecated use `EndDate$inboundSchema` instead. */ export const inboundSchema = EndDate$inboundSchema; /** @deprecated use `EndDate$outboundSchema` instead. */ export const outboundSchema = EndDate$outboundSchema; /** @deprecated use `EndDate$Outbound` instead. */ export type Outbound = EndDate$Outbound; } export function endDateToJSON(endDate: EndDate): string { return JSON.stringify(EndDate$outboundSchema.parse(endDate)); } export function endDateFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => EndDate$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'EndDate' from JSON`, ); } /** @internal */ export const DndbDetails$inboundSchema: z.ZodType< DndbDetails, z.ZodTypeDef, unknown > = z.object({ business_nm: z.string().optional(), comments: z.string().optional(), create_user: z.string().optional(), created_date: z.nullable(z.lazy(() => CreatedDate$inboundSchema)).optional(), dob: z.nullable(z.lazy(() => Dob$inboundSchema)).optional(), email: z.string().optional(), end_date: z.nullable(z.lazy(() => EndDate$inboundSchema)).optional(), first_nm: z.string().optional(), id: z.number().int().optional(), last_nm: z.string().optional(), middle_nm: z.string().optional(), ssn: z.string().optional(), telephone: z.string().optional(), tin: z.string().optional(), }).transform((v) => { return remap$(v, { "business_nm": "businessNm", "create_user": "createUser", "created_date": "createdDate", "end_date": "endDate", "first_nm": "firstNm", "last_nm": "lastNm", "middle_nm": "middleNm", }); }); /** @internal */ export type DndbDetails$Outbound = { business_nm?: string | undefined; comments?: string | undefined; create_user?: string | undefined; created_date?: CreatedDate$Outbound | null | undefined; dob?: Dob$Outbound | null | undefined; email?: string | undefined; end_date?: EndDate$Outbound | null | undefined; first_nm?: string | undefined; id?: number | undefined; last_nm?: string | undefined; middle_nm?: string | undefined; ssn?: string | undefined; telephone?: string | undefined; tin?: string | undefined; }; /** @internal */ export const DndbDetails$outboundSchema: z.ZodType< DndbDetails$Outbound, z.ZodTypeDef, DndbDetails > = z.object({ businessNm: z.string().optional(), comments: z.string().optional(), createUser: z.string().optional(), createdDate: z.nullable(z.lazy(() => CreatedDate$outboundSchema)).optional(), dob: z.nullable(z.lazy(() => Dob$outboundSchema)).optional(), email: z.string().optional(), endDate: z.nullable(z.lazy(() => EndDate$outboundSchema)).optional(), firstNm: z.string().optional(), id: z.number().int().optional(), lastNm: z.string().optional(), middleNm: z.string().optional(), ssn: z.string().optional(), telephone: z.string().optional(), tin: z.string().optional(), }).transform((v) => { return remap$(v, { businessNm: "business_nm", createUser: "create_user", createdDate: "created_date", endDate: "end_date", firstNm: "first_nm", lastNm: "last_nm", middleNm: "middle_nm", }); }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace DndbDetails$ { /** @deprecated use `DndbDetails$inboundSchema` instead. */ export const inboundSchema = DndbDetails$inboundSchema; /** @deprecated use `DndbDetails$outboundSchema` instead. */ export const outboundSchema = DndbDetails$outboundSchema; /** @deprecated use `DndbDetails$Outbound` instead. */ export type Outbound = DndbDetails$Outbound; } export function dndbDetailsToJSON(dndbDetails: DndbDetails): string { return JSON.stringify(DndbDetails$outboundSchema.parse(dndbDetails)); } export function dndbDetailsFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => DndbDetails$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'DndbDetails' from JSON`, ); } /** @internal */ export const LastChangedDate$inboundSchema: z.ZodType< LastChangedDate, z.ZodTypeDef, unknown > = z.object({ day: z.string().optional(), month: z.string().optional(), year: z.string().optional(), }); /** @internal */ export type LastChangedDate$Outbound = { day?: string | undefined; month?: string | undefined; year?: string | undefined; }; /** @internal */ export const LastChangedDate$outboundSchema: z.ZodType< LastChangedDate$Outbound, z.ZodTypeDef, LastChangedDate > = z.object({ day: z.string().optional(), month: z.string().optional(), year: z.string().optional(), }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace LastChangedDate$ { /** @deprecated use `LastChangedDate$inboundSchema` instead. */ export const inboundSchema = LastChangedDate$inboundSchema; /** @deprecated use `LastChangedDate$outboundSchema` instead. */ export const outboundSchema = LastChangedDate$outboundSchema; /** @deprecated use `LastChangedDate$Outbound` instead. */ export type Outbound = LastChangedDate$Outbound; } export function lastChangedDateToJSON( lastChangedDate: LastChangedDate, ): string { return JSON.stringify(LastChangedDate$outboundSchema.parse(lastChangedDate)); } export function lastChangedDateFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => LastChangedDate$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'LastChangedDate' from JSON`, ); } /** @internal */ export const DowJonesDetails$inboundSchema: z.ZodType< DowJonesDetails, z.ZodTypeDef, unknown > = z.object({ active_status: z.string().optional(), address_details: z.array(AddressDetail$inboundSchema).optional(), birth_dates: z.array(DowJonesDate$inboundSchema).optional(), birth_places: z.array(z.string()).optional(), country_details: z.array(CountryDetail$inboundSchema).optional(), deceased: z.string().optional(), deceased_dates: z.array(DowJonesDate$inboundSchema).optional(), description_details: z.array(DescriptionDetail$inboundSchema).optional(), dow_jones_person_id: z.number().int().optional(), gender: z.string().optional(), identifications: z.array(IdentificationDetail$inboundSchema).optional(), images: z.array(z.string()).optional(), last_changed_date: z.nullable(z.lazy(() => LastChangedDate$inboundSchema)) .optional(), name_details: z.array(NameDetail$inboundSchema).optional(), profile_notes: z.string().optional(), related_profiles: z.array(RelatedProfile$inboundSchema).optional(), role_details: z.array(RoleDetail$inboundSchema).optional(), sanctions_list_details: z.array(SanctionsListDetail$inboundSchema).optional(), sources: z.array(z.string()).optional(), }).transform((v) => { return remap$(v, { "active_status": "activeStatus", "address_details": "addressDetails", "birth_dates": "birthDates", "birth_places": "birthPlaces", "country_details": "countryDetails", "deceased_dates": "deceasedDates", "description_details": "descriptionDetails", "dow_jones_person_id": "dowJonesPersonId", "last_changed_date": "lastChangedDate", "name_details": "nameDetails", "profile_notes": "profileNotes", "related_profiles": "relatedProfiles", "role_details": "roleDetails", "sanctions_list_details": "sanctionsListDetails", }); }); /** @internal */ export type DowJonesDetails$Outbound = { active_status?: string | undefined; address_details?: Array | undefined; birth_dates?: Array | undefined; birth_places?: Array | undefined; country_details?: Array | undefined; deceased?: string | undefined; deceased_dates?: Array | undefined; description_details?: Array | undefined; dow_jones_person_id?: number | undefined; gender?: string | undefined; identifications?: Array | undefined; images?: Array | undefined; last_changed_date?: LastChangedDate$Outbound | null | undefined; name_details?: Array | undefined; profile_notes?: string | undefined; related_profiles?: Array | undefined; role_details?: Array | undefined; sanctions_list_details?: Array | undefined; sources?: Array | undefined; }; /** @internal */ export const DowJonesDetails$outboundSchema: z.ZodType< DowJonesDetails$Outbound, z.ZodTypeDef, DowJonesDetails > = z.object({ activeStatus: z.string().optional(), addressDetails: z.array(AddressDetail$outboundSchema).optional(), birthDates: z.array(DowJonesDate$outboundSchema).optional(), birthPlaces: z.array(z.string()).optional(), countryDetails: z.array(CountryDetail$outboundSchema).optional(), deceased: z.string().optional(), deceasedDates: z.array(DowJonesDate$outboundSchema).optional(), descriptionDetails: z.array(DescriptionDetail$outboundSchema).optional(), dowJonesPersonId: z.number().int().optional(), gender: z.string().optional(), identifications: z.array(IdentificationDetail$outboundSchema).optional(), images: z.array(z.string()).optional(), lastChangedDate: z.nullable(z.lazy(() => LastChangedDate$outboundSchema)) .optional(), nameDetails: z.array(NameDetail$outboundSchema).optional(), profileNotes: z.string().optional(), relatedProfiles: z.array(RelatedProfile$outboundSchema).optional(), roleDetails: z.array(RoleDetail$outboundSchema).optional(), sanctionsListDetails: z.array(SanctionsListDetail$outboundSchema).optional(), sources: z.array(z.string()).optional(), }).transform((v) => { return remap$(v, { activeStatus: "active_status", addressDetails: "address_details", birthDates: "birth_dates", birthPlaces: "birth_places", countryDetails: "country_details", deceasedDates: "deceased_dates", descriptionDetails: "description_details", dowJonesPersonId: "dow_jones_person_id", lastChangedDate: "last_changed_date", nameDetails: "name_details", profileNotes: "profile_notes", relatedProfiles: "related_profiles", roleDetails: "role_details", sanctionsListDetails: "sanctions_list_details", }); }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace DowJonesDetails$ { /** @deprecated use `DowJonesDetails$inboundSchema` instead. */ export const inboundSchema = DowJonesDetails$inboundSchema; /** @deprecated use `DowJonesDetails$outboundSchema` instead. */ export const outboundSchema = DowJonesDetails$outboundSchema; /** @deprecated use `DowJonesDetails$Outbound` instead. */ export type Outbound = DowJonesDetails$Outbound; } export function dowJonesDetailsToJSON( dowJonesDetails: DowJonesDetails, ): string { return JSON.stringify(DowJonesDetails$outboundSchema.parse(dowJonesDetails)); } export function dowJonesDetailsFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => DowJonesDetails$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'DowJonesDetails' from JSON`, ); } /** @internal */ export const WatchlistItem$inboundSchema: z.ZodType< WatchlistItem, z.ZodTypeDef, unknown > = z.object({ dndb_details: z.nullable(z.lazy(() => DndbDetails$inboundSchema)).optional(), dow_jones_details: z.nullable(z.lazy(() => DowJonesDetails$inboundSchema)) .optional(), name: z.string().optional(), watchlist: z.string().optional(), watchlist_item: z.number().int().optional(), }).transform((v) => { return remap$(v, { "dndb_details": "dndbDetails", "dow_jones_details": "dowJonesDetails", "watchlist_item": "watchlistItem", }); }); /** @internal */ export type WatchlistItem$Outbound = { dndb_details?: DndbDetails$Outbound | null | undefined; dow_jones_details?: DowJonesDetails$Outbound | null | undefined; name?: string | undefined; watchlist?: string | undefined; watchlist_item?: number | undefined; }; /** @internal */ export const WatchlistItem$outboundSchema: z.ZodType< WatchlistItem$Outbound, z.ZodTypeDef, WatchlistItem > = z.object({ dndbDetails: z.nullable(z.lazy(() => DndbDetails$outboundSchema)).optional(), dowJonesDetails: z.nullable(z.lazy(() => DowJonesDetails$outboundSchema)) .optional(), name: z.string().optional(), watchlist: z.string().optional(), watchlistItem: z.number().int().optional(), }).transform((v) => { return remap$(v, { dndbDetails: "dndb_details", dowJonesDetails: "dow_jones_details", watchlistItem: "watchlist_item", }); }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace WatchlistItem$ { /** @deprecated use `WatchlistItem$inboundSchema` instead. */ export const inboundSchema = WatchlistItem$inboundSchema; /** @deprecated use `WatchlistItem$outboundSchema` instead. */ export const outboundSchema = WatchlistItem$outboundSchema; /** @deprecated use `WatchlistItem$Outbound` instead. */ export type Outbound = WatchlistItem$Outbound; } export function watchlistItemToJSON(watchlistItem: WatchlistItem): string { return JSON.stringify(WatchlistItem$outboundSchema.parse(watchlistItem)); } export function watchlistItemFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => WatchlistItem$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'WatchlistItem' from JSON`, ); }