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

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

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

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

/** @internal */
export const LibrariesDocumentsUpdateV1Request$outboundSchema: z.ZodType<
  LibrariesDocumentsUpdateV1Request$Outbound,
  LibrariesDocumentsUpdateV1Request
> = 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 librariesDocumentsUpdateV1RequestToJSON(
  librariesDocumentsUpdateV1Request: LibrariesDocumentsUpdateV1Request,
): string {
  return JSON.stringify(
    LibrariesDocumentsUpdateV1Request$outboundSchema.parse(
      librariesDocumentsUpdateV1Request,
    ),
  );
}
