001/*
002 * Licensed to the Apache Software Foundation (ASF) under one or more
003 * contributor license agreements.  See the NOTICE file distributed with
004 * this work for additional information regarding copyright ownership.
005 * The ASF licenses this file to You under the Apache License, Version 2.0
006 * (the "License"); you may not use this file except in compliance with
007 * the License.  You may obtain a copy of the License at
008 *
009 *      http://www.apache.org/licenses/LICENSE-2.0
010 *
011 * Unless required by applicable law or agreed to in writing, software
012 * distributed under the License is distributed on an "AS IS" BASIS,
013 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
014 * See the License for the specific language governing permissions and
015 * limitations under the License.
016 */
017package org.apache.juneau.bean.mcp.v20260728;
018
019import static org.apache.juneau.commons.utils.Shorts.*;
020
021import java.util.*;
022
023import org.apache.juneau.marshall.*;
024
025/**
026 * One entry of an {@code input_required} pause's {@code inputRequests} map for an elicitation sub-request (MCP
027 * {@code 2026-07-28} SEP-2322), built by a {@code tools/call}/{@code prompts/get}/{@code resources/read} handler
028 * and placed via {@code org.apache.juneau.rest.server.mcp.v20260728.ElicitationRequests}.
029 *
030 * <p>
031 * {@link #getRequestedSchema()} is a restricted JSON Schema (see
032 * {@code org.apache.juneau.bean.mcp.v20260728.ElicitSchema}) describing the expected shape of the end user's
033 * answer; it permits only primitive-typed, non-nested top-level properties.
034 */
035@Marshalled
036public class ElicitRequest {
037
038   private String message;
039   private Map<String,Object> requestedSchema;
040
041   /**
042    * The prompt shown to the end user.
043    *
044    * @return The message, or {@code null} if not set.
045    */
046   public String getMessage() {
047      return message;
048   }
049
050   /**
051    * Sets the prompt shown to the end user.
052    *
053    * @param value The new value.  Can be <jk>null</jk> to unset the property.
054    * @return This object (for method chaining).
055    */
056   public ElicitRequest setMessage(String value) {
057      message = value;
058      return this;
059   }
060
061   /**
062    * The restricted JSON Schema describing the expected answer shape.
063    *
064    * @return An unmodifiable view of the schema, or {@code null} if not set.
065    */
066   public Map<String,Object> getRequestedSchema() {
067      return u(requestedSchema);
068   }
069
070   /**
071    * Sets the restricted JSON Schema describing the expected answer shape.
072    *
073    * @param value The new value, typically built via {@code ElicitSchema.create()....build()}.  Can be
074    *    <jk>null</jk> to unset the property.
075    * @return This object (for method chaining).
076    */
077   public ElicitRequest setRequestedSchema(Map<String,Object> value) {
078      requestedSchema = value;
079      return this;
080   }
081}