/* * 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 PayrollsFilter = { /** * Return payrolls whose pay period is after the start date */ startDate?: string | undefined; /** * Return payrolls whose pay period is before the end date */ endDate?: string | undefined; }; /** @internal */ export const PayrollsFilter$inboundSchema: z.ZodType< PayrollsFilter, z.ZodTypeDef, unknown > = z.object({ start_date: z.string().optional(), end_date: z.string().optional(), }).transform((v) => { return remap$(v, { "start_date": "startDate", "end_date": "endDate", }); }); /** @internal */ export type PayrollsFilter$Outbound = { start_date?: string | undefined; end_date?: string | undefined; }; /** @internal */ export const PayrollsFilter$outboundSchema: z.ZodType< PayrollsFilter$Outbound, z.ZodTypeDef, PayrollsFilter > = z.object({ startDate: z.string().optional(), endDate: z.string().optional(), }).transform((v) => { return remap$(v, { startDate: "start_date", endDate: "end_date", }); }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace PayrollsFilter$ { /** @deprecated use `PayrollsFilter$inboundSchema` instead. */ export const inboundSchema = PayrollsFilter$inboundSchema; /** @deprecated use `PayrollsFilter$outboundSchema` instead. */ export const outboundSchema = PayrollsFilter$outboundSchema; /** @deprecated use `PayrollsFilter$Outbound` instead. */ export type Outbound = PayrollsFilter$Outbound; } export function payrollsFilterToJSON(payrollsFilter: PayrollsFilter): string { return JSON.stringify(PayrollsFilter$outboundSchema.parse(payrollsFilter)); } export function payrollsFilterFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => PayrollsFilter$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'PayrollsFilter' from JSON`, ); }