Class: Anthropic::Models::Beta::Organization::BetaAnalyticsPluginActivity

Inherits:
Internal::Type::BaseModel show all
Defined in:
lib/anthropic/models/beta/organization/beta_analytics_plugin_activity.rb,
sig/anthropic/models/beta/organization/beta_analytics_plugin_activity.rbs

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Internal::Type::BaseModel

==, #==, #[], coerce, #deconstruct_keys, #deep_to_h, dump, fields, hash, #hash, inherited, inspect, #inspect, known_fields, optional, recursively_to_h, required, #to_h, #to_json, #to_s, to_sorbet_type, #to_yaml

Methods included from Internal::Type::Converter

#coerce, coerce, #dump, dump, inspect, #inspect, meta_info, new_coerce_state, type_info

Methods included from Internal::Util::SorbetRuntimeSupport

#const_missing, #define_sorbet_constant!, #sorbet_constant_defined?, #to_sorbet_type, to_sorbet_type

Constructor Details

#initialize(claude_code_metrics:, cowork_metrics:, distinct_user_count:, install_count:, invocation_count:, plugin_id:, plugin_name:, chat_cowork_unified_metrics: nil, product: nil, rbac_group_id: nil, rbac_group_name: nil, user_id: nil) ⇒ BetaAnalyticsPluginActivity

Per-plugin install + invocation activity for a given day.

With group_by[]=user_id / rbac_group_id / product (cowork, claude_code and chat_cowork_unified only on this endpoint) each row is one (plugin, user), (plugin, group), or (plugin, product) cut: the flat user_id / rbac_group_id / product keys carry the cut and the counts are scoped to it.

Some parameter documentations has been truncated, see Anthropic::Models::Beta::Organization::BetaAnalyticsPluginActivity for more details.

Parameters:

  • claude_code_metrics (Anthropic::Models::Beta::Organization::BetaAnalyticsPluginClaudeCodeMetrics) —

    Claude Code activity metrics for a single plugin on a given day.

  • cowork_metrics (Anthropic::Models::Beta::Organization::BetaAnalyticsPluginCoworkMetrics) —

    Cowork activity metrics for a single plugin on a given day.

  • distinct_user_count (Integer) —

    Number of distinct users with recorded install or invocation activity for the pl

  • install_count (Integer, nil) —

    Number of distinct users who installed the plugin on the requested day, or, in d

  • invocation_count (Integer) —

    Number of plugin invocations on the requested day

  • plugin_id (String, nil) —

    Stable plugin identifier when available (e.g. serena@claude-plugins-official).

  • plugin_name (String) —

    Name of the plugin

  • chat_cowork_unified_metrics (Anthropic::Models::Beta::Organization::BetaAnalyticsPluginChatCoworkUnifiedMetrics, nil) (defaults to: nil) —

    Plugin use recorded while members had Chat and Cowork unified (Cowork's features

  • product (String, nil) (defaults to: nil) —

    Product that produced this row's activity: one of chat, claude_code,

  • rbac_group_id (String, nil) (defaults to: nil) —

    Tagged RBAC group identifier (rbac_group_...), matching the spend-limits API s

  • rbac_group_name (String, nil) (defaults to: nil) —

    Resolved RBAC group display name, alongside rbac_group_id when name resolution

  • user_id (String, nil) (defaults to: nil) —

    Tagged user identifier (e.g. user_...). Present only when the request grouped

  • claude_code_metrics: (Anthropic::Beta::Organization::BetaAnalyticsPluginClaudeCodeMetrics)
  • cowork_metrics: (Anthropic::Beta::Organization::BetaAnalyticsPluginCoworkMetrics)
  • distinct_user_count: (Integer)
  • install_count: (Integer, nil)
  • invocation_count: (Integer)
  • plugin_id: (String, nil)
  • plugin_name: (String)
  • chat_cowork_unified_metrics: (Anthropic::Beta::Organization::BetaAnalyticsPluginChatCoworkUnifiedMetrics, nil) (defaults to: nil)
  • product: (String, nil) (defaults to: nil)
  • rbac_group_id: (String, nil) (defaults to: nil)
  • rbac_group_name: (String, nil) (defaults to: nil)
  • user_id: (String, nil) (defaults to: nil)


# File 'lib/anthropic/models/beta/organization/beta_analytics_plugin_activity.rb', line 105

Instance Attribute Details

#chat_cowork_unified_metrics ⇒ Anthropic::Models::Beta::Organization::BetaAnalyticsPluginChatCoworkUnifiedMetrics?

Plugin use recorded while members had Chat and Cowork unified (Cowork's features inside claude.ai chat) turned on. A count is null in date-range mode where it cannot be computed. Omitted from the response where Chat and Cowork unified is not available.

Parameters:

  • value (Anthropic::Beta::Organization::BetaAnalyticsPluginChatCoworkUnifiedMetrics, nil)

Returns:



64
65
66
# File 'lib/anthropic/models/beta/organization/beta_analytics_plugin_activity.rb', line 64

optional :chat_cowork_unified_metrics,
-> { Anthropic::Beta::Organization::BetaAnalyticsPluginChatCoworkUnifiedMetrics },
nil?: true

#claude_code_metrics ⇒ Anthropic::Models::Beta::Organization::BetaAnalyticsPluginClaudeCodeMetrics

Claude Code activity metrics for a single plugin on a given day.

Parameters:

  • value (Anthropic::Beta::Organization::BetaAnalyticsPluginClaudeCodeMetrics)

Returns:



12
# File 'lib/anthropic/models/beta/organization/beta_analytics_plugin_activity.rb', line 12

required :claude_code_metrics, -> { Anthropic::Beta::Organization::BetaAnalyticsPluginClaudeCodeMetrics }

#cowork_metrics ⇒ Anthropic::Models::Beta::Organization::BetaAnalyticsPluginCoworkMetrics

Cowork activity metrics for a single plugin on a given day.

Parameters:

  • value (Anthropic::Beta::Organization::BetaAnalyticsPluginCoworkMetrics)

Returns:



18
# File 'lib/anthropic/models/beta/organization/beta_analytics_plugin_activity.rb', line 18

required :cowork_metrics, -> { Anthropic::Beta::Organization::BetaAnalyticsPluginCoworkMetrics }

#distinct_user_count ⇒ Integer

Number of distinct users with recorded install or invocation activity for the plugin on the requested day (install-only users count), or, in date-range mode, over the requested window — recomputed as an exact distinct count over the window's per-member daily rows, never a sum of per-day values.

Parameters:

  • value (Integer)

Returns:

  • (Integer)


27
# File 'lib/anthropic/models/beta/organization/beta_analytics_plugin_activity.rb', line 27

required :distinct_user_count, Integer

#install_count ⇒ Integer?

Number of distinct users who installed the plugin on the requested day, or, in date-range mode, over the requested window — recomputed as an exact distinct count over the window's per-member daily rows, never a sum of per-day values.

Parameters:

  • value (Integer, nil)

Returns:

  • (Integer, nil)


35
# File 'lib/anthropic/models/beta/organization/beta_analytics_plugin_activity.rb', line 35

required :install_count, Integer, nil?: true

#invocation_count ⇒ Integer

Number of plugin invocations on the requested day

Parameters:

  • value (Integer)

Returns:

  • (Integer)


41
# File 'lib/anthropic/models/beta/organization/beta_analytics_plugin_activity.rb', line 41

required :invocation_count, Integer

#plugin_id ⇒ String?

Stable plugin identifier when available (e.g. serena@claude-plugins-official). Null for third-party Claude Code plugins (redacted at the source) and Cowork slash commands that carry only a hashed id.

Parameters:

  • value (String, nil)

Returns:

  • (String, nil)


49
# File 'lib/anthropic/models/beta/organization/beta_analytics_plugin_activity.rb', line 49

required :plugin_id, String, nil?: true

#plugin_name ⇒ String

Name of the plugin

Parameters:

  • value (String)

Returns:

  • (String)


55
# File 'lib/anthropic/models/beta/organization/beta_analytics_plugin_activity.rb', line 55

required :plugin_name, String

#product ⇒ String?

Product that produced this row's activity: one of chat, claude_code, cowork, office_agent, or chat_cowork_unified (Chat and Cowork unified). These are the canonical Cost & Usage product names; an office_agent row's per-surface breakdown is in its office_metrics. On /plugins only cowork, claude_code and chat_cowork_unified occur (the only surfaces with plugin attribution); on /artifacts only chat, claude_code, cowork and chat_cowork_unified occur (the surfaces that create artifacts); /apps/chat/projects does not support the product dimension (a product entry in group_by[] or filter[] there is rejected). Present only when the request grouped by product.

Parameters:

  • value (String, nil)

Returns:

  • (String, nil)


81
# File 'lib/anthropic/models/beta/organization/beta_analytics_plugin_activity.rb', line 81

optional :product, String, nil?: true

#rbac_group_id ⇒ String?

Tagged RBAC group identifier (rbac_group_...), matching the spend-limits API spelling. Present only when the request grouped by rbac_group_id.

Parameters:

  • value (String, nil)

Returns:

  • (String, nil)


88
# File 'lib/anthropic/models/beta/organization/beta_analytics_plugin_activity.rb', line 88

optional :rbac_group_id, String, nil?: true

#rbac_group_name ⇒ String?

Resolved RBAC group display name, alongside rbac_group_id when name resolution is available. Null if the group has been deleted or its name could not be resolved; rbac_group_id remains the stable key.

Parameters:

  • value (String, nil)

Returns:

  • (String, nil)


96
# File 'lib/anthropic/models/beta/organization/beta_analytics_plugin_activity.rb', line 96

optional :rbac_group_name, String, nil?: true

#user_id ⇒ String?

Tagged user identifier (e.g. user_...). Present only when the request grouped by user_id.

Parameters:

  • value (String, nil)

Returns:

  • (String, nil)


103
# File 'lib/anthropic/models/beta/organization/beta_analytics_plugin_activity.rb', line 103

optional :user_id, String, nil?: true

Instance Method Details

#to_hash ⇒ { claude_code_metrics: Anthropic::Beta::Organization::BetaAnalyticsPluginClaudeCodeMetrics, cowork_metrics: Anthropic::Beta::Organization::BetaAnalyticsPluginCoworkMetrics, distinct_user_count: Integer, install_count: Integer?, invocation_count: Integer, plugin_id: String?, plugin_name: String, chat_cowork_unified_metrics: Anthropic::Beta::Organization::BetaAnalyticsPluginChatCoworkUnifiedMetrics?, product: String?, rbac_group_id: String?, rbac_group_name: String?, user_id: String? }

Returns:

  • ({ claude_code_metrics: Anthropic::Beta::Organization::BetaAnalyticsPluginClaudeCodeMetrics, cowork_metrics: Anthropic::Beta::Organization::BetaAnalyticsPluginCoworkMetrics, distinct_user_count: Integer, install_count: Integer?, invocation_count: Integer, plugin_id: String?, plugin_name: String, chat_cowork_unified_metrics: Anthropic::Beta::Organization::BetaAnalyticsPluginChatCoworkUnifiedMetrics?, product: String?, rbac_group_id: String?, rbac_group_name: String?, user_id: String? })


61
62
63
64
65
66
67
68
69
70
71
72
73
74
# File 'sig/anthropic/models/beta/organization/beta_analytics_plugin_activity.rbs', line 61

def to_hash: -> {
  claude_code_metrics: Anthropic::Beta::Organization::BetaAnalyticsPluginClaudeCodeMetrics,
  cowork_metrics: Anthropic::Beta::Organization::BetaAnalyticsPluginCoworkMetrics,
  distinct_user_count: Integer,
  install_count: Integer?,
  invocation_count: Integer,
  plugin_id: String?,
  plugin_name: String,
  chat_cowork_unified_metrics: Anthropic::Beta::Organization::BetaAnalyticsPluginChatCoworkUnifiedMetrics?,
  product: String?,
  rbac_group_id: String?,
  rbac_group_name: String?,
  user_id: String?
}