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

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 { Connector, Connector$inboundSchema } from "./connector.js";
import {
  PaginationResponse,
  PaginationResponse$inboundSchema,
} from "./paginationresponse.js";

export type PaginatedConnectors = {
  items: Array<Connector>;
  pagination: PaginationResponse;
};

/** @internal */
export const PaginatedConnectors$inboundSchema: z.ZodType<
  PaginatedConnectors,
  unknown
> = z.object({
  items: z.array(Connector$inboundSchema),
  pagination: PaginationResponse$inboundSchema,
});

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