/* * 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"; /** * A customer-disclosed list of other Apex-held accounts owned by the Entity applicant at the time of this account's application; expressed as zero, one, or many account numbers */ export type OtherAccountsCreate = { /** * Other account names held at Apex */ accountNames?: Array | undefined; /** * Other account numbers held at Apex */ accountNumbers?: Array | undefined; /** * The owner has other accounts at Apex */ ownerHasOtherAccountsAtApex: boolean; }; /** @internal */ export const OtherAccountsCreate$inboundSchema: z.ZodType< OtherAccountsCreate, z.ZodTypeDef, unknown > = z.object({ account_names: z.array(z.string()).optional(), account_numbers: z.array(z.string()).optional(), owner_has_other_accounts_at_apex: z.boolean(), }).transform((v) => { return remap$(v, { "account_names": "accountNames", "account_numbers": "accountNumbers", "owner_has_other_accounts_at_apex": "ownerHasOtherAccountsAtApex", }); }); /** @internal */ export type OtherAccountsCreate$Outbound = { account_names?: Array | undefined; account_numbers?: Array | undefined; owner_has_other_accounts_at_apex: boolean; }; /** @internal */ export const OtherAccountsCreate$outboundSchema: z.ZodType< OtherAccountsCreate$Outbound, z.ZodTypeDef, OtherAccountsCreate > = z.object({ accountNames: z.array(z.string()).optional(), accountNumbers: z.array(z.string()).optional(), ownerHasOtherAccountsAtApex: z.boolean(), }).transform((v) => { return remap$(v, { accountNames: "account_names", accountNumbers: "account_numbers", ownerHasOtherAccountsAtApex: "owner_has_other_accounts_at_apex", }); }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace OtherAccountsCreate$ { /** @deprecated use `OtherAccountsCreate$inboundSchema` instead. */ export const inboundSchema = OtherAccountsCreate$inboundSchema; /** @deprecated use `OtherAccountsCreate$outboundSchema` instead. */ export const outboundSchema = OtherAccountsCreate$outboundSchema; /** @deprecated use `OtherAccountsCreate$Outbound` instead. */ export type Outbound = OtherAccountsCreate$Outbound; } export function otherAccountsCreateToJSON( otherAccountsCreate: OtherAccountsCreate, ): string { return JSON.stringify( OtherAccountsCreate$outboundSchema.parse(otherAccountsCreate), ); } export function otherAccountsCreateFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => OtherAccountsCreate$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'OtherAccountsCreate' from JSON`, ); }