/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod/v3"; import { safeParse } from "../../lib/schemas.js"; import { Result as SafeParseResult } from "../../types/fp.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; export type IssuingMerchantData = { /** * External identifier used to identify the merchant with the card brand. */ networkID: string; /** * Name of the merchant. */ name?: string | undefined; /** * The merchant's location. */ city?: string | undefined; /** * Two-letter country code. */ country: string; /** * The merchant's five-digit postal code. */ postalCode?: string | undefined; /** * The merchant's two-letter state abbreviation. */ state?: string | undefined; /** * The Merchant Category Code. */ mcc: string; }; /** @internal */ export const IssuingMerchantData$inboundSchema: z.ZodType< IssuingMerchantData, z.ZodTypeDef, unknown > = z.object({ networkID: z.string(), name: z.string().optional(), city: z.string().optional(), country: z.string(), postalCode: z.string().optional(), state: z.string().optional(), mcc: z.string(), }); /** @internal */ export type IssuingMerchantData$Outbound = { networkID: string; name?: string | undefined; city?: string | undefined; country: string; postalCode?: string | undefined; state?: string | undefined; mcc: string; }; /** @internal */ export const IssuingMerchantData$outboundSchema: z.ZodType< IssuingMerchantData$Outbound, z.ZodTypeDef, IssuingMerchantData > = z.object({ networkID: z.string(), name: z.string().optional(), city: z.string().optional(), country: z.string(), postalCode: z.string().optional(), state: z.string().optional(), mcc: z.string(), }); export function issuingMerchantDataToJSON( issuingMerchantData: IssuingMerchantData, ): string { return JSON.stringify( IssuingMerchantData$outboundSchema.parse(issuingMerchantData), ); } export function issuingMerchantDataFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => IssuingMerchantData$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'IssuingMerchantData' from JSON`, ); }