Class RealtimeToolsConfigUnion.Mcp.AllowedTools
-
- All Implemented Interfaces:
public final class RealtimeToolsConfigUnion.Mcp.AllowedToolsList of allowed tool names or a filter object.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public interfaceRealtimeToolsConfigUnion.Mcp.AllowedTools.VisitorAn interface that defines how to map each variant of AllowedTools to a value of type T.
public final classRealtimeToolsConfigUnion.Mcp.AllowedTools.McpToolFilterA filter object to specify which tools are allowed.
-
Method Summary
Modifier and Type Method Description final Optional<List<String>>mcp()A string array of allowed tool names final Optional<RealtimeToolsConfigUnion.Mcp.AllowedTools.McpToolFilter>mcpToolFilter()A filter object to specify which tools are allowed. final BooleanisMcp()final BooleanisMcpToolFilter()final List<String>asMcp()A string array of allowed tool names final RealtimeToolsConfigUnion.Mcp.AllowedTools.McpToolFilterasMcpToolFilter()A filter object to specify which tools are allowed. final Optional<JsonValue>_json()final <T extends Any> Taccept(RealtimeToolsConfigUnion.Mcp.AllowedTools.Visitor<T> visitor)Maps this instance's current variant to a value of type T using the given visitor. final RealtimeToolsConfigUnion.Mcp.AllowedToolsvalidate()Validates that the types of all values in this object match their expected types recursively. final BooleanisValid()Booleanequals(Object other)IntegerhashCode()StringtoString()final static RealtimeToolsConfigUnion.Mcp.AllowedToolsofMcp(List<String> mcp)A string array of allowed tool names final static RealtimeToolsConfigUnion.Mcp.AllowedToolsofMcpToolFilter(RealtimeToolsConfigUnion.Mcp.AllowedTools.McpToolFilter mcpToolFilter)A filter object to specify which tools are allowed. -
-
Method Detail
-
mcpToolFilter
final Optional<RealtimeToolsConfigUnion.Mcp.AllowedTools.McpToolFilter> mcpToolFilter()
A filter object to specify which tools are allowed.
-
isMcpToolFilter
final Boolean isMcpToolFilter()
-
asMcpToolFilter
final RealtimeToolsConfigUnion.Mcp.AllowedTools.McpToolFilter asMcpToolFilter()
A filter object to specify which tools are allowed.
-
accept
final <T extends Any> T accept(RealtimeToolsConfigUnion.Mcp.AllowedTools.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 = allowedTools.accept(new AllowedTools.Visitor<Optional<String>>() { @Override public Optional<String> visitMcp(List<String> mcp) { return Optional.of(mcp.toString()); } // ... @Override public Optional<String> unknown(JsonValue json) { // Or inspect the `json`. return Optional.empty(); } });
-
validate
final RealtimeToolsConfigUnion.Mcp.AllowedTools 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.
-
ofMcp
final static RealtimeToolsConfigUnion.Mcp.AllowedTools ofMcp(List<String> mcp)
A string array of allowed tool names
-
ofMcpToolFilter
final static RealtimeToolsConfigUnion.Mcp.AllowedTools ofMcpToolFilter(RealtimeToolsConfigUnion.Mcp.AllowedTools.McpToolFilter mcpToolFilter)
A filter object to specify which tools are allowed.
-
-
-
-