/*
 * 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 LibrariesShareCreateV1Request = {
  libraryId: string;
  sharingIn: components.SharingIn;
};

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

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

export function librariesShareCreateV1RequestToJSON(
  librariesShareCreateV1Request: LibrariesShareCreateV1Request,
): string {
  return JSON.stringify(
    LibrariesShareCreateV1Request$outboundSchema.parse(
      librariesShareCreateV1Request,
    ),
  );
}
