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

import * as z from "zod/v4";
import { safeParse } from "../../lib/schemas.js";
import { Result as SafeParseResult } from "../../types/fp.js";
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
import { Sharing, Sharing$inboundSchema } from "./sharing.js";

export type ListSharingResponse = {
  data: Array<Sharing>;
};

/** @internal */
export const ListSharingResponse$inboundSchema: z.ZodType<
  ListSharingResponse,
  unknown
> = z.object({
  data: z.array(Sharing$inboundSchema),
});

export function listSharingResponseFromJSON(
  jsonString: string,
): SafeParseResult<ListSharingResponse, SDKValidationError> {
  return safeParse(
    jsonString,
    (x) => ListSharingResponse$inboundSchema.parse(JSON.parse(x)),
    `Failed to parse 'ListSharingResponse' from JSON`,
  );
}
