/* * 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"; /** * The external account information */ export type ExternalAccountCreate = { /** * The account identifier The account number for external communications */ accountNumber: string; /** * The NSCC brokerage / clearing house identifier */ participantNumber: string; }; /** @internal */ export const ExternalAccountCreate$inboundSchema: z.ZodType< ExternalAccountCreate, z.ZodTypeDef, unknown > = z.object({ account_number: z.string(), participant_number: z.string(), }).transform((v) => { return remap$(v, { "account_number": "accountNumber", "participant_number": "participantNumber", }); }); /** @internal */ export type ExternalAccountCreate$Outbound = { account_number: string; participant_number: string; }; /** @internal */ export const ExternalAccountCreate$outboundSchema: z.ZodType< ExternalAccountCreate$Outbound, z.ZodTypeDef, ExternalAccountCreate > = z.object({ accountNumber: z.string(), participantNumber: z.string(), }).transform((v) => { return remap$(v, { accountNumber: "account_number", participantNumber: "participant_number", }); }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace ExternalAccountCreate$ { /** @deprecated use `ExternalAccountCreate$inboundSchema` instead. */ export const inboundSchema = ExternalAccountCreate$inboundSchema; /** @deprecated use `ExternalAccountCreate$outboundSchema` instead. */ export const outboundSchema = ExternalAccountCreate$outboundSchema; /** @deprecated use `ExternalAccountCreate$Outbound` instead. */ export type Outbound = ExternalAccountCreate$Outbound; } export function externalAccountCreateToJSON( externalAccountCreate: ExternalAccountCreate, ): string { return JSON.stringify( ExternalAccountCreate$outboundSchema.parse(externalAccountCreate), ); } export function externalAccountCreateFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => ExternalAccountCreate$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ExternalAccountCreate' from JSON`, ); }