/* * 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 { ClosedEnum } from "../../types/enums.js"; export const PayScheduleAssignmentBodyType = { Single: "single", HourlySalaried: "hourly_salaried", ByEmployee: "by_employee", ByDepartment: "by_department", } as const; export type PayScheduleAssignmentBodyType = ClosedEnum< typeof PayScheduleAssignmentBodyType >; export type Employees = { /** * Employee UUID */ employeeUuid?: string | undefined; /** * Pay schedule UUID */ payScheduleUuid?: string | undefined; }; export type Departments = { /** * Department UUID */ departmentUuid?: string | undefined; /** * Pay schedule UUID */ payScheduleUuid?: string | undefined; }; export type PayScheduleAssignmentBody = { /** * The pay schedule assignment type. */ type: PayScheduleAssignmentBodyType | null; /** * Pay schedule for hourly employees. */ hourlyPayScheduleUuid?: string | undefined; /** * Pay schedule for salaried employees. */ salariedPayScheduleUuid?: string | undefined; /** * Default pay schedule for employees. */ defaultPayScheduleUuid?: string | undefined; /** * Indicates whether the request provides pay schedule assignments for a partial list of employees or departments of the company. By default, this is set to false. */ partialAssignment?: boolean | undefined; /** * List of employees and their pay schedules. */ employees?: Array | undefined; /** * List of departments and their pay schedules. */ departments?: Array | undefined; }; /** @internal */ export const PayScheduleAssignmentBodyType$outboundSchema: z.ZodNativeEnum< typeof PayScheduleAssignmentBodyType > = z.nativeEnum(PayScheduleAssignmentBodyType); /** @internal */ export type Employees$Outbound = { employee_uuid?: string | undefined; pay_schedule_uuid?: string | undefined; }; /** @internal */ export const Employees$outboundSchema: z.ZodType< Employees$Outbound, z.ZodTypeDef, Employees > = z.object({ employeeUuid: z.string().optional(), payScheduleUuid: z.string().optional(), }).transform((v) => { return remap$(v, { employeeUuid: "employee_uuid", payScheduleUuid: "pay_schedule_uuid", }); }); export function employeesToJSON(employees: Employees): string { return JSON.stringify(Employees$outboundSchema.parse(employees)); } /** @internal */ export type Departments$Outbound = { department_uuid?: string | undefined; pay_schedule_uuid?: string | undefined; }; /** @internal */ export const Departments$outboundSchema: z.ZodType< Departments$Outbound, z.ZodTypeDef, Departments > = z.object({ departmentUuid: z.string().optional(), payScheduleUuid: z.string().optional(), }).transform((v) => { return remap$(v, { departmentUuid: "department_uuid", payScheduleUuid: "pay_schedule_uuid", }); }); export function departmentsToJSON(departments: Departments): string { return JSON.stringify(Departments$outboundSchema.parse(departments)); } /** @internal */ export type PayScheduleAssignmentBody$Outbound = { type: string | null; hourly_pay_schedule_uuid?: string | undefined; salaried_pay_schedule_uuid?: string | undefined; default_pay_schedule_uuid?: string | undefined; partial_assignment?: boolean | undefined; employees?: Array | undefined; departments?: Array | undefined; }; /** @internal */ export const PayScheduleAssignmentBody$outboundSchema: z.ZodType< PayScheduleAssignmentBody$Outbound, z.ZodTypeDef, PayScheduleAssignmentBody > = z.object({ type: z.nullable(PayScheduleAssignmentBodyType$outboundSchema), hourlyPayScheduleUuid: z.string().optional(), salariedPayScheduleUuid: z.string().optional(), defaultPayScheduleUuid: z.string().optional(), partialAssignment: z.boolean().optional(), employees: z.array(z.lazy(() => Employees$outboundSchema)).optional(), departments: z.array(z.lazy(() => Departments$outboundSchema)).optional(), }).transform((v) => { return remap$(v, { hourlyPayScheduleUuid: "hourly_pay_schedule_uuid", salariedPayScheduleUuid: "salaried_pay_schedule_uuid", defaultPayScheduleUuid: "default_pay_schedule_uuid", partialAssignment: "partial_assignment", }); }); export function payScheduleAssignmentBodyToJSON( payScheduleAssignmentBody: PayScheduleAssignmentBody, ): string { return JSON.stringify( PayScheduleAssignmentBody$outboundSchema.parse(payScheduleAssignmentBody), ); }