Class BetaAnalyticsUsageUsersItem.Actor
-
- All Implemented Interfaces:
public final class BetaAnalyticsUsageUsersItem.ActorThe user this row's usage or cost is attributed to. Always a
user_actor.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public interfaceBetaAnalyticsUsageUsersItem.Actor.VisitorAn interface that defines how to map each variant of Actor to a value of type T.
public final classBetaAnalyticsUsageUsersItem.Actor.Type
-
Method Summary
Modifier and Type Method Description final Optional<BetaAnalyticsUserActor>user()final Optional<JsonValue>_json()final BetaAnalyticsUsageUsersItem.Actor.Typetype()final BooleanisUser()final BetaAnalyticsUserActorasUser()final <T extends Any> Taccept(BetaAnalyticsUsageUsersItem.Actor.Visitor<T> visitor)Maps this instance's current variant to a value of type T using the given visitor. final BetaAnalyticsUsageUsersItem.Actorvalidate()Validates that the types of all values in this object match their expected types recursively. final BooleanisValid()Booleanequals(Object other)IntegerhashCode()StringtoString()final static BetaAnalyticsUsageUsersItem.ActorofUser(BetaAnalyticsUserActor user)-
-
Method Detail
-
user
final Optional<BetaAnalyticsUserActor> user()
-
type
final BetaAnalyticsUsageUsersItem.Actor.Type type()
-
asUser
final BetaAnalyticsUserActor asUser()
-
accept
final <T extends Any> T accept(BetaAnalyticsUsageUsersItem.Actor.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 = actor.accept(new Actor.Visitor<Optional<String>>() { @Override public Optional<String> visitUser(BetaAnalyticsUserActor user) { return Optional.of(user.toString()); } // ... @Override public Optional<String> unknown(JsonValue json) { // Or inspect the `json`. return Optional.empty(); } });
-
validate
final BetaAnalyticsUsageUsersItem.Actor 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.
-
ofUser
final static BetaAnalyticsUsageUsersItem.Actor ofUser(BetaAnalyticsUserActor user)
-
-
-
-