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

import * as z from "zod/v4-mini";
import { smartUnion } from "../../types/smartUnion.js";
import {
  CustomerIndividualCreate,
  CustomerIndividualCreate$Outbound,
  CustomerIndividualCreate$outboundSchema,
} from "./customerindividualcreate.js";
import {
  CustomerTeamCreate,
  CustomerTeamCreate$Outbound,
  CustomerTeamCreate$outboundSchema,
} from "./customerteamcreate.js";

export type CustomerCreate = CustomerIndividualCreate | CustomerTeamCreate;

/** @internal */
export type CustomerCreate$Outbound =
  | CustomerIndividualCreate$Outbound
  | CustomerTeamCreate$Outbound;

/** @internal */
export const CustomerCreate$outboundSchema: z.ZodMiniType<
  CustomerCreate$Outbound,
  CustomerCreate
> = smartUnion([
  CustomerIndividualCreate$outboundSchema,
  CustomerTeamCreate$outboundSchema,
]);

export function customerCreateToJSON(customerCreate: CustomerCreate): string {
  return JSON.stringify(CustomerCreate$outboundSchema.parse(customerCreate));
}
