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

import * as z from "zod/v3";
import { remap as remap$ } from "../../lib/primitives.js";

export type FileChunk = {
  type?: "file" | undefined;
  fileId: string;
};

/** @internal */
export type FileChunk$Outbound = {
  type: "file";
  file_id: string;
};

/** @internal */
export const FileChunk$outboundSchema: z.ZodType<
  FileChunk$Outbound,
  z.ZodTypeDef,
  FileChunk
> = z.object({
  type: z.literal("file").default("file" as const),
  fileId: z.string(),
}).transform((v) => {
  return remap$(v, {
    fileId: "file_id",
  });
});

export function fileChunkToJSON(fileChunk: FileChunk): string {
  return JSON.stringify(FileChunk$outboundSchema.parse(fileChunk));
}
