/*
 * 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 { EntityType, EntityType$outboundSchema } from "./entitytype.js";

export type SharingDelete = {
  orgId?: string | null | undefined;
  /**
   * The id of the entity (user, workspace or organization) to share with
   */
  shareWithUuid: string;
  /**
   * The type of entity, used to share a library.
   */
  shareWithType: EntityType;
};

/** @internal */
export type SharingDelete$Outbound = {
  org_id?: string | null | undefined;
  share_with_uuid: string;
  share_with_type: string;
};

/** @internal */
export const SharingDelete$outboundSchema: z.ZodType<
  SharingDelete$Outbound,
  z.ZodTypeDef,
  SharingDelete
> = z.object({
  orgId: z.nullable(z.string()).optional(),
  shareWithUuid: z.string(),
  shareWithType: EntityType$outboundSchema,
}).transform((v) => {
  return remap$(v, {
    orgId: "org_id",
    shareWithUuid: "share_with_uuid",
    shareWithType: "share_with_type",
  });
});

export function sharingDeleteToJSON(sharingDelete: SharingDelete): string {
  return JSON.stringify(SharingDelete$outboundSchema.parse(sharingDelete));
}
