/* * 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 { NegativeNewsUpdate, NegativeNewsUpdate$inboundSchema, NegativeNewsUpdate$Outbound, NegativeNewsUpdate$outboundSchema, } from "./negativenewsupdate.js"; /** * Due Diligence for Legal Entities required when a Legal Entity is the Primary Owner on an Account. */ export type EntityDueDiligenceUpdate = { /** * Indicates whether the entity issues bearer shares */ entityIssuesBearerShares?: boolean | undefined; /** * Negative News detail. */ negativeNews?: NegativeNewsUpdate | undefined; }; /** @internal */ export const EntityDueDiligenceUpdate$inboundSchema: z.ZodType< EntityDueDiligenceUpdate, z.ZodTypeDef, unknown > = z.object({ entity_issues_bearer_shares: z.boolean().optional(), negative_news: NegativeNewsUpdate$inboundSchema.optional(), }).transform((v) => { return remap$(v, { "entity_issues_bearer_shares": "entityIssuesBearerShares", "negative_news": "negativeNews", }); }); /** @internal */ export type EntityDueDiligenceUpdate$Outbound = { entity_issues_bearer_shares?: boolean | undefined; negative_news?: NegativeNewsUpdate$Outbound | undefined; }; /** @internal */ export const EntityDueDiligenceUpdate$outboundSchema: z.ZodType< EntityDueDiligenceUpdate$Outbound, z.ZodTypeDef, EntityDueDiligenceUpdate > = z.object({ entityIssuesBearerShares: z.boolean().optional(), negativeNews: NegativeNewsUpdate$outboundSchema.optional(), }).transform((v) => { return remap$(v, { entityIssuesBearerShares: "entity_issues_bearer_shares", negativeNews: "negative_news", }); }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace EntityDueDiligenceUpdate$ { /** @deprecated use `EntityDueDiligenceUpdate$inboundSchema` instead. */ export const inboundSchema = EntityDueDiligenceUpdate$inboundSchema; /** @deprecated use `EntityDueDiligenceUpdate$outboundSchema` instead. */ export const outboundSchema = EntityDueDiligenceUpdate$outboundSchema; /** @deprecated use `EntityDueDiligenceUpdate$Outbound` instead. */ export type Outbound = EntityDueDiligenceUpdate$Outbound; } export function entityDueDiligenceUpdateToJSON( entityDueDiligenceUpdate: EntityDueDiligenceUpdate, ): string { return JSON.stringify( EntityDueDiligenceUpdate$outboundSchema.parse(entityDueDiligenceUpdate), ); } export function entityDueDiligenceUpdateFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => EntityDueDiligenceUpdate$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'EntityDueDiligenceUpdate' from JSON`, ); }