Class SpendLimitSetParams.Scope
-
- All Implemented Interfaces:
public final class SpendLimitSetParams.ScopeWhat the limit applies to. Claude Enterprise organizations set
userlimits. Claude Console organizations setorganizationandworkspacelimits. Any other combination returns 400. Settingorganizationandworkspacelimits through the API is in an early access preview. To request access, contact your Anthropic account team.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public interfaceSpendLimitSetParams.Scope.VisitorAn interface that defines how to map each variant of Scope to a value of type T.
public final classSpendLimitSetParams.Scope.Type
-
Method Summary
Modifier and Type Method Description final Optional<BetaSpendLimitUserScope>user()Scope selecting a single member of the organization. final Optional<BetaSpendLimitOrganizationScope>organization()final Optional<BetaSpendLimitWorkspaceScope>workspace()Scope selecting one workspace of a Claude Console organization. final Optional<JsonValue>_json()final SpendLimitSetParams.Scope.Typetype()final BooleanisUser()final BooleanisOrganization()final BooleanisWorkspace()final BetaSpendLimitUserScopeasUser()Scope selecting a single member of the organization. final BetaSpendLimitOrganizationScopeasOrganization()final BetaSpendLimitWorkspaceScopeasWorkspace()Scope selecting one workspace of a Claude Console organization. final <T extends Any> Taccept(SpendLimitSetParams.Scope.Visitor<T> visitor)Maps this instance's current variant to a value of type T using the given visitor. final SpendLimitSetParams.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 SpendLimitSetParams.ScopeofUser(BetaSpendLimitUserScope user)Scope selecting a single member of the organization. final static SpendLimitSetParams.ScopeofUser(String userId)Returns an immutable instance of Scope whose ofUser variant is built from the given required userId. final static SpendLimitSetParams.ScopeofOrganization(BetaSpendLimitOrganizationScope organization)final static SpendLimitSetParams.ScopeofWorkspace(BetaSpendLimitWorkspaceScope workspace)Scope selecting one workspace of a Claude Console organization. final static SpendLimitSetParams.ScopeofWorkspace(String workspaceId)Returns an immutable instance of Scope whose ofWorkspace variant is built from the given required workspaceId. -
-
Method Detail
-
user
final Optional<BetaSpendLimitUserScope> user()
Scope selecting a single member of the organization.
-
organization
final Optional<BetaSpendLimitOrganizationScope> organization()
-
workspace
final Optional<BetaSpendLimitWorkspaceScope> workspace()
Scope selecting one workspace of a Claude Console organization.
-
type
final SpendLimitSetParams.Scope.Type type()
-
isOrganization
final Boolean isOrganization()
-
isWorkspace
final Boolean isWorkspace()
-
asUser
final BetaSpendLimitUserScope asUser()
Scope selecting a single member of the organization.
-
asOrganization
final BetaSpendLimitOrganizationScope asOrganization()
-
asWorkspace
final BetaSpendLimitWorkspaceScope asWorkspace()
Scope selecting one workspace of a Claude Console organization.
-
accept
final <T extends Any> T accept(SpendLimitSetParams.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 SpendLimitSetParams.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 SpendLimitSetParams.Scope ofUser(BetaSpendLimitUserScope user)
Scope selecting a single member of the organization.
-
ofUser
final static SpendLimitSetParams.Scope ofUser(String userId)
Returns an immutable instance of Scope whose ofUser variant is built from the given required userId.
-
ofOrganization
final static SpendLimitSetParams.Scope ofOrganization(BetaSpendLimitOrganizationScope organization)
-
ofWorkspace
final static SpendLimitSetParams.Scope ofWorkspace(BetaSpendLimitWorkspaceScope workspace)
Scope selecting one workspace of a Claude Console organization.
-
ofWorkspace
final static SpendLimitSetParams.Scope ofWorkspace(String workspaceId)
Returns an immutable instance of Scope whose ofWorkspace variant is built from the given required workspaceId.
-
-
-
-