Class BetaManagedAgentsCredential.Auth
-
- All Implemented Interfaces:
public final class BetaManagedAgentsCredential.AuthAuthentication details for a credential.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public interfaceBetaManagedAgentsCredential.Auth.VisitorAn interface that defines how to map each variant of Auth to a value of type T.
-
Method Summary
Modifier and Type Method Description final Optional<BetaManagedAgentsMcpOAuthAuthResponse>mcpOAuth()OAuth credential details for an MCP server. final Optional<BetaManagedAgentsStaticBearerAuthResponse>staticBearer()Static bearer token credential details for an MCP server. final Optional<BetaManagedAgentsEnvironmentVariableAuthResponse>environmentVariable()Environment variable credential details. final BooleanisMcpOAuth()final BooleanisStaticBearer()final BooleanisEnvironmentVariable()final BetaManagedAgentsMcpOAuthAuthResponseasMcpOAuth()OAuth credential details for an MCP server. final BetaManagedAgentsStaticBearerAuthResponseasStaticBearer()Static bearer token credential details for an MCP server. final BetaManagedAgentsEnvironmentVariableAuthResponseasEnvironmentVariable()Environment variable credential details. final Optional<JsonValue>_json()final <T extends Any> Taccept(BetaManagedAgentsCredential.Auth.Visitor<T> visitor)Maps this instance's current variant to a value of type T using the given visitor. final BetaManagedAgentsCredential.Authvalidate()Validates that the types of all values in this object match their expected types recursively. final BooleanisValid()Booleanequals(Object other)IntegerhashCode()StringtoString()final static BetaManagedAgentsCredential.AuthofMcpOAuth(BetaManagedAgentsMcpOAuthAuthResponse mcpOAuth)OAuth credential details for an MCP server. final static BetaManagedAgentsCredential.AuthofStaticBearer(BetaManagedAgentsStaticBearerAuthResponse staticBearer)Static bearer token credential details for an MCP server. final static BetaManagedAgentsCredential.AuthofEnvironmentVariable(BetaManagedAgentsEnvironmentVariableAuthResponse environmentVariable)Environment variable credential details. -
-
Method Detail
-
mcpOAuth
final Optional<BetaManagedAgentsMcpOAuthAuthResponse> mcpOAuth()
OAuth credential details for an MCP server.
-
staticBearer
final Optional<BetaManagedAgentsStaticBearerAuthResponse> staticBearer()
Static bearer token credential details for an MCP server.
-
environmentVariable
final Optional<BetaManagedAgentsEnvironmentVariableAuthResponse> environmentVariable()
Environment variable credential details. The secret value is never returned.
-
isMcpOAuth
final Boolean isMcpOAuth()
-
isStaticBearer
final Boolean isStaticBearer()
-
isEnvironmentVariable
final Boolean isEnvironmentVariable()
-
asMcpOAuth
final BetaManagedAgentsMcpOAuthAuthResponse asMcpOAuth()
OAuth credential details for an MCP server.
-
asStaticBearer
final BetaManagedAgentsStaticBearerAuthResponse asStaticBearer()
Static bearer token credential details for an MCP server.
-
asEnvironmentVariable
final BetaManagedAgentsEnvironmentVariableAuthResponse asEnvironmentVariable()
Environment variable credential details. The secret value is never returned.
-
accept
final <T extends Any> T accept(BetaManagedAgentsCredential.Auth.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.anthropic.core.JsonValue; import java.util.Optional; Optional<String> result = auth.accept(new Auth.Visitor<Optional<String>>() { @Override public Optional<String> visitMcpOAuth(BetaManagedAgentsMcpOAuthAuthResponse mcpOAuth) { return Optional.of(mcpOAuth.toString()); } // ... @Override public Optional<String> unknown(JsonValue json) { // Or inspect the `json`. return Optional.empty(); } });
-
validate
final BetaManagedAgentsCredential.Auth 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.
-
ofMcpOAuth
final static BetaManagedAgentsCredential.Auth ofMcpOAuth(BetaManagedAgentsMcpOAuthAuthResponse mcpOAuth)
OAuth credential details for an MCP server.
-
ofStaticBearer
final static BetaManagedAgentsCredential.Auth ofStaticBearer(BetaManagedAgentsStaticBearerAuthResponse staticBearer)
Static bearer token credential details for an MCP server.
-
ofEnvironmentVariable
final static BetaManagedAgentsCredential.Auth ofEnvironmentVariable(BetaManagedAgentsEnvironmentVariableAuthResponse environmentVariable)
Environment variable credential details. The secret value is never returned.
-
-
-
-