/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod/v4-mini"; import { remap as remap$ } from "../../lib/primitives.js"; import { CheckoutAction, CheckoutAction$outboundSchema, } from "./checkout-action.js"; import { CheckoutConfiguration, CheckoutConfiguration$Outbound, CheckoutConfiguration$outboundSchema, } from "./checkout-configuration.js"; import { CheckoutPaymentProviderConfig, CheckoutPaymentProviderConfig$Outbound, CheckoutPaymentProviderConfig$outboundSchema, } from "./checkout-payment-provider-config.js"; import { CheckoutPaymentProvider, CheckoutPaymentProvider$outboundSchema, } from "./checkout-payment-provider.js"; export type CreateCheckoutSessionRequest = { action: CheckoutAction; cancelUrl?: string | undefined; configuration?: CheckoutConfiguration | undefined; customerExternalId: string; failureUrl?: string | undefined; idempotencyKey?: string | undefined; metadata?: { [k: string]: string } | undefined; paymentProvider: CheckoutPaymentProvider; paymentProviderConfig?: CheckoutPaymentProviderConfig | undefined; successUrl?: string | undefined; }; /** @internal */ export type CreateCheckoutSessionRequest$Outbound = { action: string; cancel_url?: string | undefined; configuration?: CheckoutConfiguration$Outbound | undefined; customer_external_id: string; failure_url?: string | undefined; idempotency_key?: string | undefined; metadata?: { [k: string]: string } | undefined; payment_provider: string; payment_provider_config?: CheckoutPaymentProviderConfig$Outbound | undefined; success_url?: string | undefined; }; /** @internal */ export const CreateCheckoutSessionRequest$outboundSchema: z.ZodMiniType< CreateCheckoutSessionRequest$Outbound, CreateCheckoutSessionRequest > = z.pipe( z.object({ action: CheckoutAction$outboundSchema, cancelUrl: z.optional(z.string()), configuration: z.optional(CheckoutConfiguration$outboundSchema), customerExternalId: z.string(), failureUrl: z.optional(z.string()), idempotencyKey: z.optional(z.string()), metadata: z.optional(z.record(z.string(), z.string())), paymentProvider: CheckoutPaymentProvider$outboundSchema, paymentProviderConfig: z.optional( CheckoutPaymentProviderConfig$outboundSchema, ), successUrl: z.optional(z.string()), }), z.transform((v) => { return remap$(v, { cancelUrl: "cancel_url", customerExternalId: "customer_external_id", failureUrl: "failure_url", idempotencyKey: "idempotency_key", paymentProvider: "payment_provider", paymentProviderConfig: "payment_provider_config", successUrl: "success_url", }); }), ); export function createCheckoutSessionRequestToJSON( createCheckoutSessionRequest: CreateCheckoutSessionRequest, ): string { return JSON.stringify( CreateCheckoutSessionRequest$outboundSchema.parse( createCheckoutSessionRequest, ), ); }