/*
 * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
 */

import * as z from "zod/v4-mini";
import { smartUnion } from "../../types/smartUnion.js";
import {
  ProductCreateOneTime,
  ProductCreateOneTime$Outbound,
  ProductCreateOneTime$outboundSchema,
} from "./productcreateonetime.js";
import {
  ProductCreateRecurring,
  ProductCreateRecurring$Outbound,
  ProductCreateRecurring$outboundSchema,
} from "./productcreaterecurring.js";

export type ProductCreate = ProductCreateRecurring | ProductCreateOneTime;

/** @internal */
export type ProductCreate$Outbound =
  | ProductCreateRecurring$Outbound
  | ProductCreateOneTime$Outbound;

/** @internal */
export const ProductCreate$outboundSchema: z.ZodMiniType<
  ProductCreate$Outbound,
  ProductCreate
> = smartUnion([
  ProductCreateRecurring$outboundSchema,
  ProductCreateOneTime$outboundSchema,
]);

export function productCreateToJSON(productCreate: ProductCreate): string {
  return JSON.stringify(ProductCreate$outboundSchema.parse(productCreate));
}
