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

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

export type ListSharingOut = {
  data: Array<SharingOut>;
};

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

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