/* * 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 { CartItem, CartItem$Outbound, CartItem$outboundSchema, } from "./cartitem.js"; export type PaymentOptionRequest = { /** * The metadata to used to evaluate checkout rules, which will help determine the right payment options to display. */ metadata?: { [k: string]: string } | null | undefined; /** * The country code used to evaluate checkout rules, and which are used to help determine the right payment options to display. */ country?: string | null | undefined; /** * The currency code used to evaluate checkout rules, and which are used to help determine the right payment options to display. */ currency?: string | null | undefined; /** * The amount used to evaluate checkout rules, and which are used to help determine the right payment options to display. */ amount?: number | null | undefined; /** * The locale used to determine the labels for each payment option. */ locale?: string | undefined; /** * The cart items used to evaluate checkout rules, and which are used to help determine the right payment options to display. */ cartItems?: Array | null | undefined; }; /** @internal */ export type PaymentOptionRequest$Outbound = { metadata?: { [k: string]: string } | null | undefined; country?: string | null | undefined; currency?: string | null | undefined; amount?: number | null | undefined; locale: string; cart_items?: Array | null | undefined; }; /** @internal */ export const PaymentOptionRequest$outboundSchema: z.ZodType< PaymentOptionRequest$Outbound, z.ZodTypeDef, PaymentOptionRequest > = z.object({ metadata: z.nullable(z.record(z.string())).optional(), country: z.nullable(z.string()).optional(), currency: z.nullable(z.string()).optional(), amount: z.nullable(z.number().int()).optional(), locale: z.string().default("en"), cartItems: z.nullable(z.array(CartItem$outboundSchema)).optional(), }).transform((v) => { return remap$(v, { cartItems: "cart_items", }); }); export function paymentOptionRequestToJSON( paymentOptionRequest: PaymentOptionRequest, ): string { return JSON.stringify( PaymentOptionRequest$outboundSchema.parse(paymentOptionRequest), ); }