/*
 * 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 LibraryIn = {
  name: string;
  description?: string | null | undefined;
  chunkSize?: number | null | undefined;
};

/** @internal */
export type LibraryIn$Outbound = {
  name: string;
  description?: string | null | undefined;
  chunk_size?: number | null | undefined;
};

/** @internal */
export const LibraryIn$outboundSchema: z.ZodType<
  LibraryIn$Outbound,
  z.ZodTypeDef,
  LibraryIn
> = z.object({
  name: z.string(),
  description: z.nullable(z.string()).optional(),
  chunkSize: z.nullable(z.number().int()).optional(),
}).transform((v) => {
  return remap$(v, {
    chunkSize: "chunk_size",
  });
});

export function libraryInToJSON(libraryIn: LibraryIn): string {
  return JSON.stringify(LibraryIn$outboundSchema.parse(libraryIn));
}
