/* * 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 LinkedLedgerAccountInput = { /** * The unique identifier for the account. */ id?: string | undefined; /** * The nominal code of the account. */ nominalCode?: string | null | undefined; /** * The code assigned to the account. */ code?: string | null | undefined; }; /** @internal */ export const LinkedLedgerAccountInput$inboundSchema: z.ZodType< LinkedLedgerAccountInput, z.ZodTypeDef, unknown > = z.object({ id: 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 LinkedLedgerAccountInput$Outbound = { id?: string | undefined; nominal_code?: string | null | undefined; code?: string | null | undefined; }; /** @internal */ export const LinkedLedgerAccountInput$outboundSchema: z.ZodType< LinkedLedgerAccountInput$Outbound, z.ZodTypeDef, LinkedLedgerAccountInput > = z.object({ id: 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 LinkedLedgerAccountInput$ { /** @deprecated use `LinkedLedgerAccountInput$inboundSchema` instead. */ export const inboundSchema = LinkedLedgerAccountInput$inboundSchema; /** @deprecated use `LinkedLedgerAccountInput$outboundSchema` instead. */ export const outboundSchema = LinkedLedgerAccountInput$outboundSchema; /** @deprecated use `LinkedLedgerAccountInput$Outbound` instead. */ export type Outbound = LinkedLedgerAccountInput$Outbound; } export function linkedLedgerAccountInputToJSON( linkedLedgerAccountInput: LinkedLedgerAccountInput, ): string { return JSON.stringify( LinkedLedgerAccountInput$outboundSchema.parse(linkedLedgerAccountInput), ); } export function linkedLedgerAccountInputFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => LinkedLedgerAccountInput$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'LinkedLedgerAccountInput' from JSON`, ); }