/* * 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 accrued interest associated with this activity */ export type AccruedInterestAmount1 = { /** * 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; }; export type AccruedInterest = { /** * The amount of accrued interest associated with this activity */ amount?: AccruedInterestAmount1 | null | undefined; }; /** @internal */ export const AccruedInterestAmount1$inboundSchema: z.ZodType< AccruedInterestAmount1, z.ZodTypeDef, unknown > = z.object({ value: z.string().optional(), }); /** @internal */ export type AccruedInterestAmount1$Outbound = { value?: string | undefined; }; /** @internal */ export const AccruedInterestAmount1$outboundSchema: z.ZodType< AccruedInterestAmount1$Outbound, z.ZodTypeDef, AccruedInterestAmount1 > = 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 AccruedInterestAmount1$ { /** @deprecated use `AccruedInterestAmount1$inboundSchema` instead. */ export const inboundSchema = AccruedInterestAmount1$inboundSchema; /** @deprecated use `AccruedInterestAmount1$outboundSchema` instead. */ export const outboundSchema = AccruedInterestAmount1$outboundSchema; /** @deprecated use `AccruedInterestAmount1$Outbound` instead. */ export type Outbound = AccruedInterestAmount1$Outbound; } export function accruedInterestAmount1ToJSON( accruedInterestAmount1: AccruedInterestAmount1, ): string { return JSON.stringify( AccruedInterestAmount1$outboundSchema.parse(accruedInterestAmount1), ); } export function accruedInterestAmount1FromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => AccruedInterestAmount1$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'AccruedInterestAmount1' from JSON`, ); } /** @internal */ export const AccruedInterest$inboundSchema: z.ZodType< AccruedInterest, z.ZodTypeDef, unknown > = z.object({ amount: z.nullable(z.lazy(() => AccruedInterestAmount1$inboundSchema)) .optional(), }); /** @internal */ export type AccruedInterest$Outbound = { amount?: AccruedInterestAmount1$Outbound | null | undefined; }; /** @internal */ export const AccruedInterest$outboundSchema: z.ZodType< AccruedInterest$Outbound, z.ZodTypeDef, AccruedInterest > = z.object({ amount: z.nullable(z.lazy(() => AccruedInterestAmount1$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 AccruedInterest$ { /** @deprecated use `AccruedInterest$inboundSchema` instead. */ export const inboundSchema = AccruedInterest$inboundSchema; /** @deprecated use `AccruedInterest$outboundSchema` instead. */ export const outboundSchema = AccruedInterest$outboundSchema; /** @deprecated use `AccruedInterest$Outbound` instead. */ export type Outbound = AccruedInterest$Outbound; } export function accruedInterestToJSON( accruedInterest: AccruedInterest, ): string { return JSON.stringify(AccruedInterest$outboundSchema.parse(accruedInterest)); } export function accruedInterestFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => AccruedInterest$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'AccruedInterest' from JSON`, ); }