/* * 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 { NegativeNewsCreate, NegativeNewsCreate$inboundSchema, NegativeNewsCreate$Outbound, NegativeNewsCreate$outboundSchema, } from "./negativenewscreate.js"; /** * Due Diligence for Legal Entities required when a Legal Entity is the Primary Owner on an Account. */ export type EntityDueDiligenceCreate = { /** * Indicates whether the entity issues bearer shares */ entityIssuesBearerShares: boolean; /** * Negative News detail. */ negativeNews: NegativeNewsCreate; }; /** @internal */ export const EntityDueDiligenceCreate$inboundSchema: z.ZodType< EntityDueDiligenceCreate, z.ZodTypeDef, unknown > = z.object({ entity_issues_bearer_shares: z.boolean(), negative_news: NegativeNewsCreate$inboundSchema, }).transform((v) => { return remap$(v, { "entity_issues_bearer_shares": "entityIssuesBearerShares", "negative_news": "negativeNews", }); }); /** @internal */ export type EntityDueDiligenceCreate$Outbound = { entity_issues_bearer_shares: boolean; negative_news: NegativeNewsCreate$Outbound; }; /** @internal */ export const EntityDueDiligenceCreate$outboundSchema: z.ZodType< EntityDueDiligenceCreate$Outbound, z.ZodTypeDef, EntityDueDiligenceCreate > = z.object({ entityIssuesBearerShares: z.boolean(), negativeNews: NegativeNewsCreate$outboundSchema, }).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 EntityDueDiligenceCreate$ { /** @deprecated use `EntityDueDiligenceCreate$inboundSchema` instead. */ export const inboundSchema = EntityDueDiligenceCreate$inboundSchema; /** @deprecated use `EntityDueDiligenceCreate$outboundSchema` instead. */ export const outboundSchema = EntityDueDiligenceCreate$outboundSchema; /** @deprecated use `EntityDueDiligenceCreate$Outbound` instead. */ export type Outbound = EntityDueDiligenceCreate$Outbound; } export function entityDueDiligenceCreateToJSON( entityDueDiligenceCreate: EntityDueDiligenceCreate, ): string { return JSON.stringify( EntityDueDiligenceCreate$outboundSchema.parse(entityDueDiligenceCreate), ); } export function entityDueDiligenceCreateFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => EntityDueDiligenceCreate$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'EntityDueDiligenceCreate' from JSON`, ); }