Class BetaRbacRoleSource
-
- All Implemented Interfaces:
public final class BetaRbacRoleSource
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public interfaceBetaRbacRoleSource.VisitorAn interface that defines how to map each variant of BetaRbacRoleSource to a value of type T.
public final classBetaRbacRoleSource.Type
-
Method Summary
Modifier and Type Method Description final Optional<BetaRbacRoleSourceBuiltIn>builtIn()final Optional<BetaRbacRoleSourceCustom>custom()final Optional<JsonValue>_json()final BetaRbacRoleSource.Typetype()final BooleanisBuiltIn()final BooleanisCustom()final BetaRbacRoleSourceBuiltInasBuiltIn()final BetaRbacRoleSourceCustomasCustom()final <T extends Any> Taccept(BetaRbacRoleSource.Visitor<T> visitor)Maps this instance's current variant to a value of type T using the given visitor. final BetaRbacRoleSourcevalidate()Validates that the types of all values in this object match their expected types recursively. final BooleanisValid()Booleanequals(Object other)IntegerhashCode()StringtoString()final static BetaRbacRoleSourceofBuiltIn(BetaRbacRoleSourceBuiltIn builtIn)final static BetaRbacRoleSourceofCustom(BetaRbacRoleSourceCustom custom)-
-
Method Detail
-
builtIn
final Optional<BetaRbacRoleSourceBuiltIn> builtIn()
-
custom
final Optional<BetaRbacRoleSourceCustom> custom()
-
type
final BetaRbacRoleSource.Type type()
-
asBuiltIn
final BetaRbacRoleSourceBuiltIn asBuiltIn()
-
asCustom
final BetaRbacRoleSourceCustom asCustom()
-
accept
final <T extends Any> T accept(BetaRbacRoleSource.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 = betaRbacRoleSource.accept(new BetaRbacRoleSource.Visitor<Optional<String>>() { @Override public Optional<String> visitBuiltIn(BetaRbacRoleSourceBuiltIn builtIn) { return Optional.of(builtIn.toString()); } // ... @Override public Optional<String> unknown(JsonValue json) { // Or inspect the `json`. return Optional.empty(); } });
-
validate
final BetaRbacRoleSource 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.
-
ofBuiltIn
final static BetaRbacRoleSource ofBuiltIn(BetaRbacRoleSourceBuiltIn builtIn)
-
ofCustom
final static BetaRbacRoleSource ofCustom(BetaRbacRoleSourceCustom custom)
-
-
-
-