/* * 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 { Result as SafeParseResult } from "../../types/fp.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; export type PayrollCreditBlockerUnblockOptionWaitForReverseWireMetadata = { /** * ID of the reverse wire detail */ reverseWireDetailId?: number | null | undefined; /** * Last 4 digits of the bank account number for the reverse wire */ bankAccountLastFourDigits?: string | null | undefined; }; /** * Unblock option to resolve a credit blocker by waiting for reverse wire */ export type PayrollCreditBlockerUnblockOptionWaitForReverseWire = { /** * The type of unblock option for the credit blocker */ unblockType: "wait_for_reverse_wire"; /** * The payment check date associated with the unblock option */ checkDate: string; metadata: PayrollCreditBlockerUnblockOptionWaitForReverseWireMetadata; }; /** @internal */ export const PayrollCreditBlockerUnblockOptionWaitForReverseWireMetadata$inboundSchema: z.ZodType< PayrollCreditBlockerUnblockOptionWaitForReverseWireMetadata, z.ZodTypeDef, unknown > = z.object({ reverse_wire_detail_id: z.nullable(z.number().int()).optional(), bank_account_last_four_digits: z.nullable(z.string()).optional(), }).transform((v) => { return remap$(v, { "reverse_wire_detail_id": "reverseWireDetailId", "bank_account_last_four_digits": "bankAccountLastFourDigits", }); }); export function payrollCreditBlockerUnblockOptionWaitForReverseWireMetadataFromJSON( jsonString: string, ): SafeParseResult< PayrollCreditBlockerUnblockOptionWaitForReverseWireMetadata, SDKValidationError > { return safeParse( jsonString, (x) => PayrollCreditBlockerUnblockOptionWaitForReverseWireMetadata$inboundSchema .parse(JSON.parse(x)), `Failed to parse 'PayrollCreditBlockerUnblockOptionWaitForReverseWireMetadata' from JSON`, ); } /** @internal */ export const PayrollCreditBlockerUnblockOptionWaitForReverseWire$inboundSchema: z.ZodType< PayrollCreditBlockerUnblockOptionWaitForReverseWire, z.ZodTypeDef, unknown > = z.object({ unblock_type: z.literal("wait_for_reverse_wire"), check_date: z.string(), metadata: z.lazy(() => PayrollCreditBlockerUnblockOptionWaitForReverseWireMetadata$inboundSchema ), }).transform((v) => { return remap$(v, { "unblock_type": "unblockType", "check_date": "checkDate", }); }); export function payrollCreditBlockerUnblockOptionWaitForReverseWireFromJSON( jsonString: string, ): SafeParseResult< PayrollCreditBlockerUnblockOptionWaitForReverseWire, SDKValidationError > { return safeParse( jsonString, (x) => PayrollCreditBlockerUnblockOptionWaitForReverseWire$inboundSchema.parse( JSON.parse(x), ), `Failed to parse 'PayrollCreditBlockerUnblockOptionWaitForReverseWire' from JSON`, ); }