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

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 {
  TasksToolsCapability,
  TasksToolsCapability$inboundSchema,
} from "./taskstoolscapability.js";

/**
 * Capability for tasks requests operations.
 */
export type ServerTasksRequestsCapability = {
  tools?: TasksToolsCapability | null | undefined;
  [additionalProperties: string]: unknown;
};

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

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