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

import * as z from "zod/v4";
import { remap as remap$ } from "../../lib/primitives.js";
import { EntityType, EntityType$outboundSchema } from "./entitytype.js";

export type SharingDelete = {
  /**
   * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible.
   */
  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,
  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));
}
