Class BetaManagedAgentsActor
-
- All Implemented Interfaces:
public final class BetaManagedAgentsActorIdentifies who performed an operation. Recorded when the operation happens and not updated afterwards, so the ID may refer to a user, service account, API key, or session that has since been deleted.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public interfaceBetaManagedAgentsActor.VisitorAn interface that defines how to map each variant of BetaManagedAgentsActor to a value of type T.
public final classBetaManagedAgentsActor.Type
-
Method Summary
Modifier and Type Method Description final Optional<BetaManagedAgentsSessionActor>session()An agent acting during a session, for example through the session's mounted filesystem. final Optional<BetaManagedAgentsApiActor>api()A direct caller of the public API, identified by the API key that authenticated the request. final Optional<BetaManagedAgentsUserActor>user()A human user, for example acting through the Anthropic Console. final Optional<BetaManagedAgentsServiceAccountActor>serviceAccount()A workload authenticated as a service account, for example via Workload Identity Federation. final Optional<JsonValue>_json()final BetaManagedAgentsActor.Typetype()final BooleanisSession()final BooleanisApi()final BooleanisUser()final BooleanisServiceAccount()final BetaManagedAgentsSessionActorasSession()An agent acting during a session, for example through the session's mounted filesystem. final BetaManagedAgentsApiActorasApi()A direct caller of the public API, identified by the API key that authenticated the request. final BetaManagedAgentsUserActorasUser()A human user, for example acting through the Anthropic Console. final BetaManagedAgentsServiceAccountActorasServiceAccount()A workload authenticated as a service account, for example via Workload Identity Federation. final <T extends Any> Taccept(BetaManagedAgentsActor.Visitor<T> visitor)Maps this instance's current variant to a value of type T using the given visitor. final BetaManagedAgentsActorvalidate()Validates that the types of all values in this object match their expected types recursively. final BooleanisValid()Booleanequals(Object other)IntegerhashCode()StringtoString()final static BetaManagedAgentsActorofSession(BetaManagedAgentsSessionActor session)An agent acting during a session, for example through the session's mounted filesystem. final static BetaManagedAgentsActorofSession(String sessionId)Returns an immutable instance of BetaManagedAgentsActor whose ofSession variant is built from the given required sessionId. final static BetaManagedAgentsActorofApi(BetaManagedAgentsApiActor api)A direct caller of the public API, identified by the API key that authenticated the request. final static BetaManagedAgentsActorofApi(String apiKeyId)Returns an immutable instance of BetaManagedAgentsActor whose ofApi variant is built from the given required apiKeyId. final static BetaManagedAgentsActorofUser(BetaManagedAgentsUserActor user)A human user, for example acting through the Anthropic Console. final static BetaManagedAgentsActorofUser(String userId)Returns an immutable instance of BetaManagedAgentsActor whose ofUser variant is built from the given required userId. final static BetaManagedAgentsActorofServiceAccount(BetaManagedAgentsServiceAccountActor serviceAccount)A workload authenticated as a service account, for example via Workload Identity Federation. final static BetaManagedAgentsActorofServiceAccount(String serviceAccountId)Returns an immutable instance of BetaManagedAgentsActor whose ofServiceAccount variant is built from the given required serviceAccountId. -
-
Method Detail
-
session
final Optional<BetaManagedAgentsSessionActor> session()
An agent acting during a session, for example through the session's mounted filesystem. It names the session itself, not the user or API key that started the session.
-
api
final Optional<BetaManagedAgentsApiActor> api()
A direct caller of the public API, identified by the API key that authenticated the request.
-
user
final Optional<BetaManagedAgentsUserActor> user()
A human user, for example acting through the Anthropic Console.
-
serviceAccount
final Optional<BetaManagedAgentsServiceAccountActor> serviceAccount()
A workload authenticated as a service account, for example via Workload Identity Federation.
-
type
final BetaManagedAgentsActor.Type type()
-
isServiceAccount
final Boolean isServiceAccount()
-
asSession
final BetaManagedAgentsSessionActor asSession()
An agent acting during a session, for example through the session's mounted filesystem. It names the session itself, not the user or API key that started the session.
-
asApi
final BetaManagedAgentsApiActor asApi()
A direct caller of the public API, identified by the API key that authenticated the request.
-
asUser
final BetaManagedAgentsUserActor asUser()
A human user, for example acting through the Anthropic Console.
-
asServiceAccount
final BetaManagedAgentsServiceAccountActor asServiceAccount()
A workload authenticated as a service account, for example via Workload Identity Federation.
-
accept
final <T extends Any> T accept(BetaManagedAgentsActor.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 = betaManagedAgentsActor.accept(new BetaManagedAgentsActor.Visitor<Optional<String>>() { @Override public Optional<String> visitSession(BetaManagedAgentsSessionActor session) { return Optional.of(session.toString()); } // ... @Override public Optional<String> unknown(JsonValue json) { // Or inspect the `json`. return Optional.empty(); } });
-
validate
final BetaManagedAgentsActor 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.
-
ofSession
final static BetaManagedAgentsActor ofSession(BetaManagedAgentsSessionActor session)
An agent acting during a session, for example through the session's mounted filesystem. It names the session itself, not the user or API key that started the session.
-
ofSession
final static BetaManagedAgentsActor ofSession(String sessionId)
Returns an immutable instance of BetaManagedAgentsActor whose ofSession variant is built from the given required sessionId.
-
ofApi
final static BetaManagedAgentsActor ofApi(BetaManagedAgentsApiActor api)
A direct caller of the public API, identified by the API key that authenticated the request.
-
ofApi
final static BetaManagedAgentsActor ofApi(String apiKeyId)
Returns an immutable instance of BetaManagedAgentsActor whose ofApi variant is built from the given required apiKeyId.
-
ofUser
final static BetaManagedAgentsActor ofUser(BetaManagedAgentsUserActor user)
A human user, for example acting through the Anthropic Console.
-
ofUser
final static BetaManagedAgentsActor ofUser(String userId)
Returns an immutable instance of BetaManagedAgentsActor whose ofUser variant is built from the given required userId.
-
ofServiceAccount
final static BetaManagedAgentsActor ofServiceAccount(BetaManagedAgentsServiceAccountActor serviceAccount)
A workload authenticated as a service account, for example via Workload Identity Federation.
-
ofServiceAccount
final static BetaManagedAgentsActor ofServiceAccount(String serviceAccountId)
Returns an immutable instance of BetaManagedAgentsActor whose ofServiceAccount variant is built from the given required serviceAccountId.
-
-
-
-