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

import * as z from "zod/v3";
import {
  AgentHandoffEntry,
  AgentHandoffEntry$Outbound,
  AgentHandoffEntry$outboundSchema,
} from "./agenthandoffentry.js";
import {
  FunctionCallEntry,
  FunctionCallEntry$Outbound,
  FunctionCallEntry$outboundSchema,
} from "./functioncallentry.js";
import {
  FunctionResultEntry,
  FunctionResultEntry$Outbound,
  FunctionResultEntry$outboundSchema,
} from "./functionresultentry.js";
import {
  MessageInputEntry,
  MessageInputEntry$Outbound,
  MessageInputEntry$outboundSchema,
} from "./messageinputentry.js";
import {
  MessageOutputEntry,
  MessageOutputEntry$Outbound,
  MessageOutputEntry$outboundSchema,
} from "./messageoutputentry.js";
import {
  ToolExecutionEntry,
  ToolExecutionEntry$Outbound,
  ToolExecutionEntry$outboundSchema,
} from "./toolexecutionentry.js";

export type InputEntries =
  | AgentHandoffEntry
  | FunctionCallEntry
  | MessageInputEntry
  | FunctionResultEntry
  | ToolExecutionEntry
  | MessageOutputEntry;

/** @internal */
export type InputEntries$Outbound =
  | AgentHandoffEntry$Outbound
  | FunctionCallEntry$Outbound
  | MessageInputEntry$Outbound
  | FunctionResultEntry$Outbound
  | ToolExecutionEntry$Outbound
  | MessageOutputEntry$Outbound;

/** @internal */
export const InputEntries$outboundSchema: z.ZodType<
  InputEntries$Outbound,
  z.ZodTypeDef,
  InputEntries
> = z.union([
  AgentHandoffEntry$outboundSchema,
  FunctionCallEntry$outboundSchema,
  MessageInputEntry$outboundSchema,
  FunctionResultEntry$outboundSchema,
  ToolExecutionEntry$outboundSchema,
  MessageOutputEntry$outboundSchema,
]);

export function inputEntriesToJSON(inputEntries: InputEntries): string {
  return JSON.stringify(InputEntries$outboundSchema.parse(inputEntries));
}
