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

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 {
  TasksElicitationCapability,
  TasksElicitationCapability$inboundSchema,
} from "./taskselicitationcapability.js";
import {
  TasksSamplingCapability,
  TasksSamplingCapability$inboundSchema,
} from "./taskssamplingcapability.js";

/**
 * Capability for tasks requests operations.
 */
export type ClientTasksRequestsCapability = {
  sampling?: TasksSamplingCapability | null | undefined;
  elicitation?: TasksElicitationCapability | null | undefined;
  [additionalProperties: string]: unknown;
};

/** @internal */
export const ClientTasksRequestsCapability$inboundSchema: z.ZodType<
  ClientTasksRequestsCapability,
  unknown
> = z.object({
  sampling: z.nullable(TasksSamplingCapability$inboundSchema).optional(),
  elicitation: z.nullable(TasksElicitationCapability$inboundSchema).optional(),
}).catchall(z.any());

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