/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod"; import { safeParse } from "../../lib/schemas.js"; import { catchUnrecognizedEnum, OpenEnum, Unrecognized, } from "../../types/enums.js"; import { Result as SafeParseResult } from "../../types/fp.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; /** * The type of bank identifier specified */ export enum RecipientBankBankIdCreateType { TypeUnspecified = "TYPE_UNSPECIFIED", Aba = "ABA", Bic = "BIC", } /** * The type of bank identifier specified */ export type RecipientBankBankIdCreateTypeOpen = OpenEnum< typeof RecipientBankBankIdCreateType >; /** * A bank identifier */ export type RecipientBankBankIdCreate = { /** * The bank identifier */ id: string; /** * The type of bank identifier specified */ type: RecipientBankBankIdCreateTypeOpen; }; /** @internal */ export const RecipientBankBankIdCreateType$inboundSchema: z.ZodType< RecipientBankBankIdCreateTypeOpen, z.ZodTypeDef, unknown > = z .union([ z.nativeEnum(RecipientBankBankIdCreateType), z.string().transform(catchUnrecognizedEnum), ]); /** @internal */ export const RecipientBankBankIdCreateType$outboundSchema: z.ZodType< RecipientBankBankIdCreateTypeOpen, z.ZodTypeDef, RecipientBankBankIdCreateTypeOpen > = z.union([ z.nativeEnum(RecipientBankBankIdCreateType), z.string().and(z.custom>()), ]); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace RecipientBankBankIdCreateType$ { /** @deprecated use `RecipientBankBankIdCreateType$inboundSchema` instead. */ export const inboundSchema = RecipientBankBankIdCreateType$inboundSchema; /** @deprecated use `RecipientBankBankIdCreateType$outboundSchema` instead. */ export const outboundSchema = RecipientBankBankIdCreateType$outboundSchema; } /** @internal */ export const RecipientBankBankIdCreate$inboundSchema: z.ZodType< RecipientBankBankIdCreate, z.ZodTypeDef, unknown > = z.object({ id: z.string(), type: RecipientBankBankIdCreateType$inboundSchema, }); /** @internal */ export type RecipientBankBankIdCreate$Outbound = { id: string; type: string; }; /** @internal */ export const RecipientBankBankIdCreate$outboundSchema: z.ZodType< RecipientBankBankIdCreate$Outbound, z.ZodTypeDef, RecipientBankBankIdCreate > = z.object({ id: z.string(), type: RecipientBankBankIdCreateType$outboundSchema, }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace RecipientBankBankIdCreate$ { /** @deprecated use `RecipientBankBankIdCreate$inboundSchema` instead. */ export const inboundSchema = RecipientBankBankIdCreate$inboundSchema; /** @deprecated use `RecipientBankBankIdCreate$outboundSchema` instead. */ export const outboundSchema = RecipientBankBankIdCreate$outboundSchema; /** @deprecated use `RecipientBankBankIdCreate$Outbound` instead. */ export type Outbound = RecipientBankBankIdCreate$Outbound; } export function recipientBankBankIdCreateToJSON( recipientBankBankIdCreate: RecipientBankBankIdCreate, ): string { return JSON.stringify( RecipientBankBankIdCreate$outboundSchema.parse(recipientBankBankIdCreate), ); } export function recipientBankBankIdCreateFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => RecipientBankBankIdCreate$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'RecipientBankBankIdCreate' from JSON`, ); }