/* * 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 { CustomerReferralSourceCreate, CustomerReferralSourceCreate$inboundSchema, CustomerReferralSourceCreate$Outbound, CustomerReferralSourceCreate$outboundSchema, } from "./customerreferralsourcecreate.js"; import { NegativeNewsCreate, NegativeNewsCreate$inboundSchema, NegativeNewsCreate$Outbound, NegativeNewsCreate$outboundSchema, } from "./negativenewscreate.js"; import { OtherSourcesOfWealthCreate, OtherSourcesOfWealthCreate$inboundSchema, OtherSourcesOfWealthCreate$Outbound, OtherSourcesOfWealthCreate$outboundSchema, } from "./othersourcesofwealthcreate.js"; /** * Foreign Due Diligence for Legal Natural Persons required when a Legal Natural Person is the Primary Owner on a non-resident/non-citizen Account. */ export type NaturalPersonFddCreate = { /** * Customer Non-referral Source */ customerNonReferralSource?: string | undefined; /** * Customer Referral Source */ customerReferralSource?: CustomerReferralSourceCreate | undefined; /** * The description of the applicant's source of wealth */ employmentAndEmployerDescription: string; /** * Negative News detail. */ negativeNews: NegativeNewsCreate; /** * Applicant's other source of wealth */ otherSourcesOfWealth: OtherSourcesOfWealthCreate; }; /** @internal */ export const NaturalPersonFddCreate$inboundSchema: z.ZodType< NaturalPersonFddCreate, z.ZodTypeDef, unknown > = z.object({ customer_non_referral_source: z.string().optional(), customer_referral_source: CustomerReferralSourceCreate$inboundSchema .optional(), employment_and_employer_description: z.string(), negative_news: NegativeNewsCreate$inboundSchema, other_sources_of_wealth: OtherSourcesOfWealthCreate$inboundSchema, }).transform((v) => { return remap$(v, { "customer_non_referral_source": "customerNonReferralSource", "customer_referral_source": "customerReferralSource", "employment_and_employer_description": "employmentAndEmployerDescription", "negative_news": "negativeNews", "other_sources_of_wealth": "otherSourcesOfWealth", }); }); /** @internal */ export type NaturalPersonFddCreate$Outbound = { customer_non_referral_source?: string | undefined; customer_referral_source?: CustomerReferralSourceCreate$Outbound | undefined; employment_and_employer_description: string; negative_news: NegativeNewsCreate$Outbound; other_sources_of_wealth: OtherSourcesOfWealthCreate$Outbound; }; /** @internal */ export const NaturalPersonFddCreate$outboundSchema: z.ZodType< NaturalPersonFddCreate$Outbound, z.ZodTypeDef, NaturalPersonFddCreate > = z.object({ customerNonReferralSource: z.string().optional(), customerReferralSource: CustomerReferralSourceCreate$outboundSchema .optional(), employmentAndEmployerDescription: z.string(), negativeNews: NegativeNewsCreate$outboundSchema, otherSourcesOfWealth: OtherSourcesOfWealthCreate$outboundSchema, }).transform((v) => { return remap$(v, { customerNonReferralSource: "customer_non_referral_source", customerReferralSource: "customer_referral_source", employmentAndEmployerDescription: "employment_and_employer_description", negativeNews: "negative_news", otherSourcesOfWealth: "other_sources_of_wealth", }); }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace NaturalPersonFddCreate$ { /** @deprecated use `NaturalPersonFddCreate$inboundSchema` instead. */ export const inboundSchema = NaturalPersonFddCreate$inboundSchema; /** @deprecated use `NaturalPersonFddCreate$outboundSchema` instead. */ export const outboundSchema = NaturalPersonFddCreate$outboundSchema; /** @deprecated use `NaturalPersonFddCreate$Outbound` instead. */ export type Outbound = NaturalPersonFddCreate$Outbound; } export function naturalPersonFddCreateToJSON( naturalPersonFddCreate: NaturalPersonFddCreate, ): string { return JSON.stringify( NaturalPersonFddCreate$outboundSchema.parse(naturalPersonFddCreate), ); } export function naturalPersonFddCreateFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => NaturalPersonFddCreate$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'NaturalPersonFddCreate' from JSON`, ); }