/* * 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 BankAccountValidationInteractiveRetrieveBySortcoResponseItem = { /** * The name of the banking institution. */ bank?: string | undefined; /** * The banking institution's BIC, also know as the SWIFT BIC. */ bankBIC?: string | undefined; /** * The name of the account holding branch. */ branch?: string | undefined; /** * The branch's BIC. */ branchBIC?: string | undefined; /** * Line 1 of the branch's contact address. NB: This is the address to be used for BACs enquiries and may be a contact centre rather than the branch's address. */ contactAddressLine1?: string | undefined; /** * Line 2 of the branch's contact address. */ contactAddressLine2?: string | undefined; /** * The branch's contact post town. */ contactPostTown?: string | undefined; /** * The branch's contact postcode. */ contactPostcode?: string | undefined; /** * The branch's contact phone number. */ contactPhone?: string | undefined; /** * The branch's contact fax number. */ contactFax?: string | undefined; /** * Indicates that the account supports the faster payments service. */ fasterPaymentsSupported?: boolean | undefined; /** * Indicates that the account supports the CHAPS service. */ chapsSupported?: boolean | undefined; }; export type BankAccountValidationInteractiveRetrieveBySortcoResponse = { items?: | Array | undefined; }; /** @internal */ export const BankAccountValidationInteractiveRetrieveBySortcoResponseItem$inboundSchema: z.ZodType< BankAccountValidationInteractiveRetrieveBySortcoResponseItem, z.ZodTypeDef, unknown > = z.object({ Bank: z.string().optional(), BankBIC: z.string().optional(), Branch: z.string().optional(), BranchBIC: z.string().optional(), ContactAddressLine1: z.string().optional(), ContactAddressLine2: z.string().optional(), ContactPostTown: z.string().optional(), ContactPostcode: z.string().optional(), ContactPhone: z.string().optional(), ContactFax: z.string().optional(), FasterPaymentsSupported: z.boolean().optional(), CHAPSSupported: z.boolean().optional(), }).transform((v) => { return remap$(v, { "Bank": "bank", "BankBIC": "bankBIC", "Branch": "branch", "BranchBIC": "branchBIC", "ContactAddressLine1": "contactAddressLine1", "ContactAddressLine2": "contactAddressLine2", "ContactPostTown": "contactPostTown", "ContactPostcode": "contactPostcode", "ContactPhone": "contactPhone", "ContactFax": "contactFax", "FasterPaymentsSupported": "fasterPaymentsSupported", "CHAPSSupported": "chapsSupported", }); }); export function bankAccountValidationInteractiveRetrieveBySortcoResponseItemFromJSON( jsonString: string, ): SafeParseResult< BankAccountValidationInteractiveRetrieveBySortcoResponseItem, SDKValidationError > { return safeParse( jsonString, (x) => BankAccountValidationInteractiveRetrieveBySortcoResponseItem$inboundSchema .parse(JSON.parse(x)), `Failed to parse 'BankAccountValidationInteractiveRetrieveBySortcoResponseItem' from JSON`, ); } /** @internal */ export const BankAccountValidationInteractiveRetrieveBySortcoResponse$inboundSchema: z.ZodType< BankAccountValidationInteractiveRetrieveBySortcoResponse, z.ZodTypeDef, unknown > = z.object({ Items: z.array( z.lazy(() => BankAccountValidationInteractiveRetrieveBySortcoResponseItem$inboundSchema ), ).optional(), }).transform((v) => { return remap$(v, { "Items": "items", }); }); export function bankAccountValidationInteractiveRetrieveBySortcoResponseFromJSON( jsonString: string, ): SafeParseResult< BankAccountValidationInteractiveRetrieveBySortcoResponse, SDKValidationError > { return safeParse( jsonString, (x) => BankAccountValidationInteractiveRetrieveBySortcoResponse$inboundSchema .parse(JSON.parse(x)), `Failed to parse 'BankAccountValidationInteractiveRetrieveBySortcoResponse' from JSON`, ); }