Class SpendLimit.Scope
-
- All Implemented Interfaces:
public final class SpendLimit.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 interfaceSpendLimit.Scope.VisitorAn interface that defines how to map each variant of Scope to a value of type T.
public final classSpendLimit.Scope.Type
-
Method Summary
Modifier and Type Method Description final Optional<SpendLimitUserScope>user()Scope selecting a single member of the organization. final Optional<SpendLimitSeatTierScope>seatTier()final Optional<SpendLimitRbacGroupScope>rbacGroup()final Optional<SpendLimitOrganizationServiceScope>organizationService()final Optional<SpendLimitOrganizationScope>organization()final Optional<SpendLimitWorkspaceScope>workspace()Scope selecting one workspace of a Claude Console organization. final Optional<SpendLimitUsageTierScope>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 SpendLimit.Scope.Typetype()final BooleanisUser()final BooleanisSeatTier()final BooleanisRbacGroup()final BooleanisOrganizationService()final BooleanisOrganization()final BooleanisWorkspace()final BooleanisUsageTier()final SpendLimitUserScopeasUser()Scope selecting a single member of the organization. final SpendLimitSeatTierScopeasSeatTier()final SpendLimitRbacGroupScopeasRbacGroup()final SpendLimitOrganizationServiceScopeasOrganizationService()final SpendLimitOrganizationScopeasOrganization()final SpendLimitWorkspaceScopeasWorkspace()Scope selecting one workspace of a Claude Console organization. final SpendLimitUsageTierScopeasUsageTier()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(SpendLimit.Scope.Visitor<T> visitor)Maps this instance's current variant to a value of type T using the given visitor. final SpendLimit.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 SpendLimit.ScopeofUser(SpendLimitUserScope user)Scope selecting a single member of the organization. final static SpendLimit.ScopeofUser(String userId)Returns an immutable instance of Scope whose ofUser variant is built from the given required userId. final static SpendLimit.ScopeofSeatTier(SpendLimitSeatTierScope seatTier)final static SpendLimit.ScopeofSeatTier(String seatTier)Returns an immutable instance of Scope whose ofSeatTier variant is built from the given required seatTier. final static SpendLimit.ScopeofRbacGroup(SpendLimitRbacGroupScope rbacGroup)final static SpendLimit.ScopeofRbacGroup(String rbacGroupId)Returns an immutable instance of Scope whose ofRbacGroup variant is built from the given required rbacGroupId. final static SpendLimit.ScopeofOrganizationService(SpendLimitOrganizationServiceScope organizationService)final static SpendLimit.ScopeofOrganizationService(String service)Returns an immutable instance of Scope whose ofOrganizationService variant is built from the given required service. final static SpendLimit.ScopeofOrganization(SpendLimitOrganizationScope organization)final static SpendLimit.ScopeofWorkspace(SpendLimitWorkspaceScope workspace)Scope selecting one workspace of a Claude Console organization. final static SpendLimit.ScopeofWorkspace(String workspaceId)Returns an immutable instance of Scope whose ofWorkspace variant is built from the given required workspaceId. final static SpendLimit.ScopeofUsageTier(SpendLimitUsageTierScope 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<SpendLimitUserScope> user()
Scope selecting a single member of the organization.
-
seatTier
final Optional<SpendLimitSeatTierScope> seatTier()
-
rbacGroup
final Optional<SpendLimitRbacGroupScope> rbacGroup()
-
organizationService
final Optional<SpendLimitOrganizationServiceScope> organizationService()
-
organization
final Optional<SpendLimitOrganizationScope> organization()
-
workspace
final Optional<SpendLimitWorkspaceScope> workspace()
Scope selecting one workspace of a Claude Console organization.
-
usageTier
final Optional<SpendLimitUsageTierScope> 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 SpendLimit.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 SpendLimitUserScope asUser()
Scope selecting a single member of the organization.
-
asSeatTier
final SpendLimitSeatTierScope asSeatTier()
-
asRbacGroup
final SpendLimitRbacGroupScope asRbacGroup()
-
asOrganizationService
final SpendLimitOrganizationServiceScope asOrganizationService()
-
asOrganization
final SpendLimitOrganizationScope asOrganization()
-
asWorkspace
final SpendLimitWorkspaceScope asWorkspace()
Scope selecting one workspace of a Claude Console organization.
-
asUsageTier
final SpendLimitUsageTierScope 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(SpendLimit.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(SpendLimitUserScope user) { return Optional.of(user.toString()); } // ... @Override public Optional<String> unknown(JsonValue json) { // Or inspect the `json`. return Optional.empty(); } });
-
validate
final SpendLimit.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 SpendLimit.Scope ofUser(SpendLimitUserScope user)
Scope selecting a single member of the organization.
-
ofUser
final static SpendLimit.Scope ofUser(String userId)
Returns an immutable instance of Scope whose ofUser variant is built from the given required userId.
-
ofSeatTier
final static SpendLimit.Scope ofSeatTier(SpendLimitSeatTierScope seatTier)
-
ofSeatTier
final static SpendLimit.Scope ofSeatTier(String seatTier)
Returns an immutable instance of Scope whose ofSeatTier variant is built from the given required seatTier.
-
ofRbacGroup
final static SpendLimit.Scope ofRbacGroup(SpendLimitRbacGroupScope rbacGroup)
-
ofRbacGroup
final static SpendLimit.Scope ofRbacGroup(String rbacGroupId)
Returns an immutable instance of Scope whose ofRbacGroup variant is built from the given required rbacGroupId.
-
ofOrganizationService
final static SpendLimit.Scope ofOrganizationService(SpendLimitOrganizationServiceScope organizationService)
-
ofOrganizationService
final static SpendLimit.Scope ofOrganizationService(String service)
Returns an immutable instance of Scope whose ofOrganizationService variant is built from the given required service.
-
ofOrganization
final static SpendLimit.Scope ofOrganization(SpendLimitOrganizationScope organization)
-
ofWorkspace
final static SpendLimit.Scope ofWorkspace(SpendLimitWorkspaceScope workspace)
Scope selecting one workspace of a Claude Console organization.
-
ofWorkspace
final static SpendLimit.Scope ofWorkspace(String workspaceId)
Returns an immutable instance of Scope whose ofWorkspace variant is built from the given required workspaceId.
-
ofUsageTier
final static SpendLimit.Scope ofUsageTier(SpendLimitUsageTierScope 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.
-
-
-
-