/* * 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"; export type LinkedLedgerAccount = { /** * The unique identifier for the account. */ id?: string | undefined; /** * The name of the account. */ name?: string | null | undefined; /** * The nominal code of the account. */ nominalCode?: string | null | undefined; /** * The code assigned to the account. */ code?: string | null | undefined; }; /** @internal */ export const LinkedLedgerAccount$inboundSchema: z.ZodType< LinkedLedgerAccount, z.ZodTypeDef, unknown > = z.object({ id: z.string().optional(), name: z.nullable(z.string()).optional(), nominal_code: z.nullable(z.string()).optional(), code: z.nullable(z.string()).optional(), }).transform((v) => { return remap$(v, { "nominal_code": "nominalCode", }); }); /** @internal */ export type LinkedLedgerAccount$Outbound = { id?: string | undefined; name?: string | null | undefined; nominal_code?: string | null | undefined; code?: string | null | undefined; }; /** @internal */ export const LinkedLedgerAccount$outboundSchema: z.ZodType< LinkedLedgerAccount$Outbound, z.ZodTypeDef, LinkedLedgerAccount > = z.object({ id: z.string().optional(), name: z.nullable(z.string()).optional(), nominalCode: z.nullable(z.string()).optional(), code: z.nullable(z.string()).optional(), }).transform((v) => { return remap$(v, { nominalCode: "nominal_code", }); }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace LinkedLedgerAccount$ { /** @deprecated use `LinkedLedgerAccount$inboundSchema` instead. */ export const inboundSchema = LinkedLedgerAccount$inboundSchema; /** @deprecated use `LinkedLedgerAccount$outboundSchema` instead. */ export const outboundSchema = LinkedLedgerAccount$outboundSchema; /** @deprecated use `LinkedLedgerAccount$Outbound` instead. */ export type Outbound = LinkedLedgerAccount$Outbound; } export function linkedLedgerAccountToJSON( linkedLedgerAccount: LinkedLedgerAccount, ): string { return JSON.stringify( LinkedLedgerAccount$outboundSchema.parse(linkedLedgerAccount), ); } export function linkedLedgerAccountFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => LinkedLedgerAccount$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'LinkedLedgerAccount' from JSON`, ); }