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

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

/**
 * Text to classify.
 */
export type ClassificationRequestInputs = string | Array<string>;

export type ClassificationRequest = {
  /**
   * ID of the model to use.
   */
  model: string;
  metadata?: { [k: string]: any } | null | undefined;
  /**
   * Text to classify.
   */
  inputs: string | Array<string>;
};

/** @internal */
export type ClassificationRequestInputs$Outbound = string | Array<string>;

/** @internal */
export const ClassificationRequestInputs$outboundSchema: z.ZodType<
  ClassificationRequestInputs$Outbound,
  ClassificationRequestInputs
> = smartUnion([z.string(), z.array(z.string())]);

export function classificationRequestInputsToJSON(
  classificationRequestInputs: ClassificationRequestInputs,
): string {
  return JSON.stringify(
    ClassificationRequestInputs$outboundSchema.parse(
      classificationRequestInputs,
    ),
  );
}

/** @internal */
export type ClassificationRequest$Outbound = {
  model: string;
  metadata?: { [k: string]: any } | null | undefined;
  input: string | Array<string>;
};

/** @internal */
export const ClassificationRequest$outboundSchema: z.ZodType<
  ClassificationRequest$Outbound,
  ClassificationRequest
> = z.object({
  model: z.string(),
  metadata: z.nullable(z.record(z.string(), z.any())).optional(),
  inputs: smartUnion([z.string(), z.array(z.string())]),
}).transform((v) => {
  return remap$(v, {
    inputs: "input",
  });
});

export function classificationRequestToJSON(
  classificationRequest: ClassificationRequest,
): string {
  return JSON.stringify(
    ClassificationRequest$outboundSchema.parse(classificationRequest),
  );
}
