Class UserProfileEnforcementAction
-
- All Implemented Interfaces:
public final class UserProfileEnforcementActionA limit Anthropic has placed on the entity this profile represents and not yet resolved, discriminated by
type:restrictionorban. More types may be added; read atypeyou do not recognize asrestriction.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public interfaceUserProfileEnforcementAction.VisitorAn interface that defines how to map each variant of UserProfileEnforcementAction to a value of type T.
public final classUserProfileEnforcementAction.Type
-
Method Summary
Modifier and Type Method Description final Optional<UserProfileEnforcementActionRestriction>restriction()Anthropic has limited how it serves the end user until the action is resolved. final Optional<UserProfileEnforcementActionBan>ban()Anthropic has stopped serving the end user where the ban applies and does not plan to serve them there again. final Optional<JsonValue>_json()final UserProfileEnforcementAction.Typetype()final Stringid()final Optional<UserProfileEnforcementActionNextStep>action()final Optional<OffsetDateTime>expiresAt()final OffsetDateTimeopenedAt()final UserProfileEnforcementActionReasonreason()final BooleanisRestriction()final BooleanisBan()final UserProfileEnforcementActionRestrictionasRestriction()Anthropic has limited how it serves the end user until the action is resolved. final UserProfileEnforcementActionBanasBan()Anthropic has stopped serving the end user where the ban applies and does not plan to serve them there again. final <T extends Any> Taccept(UserProfileEnforcementAction.Visitor<T> visitor)Maps this instance's current variant to a value of type T using the given visitor. final UserProfileEnforcementActionvalidate()Validates that the types of all values in this object match their expected types recursively. final BooleanisValid()Booleanequals(Object other)IntegerhashCode()StringtoString()final static UserProfileEnforcementActionofRestriction(UserProfileEnforcementActionRestriction restriction)Anthropic has limited how it serves the end user until the action is resolved. final static UserProfileEnforcementActionofBan(UserProfileEnforcementActionBan ban)Anthropic has stopped serving the end user where the ban applies and does not plan to serve them there again. -
-
Method Detail
-
restriction
final Optional<UserProfileEnforcementActionRestriction> restriction()
Anthropic has limited how it serves the end user until the action is resolved. The end user may still be served in part.
-
ban
final Optional<UserProfileEnforcementActionBan> ban()
Anthropic has stopped serving the end user where the ban applies and does not plan to serve them there again.
-
type
final UserProfileEnforcementAction.Type type()
-
action
final Optional<UserProfileEnforcementActionNextStep> action()
-
expiresAt
final Optional<OffsetDateTime> expiresAt()
-
openedAt
final OffsetDateTime openedAt()
-
reason
final UserProfileEnforcementActionReason reason()
-
isRestriction
final Boolean isRestriction()
-
asRestriction
final UserProfileEnforcementActionRestriction asRestriction()
Anthropic has limited how it serves the end user until the action is resolved. The end user may still be served in part.
-
asBan
final UserProfileEnforcementActionBan asBan()
Anthropic has stopped serving the end user where the ban applies and does not plan to serve them there again.
-
accept
final <T extends Any> T accept(UserProfileEnforcementAction.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 = userProfileEnforcementAction.accept(new UserProfileEnforcementAction.Visitor<Optional<String>>() { @Override public Optional<String> visitRestriction(UserProfileEnforcementActionRestriction restriction) { return Optional.of(restriction.toString()); } // ... @Override public Optional<String> unknown(JsonValue json) { // Or inspect the `json`. return Optional.empty(); } });
-
validate
final UserProfileEnforcementAction 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.
-
ofRestriction
final static UserProfileEnforcementAction ofRestriction(UserProfileEnforcementActionRestriction restriction)
Anthropic has limited how it serves the end user until the action is resolved. The end user may still be served in part.
-
ofBan
final static UserProfileEnforcementAction ofBan(UserProfileEnforcementActionBan ban)
Anthropic has stopped serving the end user where the ban applies and does not plan to serve them there again.
-
-
-
-