/*
 * 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 LibrariesUpdateV1Request = {
  libraryId: string;
  libraryInUpdate: components.LibraryInUpdate;
};

/** @internal */
export type LibrariesUpdateV1Request$Outbound = {
  library_id: string;
  LibraryInUpdate: components.LibraryInUpdate$Outbound;
};

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

export function librariesUpdateV1RequestToJSON(
  librariesUpdateV1Request: LibrariesUpdateV1Request,
): string {
  return JSON.stringify(
    LibrariesUpdateV1Request$outboundSchema.parse(librariesUpdateV1Request),
  );
}
