/* * 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"; /** * Billing contact information as returned from Apple Pay. * * @remarks * * Refer to [Apple's documentation](https://developer.apple.com/documentation/apple_pay_on_the_web/applepaypaymentcontact) * for more information. */ export type AppleBillingContact = { /** * Address lines 1 and 2 for the contact. */ addressLines?: Array | undefined; /** * The contact's city. */ locality?: string | undefined; /** * The contact's postal code. */ postalCode?: string | undefined; /** * The contact's two-letter state code. */ administrativeArea?: string | undefined; /** * The contact's two-letter ISO 3166 */ countryCode?: string | undefined; }; /** @internal */ export const AppleBillingContact$inboundSchema: z.ZodType< AppleBillingContact, z.ZodTypeDef, unknown > = z.object({ addressLines: z.array(z.string()).optional(), locality: z.string().optional(), postalCode: z.string().optional(), administrativeArea: z.string().optional(), countryCode: z.string().optional(), }); /** @internal */ export type AppleBillingContact$Outbound = { addressLines?: Array | undefined; locality?: string | undefined; postalCode?: string | undefined; administrativeArea?: string | undefined; countryCode?: string | undefined; }; /** @internal */ export const AppleBillingContact$outboundSchema: z.ZodType< AppleBillingContact$Outbound, z.ZodTypeDef, AppleBillingContact > = z.object({ addressLines: z.array(z.string()).optional(), locality: z.string().optional(), postalCode: z.string().optional(), administrativeArea: z.string().optional(), countryCode: z.string().optional(), }); export function appleBillingContactToJSON( appleBillingContact: AppleBillingContact, ): string { return JSON.stringify( AppleBillingContact$outboundSchema.parse(appleBillingContact), ); } export function appleBillingContactFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => AppleBillingContact$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'AppleBillingContact' from JSON`, ); }