Class BetaAnalyticsUsageBucketedResult.Builder
-
- All Implemented Interfaces:
public final class BetaAnalyticsUsageBucketedResult.BuilderA builder for BetaAnalyticsUsageBucketedResult.
-
-
Method Summary
-
-
Method Detail
-
cacheCreation
final BetaAnalyticsUsageBucketedResult.Builder cacheCreation(BetaCacheCreation cacheCreation)
The number of input tokens for cache creation.
-
cacheCreation
final BetaAnalyticsUsageBucketedResult.Builder cacheCreation(JsonField<BetaCacheCreation> cacheCreation)
Sets Builder.cacheCreation to an arbitrary JSON value.
You should usually call Builder.cacheCreation with a well-typed BetaCacheCreation value instead. This method is primarily for setting the field to an undocumented or not yet supported value.
-
cacheReadInputTokens
final BetaAnalyticsUsageBucketedResult.Builder cacheReadInputTokens(Long cacheReadInputTokens)
The number of input tokens read from the cache.
-
cacheReadInputTokens
final BetaAnalyticsUsageBucketedResult.Builder cacheReadInputTokens(JsonField<Long> cacheReadInputTokens)
Sets Builder.cacheReadInputTokens to an arbitrary JSON value.
You should usually call Builder.cacheReadInputTokens with a well-typed Long value instead. This method is primarily for setting the field to an undocumented or not yet supported value.
-
claudeTagCategory
final BetaAnalyticsUsageBucketedResult.Builder claudeTagCategory(BetaAnalyticsClaudeTagCategory claudeTagCategory)
Claude Tag (Claude in Slack) spend category:
engaged(a person addressed Claude in a channel or thread),proactive(Claude responded without being addressed),scheduled(a scheduled routine ran),monitoring(Claude watching a channel it was asked to monitor), ordm(direct messages with Claude). Populated only whenclaude_tag_categoryis ingroup_by[]; null for usage that is not Claude Tag. New categories may be added over time.
-
claudeTagCategory
final BetaAnalyticsUsageBucketedResult.Builder claudeTagCategory(Optional<BetaAnalyticsClaudeTagCategory> claudeTagCategory)
Alias for calling Builder.claudeTagCategory with
claudeTagCategory.orElse(null).
-
claudeTagCategory
final BetaAnalyticsUsageBucketedResult.Builder claudeTagCategory(JsonField<BetaAnalyticsClaudeTagCategory> claudeTagCategory)
Sets Builder.claudeTagCategory to an arbitrary JSON value.
You should usually call Builder.claudeTagCategory with a well-typed BetaAnalyticsClaudeTagCategory value instead. This method is primarily for setting the field to an undocumented or not yet supported value.
-
claudeTagUserId
final BetaAnalyticsUsageBucketedResult.Builder claudeTagUserId(String claudeTagUserId)
Slack user ID (for example
U0123ABCDEF) of the member the Claude Tag (Claude in Slack) usage is attributed to, not a claude.ai user ID. Populated only whenclaude_tag_user_idis ingroup_by[]; null for usage that is not Claude Tag and for Claude Tag usage that is not attributed to a single user (for examplemonitoring, andproactiveusage Claude initiated), so per-user rows can sum to less than the Claude Tag total. Cannot be combined withgroup_by[]=rbac_group_idor therbac_group_ids[]filter.
-
claudeTagUserId
final BetaAnalyticsUsageBucketedResult.Builder claudeTagUserId(Optional<String> claudeTagUserId)
Alias for calling Builder.claudeTagUserId with
claudeTagUserId.orElse(null).
-
claudeTagUserId
final BetaAnalyticsUsageBucketedResult.Builder claudeTagUserId(JsonField<String> claudeTagUserId)
Sets Builder.claudeTagUserId to an arbitrary JSON value.
You should usually call Builder.claudeTagUserId with a well-typed String value instead. This method is primarily for setting the field to an undocumented or not yet supported value.
-
contextWindow
final BetaAnalyticsUsageBucketedResult.Builder contextWindow(BetaAnalyticsContextWindow contextWindow)
Context-window pricing tier of the usage or cost. Null unless
context_windowis ingroup_by[]; it can also be null on grouped rows with no context-window tier, such as code execution.
-
contextWindow
final BetaAnalyticsUsageBucketedResult.Builder contextWindow(Optional<BetaAnalyticsContextWindow> contextWindow)
Alias for calling Builder.contextWindow with
contextWindow.orElse(null).
-
contextWindow
final BetaAnalyticsUsageBucketedResult.Builder contextWindow(JsonField<BetaAnalyticsContextWindow> contextWindow)
Sets Builder.contextWindow to an arbitrary JSON value.
You should usually call Builder.contextWindow with a well-typed BetaAnalyticsContextWindow value instead. This method is primarily for setting the field to an undocumented or not yet supported value.
-
inferenceGeo
final BetaAnalyticsUsageBucketedResult.Builder inferenceGeo(BetaAnalyticsUsageBucketedResult.InferenceGeo inferenceGeo)
Inference region of the usage or cost. Null unless
inference_geois ingroup_by[]; it can also be null on grouped rows where the region is not set (the rows thatinference_geos[]=not_availablematches).
-
inferenceGeo
final BetaAnalyticsUsageBucketedResult.Builder inferenceGeo(Optional<BetaAnalyticsUsageBucketedResult.InferenceGeo> inferenceGeo)
Alias for calling Builder.inferenceGeo with
inferenceGeo.orElse(null).
-
inferenceGeo
final BetaAnalyticsUsageBucketedResult.Builder inferenceGeo(JsonField<BetaAnalyticsUsageBucketedResult.InferenceGeo> inferenceGeo)
Sets Builder.inferenceGeo to an arbitrary JSON value.
You should usually call Builder.inferenceGeo with a well-typed InferenceGeo value instead. This method is primarily for setting the field to an undocumented or not yet supported value.
-
model
final BetaAnalyticsUsageBucketedResult.Builder model(String model)
Model that produced the usage or cost, as a model name in the form the
models[]filter accepts (for example,claude-opus-5-5). Null unlessmodelis ingroup_by[]; it can also be null on grouped rows whose usage or cost is not attributed to a specific model, such as code execution.
-
model
final BetaAnalyticsUsageBucketedResult.Builder model(Optional<String> model)
Alias for calling Builder.model with
model.orElse(null).
-
model
final BetaAnalyticsUsageBucketedResult.Builder model(JsonField<String> model)
Sets Builder.model to an arbitrary JSON value.
You should usually call Builder.model with a well-typed String value instead. This method is primarily for setting the field to an undocumented or not yet supported value.
-
outputTokens
final BetaAnalyticsUsageBucketedResult.Builder outputTokens(Long outputTokens)
The number of output tokens generated.
-
outputTokens
final BetaAnalyticsUsageBucketedResult.Builder outputTokens(JsonField<Long> outputTokens)
Sets Builder.outputTokens to an arbitrary JSON value.
You should usually call Builder.outputTokens with a well-typed Long value instead. This method is primarily for setting the field to an undocumented or not yet supported value.
-
product
final BetaAnalyticsUsageBucketedResult.Builder product(String product)
Product surface that produced the usage or cost. Null unless product is in
group_by[]; it can also be null on grouped rows whose usage cannot be attributed to a known surface. Values includechat,claude_code,cowork,office_agent,claude_in_chrome,claude_design,claude-tag, andchat_cowork_unified.claude-tagis Claude Tag, the Claude product in Slack.chat_cowork_unifiedis Chat and Cowork unified, Cowork's features inside claude.ai chat: chat and Cowork usage by a member who has it turned on is reported under this value instead ofchatorcowork. It is accepted as a filter only where Chat and Cowork unified is available. Some unattributed usage is reported as "other".
-
product
final BetaAnalyticsUsageBucketedResult.Builder product(Optional<String> product)
Alias for calling Builder.product with
product.orElse(null).
-
product
final BetaAnalyticsUsageBucketedResult.Builder product(JsonField<String> product)
Sets Builder.product to an arbitrary JSON value.
You should usually call Builder.product with a well-typed String value instead. This method is primarily for setting the field to an undocumented or not yet supported value.
-
rbacGroupId
final BetaAnalyticsUsageBucketedResult.Builder rbacGroupId(String rbacGroupId)
RBAC group (team) the usage is attributed to, in the public tagged
rbac_group_...spelling — the same spelling the activity resources use for this key, so the same team has one id across resources and it round-trips as anrbac_group_ids[]filter value. Populated only whenrbac_group_idis ingroup_by[]. Any-membership semantics: a user in several groups contributes their full usage to each of those groups' rows, so the named-group rows overlap and their sum can exceed the org total. A null value is the single unassigned row: users in no group on that (UTC) day. For the true org total, run the same query withoutgroup_by[].
-
rbacGroupId
final BetaAnalyticsUsageBucketedResult.Builder rbacGroupId(Optional<String> rbacGroupId)
Alias for calling Builder.rbacGroupId with
rbacGroupId.orElse(null).
-
rbacGroupId
final BetaAnalyticsUsageBucketedResult.Builder rbacGroupId(JsonField<String> rbacGroupId)
Sets Builder.rbacGroupId to an arbitrary JSON value.
You should usually call Builder.rbacGroupId with a well-typed String value instead. This method is primarily for setting the field to an undocumented or not yet supported value.
-
requests
final BetaAnalyticsUsageBucketedResult.Builder requests(Long requests)
Number of API requests in this row's scope. For sandbox / code-execution events, this counts execution spans rather than HTTP requests (these rows surface with
product: null).
-
requests
final BetaAnalyticsUsageBucketedResult.Builder requests(Long requests)
Alias for Builder.requests.
This unboxed primitive overload exists for backwards compatibility.
-
requests
final BetaAnalyticsUsageBucketedResult.Builder requests(Optional<Long> requests)
Alias for calling Builder.requests with
requests.orElse(null).
-
requests
final BetaAnalyticsUsageBucketedResult.Builder requests(JsonField<Long> requests)
Sets Builder.requests to an arbitrary JSON value.
You should usually call Builder.requests with a well-typed Long value instead. This method is primarily for setting the field to an undocumented or not yet supported value.
-
serverToolUse
final BetaAnalyticsUsageBucketedResult.Builder serverToolUse(BetaAnalyticsServerToolUse serverToolUse)
Server-side tool usage metrics.
-
serverToolUse
final BetaAnalyticsUsageBucketedResult.Builder serverToolUse(JsonField<BetaAnalyticsServerToolUse> serverToolUse)
Sets Builder.serverToolUse to an arbitrary JSON value.
You should usually call Builder.serverToolUse with a well-typed BetaAnalyticsServerToolUse value instead. This method is primarily for setting the field to an undocumented or not yet supported value.
-
slackChannelId
final BetaAnalyticsUsageBucketedResult.Builder slackChannelId(String slackChannelId)
Slack channel the usage originated from. Populated only when
slack_channel_idis ingroup_by[]; null for usage outside Slack, for some Claude Tag usage that has no channel recorded, and for usage recorded before channel attribution was enabled.
-
slackChannelId
final BetaAnalyticsUsageBucketedResult.Builder slackChannelId(Optional<String> slackChannelId)
Alias for calling Builder.slackChannelId with
slackChannelId.orElse(null).
-
slackChannelId
final BetaAnalyticsUsageBucketedResult.Builder slackChannelId(JsonField<String> slackChannelId)
Sets Builder.slackChannelId to an arbitrary JSON value.
You should usually call Builder.slackChannelId with a well-typed String value instead. This method is primarily for setting the field to an undocumented or not yet supported value.
-
speed
final BetaAnalyticsUsageBucketedResult.Builder speed(BetaAnalyticsUsageBucketedResult.Speed speed)
Inference speed mode of the usage or cost:
fastorstandard. Null unlessspeedis ingroup_by[].
-
speed
final BetaAnalyticsUsageBucketedResult.Builder speed(Optional<BetaAnalyticsUsageBucketedResult.Speed> speed)
Alias for calling Builder.speed with
speed.orElse(null).
-
speed
final BetaAnalyticsUsageBucketedResult.Builder speed(JsonField<BetaAnalyticsUsageBucketedResult.Speed> speed)
Sets Builder.speed to an arbitrary JSON value.
You should usually call Builder.speed with a well-typed Speed value instead. This method is primarily for setting the field to an undocumented or not yet supported value.
-
uncachedInputTokens
final BetaAnalyticsUsageBucketedResult.Builder uncachedInputTokens(Long uncachedInputTokens)
The number of uncached input tokens processed.
-
uncachedInputTokens
final BetaAnalyticsUsageBucketedResult.Builder uncachedInputTokens(JsonField<Long> uncachedInputTokens)
Sets Builder.uncachedInputTokens to an arbitrary JSON value.
You should usually call Builder.uncachedInputTokens with a well-typed Long value instead. This method is primarily for setting the field to an undocumented or not yet supported value.
-
additionalProperties
final BetaAnalyticsUsageBucketedResult.Builder additionalProperties(Map<String, JsonValue> additionalProperties)
-
putAdditionalProperty
final BetaAnalyticsUsageBucketedResult.Builder putAdditionalProperty(String key, JsonValue value)
-
putAllAdditionalProperties
final BetaAnalyticsUsageBucketedResult.Builder putAllAdditionalProperties(Map<String, JsonValue> additionalProperties)
-
removeAdditionalProperty
final BetaAnalyticsUsageBucketedResult.Builder removeAdditionalProperty(String key)
-
removeAllAdditionalProperties
final BetaAnalyticsUsageBucketedResult.Builder removeAllAdditionalProperties(Set<String> keys)
-
build
final BetaAnalyticsUsageBucketedResult build()
Returns an immutable instance of BetaAnalyticsUsageBucketedResult.
Further updates to this Builder will not mutate the returned instance.
The following fields are required:
.cacheCreation() .cacheReadInputTokens() .claudeTagCategory() .claudeTagUserId() .contextWindow() .inferenceGeo() .model() .outputTokens() .product() .rbacGroupId() .requests() .serverToolUse() .slackChannelId() .speed() .uncachedInputTokens()
-
-
-
-