/* * 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"; /** * Bank account type */ export const ContractorBankAccountAccountType = { Checking: "Checking", Savings: "Savings", } as const; /** * Bank account type */ export type ContractorBankAccountAccountType = ClosedEnum< typeof ContractorBankAccountAccountType >; export type ContractorBankAccount = { /** * UUID of the bank account */ uuid: string; /** * UUID of the contractor */ contractorUuid: string; /** * Bank account type */ accountType: ContractorBankAccountAccountType; /** * Name for the bank account */ name: string; /** * The bank account's routing number */ routingNumber: string; /** * Masked bank account number */ hiddenAccountNumber: string; }; /** @internal */ export const ContractorBankAccountAccountType$inboundSchema: z.ZodNativeEnum< typeof ContractorBankAccountAccountType > = z.nativeEnum(ContractorBankAccountAccountType); /** @internal */ export const ContractorBankAccount$inboundSchema: z.ZodType< ContractorBankAccount, z.ZodTypeDef, unknown > = z.object({ uuid: z.string(), contractor_uuid: z.string(), account_type: ContractorBankAccountAccountType$inboundSchema, name: z.string(), routing_number: z.string(), hidden_account_number: z.string(), }).transform((v) => { return remap$(v, { "contractor_uuid": "contractorUuid", "account_type": "accountType", "routing_number": "routingNumber", "hidden_account_number": "hiddenAccountNumber", }); }); export function contractorBankAccountFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => ContractorBankAccount$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ContractorBankAccount' from JSON`, ); }