Class BetaSpendLimit.Scope
-
- All Implemented Interfaces:
public final class BetaSpendLimit.ScopeWhat the limit applies to. A tagged union on
type; each variant carries the identifier for its scope.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public interfaceBetaSpendLimit.Scope.VisitorAn interface that defines how to map each variant of Scope to a value of type T.
public final classBetaSpendLimit.Scope.Type
-
Method Summary
Modifier and Type Method Description final Optional<BetaSpendLimitUserScope>user()Scope selecting a single member of the organization. final Optional<BetaSpendLimitSeatTierScope>seatTier()final Optional<BetaSpendLimitRbacGroupScope>rbacGroup()final Optional<BetaSpendLimitOrganizationServiceScope>organizationService()final Optional<BetaSpendLimitOrganizationScope>organization()final Optional<BetaSpendLimitWorkspaceScope>workspace()Scope selecting one workspace of a Claude Console organization. final Optional<BetaSpendLimitUsageTierScope>usageTier()Scope of the monthly spend cap Anthropic sets for a Claude Console organization from its usage tier, or a higher cap Anthropic granted the organization. final Optional<JsonValue>_json()final BetaSpendLimit.Scope.Typetype()final BooleanisUser()final BooleanisSeatTier()final BooleanisRbacGroup()final BooleanisOrganizationService()final BooleanisOrganization()final BooleanisWorkspace()final BooleanisUsageTier()final BetaSpendLimitUserScopeasUser()Scope selecting a single member of the organization. final BetaSpendLimitSeatTierScopeasSeatTier()final BetaSpendLimitRbacGroupScopeasRbacGroup()final BetaSpendLimitOrganizationServiceScopeasOrganizationService()final BetaSpendLimitOrganizationScopeasOrganization()final BetaSpendLimitWorkspaceScopeasWorkspace()Scope selecting one workspace of a Claude Console organization. final BetaSpendLimitUsageTierScopeasUsageTier()Scope of the monthly spend cap Anthropic sets for a Claude Console organization from its usage tier, or a higher cap Anthropic granted the organization. final <T extends Any> Taccept(BetaSpendLimit.Scope.Visitor<T> visitor)Maps this instance's current variant to a value of type T using the given visitor. final BetaSpendLimit.Scopevalidate()Validates that the types of all values in this object match their expected types recursively. final BooleanisValid()Booleanequals(Object other)IntegerhashCode()StringtoString()final static BetaSpendLimit.ScopeofUser(BetaSpendLimitUserScope user)Scope selecting a single member of the organization. final static BetaSpendLimit.ScopeofUser(String userId)Returns an immutable instance of Scope whose ofUser variant is built from the given required userId. final static BetaSpendLimit.ScopeofSeatTier(BetaSpendLimitSeatTierScope seatTier)final static BetaSpendLimit.ScopeofSeatTier(String seatTier)Returns an immutable instance of Scope whose ofSeatTier variant is built from the given required seatTier. final static BetaSpendLimit.ScopeofRbacGroup(BetaSpendLimitRbacGroupScope rbacGroup)final static BetaSpendLimit.ScopeofRbacGroup(String rbacGroupId)Returns an immutable instance of Scope whose ofRbacGroup variant is built from the given required rbacGroupId. final static BetaSpendLimit.ScopeofOrganizationService(BetaSpendLimitOrganizationServiceScope organizationService)final static BetaSpendLimit.ScopeofOrganizationService(String service)Returns an immutable instance of Scope whose ofOrganizationService variant is built from the given required service. final static BetaSpendLimit.ScopeofOrganization(BetaSpendLimitOrganizationScope organization)final static BetaSpendLimit.ScopeofWorkspace(BetaSpendLimitWorkspaceScope workspace)Scope selecting one workspace of a Claude Console organization. final static BetaSpendLimit.ScopeofWorkspace(String workspaceId)Returns an immutable instance of Scope whose ofWorkspace variant is built from the given required workspaceId. final static BetaSpendLimit.ScopeofUsageTier(BetaSpendLimitUsageTierScope usageTier)Scope of the monthly spend cap Anthropic sets for a Claude Console organization from its usage tier, or a higher cap Anthropic granted the organization. -
-
Method Detail
-
user
final Optional<BetaSpendLimitUserScope> user()
Scope selecting a single member of the organization.
-
seatTier
final Optional<BetaSpendLimitSeatTierScope> seatTier()
-
rbacGroup
final Optional<BetaSpendLimitRbacGroupScope> rbacGroup()
-
organizationService
final Optional<BetaSpendLimitOrganizationServiceScope> organizationService()
-
organization
final Optional<BetaSpendLimitOrganizationScope> organization()
-
workspace
final Optional<BetaSpendLimitWorkspaceScope> workspace()
Scope selecting one workspace of a Claude Console organization.
-
usageTier
final Optional<BetaSpendLimitUsageTierScope> usageTier()
Scope of the monthly spend cap Anthropic sets for a Claude Console organization from its usage tier, or a higher cap Anthropic granted the organization. Read-only; its
created_atandupdated_atare the organization's creation time, soamountcan change whileupdated_atstays the same.
-
type
final BetaSpendLimit.Scope.Type type()
-
isSeatTier
final Boolean isSeatTier()
-
isRbacGroup
final Boolean isRbacGroup()
-
isOrganizationService
final Boolean isOrganizationService()
-
isOrganization
final Boolean isOrganization()
-
isWorkspace
final Boolean isWorkspace()
-
isUsageTier
final Boolean isUsageTier()
-
asUser
final BetaSpendLimitUserScope asUser()
Scope selecting a single member of the organization.
-
asSeatTier
final BetaSpendLimitSeatTierScope asSeatTier()
-
asRbacGroup
final BetaSpendLimitRbacGroupScope asRbacGroup()
-
asOrganizationService
final BetaSpendLimitOrganizationServiceScope asOrganizationService()
-
asOrganization
final BetaSpendLimitOrganizationScope asOrganization()
-
asWorkspace
final BetaSpendLimitWorkspaceScope asWorkspace()
Scope selecting one workspace of a Claude Console organization.
-
asUsageTier
final BetaSpendLimitUsageTierScope asUsageTier()
Scope of the monthly spend cap Anthropic sets for a Claude Console organization from its usage tier, or a higher cap Anthropic granted the organization. Read-only; its
created_atandupdated_atare the organization's creation time, soamountcan change whileupdated_atstays the same.
-
accept
final <T extends Any> T accept(BetaSpendLimit.Scope.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 = scope.accept(new Scope.Visitor<Optional<String>>() { @Override public Optional<String> visitUser(BetaSpendLimitUserScope user) { return Optional.of(user.toString()); } // ... @Override public Optional<String> unknown(JsonValue json) { // Or inspect the `json`. return Optional.empty(); } });
-
validate
final BetaSpendLimit.Scope 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 BetaSpendLimit.Scope ofUser(BetaSpendLimitUserScope user)
Scope selecting a single member of the organization.
-
ofUser
final static BetaSpendLimit.Scope ofUser(String userId)
Returns an immutable instance of Scope whose ofUser variant is built from the given required userId.
-
ofSeatTier
final static BetaSpendLimit.Scope ofSeatTier(BetaSpendLimitSeatTierScope seatTier)
-
ofSeatTier
final static BetaSpendLimit.Scope ofSeatTier(String seatTier)
Returns an immutable instance of Scope whose ofSeatTier variant is built from the given required seatTier.
-
ofRbacGroup
final static BetaSpendLimit.Scope ofRbacGroup(BetaSpendLimitRbacGroupScope rbacGroup)
-
ofRbacGroup
final static BetaSpendLimit.Scope ofRbacGroup(String rbacGroupId)
Returns an immutable instance of Scope whose ofRbacGroup variant is built from the given required rbacGroupId.
-
ofOrganizationService
final static BetaSpendLimit.Scope ofOrganizationService(BetaSpendLimitOrganizationServiceScope organizationService)
-
ofOrganizationService
final static BetaSpendLimit.Scope ofOrganizationService(String service)
Returns an immutable instance of Scope whose ofOrganizationService variant is built from the given required service.
-
ofOrganization
final static BetaSpendLimit.Scope ofOrganization(BetaSpendLimitOrganizationScope organization)
-
ofWorkspace
final static BetaSpendLimit.Scope ofWorkspace(BetaSpendLimitWorkspaceScope workspace)
Scope selecting one workspace of a Claude Console organization.
-
ofWorkspace
final static BetaSpendLimit.Scope ofWorkspace(String workspaceId)
Returns an immutable instance of Scope whose ofWorkspace variant is built from the given required workspaceId.
-
ofUsageTier
final static BetaSpendLimit.Scope ofUsageTier(BetaSpendLimitUsageTierScope usageTier)
Scope of the monthly spend cap Anthropic sets for a Claude Console organization from its usage tier, or a higher cap Anthropic granted the organization. Read-only; its
created_atandupdated_atare the organization's creation time, soamountcan change whileupdated_atstays the same.
-
-
-
-