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

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 elicitation operations.
 *
 * @remarks
 *
 * Clients must support at least one mode (form or url).
 */
export type ElicitationCapability = {
  form?: { [k: string]: any } | null | undefined;
  url?: { [k: string]: any } | null | undefined;
  [additionalProperties: string]: unknown;
};

/** @internal */
export const ElicitationCapability$inboundSchema: z.ZodType<
  ElicitationCapability,
  unknown
> = z.object({
  form: z.nullable(z.record(z.string(), z.any())).optional(),
  url: z.nullable(z.record(z.string(), z.any())).optional(),
}).catchall(z.any());

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