Class SpendSummary.Source
-
- All Implemented Interfaces:
public final class SpendSummary.Source
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public interfaceSpendSummary.Source.VisitorAn interface that defines how to map each variant of Source to a value of type T.
public final classSpendSummary.Source.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 SpendSummary.Source.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(SpendSummary.Source.Visitor<T> visitor)Maps this instance's current variant to a value of type T using the given visitor. final SpendSummary.Sourcevalidate()Validates that the types of all values in this object match their expected types recursively. final BooleanisValid()Booleanequals(Object other)IntegerhashCode()StringtoString()final static SpendSummary.SourceofUser(SpendLimitUserScope user)Scope selecting a single member of the organization. final static SpendSummary.SourceofUser(String userId)Returns an immutable instance of Source whose ofUser variant is built from the given required userId. final static SpendSummary.SourceofSeatTier(SpendLimitSeatTierScope seatTier)final static SpendSummary.SourceofSeatTier(String seatTier)Returns an immutable instance of Source whose ofSeatTier variant is built from the given required seatTier. final static SpendSummary.SourceofRbacGroup(SpendLimitRbacGroupScope rbacGroup)final static SpendSummary.SourceofRbacGroup(String rbacGroupId)Returns an immutable instance of Source whose ofRbacGroup variant is built from the given required rbacGroupId. final static SpendSummary.SourceofOrganizationService(SpendLimitOrganizationServiceScope organizationService)final static SpendSummary.SourceofOrganizationService(String service)Returns an immutable instance of Source whose ofOrganizationService variant is built from the given required service. final static SpendSummary.SourceofOrganization(SpendLimitOrganizationScope organization)final static SpendSummary.SourceofWorkspace(SpendLimitWorkspaceScope workspace)Scope selecting one workspace of a Claude Console organization. final static SpendSummary.SourceofWorkspace(String workspaceId)Returns an immutable instance of Source whose ofWorkspace variant is built from the given required workspaceId. final static SpendSummary.SourceofUsageTier(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 SpendSummary.Source.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(SpendSummary.Source.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 = source.accept(new Source.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 SpendSummary.Source 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 SpendSummary.Source ofUser(SpendLimitUserScope user)
Scope selecting a single member of the organization.
-
ofUser
final static SpendSummary.Source ofUser(String userId)
Returns an immutable instance of Source whose ofUser variant is built from the given required userId.
-
ofSeatTier
final static SpendSummary.Source ofSeatTier(SpendLimitSeatTierScope seatTier)
-
ofSeatTier
final static SpendSummary.Source ofSeatTier(String seatTier)
Returns an immutable instance of Source whose ofSeatTier variant is built from the given required seatTier.
-
ofRbacGroup
final static SpendSummary.Source ofRbacGroup(SpendLimitRbacGroupScope rbacGroup)
-
ofRbacGroup
final static SpendSummary.Source ofRbacGroup(String rbacGroupId)
Returns an immutable instance of Source whose ofRbacGroup variant is built from the given required rbacGroupId.
-
ofOrganizationService
final static SpendSummary.Source ofOrganizationService(SpendLimitOrganizationServiceScope organizationService)
-
ofOrganizationService
final static SpendSummary.Source ofOrganizationService(String service)
Returns an immutable instance of Source whose ofOrganizationService variant is built from the given required service.
-
ofOrganization
final static SpendSummary.Source ofOrganization(SpendLimitOrganizationScope organization)
-
ofWorkspace
final static SpendSummary.Source ofWorkspace(SpendLimitWorkspaceScope workspace)
Scope selecting one workspace of a Claude Console organization.
-
ofWorkspace
final static SpendSummary.Source ofWorkspace(String workspaceId)
Returns an immutable instance of Source whose ofWorkspace variant is built from the given required workspaceId.
-
ofUsageTier
final static SpendSummary.Source 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.
-
-
-
-