/*
 * 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";

export type CustomerPaymentMethodCreate = {
  confirmationTokenId: string;
  setDefault: boolean;
  returnUrl: string;
};

/** @internal */
export type CustomerPaymentMethodCreate$Outbound = {
  confirmation_token_id: string;
  set_default: boolean;
  return_url: string;
};

/** @internal */
export const CustomerPaymentMethodCreate$outboundSchema: z.ZodMiniType<
  CustomerPaymentMethodCreate$Outbound,
  CustomerPaymentMethodCreate
> = z.pipe(
  z.object({
    confirmationTokenId: z.string(),
    setDefault: z.boolean(),
    returnUrl: z.string(),
  }),
  z.transform((v) => {
    return remap$(v, {
      confirmationTokenId: "confirmation_token_id",
      setDefault: "set_default",
      returnUrl: "return_url",
    });
  }),
);

export function customerPaymentMethodCreateToJSON(
  customerPaymentMethodCreate: CustomerPaymentMethodCreate,
): string {
  return JSON.stringify(
    CustomerPaymentMethodCreate$outboundSchema.parse(
      customerPaymentMethodCreate,
    ),
  );
}
