/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod/v3"; import { safeParse } from "../../lib/schemas.js"; import * as openEnums from "../../types/enums.js"; import { OpenEnum } from "../../types/enums.js"; import { Result as SafeParseResult } from "../../types/fp.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; import { PazeBillingAddress, PazeBillingAddress$inboundSchema, } from "./pazebillingaddress.js"; import { PazeDigitalCardData, PazeDigitalCardData$inboundSchema, } from "./pazedigitalcarddata.js"; /** * Card type. */ export const Paymentcardtype = { Credit: "CREDIT", Debit: "DEBIT", } as const; /** * Card type. */ export type Paymentcardtype = OpenEnum; /** * Card brand. */ export const Paymentcardbrand = { Visa: "VISA", Mastercard: "MASTERCARD", Discover: "DISCOVER", } as const; /** * Card brand. */ export type Paymentcardbrand = OpenEnum; /** * Card network. */ export const Paymentcardnetwork = { Visa: "VISA", Mastercard: "MASTERCARD", Discover: "DISCOVER", } as const; /** * Card network. */ export type Paymentcardnetwork = OpenEnum; export type PazeMaskedCard = { /** * Last four digits of the PAN. */ panLastFour: string; /** * Payment Account Reference (PAR). A non-financial reference assigned to each unique PAN. */ paymentAccountReference: string; /** * 2-digit PAN expiration month. */ panExpirationMonth: string | null; /** * 4-digit PAN expiration year. */ panExpirationYear: string | null; /** * Free-form string used for card or program recognition. */ paymentCardDescriptor: string; /** * Card type. */ paymentCardType: Paymentcardtype; /** * Card brand. */ paymentCardBrand: Paymentcardbrand; /** * Card network. */ paymentCardNetwork: Paymentcardnetwork; digitalCardData: PazeDigitalCardData; billingAddress: PazeBillingAddress | null; }; /** @internal */ export const Paymentcardtype$inboundSchema: z.ZodType< Paymentcardtype, z.ZodTypeDef, unknown > = openEnums.inboundSchema(Paymentcardtype); /** @internal */ export const Paymentcardbrand$inboundSchema: z.ZodType< Paymentcardbrand, z.ZodTypeDef, unknown > = openEnums.inboundSchema(Paymentcardbrand); /** @internal */ export const Paymentcardnetwork$inboundSchema: z.ZodType< Paymentcardnetwork, z.ZodTypeDef, unknown > = openEnums.inboundSchema(Paymentcardnetwork); /** @internal */ export const PazeMaskedCard$inboundSchema: z.ZodType< PazeMaskedCard, z.ZodTypeDef, unknown > = z.object({ panLastFour: z.string(), paymentAccountReference: z.string(), panExpirationMonth: z.nullable(z.string()), panExpirationYear: z.nullable(z.string()), paymentCardDescriptor: z.string(), paymentCardType: Paymentcardtype$inboundSchema, paymentCardBrand: Paymentcardbrand$inboundSchema, paymentCardNetwork: Paymentcardnetwork$inboundSchema, digitalCardData: PazeDigitalCardData$inboundSchema, billingAddress: z.nullable(PazeBillingAddress$inboundSchema), }); export function pazeMaskedCardFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => PazeMaskedCard$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'PazeMaskedCard' from JSON`, ); }