/*
 * 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 TrainingFile = {
  fileId: string;
  weight?: number | undefined;
};

/** @internal */
export type TrainingFile$Outbound = {
  file_id: string;
  weight: number;
};

/** @internal */
export const TrainingFile$outboundSchema: z.ZodType<
  TrainingFile$Outbound,
  z.ZodTypeDef,
  TrainingFile
> = z.object({
  fileId: z.string(),
  weight: z.number().default(1),
}).transform((v) => {
  return remap$(v, {
    fileId: "file_id",
  });
});

export function trainingFileToJSON(trainingFile: TrainingFile): string {
  return JSON.stringify(TrainingFile$outboundSchema.parse(trainingFile));
}
