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

import * as z from "zod/v4";
import { remap as remap$ } from "../../lib/primitives.js";
import {
  FTClassifierLossFunction,
  FTClassifierLossFunction$outboundSchema,
} from "./ftclassifierlossfunction.js";

export type ClassifierTarget = {
  name: string;
  labels: Array<string>;
  weight?: number | undefined;
  lossFunction?: FTClassifierLossFunction | null | undefined;
};

/** @internal */
export type ClassifierTarget$Outbound = {
  name: string;
  labels: Array<string>;
  weight: number;
  loss_function?: string | null | undefined;
};

/** @internal */
export const ClassifierTarget$outboundSchema: z.ZodType<
  ClassifierTarget$Outbound,
  ClassifierTarget
> = z.object({
  name: z.string(),
  labels: z.array(z.string()),
  weight: z.number().default(1),
  lossFunction: z.nullable(FTClassifierLossFunction$outboundSchema).optional(),
}).transform((v) => {
  return remap$(v, {
    lossFunction: "loss_function",
  });
});

export function classifierTargetToJSON(
  classifierTarget: ClassifierTarget,
): string {
  return JSON.stringify(
    ClassifierTarget$outboundSchema.parse(classifierTarget),
  );
}
