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

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

export type LibrariesDocumentsPatchV1Request = {
  libraryId: string;
  documentId: string;
  updateDocumentRequest: components.UpdateDocumentRequest;
};

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

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

export function librariesDocumentsPatchV1RequestToJSON(
  librariesDocumentsPatchV1Request: LibrariesDocumentsPatchV1Request,
): string {
  return JSON.stringify(
    LibrariesDocumentsPatchV1Request$outboundSchema.parse(
      librariesDocumentsPatchV1Request,
    ),
  );
}
