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

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";

/**
 * Capability for resources operations.
 */
export type ResourcesCapability = {
  subscribe?: boolean | null | undefined;
  listChanged?: boolean | null | undefined;
  [additionalProperties: string]: unknown;
};

/** @internal */
export const ResourcesCapability$inboundSchema: z.ZodType<
  ResourcesCapability,
  unknown
> = z.object({
  subscribe: z.nullable(z.boolean()).optional(),
  listChanged: z.nullable(z.boolean()).optional(),
}).catchall(z.any());

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