/* * 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 * as openEnums from "../../types/enums.js"; import { OpenEnum } from "../../types/enums.js"; export const CallbackEvents = { ShippingAddress: "SHIPPING_ADDRESS", ShippingOptions: "SHIPPING_OPTIONS", } as const; export type CallbackEvents = OpenEnum; export type PaypalOrderUpdateCallbackConfig = { /** * The URL for the webhook endpoint you provide for PayPal to send you order update events. */ callbackUrl?: string | null | undefined; /** * The events that trigger a callback. */ callbackEvents?: Array | null | undefined; }; /** @internal */ export const CallbackEvents$outboundSchema: z.ZodType< string, z.ZodTypeDef, CallbackEvents > = openEnums.outboundSchema(CallbackEvents); /** @internal */ export type PaypalOrderUpdateCallbackConfig$Outbound = { callback_url?: string | null | undefined; callback_events?: Array | null | undefined; }; /** @internal */ export const PaypalOrderUpdateCallbackConfig$outboundSchema: z.ZodType< PaypalOrderUpdateCallbackConfig$Outbound, z.ZodTypeDef, PaypalOrderUpdateCallbackConfig > = z.object({ callbackUrl: z.nullable(z.string()).optional(), callbackEvents: z.nullable(z.array(CallbackEvents$outboundSchema)).optional(), }).transform((v) => { return remap$(v, { callbackUrl: "callback_url", callbackEvents: "callback_events", }); }); export function paypalOrderUpdateCallbackConfigToJSON( paypalOrderUpdateCallbackConfig: PaypalOrderUpdateCallbackConfig, ): string { return JSON.stringify( PaypalOrderUpdateCallbackConfig$outboundSchema.parse( paypalOrderUpdateCallbackConfig, ), ); }