/* * 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 LedgerAccountsFilter = { updatedSince?: Date | undefined; }; /** @internal */ export const LedgerAccountsFilter$inboundSchema: z.ZodType< LedgerAccountsFilter, z.ZodTypeDef, unknown > = z.object({ updated_since: z.string().datetime({ offset: true }).transform(v => new Date(v) ).optional(), }).transform((v) => { return remap$(v, { "updated_since": "updatedSince", }); }); /** @internal */ export type LedgerAccountsFilter$Outbound = { updated_since?: string | undefined; }; /** @internal */ export const LedgerAccountsFilter$outboundSchema: z.ZodType< LedgerAccountsFilter$Outbound, z.ZodTypeDef, LedgerAccountsFilter > = z.object({ updatedSince: z.date().transform(v => v.toISOString()).optional(), }).transform((v) => { return remap$(v, { updatedSince: "updated_since", }); }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace LedgerAccountsFilter$ { /** @deprecated use `LedgerAccountsFilter$inboundSchema` instead. */ export const inboundSchema = LedgerAccountsFilter$inboundSchema; /** @deprecated use `LedgerAccountsFilter$outboundSchema` instead. */ export const outboundSchema = LedgerAccountsFilter$outboundSchema; /** @deprecated use `LedgerAccountsFilter$Outbound` instead. */ export type Outbound = LedgerAccountsFilter$Outbound; } export function ledgerAccountsFilterToJSON( ledgerAccountsFilter: LedgerAccountsFilter, ): string { return JSON.stringify( LedgerAccountsFilter$outboundSchema.parse(ledgerAccountsFilter), ); } export function ledgerAccountsFilterFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => LedgerAccountsFilter$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'LedgerAccountsFilter' from JSON`, ); }