/* * 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"; /** * Payment speed. READ-ONLY. * * @remarks * - `1-day`: Next-day ACH (only for partners that opt in). * - `2-day`: Two-day ACH. * - `4-day`: Standard ACH. */ export const PaymentSpeed = { OneMinusDay: "1-day", TwoMinusDay: "2-day", FourMinusDay: "4-day", } as const; /** * Payment speed. READ-ONLY. * * @remarks * - `1-day`: Next-day ACH (only for partners that opt in). * - `2-day`: Two-day ACH. * - `4-day`: Standard ACH. */ export type PaymentSpeed = ClosedEnum; /** * The type of blocker */ export const BlockerType = { MinimumDays: "minimum_days", MinimumFundedPayments: "minimum_funded_payments", } as const; /** * The type of blocker */ export type BlockerType = ClosedEnum; export type EarnedFastAchBlockers = { /** * The type of blocker */ blockerType?: BlockerType | undefined; /** * The threshold needed to unblock */ threshold?: number | undefined; }; export type PaymentConfigs = { /** * Company uuid */ companyUuid?: string | undefined; /** * Partner uuid */ partnerUuid?: string | undefined; /** * Payment limit for 1-day or 2-day payroll (string representation of decimal). */ fastPaymentLimit?: string | null | undefined; /** * Payment speed. READ-ONLY. * * @remarks * - `1-day`: Next-day ACH (only for partners that opt in). * - `2-day`: Two-day ACH. * - `4-day`: Standard ACH. */ paymentSpeed?: PaymentSpeed | undefined; /** * Whether the company is configured to use the partner-owned disbursement payment rail */ partnerOwnedDisbursement?: boolean | undefined; /** * Blockers preventing the company from earning fast ACH payments */ earnedFastAchBlockers?: Array | undefined; }; /** @internal */ export const PaymentSpeed$inboundSchema: z.ZodNativeEnum = z.nativeEnum(PaymentSpeed); /** @internal */ export const BlockerType$inboundSchema: z.ZodNativeEnum = z .nativeEnum(BlockerType); /** @internal */ export const EarnedFastAchBlockers$inboundSchema: z.ZodType< EarnedFastAchBlockers, z.ZodTypeDef, unknown > = z.object({ blocker_type: BlockerType$inboundSchema.optional(), threshold: z.number().optional(), }).transform((v) => { return remap$(v, { "blocker_type": "blockerType", }); }); export function earnedFastAchBlockersFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => EarnedFastAchBlockers$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'EarnedFastAchBlockers' from JSON`, ); } /** @internal */ export const PaymentConfigs$inboundSchema: z.ZodType< PaymentConfigs, z.ZodTypeDef, unknown > = z.object({ company_uuid: z.string().optional(), partner_uuid: z.string().optional(), fast_payment_limit: z.nullable(z.string()).optional(), payment_speed: PaymentSpeed$inboundSchema.optional(), partner_owned_disbursement: z.boolean().optional(), earned_fast_ach_blockers: z.array( z.lazy(() => EarnedFastAchBlockers$inboundSchema), ).optional(), }).transform((v) => { return remap$(v, { "company_uuid": "companyUuid", "partner_uuid": "partnerUuid", "fast_payment_limit": "fastPaymentLimit", "payment_speed": "paymentSpeed", "partner_owned_disbursement": "partnerOwnedDisbursement", "earned_fast_ach_blockers": "earnedFastAchBlockers", }); }); export function paymentConfigsFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => PaymentConfigs$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'PaymentConfigs' from JSON`, ); }