/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod/v3"; import * as openEnums from "../../types/enums.js"; import { OpenEnum } from "../../types/enums.js"; import { PaypalShippingOptionsItemAmount, PaypalShippingOptionsItemAmount$Outbound, PaypalShippingOptionsItemAmount$outboundSchema, } from "./paypalshippingoptionsitemamount.js"; export const PaypalShippingOptionsItemType = { Shipping: "SHIPPING", Pickup: "PICKUP", PickupInStore: "PICKUP_IN_STORE", PickupFromPerson: "PICKUP_FROM_PERSON", } as const; export type PaypalShippingOptionsItemType = OpenEnum< typeof PaypalShippingOptionsItemType >; export type PaypalShippingOptionsItem = { /** * A unique ID that identifies a payer-selected shipping option. */ id: string; /** * A description that the payer sees, which helps them choose an appropriate shipping option. */ label: string; /** * If the API request sets selected = true, it represents the shipping option that the payee or merchant expects to be pre-selected for the payer when they first view the shipping.options in the PayPal Checkout experience. Only one shipping.option can be set to selected=true. */ selected: boolean; /** * A classification for the method of purchase fulfillment. */ type?: PaypalShippingOptionsItemType | null | undefined; /** * The shipping cost for the selected option. */ amount?: PaypalShippingOptionsItemAmount | null | undefined; }; /** @internal */ export const PaypalShippingOptionsItemType$outboundSchema: z.ZodType< string, z.ZodTypeDef, PaypalShippingOptionsItemType > = openEnums.outboundSchema(PaypalShippingOptionsItemType); /** @internal */ export type PaypalShippingOptionsItem$Outbound = { id: string; label: string; selected: boolean; type?: string | null | undefined; amount?: PaypalShippingOptionsItemAmount$Outbound | null | undefined; }; /** @internal */ export const PaypalShippingOptionsItem$outboundSchema: z.ZodType< PaypalShippingOptionsItem$Outbound, z.ZodTypeDef, PaypalShippingOptionsItem > = z.object({ id: z.string(), label: z.string(), selected: z.boolean(), type: z.nullable(PaypalShippingOptionsItemType$outboundSchema).optional(), amount: z.nullable(PaypalShippingOptionsItemAmount$outboundSchema).optional(), }); export function paypalShippingOptionsItemToJSON( paypalShippingOptionsItem: PaypalShippingOptionsItem, ): string { return JSON.stringify( PaypalShippingOptionsItem$outboundSchema.parse(paypalShippingOptionsItem), ); }