/* * 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"; import { Address, Address$inboundSchema } from "./address.js"; /** * PayoutMerchantSummary * * @remarks * * Represents a summary of a merchant. */ export type PayoutMerchantSummary = { /** * Always `merchant`. */ type: "merchant"; /** * The name of the merchant. */ name: string; /** * Unique value which identifies a merchant for processing transactions, also known as a MID. */ identificationNumber: string; /** * The phone number for the merchant which should be formatted according to the E164 number standard. */ phoneNumber: string; /** * Merchant website URL. */ url: string; /** * Value to explain charges or payments on bank statements. */ statementDescriptor?: string | null | undefined; /** * Merchant classification for the type of goods or services it provides. */ merchantCategoryCode: string; /** * The address for the merchant. */ address?: Address | null | undefined; }; /** @internal */ export const PayoutMerchantSummary$inboundSchema: z.ZodType< PayoutMerchantSummary, z.ZodTypeDef, unknown > = z.object({ type: z.literal("merchant").default("merchant"), name: z.string(), identification_number: z.string(), phone_number: z.string(), url: z.string(), statement_descriptor: z.nullable(z.string()).optional(), merchant_category_code: z.string(), address: z.nullable(Address$inboundSchema).optional(), }).transform((v) => { return remap$(v, { "identification_number": "identificationNumber", "phone_number": "phoneNumber", "statement_descriptor": "statementDescriptor", "merchant_category_code": "merchantCategoryCode", }); }); export function payoutMerchantSummaryFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => PayoutMerchantSummary$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'PayoutMerchantSummary' from JSON`, ); }