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

import * as z from "zod/v4-mini";
import {
  DownloadableFileCreate,
  DownloadableFileCreate$Outbound,
  DownloadableFileCreate$outboundSchema,
} from "./downloadablefilecreate.js";
import {
  OrganizationAvatarFileCreate,
  OrganizationAvatarFileCreate$Outbound,
  OrganizationAvatarFileCreate$outboundSchema,
} from "./organizationavatarfilecreate.js";
import {
  ProductMediaFileCreate,
  ProductMediaFileCreate$Outbound,
  ProductMediaFileCreate$outboundSchema,
} from "./productmediafilecreate.js";
import {
  SupportCaseAttachmentFileCreate,
  SupportCaseAttachmentFileCreate$Outbound,
  SupportCaseAttachmentFileCreate$outboundSchema,
} from "./supportcaseattachmentfilecreate.js";

export type FileCreate =
  | DownloadableFileCreate
  | OrganizationAvatarFileCreate
  | ProductMediaFileCreate
  | SupportCaseAttachmentFileCreate;

/** @internal */
export type FileCreate$Outbound =
  | DownloadableFileCreate$Outbound
  | OrganizationAvatarFileCreate$Outbound
  | ProductMediaFileCreate$Outbound
  | SupportCaseAttachmentFileCreate$Outbound;

/** @internal */
export const FileCreate$outboundSchema: z.ZodMiniType<
  FileCreate$Outbound,
  FileCreate
> = z.union([
  DownloadableFileCreate$outboundSchema,
  OrganizationAvatarFileCreate$outboundSchema,
  ProductMediaFileCreate$outboundSchema,
  SupportCaseAttachmentFileCreate$outboundSchema,
]);

export function fileCreateToJSON(fileCreate: FileCreate): string {
  return JSON.stringify(FileCreate$outboundSchema.parse(fileCreate));
}
