/* * 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"; export type UnblockOptions = { /** * The type of unblock option for the submission blocker. */ unblockType?: string | undefined; /** * The payment check date associated with the unblock option. */ checkDate?: string | undefined; /** * Additional data associated with the unblock option. */ metadata?: { [k: string]: any } | undefined; }; /** * The status of the submission blocker. */ export const PayrollSubmissionBlockerTypeStatus = { Unresolved: "unresolved", Resolved: "resolved", } as const; /** * The status of the submission blocker. */ export type PayrollSubmissionBlockerTypeStatus = ClosedEnum< typeof PayrollSubmissionBlockerTypeStatus >; /** * A blocker that prevents payment submission. */ export type PayrollSubmissionBlockerType = { /** * The type of blocker that's blocking the payment submission. */ blockerType?: string | undefined; /** * The name of the submission blocker. */ blockerName?: string | undefined; /** * The available options to unblock a submission blocker. */ unblockOptions?: Array | undefined; /** * The unblock option that's been selected to resolve the submission blocker. */ selectedOption?: string | null | undefined; /** * The status of the submission blocker. */ status?: PayrollSubmissionBlockerTypeStatus | undefined; }; /** @internal */ export const UnblockOptions$inboundSchema: z.ZodType< UnblockOptions, z.ZodTypeDef, unknown > = z.object({ unblock_type: z.string().optional(), check_date: z.string().optional(), metadata: z.record(z.any()).optional(), }).transform((v) => { return remap$(v, { "unblock_type": "unblockType", "check_date": "checkDate", }); }); export function unblockOptionsFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => UnblockOptions$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'UnblockOptions' from JSON`, ); } /** @internal */ export const PayrollSubmissionBlockerTypeStatus$inboundSchema: z.ZodNativeEnum< typeof PayrollSubmissionBlockerTypeStatus > = z.nativeEnum(PayrollSubmissionBlockerTypeStatus); /** @internal */ export const PayrollSubmissionBlockerType$inboundSchema: z.ZodType< PayrollSubmissionBlockerType, z.ZodTypeDef, unknown > = z.object({ blocker_type: z.string().optional(), blocker_name: z.string().optional(), unblock_options: z.array(z.lazy(() => UnblockOptions$inboundSchema)) .optional(), selected_option: z.nullable(z.string()).optional(), status: PayrollSubmissionBlockerTypeStatus$inboundSchema.optional(), }).transform((v) => { return remap$(v, { "blocker_type": "blockerType", "blocker_name": "blockerName", "unblock_options": "unblockOptions", "selected_option": "selectedOption", }); }); export function payrollSubmissionBlockerTypeFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => PayrollSubmissionBlockerType$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'PayrollSubmissionBlockerType' from JSON`, ); }