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

import * as z from "zod/v3";
import { remap as remap$ } from "../../lib/primitives.js";
import * as components from "../components/index.js";

export type LibrariesDocumentsUpdateV1Request = {
  libraryId: string;
  documentId: string;
  documentUpdateIn: components.DocumentUpdateIn;
};

/** @internal */
export type LibrariesDocumentsUpdateV1Request$Outbound = {
  library_id: string;
  document_id: string;
  DocumentUpdateIn: components.DocumentUpdateIn$Outbound;
};

/** @internal */
export const LibrariesDocumentsUpdateV1Request$outboundSchema: z.ZodType<
  LibrariesDocumentsUpdateV1Request$Outbound,
  z.ZodTypeDef,
  LibrariesDocumentsUpdateV1Request
> = z.object({
  libraryId: z.string(),
  documentId: z.string(),
  documentUpdateIn: components.DocumentUpdateIn$outboundSchema,
}).transform((v) => {
  return remap$(v, {
    libraryId: "library_id",
    documentId: "document_id",
    documentUpdateIn: "DocumentUpdateIn",
  });
});

export function librariesDocumentsUpdateV1RequestToJSON(
  librariesDocumentsUpdateV1Request: LibrariesDocumentsUpdateV1Request,
): string {
  return JSON.stringify(
    LibrariesDocumentsUpdateV1Request$outboundSchema.parse(
      librariesDocumentsUpdateV1Request,
    ),
  );
}
