Class RealtimeResponseCreateMcpTool.RequireApproval
-
- All Implemented Interfaces:
public final class RealtimeResponseCreateMcpTool.RequireApprovalSpecify which of the MCP server's tools require approval.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public interfaceRealtimeResponseCreateMcpTool.RequireApproval.VisitorAn interface that defines how to map each variant of RequireApproval to a value of type T.
public final classRealtimeResponseCreateMcpTool.RequireApproval.McpToolApprovalFilterSpecify which of the MCP server's tools require approval. Can be
always,never, or a filter object associated with tools that require approval.public final classRealtimeResponseCreateMcpTool.RequireApproval.McpToolApprovalSettingSpecify a single approval policy for all tools. One of
alwaysornever. When set toalways, all tools will require approval. When set tonever, all tools will not require approval.
-
Method Summary
-
-
Method Detail
-
mcpToolApprovalFilter
final Optional<RealtimeResponseCreateMcpTool.RequireApproval.McpToolApprovalFilter> mcpToolApprovalFilter()
Specify which of the MCP server's tools require approval. Can be
always,never, or a filter object associated with tools that require approval.
-
mcpToolApprovalSetting
final Optional<RealtimeResponseCreateMcpTool.RequireApproval.McpToolApprovalSetting> mcpToolApprovalSetting()
Specify a single approval policy for all tools. One of
alwaysornever. When set toalways, all tools will require approval. When set tonever, all tools will not require approval.
-
isMcpToolApprovalFilter
final Boolean isMcpToolApprovalFilter()
-
isMcpToolApprovalSetting
final Boolean isMcpToolApprovalSetting()
-
asMcpToolApprovalFilter
final RealtimeResponseCreateMcpTool.RequireApproval.McpToolApprovalFilter asMcpToolApprovalFilter()
Specify which of the MCP server's tools require approval. Can be
always,never, or a filter object associated with tools that require approval.
-
asMcpToolApprovalSetting
final RealtimeResponseCreateMcpTool.RequireApproval.McpToolApprovalSetting asMcpToolApprovalSetting()
Specify a single approval policy for all tools. One of
alwaysornever. When set toalways, all tools will require approval. When set tonever, all tools will not require approval.
-
accept
final <T extends Any> T accept(RealtimeResponseCreateMcpTool.RequireApproval.Visitor<T> visitor)
Maps this instance's current variant to a value of type T using the given visitor.
Note that this method is not forwards compatible with new variants from the API, unless visitor overrides Visitor.unknown. To handle variants not known to this version of the SDK gracefully, consider overriding Visitor.unknown:
import com.openai.core.JsonValue; import java.util.Optional; Optional<String> result = requireApproval.accept(new RequireApproval.Visitor<Optional<String>>() { @Override public Optional<String> visitMcpToolApprovalFilter(McpToolApprovalFilter mcpToolApprovalFilter) { return Optional.of(mcpToolApprovalFilter.toString()); } // ... @Override public Optional<String> unknown(JsonValue json) { // Or inspect the `json`. return Optional.empty(); } });
-
validate
final RealtimeResponseCreateMcpTool.RequireApproval validate()
Validates that the types of all values in this object match their expected types recursively.
This method is not forwards compatible with new types from the API for existing fields.
-
ofMcpToolApprovalFilter
final static RealtimeResponseCreateMcpTool.RequireApproval ofMcpToolApprovalFilter(RealtimeResponseCreateMcpTool.RequireApproval.McpToolApprovalFilter mcpToolApprovalFilter)
Specify which of the MCP server's tools require approval. Can be
always,never, or a filter object associated with tools that require approval.
-
ofMcpToolApprovalSetting
final static RealtimeResponseCreateMcpTool.RequireApproval ofMcpToolApprovalSetting(RealtimeResponseCreateMcpTool.RequireApproval.McpToolApprovalSetting mcpToolApprovalSetting)
Specify a single approval policy for all tools. One of
alwaysornever. When set toalways, all tools will require approval. When set tonever, all tools will not require approval.
-
-
-
-