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

import * as z from "zod/v3";
import { remap as remap$ } from "../../lib/primitives.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,
  z.ZodTypeDef,
  ClassificationRequestInputs
> = z.union([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,
  z.ZodTypeDef,
  ClassificationRequest
> = z.object({
  model: z.string(),
  metadata: z.nullable(z.record(z.any())).optional(),
  inputs: z.union([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),
  );
}
