Class BetaManagedAgentsAgentAutoEvaluatedPermission
-
- All Implemented Interfaces:
public final class BetaManagedAgentsAgentAutoEvaluatedPermissionThe server's per-invocation judgement under the auto permission policy. Its type always equals the event's top-level evaluated_permission. Open union: clients must tolerate unknown variants.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public interfaceBetaManagedAgentsAgentAutoEvaluatedPermission.VisitorAn interface that defines how to map each variant of BetaManagedAgentsAgentAutoEvaluatedPermission to a value of type T.
public final classBetaManagedAgentsAgentAutoEvaluatedPermission.Type
-
Method Summary
Modifier and Type Method Description final Optional<BetaManagedAgentsAgentAutoEvaluatedPermissionAllow>allow()The server judged the invocation safe to execute without client approval. final Optional<BetaManagedAgentsAgentAutoEvaluatedPermissionAsk>ask()The server reached no judgement; the invocation is held for client approval. final Optional<BetaManagedAgentsAgentAutoEvaluatedPermissionDeny>deny()The server judged the invocation high-risk, or reached no judgement and did not hold it for client approval (for example, because the organization is out of credits or has reached a spend limit); it does not execute and a synthetic error tool result is appended. final Optional<JsonValue>_json()final BetaManagedAgentsAgentAutoEvaluatedPermission.Typetype()final Optional<String>reasonCode()final BooleanisAllow()final BooleanisAsk()final BooleanisDeny()final BetaManagedAgentsAgentAutoEvaluatedPermissionAllowasAllow()The server judged the invocation safe to execute without client approval. final BetaManagedAgentsAgentAutoEvaluatedPermissionAskasAsk()The server reached no judgement; the invocation is held for client approval. final BetaManagedAgentsAgentAutoEvaluatedPermissionDenyasDeny()The server judged the invocation high-risk, or reached no judgement and did not hold it for client approval (for example, because the organization is out of credits or has reached a spend limit); it does not execute and a synthetic error tool result is appended. final <T extends Any> Taccept(BetaManagedAgentsAgentAutoEvaluatedPermission.Visitor<T> visitor)Maps this instance's current variant to a value of type T using the given visitor. final BetaManagedAgentsAgentAutoEvaluatedPermissionvalidate()Validates that the types of all values in this object match their expected types recursively. final BooleanisValid()Booleanequals(Object other)IntegerhashCode()StringtoString()final static BetaManagedAgentsAgentAutoEvaluatedPermissionofAllow(BetaManagedAgentsAgentAutoEvaluatedPermissionAllow allow)The server judged the invocation safe to execute without client approval. final static BetaManagedAgentsAgentAutoEvaluatedPermissionofAsk(BetaManagedAgentsAgentAutoEvaluatedPermissionAsk ask)The server reached no judgement; the invocation is held for client approval. final static BetaManagedAgentsAgentAutoEvaluatedPermissionofAsk(String reasonCode)Returns an immutable instance of BetaManagedAgentsAgentAutoEvaluatedPermission whose ofAsk variant is built from the given required reasonCode. final static BetaManagedAgentsAgentAutoEvaluatedPermissionofDeny(BetaManagedAgentsAgentAutoEvaluatedPermissionDeny deny)The server judged the invocation high-risk, or reached no judgement and did not hold it for client approval (for example, because the organization is out of credits or has reached a spend limit); it does not execute and a synthetic error tool result is appended. final static BetaManagedAgentsAgentAutoEvaluatedPermissionofDeny(String reasonCode)Returns an immutable instance of BetaManagedAgentsAgentAutoEvaluatedPermission whose ofDeny variant is built from the given required reasonCode. -
-
Method Detail
-
allow
final Optional<BetaManagedAgentsAgentAutoEvaluatedPermissionAllow> allow()
The server judged the invocation safe to execute without client approval.
-
ask
final Optional<BetaManagedAgentsAgentAutoEvaluatedPermissionAsk> ask()
The server reached no judgement; the invocation is held for client approval.
-
deny
final Optional<BetaManagedAgentsAgentAutoEvaluatedPermissionDeny> deny()
The server judged the invocation high-risk, or reached no judgement and did not hold it for client approval (for example, because the organization is out of credits or has reached a spend limit); it does not execute and a synthetic error tool result is appended.
-
type
final BetaManagedAgentsAgentAutoEvaluatedPermission.Type type()
-
reasonCode
final Optional<String> reasonCode()
-
asAllow
final BetaManagedAgentsAgentAutoEvaluatedPermissionAllow asAllow()
The server judged the invocation safe to execute without client approval.
-
asAsk
final BetaManagedAgentsAgentAutoEvaluatedPermissionAsk asAsk()
The server reached no judgement; the invocation is held for client approval.
-
asDeny
final BetaManagedAgentsAgentAutoEvaluatedPermissionDeny asDeny()
The server judged the invocation high-risk, or reached no judgement and did not hold it for client approval (for example, because the organization is out of credits or has reached a spend limit); it does not execute and a synthetic error tool result is appended.
-
accept
final <T extends Any> T accept(BetaManagedAgentsAgentAutoEvaluatedPermission.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 = betaManagedAgentsAgentAutoEvaluatedPermission.accept(new BetaManagedAgentsAgentAutoEvaluatedPermission.Visitor<Optional<String>>() { @Override public Optional<String> visitAllow(BetaManagedAgentsAgentAutoEvaluatedPermissionAllow allow) { return Optional.of(allow.toString()); } // ... @Override public Optional<String> unknown(JsonValue json) { // Or inspect the `json`. return Optional.empty(); } });
-
validate
final BetaManagedAgentsAgentAutoEvaluatedPermission 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.
-
ofAllow
final static BetaManagedAgentsAgentAutoEvaluatedPermission ofAllow(BetaManagedAgentsAgentAutoEvaluatedPermissionAllow allow)
The server judged the invocation safe to execute without client approval.
-
ofAsk
final static BetaManagedAgentsAgentAutoEvaluatedPermission ofAsk(BetaManagedAgentsAgentAutoEvaluatedPermissionAsk ask)
The server reached no judgement; the invocation is held for client approval.
-
ofAsk
final static BetaManagedAgentsAgentAutoEvaluatedPermission ofAsk(String reasonCode)
Returns an immutable instance of BetaManagedAgentsAgentAutoEvaluatedPermission whose ofAsk variant is built from the given required reasonCode.
-
ofDeny
final static BetaManagedAgentsAgentAutoEvaluatedPermission ofDeny(BetaManagedAgentsAgentAutoEvaluatedPermissionDeny deny)
The server judged the invocation high-risk, or reached no judgement and did not hold it for client approval (for example, because the organization is out of credits or has reached a spend limit); it does not execute and a synthetic error tool result is appended.
-
ofDeny
final static BetaManagedAgentsAgentAutoEvaluatedPermission ofDeny(String reasonCode)
Returns an immutable instance of BetaManagedAgentsAgentAutoEvaluatedPermission whose ofDeny variant is built from the given required reasonCode.
-
-
-
-