Class BetaManagedAgentsExecutionIdentity
-
- All Implemented Interfaces:
public final class BetaManagedAgentsExecutionIdentityExecution principal for runs of this agent as returned in API responses.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public interfaceBetaManagedAgentsExecutionIdentity.VisitorAn interface that defines how to map each variant of BetaManagedAgentsExecutionIdentity to a value of type T.
public final classBetaManagedAgentsExecutionIdentity.Type
-
Method Summary
Modifier and Type Method Description final Optional<BetaManagedAgentsAwsRoleExecutionIdentity>awsRole()An AWS IAM role principal as returned in API responses. final Optional<BetaManagedAgentsServiceAccountExecutionIdentity>serviceAccount()The Anthropic-managed service account as returned in API responses. final Optional<JsonValue>_json()final BetaManagedAgentsExecutionIdentity.Typetype()final BooleanisAwsRole()final BooleanisServiceAccount()final BetaManagedAgentsAwsRoleExecutionIdentityasAwsRole()An AWS IAM role principal as returned in API responses. final BetaManagedAgentsServiceAccountExecutionIdentityasServiceAccount()The Anthropic-managed service account as returned in API responses. final <T extends Any> Taccept(BetaManagedAgentsExecutionIdentity.Visitor<T> visitor)Maps this instance's current variant to a value of type T using the given visitor. final BetaManagedAgentsExecutionIdentityvalidate()Validates that the types of all values in this object match their expected types recursively. final BooleanisValid()Booleanequals(Object other)IntegerhashCode()StringtoString()final static BetaManagedAgentsExecutionIdentityofAwsRole(BetaManagedAgentsAwsRoleExecutionIdentity awsRole)An AWS IAM role principal as returned in API responses. final static BetaManagedAgentsExecutionIdentityofAwsRole(String roleArn)Returns an immutable instance of BetaManagedAgentsExecutionIdentity whose ofAwsRole variant is built from the given required roleArn. final static BetaManagedAgentsExecutionIdentityofServiceAccount(BetaManagedAgentsServiceAccountExecutionIdentity serviceAccount)The Anthropic-managed service account as returned in API responses. -
-
Method Detail
-
awsRole
final Optional<BetaManagedAgentsAwsRoleExecutionIdentity> awsRole()
An AWS IAM role principal as returned in API responses.
-
serviceAccount
final Optional<BetaManagedAgentsServiceAccountExecutionIdentity> serviceAccount()
The Anthropic-managed service account as returned in API responses.
-
type
final BetaManagedAgentsExecutionIdentity.Type type()
-
isServiceAccount
final Boolean isServiceAccount()
-
asAwsRole
final BetaManagedAgentsAwsRoleExecutionIdentity asAwsRole()
An AWS IAM role principal as returned in API responses.
-
asServiceAccount
final BetaManagedAgentsServiceAccountExecutionIdentity asServiceAccount()
The Anthropic-managed service account as returned in API responses.
-
accept
final <T extends Any> T accept(BetaManagedAgentsExecutionIdentity.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 = betaManagedAgentsExecutionIdentity.accept(new BetaManagedAgentsExecutionIdentity.Visitor<Optional<String>>() { @Override public Optional<String> visitAwsRole(BetaManagedAgentsAwsRoleExecutionIdentity awsRole) { return Optional.of(awsRole.toString()); } // ... @Override public Optional<String> unknown(JsonValue json) { // Or inspect the `json`. return Optional.empty(); } });
-
validate
final BetaManagedAgentsExecutionIdentity 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.
-
ofAwsRole
final static BetaManagedAgentsExecutionIdentity ofAwsRole(BetaManagedAgentsAwsRoleExecutionIdentity awsRole)
An AWS IAM role principal as returned in API responses.
-
ofAwsRole
final static BetaManagedAgentsExecutionIdentity ofAwsRole(String roleArn)
Returns an immutable instance of BetaManagedAgentsExecutionIdentity whose ofAwsRole variant is built from the given required roleArn.
-
ofServiceAccount
final static BetaManagedAgentsExecutionIdentity ofServiceAccount(BetaManagedAgentsServiceAccountExecutionIdentity serviceAccount)
The Anthropic-managed service account as returned in API responses.
-
-
-
-