/*
 * 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 CustomerPaymentMethodConfirm = {
  setupIntentId: string;
  setDefault: boolean;
};

/** @internal */
export type CustomerPaymentMethodConfirm$Outbound = {
  setup_intent_id: string;
  set_default: boolean;
};

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

export function customerPaymentMethodConfirmToJSON(
  customerPaymentMethodConfirm: CustomerPaymentMethodConfirm,
): string {
  return JSON.stringify(
    CustomerPaymentMethodConfirm$outboundSchema.parse(
      customerPaymentMethodConfirm,
    ),
  );
}
