/*
 * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
 * @generated-id: 7ba185bfa919
 */

import * as z from "zod/v4";

export type FileT = {
  fileName: string;
  content: ReadableStream<Uint8Array> | Blob | ArrayBuffer | Uint8Array;
};

/** @internal */
export type FileT$Outbound = {
  fileName: string;
  content: ReadableStream<Uint8Array> | Blob | ArrayBuffer | Uint8Array;
};

/** @internal */
export const FileT$outboundSchema: z.ZodType<FileT$Outbound, FileT> = z.object({
  fileName: z.string(),
  content: z.union([
    z.custom<ReadableStream<Uint8Array>>(x => x instanceof ReadableStream),
    z.custom<Blob>(x => x instanceof Blob),
    z.custom<ArrayBuffer>(x => x instanceof ArrayBuffer),
    z.custom<Uint8Array>(x => x instanceof Uint8Array),
  ]),
});

export function fileToJSON(fileT: FileT): string {
  return JSON.stringify(FileT$outboundSchema.parse(fileT));
}
