/* * 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"; 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; /** * The parent ID of the account. */ parentId?: string | null | undefined; /** * The display ID of the account. */ displayId?: string | null | undefined; }; /** @internal */ export const LinkedLedgerAccount$inboundSchema: z.ZodType< LinkedLedgerAccount, z.ZodTypeDef, unknown > = /* @__PURE__ */ lazySchema$(() => z.object({ id: types.optional(types.string()), name: z.nullable(types.string()).optional(), nominal_code: z.nullable(types.string()).optional(), code: z.nullable(types.string()).optional(), parent_id: z.nullable(types.string()).optional(), display_id: z.nullable(types.string()).optional(), }).transform((v) => { return remap$(v, { "nominal_code": "nominalCode", "parent_id": "parentId", "display_id": "displayId", }); }) ); /** @internal */ export type LinkedLedgerAccount$Outbound = { id?: string | undefined; name?: string | null | undefined; nominal_code?: string | null | undefined; code?: string | null | undefined; parent_id?: string | null | undefined; display_id?: string | null | undefined; }; /** @internal */ export const LinkedLedgerAccount$outboundSchema: z.ZodType< LinkedLedgerAccount$Outbound, z.ZodTypeDef, LinkedLedgerAccount > = /* @__PURE__ */ lazySchema$(() => z.object({ id: z.string().optional(), name: z.nullable(z.string()).optional(), nominalCode: z.nullable(z.string()).optional(), code: z.nullable(z.string()).optional(), parentId: z.nullable(z.string()).optional(), displayId: z.nullable(z.string()).optional(), }).transform((v) => { return remap$(v, { nominalCode: "nominal_code", parentId: "parent_id", displayId: "display_id", }); }) ); 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`, ); }