/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod/v3"; import { remap as remap$ } from "../../lib/primitives.js"; import { lazySchema as lazySchema$, safeParse } from "../../lib/schemas.js"; import { Result as SafeParseResult } from "../../types/fp.js"; import * as types from "../../types/primitives.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; import { OutstandingBalanceByCurrency, OutstandingBalanceByCurrency$inboundSchema, } from "./outstandingbalancebycurrency.js"; export type OutstandingBalanceByCustomer = { /** * Unique identifier for the customer. */ customerId?: string | undefined; /** * Full name of the customer. */ customerName?: string | undefined; outstandingBalancesByCurrency?: | Array | undefined; }; /** @internal */ export const OutstandingBalanceByCustomer$inboundSchema: z.ZodType< OutstandingBalanceByCustomer, z.ZodTypeDef, unknown > = /* @__PURE__ */ lazySchema$(() => z.object({ customer_id: types.optional(types.string()), customer_name: types.optional(types.string()), outstanding_balances_by_currency: types.optional( z.array(OutstandingBalanceByCurrency$inboundSchema), ), }).transform((v) => { return remap$(v, { "customer_id": "customerId", "customer_name": "customerName", "outstanding_balances_by_currency": "outstandingBalancesByCurrency", }); }) ); export function outstandingBalanceByCustomerFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => OutstandingBalanceByCustomer$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'OutstandingBalanceByCustomer' from JSON`, ); }