Class RealtimeSessionCreateResponse.Tool.McpTool.RequireApproval
-
- All Implemented Interfaces:
public final class RealtimeSessionCreateResponse.Tool.McpTool.RequireApprovalSpecify which of the MCP server's tools require approval.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public interfaceRealtimeSessionCreateResponse.Tool.McpTool.RequireApproval.VisitorAn interface that defines how to map each variant of RequireApproval to a value of type T.
public final classRealtimeSessionCreateResponse.Tool.McpTool.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 classRealtimeSessionCreateResponse.Tool.McpTool.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<RealtimeSessionCreateResponse.Tool.McpTool.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<RealtimeSessionCreateResponse.Tool.McpTool.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 RealtimeSessionCreateResponse.Tool.McpTool.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 RealtimeSessionCreateResponse.Tool.McpTool.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(RealtimeSessionCreateResponse.Tool.McpTool.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 RealtimeSessionCreateResponse.Tool.McpTool.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 RealtimeSessionCreateResponse.Tool.McpTool.RequireApproval ofMcpToolApprovalFilter(RealtimeSessionCreateResponse.Tool.McpTool.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 RealtimeSessionCreateResponse.Tool.McpTool.RequireApproval ofMcpToolApprovalSetting(RealtimeSessionCreateResponse.Tool.McpTool.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.
-
-
-
-