Class UserProfileAction
-
- All Implemented Interfaces:
public final class UserProfileActionThe action that the person who opens the URL takes, discriminated by
type.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public interfaceUserProfileAction.VisitorAn interface that defines how to map each variant of UserProfileAction to a value of type T.
public final classUserProfileAction.Type
-
Method Summary
Modifier and Type Method Description final Optional<UserProfileEnrollEndUserAction>enrollEndUser()The end-user that the profile represents enrolls in a program. final Optional<JsonValue>_json()final UserProfileAction.Typetype()final BooleanisEnrollEndUser()final UserProfileEnrollEndUserActionasEnrollEndUser()The end-user that the profile represents enrolls in a program. final <T extends Any> Taccept(UserProfileAction.Visitor<T> visitor)Maps this instance's current variant to a value of type T using the given visitor. final UserProfileActionvalidate()Validates that the types of all values in this object match their expected types recursively. final BooleanisValid()Booleanequals(Object other)IntegerhashCode()StringtoString()final static UserProfileActionofEnrollEndUser(UserProfileEnrollEndUserAction enrollEndUser)The end-user that the profile represents enrolls in a program. -
-
Method Detail
-
enrollEndUser
final Optional<UserProfileEnrollEndUserAction> enrollEndUser()
The end-user that the profile represents enrolls in a program.
-
type
final UserProfileAction.Type type()
-
isEnrollEndUser
final Boolean isEnrollEndUser()
-
asEnrollEndUser
final UserProfileEnrollEndUserAction asEnrollEndUser()
The end-user that the profile represents enrolls in a program.
-
accept
final <T extends Any> T accept(UserProfileAction.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 = userProfileAction.accept(new UserProfileAction.Visitor<Optional<String>>() { @Override public Optional<String> visitEnrollEndUser(UserProfileEnrollEndUserAction enrollEndUser) { return Optional.of(enrollEndUser.toString()); } // ... @Override public Optional<String> unknown(JsonValue json) { // Or inspect the `json`. return Optional.empty(); } });
-
validate
final UserProfileAction 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.
-
ofEnrollEndUser
final static UserProfileAction ofEnrollEndUser(UserProfileEnrollEndUserAction enrollEndUser)
The end-user that the profile represents enrolls in a program.
-
-
-
-