/* * 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"; /** * Status of the wire in */ export const WireInRequestStatus = { AwaitingFunds: "awaiting_funds", PendingReview: "pending_review", Approved: "approved", Canceled: "canceled", } as const; /** * Status of the wire in */ export type WireInRequestStatus = ClosedEnum; /** * Type of payment for the wire in */ export const PaymentType = { Payroll: "Payroll", ContractorPaymentGroup: "ContractorPaymentGroup", } as const; /** * Type of payment for the wire in */ export type PaymentType = ClosedEnum; /** * Representation of a wire in request */ export type WireInRequest = { /** * Unique identifier of a wire in request */ uuid?: string | undefined; /** * Status of the wire in */ status?: WireInRequestStatus | undefined; /** * Name of bank receiving the wire in */ originationBank?: string | undefined; /** * Address of bank receiving the wire in */ originationBankAddress?: string | undefined; /** * Name of the recipient of the wire In */ recipientName?: string | undefined; /** * Address of the recipient of the wire in */ recipientAddress?: string | undefined; /** * Recipient bank account number */ recipientAccountNumber?: string | undefined; /** * Recipient bank routing number */ recipientRoutingNumber?: string | undefined; /** * Notes for the wire in request */ additionalNotes?: string | null | undefined; /** * Name of the bank initiating the wire in */ bankName?: string | null | undefined; /** * Date the wire in was sent */ dateSent?: string | null | undefined; /** * Include in note with bank to track payment */ uniqueTrackingCode?: string | undefined; /** * Type of payment for the wire in */ paymentType?: PaymentType | undefined; /** * Unique identifier of the payment */ paymentUuid?: string | undefined; /** * Amount sent through wire in */ amountSent?: string | null | undefined; /** * Requested amount for the payment */ requestedAmount?: string | undefined; /** * Deadline to submit the wire in */ wireInDeadline?: string | undefined; }; /** @internal */ export const WireInRequestStatus$inboundSchema: z.ZodNativeEnum< typeof WireInRequestStatus > = z.nativeEnum(WireInRequestStatus); /** @internal */ export const PaymentType$inboundSchema: z.ZodNativeEnum = z .nativeEnum(PaymentType); /** @internal */ export const WireInRequest$inboundSchema: z.ZodType< WireInRequest, z.ZodTypeDef, unknown > = z.object({ uuid: z.string().optional(), status: WireInRequestStatus$inboundSchema.optional(), origination_bank: z.string().optional(), origination_bank_address: z.string().optional(), recipient_name: z.string().optional(), recipient_address: z.string().optional(), recipient_account_number: z.string().optional(), recipient_routing_number: z.string().optional(), additional_notes: z.nullable(z.string()).optional(), bank_name: z.nullable(z.string()).optional(), date_sent: z.nullable(z.string()).optional(), unique_tracking_code: z.string().optional(), payment_type: PaymentType$inboundSchema.optional(), payment_uuid: z.string().optional(), amount_sent: z.nullable(z.string()).optional(), requested_amount: z.string().optional(), wire_in_deadline: z.string().optional(), }).transform((v) => { return remap$(v, { "origination_bank": "originationBank", "origination_bank_address": "originationBankAddress", "recipient_name": "recipientName", "recipient_address": "recipientAddress", "recipient_account_number": "recipientAccountNumber", "recipient_routing_number": "recipientRoutingNumber", "additional_notes": "additionalNotes", "bank_name": "bankName", "date_sent": "dateSent", "unique_tracking_code": "uniqueTrackingCode", "payment_type": "paymentType", "payment_uuid": "paymentUuid", "amount_sent": "amountSent", "requested_amount": "requestedAmount", "wire_in_deadline": "wireInDeadline", }); }); export function wireInRequestFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => WireInRequest$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'WireInRequest' from JSON`, ); }