/* * 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 BillsFilter = { updatedSince?: Date | undefined; }; /** @internal */ export const BillsFilter$inboundSchema: z.ZodType< BillsFilter, 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 BillsFilter$Outbound = { updated_since?: string | undefined; }; /** @internal */ export const BillsFilter$outboundSchema: z.ZodType< BillsFilter$Outbound, z.ZodTypeDef, BillsFilter > = 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 BillsFilter$ { /** @deprecated use `BillsFilter$inboundSchema` instead. */ export const inboundSchema = BillsFilter$inboundSchema; /** @deprecated use `BillsFilter$outboundSchema` instead. */ export const outboundSchema = BillsFilter$outboundSchema; /** @deprecated use `BillsFilter$Outbound` instead. */ export type Outbound = BillsFilter$Outbound; } export function billsFilterToJSON(billsFilter: BillsFilter): string { return JSON.stringify(BillsFilter$outboundSchema.parse(billsFilter)); } export function billsFilterFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => BillsFilter$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'BillsFilter' from JSON`, ); }