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

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 root operations.
 */
export type RootsCapability = {
  listChanged?: boolean | null | undefined;
  [additionalProperties: string]: unknown;
};

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

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