/* * 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 CreateApplePaySession = { /** * A fully qualified top-level or sub-domain name where you will accept Apple Pay. Should not include "https". */ domain: string; /** * A UTF-8 string to display in the Buy button. */ displayName: string; }; /** @internal */ export const CreateApplePaySession$inboundSchema: z.ZodType< CreateApplePaySession, z.ZodTypeDef, unknown > = z.object({ domain: z.string(), displayName: z.string(), }); /** @internal */ export type CreateApplePaySession$Outbound = { domain: string; displayName: string; }; /** @internal */ export const CreateApplePaySession$outboundSchema: z.ZodType< CreateApplePaySession$Outbound, z.ZodTypeDef, CreateApplePaySession > = z.object({ domain: z.string(), displayName: z.string(), }); export function createApplePaySessionToJSON( createApplePaySession: CreateApplePaySession, ): string { return JSON.stringify( CreateApplePaySession$outboundSchema.parse(createApplePaySession), ); } export function createApplePaySessionFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => CreateApplePaySession$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CreateApplePaySession' from JSON`, ); }