Class BetaAnalyticsCostUsersItem.Actor
-
- All Implemented Interfaces:
public final class BetaAnalyticsCostUsersItem.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 interfaceBetaAnalyticsCostUsersItem.Actor.VisitorAn interface that defines how to map each variant of Actor to a value of type T.
public final classBetaAnalyticsCostUsersItem.Actor.Type
-
Method Summary
Modifier and Type Method Description final Optional<BetaAnalyticsUserActor>user()final Optional<JsonValue>_json()final BetaAnalyticsCostUsersItem.Actor.Typetype()final BooleanisUser()final BetaAnalyticsUserActorasUser()final <T extends Any> Taccept(BetaAnalyticsCostUsersItem.Actor.Visitor<T> visitor)Maps this instance's current variant to a value of type T using the given visitor. final BetaAnalyticsCostUsersItem.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 BetaAnalyticsCostUsersItem.ActorofUser(BetaAnalyticsUserActor user)-
-
Method Detail
-
user
final Optional<BetaAnalyticsUserActor> user()
-
type
final BetaAnalyticsCostUsersItem.Actor.Type type()
-
asUser
final BetaAnalyticsUserActor asUser()
-
accept
final <T extends Any> T accept(BetaAnalyticsCostUsersItem.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 BetaAnalyticsCostUsersItem.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 BetaAnalyticsCostUsersItem.Actor ofUser(BetaAnalyticsUserActor user)
-
-
-
-