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

import * as z from "zod/v4-mini";
import { smartUnion } from "../../types/smartUnion.js";
import {
  CostMetadataInput,
  CostMetadataInput$Outbound,
  CostMetadataInput$outboundSchema,
} from "./costmetadatainput.js";
import {
  LLMMetadata,
  LLMMetadata$Outbound,
  LLMMetadata$outboundSchema,
} from "./llmmetadata.js";

export type EventMetadataInput =
  | LLMMetadata
  | CostMetadataInput
  | string
  | number
  | number
  | boolean;

/** @internal */
export type EventMetadataInput$Outbound =
  | LLMMetadata$Outbound
  | CostMetadataInput$Outbound
  | string
  | number
  | number
  | boolean;

/** @internal */
export const EventMetadataInput$outboundSchema: z.ZodMiniType<
  EventMetadataInput$Outbound,
  EventMetadataInput
> = smartUnion([
  LLMMetadata$outboundSchema,
  CostMetadataInput$outboundSchema,
  z.string(),
  z.int(),
  z.number(),
  z.boolean(),
]);

export function eventMetadataInputToJSON(
  eventMetadataInput: EventMetadataInput,
): string {
  return JSON.stringify(
    EventMetadataInput$outboundSchema.parse(eventMetadataInput),
  );
}
