/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod"; import { safeParse } from "../../lib/schemas.js"; import { Result as SafeParseResult } from "../../types/fp.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; /** * The amount of one of the micro deposits. */ export type Amount1 = { /** * The decimal value, as a string; Refer to [Google’s Decimal type protocol buffer](https://github.com/googleapis/googleapis/blob/40203ca1880849480bbff7b8715491060bbccdf1/google/type/decimal.proto#L33) for details */ value?: string | undefined; }; /** * The amount of the other micro deposit. */ export type Amount2 = { /** * The decimal value, as a string; Refer to [Google’s Decimal type protocol buffer](https://github.com/googleapis/googleapis/blob/40203ca1880849480bbff7b8715491060bbccdf1/google/type/decimal.proto#L33) for details */ value?: string | undefined; }; /** * The micro deposits sent to verify a pending bank relationship. FOR TESTING ONLY! */ export type MicroDepositAmounts = { /** * The amount of one of the micro deposits. */ amount1?: Amount1 | null | undefined; /** * The amount of the other micro deposit. */ amount2?: Amount2 | null | undefined; }; /** @internal */ export const Amount1$inboundSchema: z.ZodType = z.object({ value: z.string().optional(), }); /** @internal */ export type Amount1$Outbound = { value?: string | undefined; }; /** @internal */ export const Amount1$outboundSchema: z.ZodType< Amount1$Outbound, z.ZodTypeDef, Amount1 > = z.object({ value: z.string().optional(), }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace Amount1$ { /** @deprecated use `Amount1$inboundSchema` instead. */ export const inboundSchema = Amount1$inboundSchema; /** @deprecated use `Amount1$outboundSchema` instead. */ export const outboundSchema = Amount1$outboundSchema; /** @deprecated use `Amount1$Outbound` instead. */ export type Outbound = Amount1$Outbound; } export function amount1ToJSON(amount1: Amount1): string { return JSON.stringify(Amount1$outboundSchema.parse(amount1)); } export function amount1FromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => Amount1$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Amount1' from JSON`, ); } /** @internal */ export const Amount2$inboundSchema: z.ZodType = z.object({ value: z.string().optional(), }); /** @internal */ export type Amount2$Outbound = { value?: string | undefined; }; /** @internal */ export const Amount2$outboundSchema: z.ZodType< Amount2$Outbound, z.ZodTypeDef, Amount2 > = z.object({ value: z.string().optional(), }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace Amount2$ { /** @deprecated use `Amount2$inboundSchema` instead. */ export const inboundSchema = Amount2$inboundSchema; /** @deprecated use `Amount2$outboundSchema` instead. */ export const outboundSchema = Amount2$outboundSchema; /** @deprecated use `Amount2$Outbound` instead. */ export type Outbound = Amount2$Outbound; } export function amount2ToJSON(amount2: Amount2): string { return JSON.stringify(Amount2$outboundSchema.parse(amount2)); } export function amount2FromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => Amount2$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Amount2' from JSON`, ); } /** @internal */ export const MicroDepositAmounts$inboundSchema: z.ZodType< MicroDepositAmounts, z.ZodTypeDef, unknown > = z.object({ amount1: z.nullable(z.lazy(() => Amount1$inboundSchema)).optional(), amount2: z.nullable(z.lazy(() => Amount2$inboundSchema)).optional(), }); /** @internal */ export type MicroDepositAmounts$Outbound = { amount1?: Amount1$Outbound | null | undefined; amount2?: Amount2$Outbound | null | undefined; }; /** @internal */ export const MicroDepositAmounts$outboundSchema: z.ZodType< MicroDepositAmounts$Outbound, z.ZodTypeDef, MicroDepositAmounts > = z.object({ amount1: z.nullable(z.lazy(() => Amount1$outboundSchema)).optional(), amount2: z.nullable(z.lazy(() => Amount2$outboundSchema)).optional(), }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace MicroDepositAmounts$ { /** @deprecated use `MicroDepositAmounts$inboundSchema` instead. */ export const inboundSchema = MicroDepositAmounts$inboundSchema; /** @deprecated use `MicroDepositAmounts$outboundSchema` instead. */ export const outboundSchema = MicroDepositAmounts$outboundSchema; /** @deprecated use `MicroDepositAmounts$Outbound` instead. */ export type Outbound = MicroDepositAmounts$Outbound; } export function microDepositAmountsToJSON( microDepositAmounts: MicroDepositAmounts, ): string { return JSON.stringify( MicroDepositAmounts$outboundSchema.parse(microDepositAmounts), ); } export function microDepositAmountsFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => MicroDepositAmounts$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'MicroDepositAmounts' from JSON`, ); }