/* * 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 { safeParse } from "../../lib/schemas.js"; import { ClosedEnum } from "../../types/enums.js"; import { Result as SafeParseResult } from "../../types/fp.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; /** * The status of the external payroll. The status will be `unprocessed` when the external payroll is created and transition to `processed` once tax liabilities are entered and finalized. Once in the `processed` status all actions that can edit an external payroll will be disabled. */ export const Status = { Unprocessed: "unprocessed", Processed: "processed", } as const; /** * The status of the external payroll. The status will be `unprocessed` when the external payroll is created and transition to `processed` once tax liabilities are entered and finalized. Once in the `processed` status all actions that can edit an external payroll will be disabled. */ export type Status = ClosedEnum; /** * The representation of an external payroll with minimal information. */ export type ExternalPayrollBasic = { /** * The UUID of the external payroll. */ uuid: string; /** * The UUID of the company. */ companyUuid?: string | undefined; /** * External payroll's check date. */ checkDate?: string | undefined; /** * External payroll's pay period start date. */ paymentPeriodStartDate?: string | undefined; /** * External payroll's pay period end date. */ paymentPeriodEndDate?: string | undefined; /** * The status of the external payroll. The status will be `unprocessed` when the external payroll is created and transition to `processed` once tax liabilities are entered and finalized. Once in the `processed` status all actions that can edit an external payroll will be disabled. */ status?: Status | undefined; }; /** @internal */ export const Status$inboundSchema: z.ZodNativeEnum = z .nativeEnum(Status); /** @internal */ export const ExternalPayrollBasic$inboundSchema: z.ZodType< ExternalPayrollBasic, z.ZodTypeDef, unknown > = z.object({ uuid: z.string(), company_uuid: z.string().optional(), check_date: z.string().optional(), payment_period_start_date: z.string().optional(), payment_period_end_date: z.string().optional(), status: Status$inboundSchema.optional(), }).transform((v) => { return remap$(v, { "company_uuid": "companyUuid", "check_date": "checkDate", "payment_period_start_date": "paymentPeriodStartDate", "payment_period_end_date": "paymentPeriodEndDate", }); }); export function externalPayrollBasicFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => ExternalPayrollBasic$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ExternalPayrollBasic' from JSON`, ); }