Class: Anthropic::Models::Beta::Organization::BetaAnalyticsUserActivity

Inherits:
Internal::Type::BaseModel show all
Defined in:
lib/anthropic/models/beta/organization/beta_analytics_user_activity.rb,
sig/anthropic/models/beta/organization/beta_analytics_user_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(chat_metrics:, claude_code_metrics:, cowork_metrics:, design_metrics:, distinct_user_count:, office_metrics:, science_metrics:, user:, web_search_count:, chat_cowork_unified_metrics: nil, claude_tag_metrics: nil, last_activity_date: nil, rbac_group_id: nil, rbac_group_name: nil) ⇒ BetaAnalyticsUserActivity

Per-user activity data for a given day.

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

Parameters:

  • chat_metrics (Anthropic::Models::Beta::Organization::BetaAnalyticsChatMetrics) —

    Claude.ai activity metrics for a single user on a given day.

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

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

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

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

  • design_metrics (Anthropic::Models::Beta::Organization::BetaAnalyticsDesignMetrics) —

    Claude Design activity metrics for a single user on a given day.

  • distinct_user_count (Integer, nil) —

    Number of distinct active users represented by this row. Only set for grouped ro

  • office_metrics (Anthropic::Models::Beta::Organization::BetaAnalyticsOfficeMetrics) —

    Office Agent activity metrics for a single user on a given day, broken out by Of

  • science_metrics (Anthropic::Models::Beta::Organization::BetaAnalyticsScienceMetrics) —

    Claude Science activity metrics for a single user on a given day.

  • user (Anthropic::Models::Beta::Organization::BetaAnalyticsUser, nil) —

    The user this row describes. Null on rows aggregated across users.

  • web_search_count (Integer) —

    Number of web searches performed

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

    Activity recorded while the member had Chat and Cowork unified (Cowork's feature

  • claude_tag_metrics (Anthropic::Models::Beta::Organization::BetaAnalyticsClaudeTagMetrics, nil) (defaults to: nil) —

    Claude Tag activity in Slack by a user who has linked a Claude account. Activity

  • last_activity_date (Date, nil) (defaults to: nil) —

    Most recent UTC day (YYYY-MM-DD) on which the user had any counted activity, wit

  • 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

  • chat_metrics: (Anthropic::Beta::Organization::BetaAnalyticsChatMetrics)
  • claude_code_metrics: (Anthropic::Beta::Organization::BetaAnalyticsClaudeCodeMetrics)
  • cowork_metrics: (Anthropic::Beta::Organization::BetaAnalyticsCoworkMetrics)
  • design_metrics: (Anthropic::Beta::Organization::BetaAnalyticsDesignMetrics)
  • distinct_user_count: (Integer, nil)
  • office_metrics: (Anthropic::Beta::Organization::BetaAnalyticsOfficeMetrics)
  • science_metrics: (Anthropic::Beta::Organization::BetaAnalyticsScienceMetrics)
  • user: (Anthropic::Beta::Organization::BetaAnalyticsUser, nil)
  • web_search_count: (Integer)
  • chat_cowork_unified_metrics: (Anthropic::Beta::Organization::BetaAnalyticsChatCoworkUnifiedMetrics, nil) (defaults to: nil)
  • claude_tag_metrics: (Anthropic::Beta::Organization::BetaAnalyticsClaudeTagMetrics, nil) (defaults to: nil)
  • last_activity_date: (Date, nil) (defaults to: nil)
  • rbac_group_id: (String, nil) (defaults to: nil)
  • rbac_group_name: (String, nil) (defaults to: nil)


# File 'lib/anthropic/models/beta/organization/beta_analytics_user_activity.rb', line 118

Instance Attribute Details

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

Activity recorded while the member had Chat and Cowork unified (Cowork's features inside claude.ai chat) turned on, split into chat (chat activity) and sessions (Cowork activity). Omitted from the response where Chat and Cowork unified is not available.

Parameters:

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

Returns:



73
74
75
# File 'lib/anthropic/models/beta/organization/beta_analytics_user_activity.rb', line 73

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

#chat_metrics ⇒ Anthropic::Models::Beta::Organization::BetaAnalyticsChatMetrics

Claude.ai activity metrics for a single user on a given day.

Parameters:

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

Returns:



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

required :chat_metrics, -> { Anthropic::Beta::Organization::BetaAnalyticsChatMetrics }

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

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

Parameters:

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

Returns:



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

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

#claude_tag_metrics ⇒ Anthropic::Models::Beta::Organization::BetaAnalyticsClaudeTagMetrics?

Claude Tag activity in Slack by a user who has linked a Claude account. Activity by Slack users who have not linked an account appears only in the /summaries Claude Tag counts, so these rows do not add up to those counts. Omitted from the response on deployments that do not offer Claude Tag reporting.

Parameters:

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

Returns:



84
85
86
# File 'lib/anthropic/models/beta/organization/beta_analytics_user_activity.rb', line 84

optional :claude_tag_metrics,
-> { Anthropic::Beta::Organization::BetaAnalyticsClaudeTagMetrics },
nil?: true

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

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

Parameters:

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

Returns:



24
# File 'lib/anthropic/models/beta/organization/beta_analytics_user_activity.rb', line 24

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

#design_metrics ⇒ Anthropic::Models::Beta::Organization::BetaAnalyticsDesignMetrics

Claude Design activity metrics for a single user on a given day.

Parameters:

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

Returns:



30
# File 'lib/anthropic/models/beta/organization/beta_analytics_user_activity.rb', line 30

required :design_metrics, -> { Anthropic::Beta::Organization::BetaAnalyticsDesignMetrics }

#distinct_user_count ⇒ Integer?

Number of distinct active users represented by this row. Only set for grouped rollups (group_by[]); null for per-user rows. In date-range mode, recomputed as an exact distinct count of the group's active members over the requested window, never a sum of per-day values.

Parameters:

  • value (Integer, nil)

Returns:

  • (Integer, nil)


39
# File 'lib/anthropic/models/beta/organization/beta_analytics_user_activity.rb', line 39

required :distinct_user_count, Integer, nil?: true

#last_activity_date ⇒ Date?

Most recent UTC day (YYYY-MM-DD) on which the user had any counted activity, within the requested window: equal to the requested date in single-day mode, and to the latest active day from starting_date (inclusive) to ending_date (exclusive) in date-range rollup mode — never a day earlier than the window start. On filtered requests (filter[]) only days matching the filter count: with filter[]=rbac_group_id:{id} it is the last day the user was active while a member of that group, consistent with the row's other metrics. On grouped (group_by[]) rows it is the latest day any member of the group was active (the requested date in single-day mode). Omitted from the response while last-activity reporting is not enabled for this organization.

Parameters:

  • value (Date, nil)

Returns:

  • (Date, nil)


101
# File 'lib/anthropic/models/beta/organization/beta_analytics_user_activity.rb', line 101

optional :last_activity_date, Date, nil?: true

#office_metrics ⇒ Anthropic::Models::Beta::Organization::BetaAnalyticsOfficeMetrics

Office Agent activity metrics for a single user on a given day, broken out by Office product.

Parameters:

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

Returns:



46
# File 'lib/anthropic/models/beta/organization/beta_analytics_user_activity.rb', line 46

required :office_metrics, -> { Anthropic::Beta::Organization::BetaAnalyticsOfficeMetrics }

#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)


108
# File 'lib/anthropic/models/beta/organization/beta_analytics_user_activity.rb', line 108

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)


116
# File 'lib/anthropic/models/beta/organization/beta_analytics_user_activity.rb', line 116

optional :rbac_group_name, String, nil?: true

#science_metrics ⇒ Anthropic::Models::Beta::Organization::BetaAnalyticsScienceMetrics

Claude Science activity metrics for a single user on a given day.

Parameters:

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

Returns:



52
# File 'lib/anthropic/models/beta/organization/beta_analytics_user_activity.rb', line 52

required :science_metrics, -> { Anthropic::Beta::Organization::BetaAnalyticsScienceMetrics }

#user ⇒ Anthropic::Models::Beta::Organization::BetaAnalyticsUser?

The user this row describes. Null on rows aggregated across users.

Parameters:

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

Returns:



58
# File 'lib/anthropic/models/beta/organization/beta_analytics_user_activity.rb', line 58

required :user, -> { Anthropic::Beta::Organization::BetaAnalyticsUser }, nil?: true

#web_search_count ⇒ Integer

Number of web searches performed

Parameters:

  • value (Integer)

Returns:

  • (Integer)


64
# File 'lib/anthropic/models/beta/organization/beta_analytics_user_activity.rb', line 64

required :web_search_count, Integer

Instance Method Details

#to_hash ⇒ { chat_metrics: Anthropic::Beta::Organization::BetaAnalyticsChatMetrics, claude_code_metrics: Anthropic::Beta::Organization::BetaAnalyticsClaudeCodeMetrics, cowork_metrics: Anthropic::Beta::Organization::BetaAnalyticsCoworkMetrics, design_metrics: Anthropic::Beta::Organization::BetaAnalyticsDesignMetrics, distinct_user_count: Integer?, office_metrics: Anthropic::Beta::Organization::BetaAnalyticsOfficeMetrics, science_metrics: Anthropic::Beta::Organization::BetaAnalyticsScienceMetrics, user: Anthropic::Beta::Organization::BetaAnalyticsUser?, web_search_count: Integer, chat_cowork_unified_metrics: Anthropic::Beta::Organization::BetaAnalyticsChatCoworkUnifiedMetrics?, claude_tag_metrics: Anthropic::Beta::Organization::BetaAnalyticsClaudeTagMetrics?, last_activity_date: Date?, rbac_group_id: String?, rbac_group_name: String? }

Returns:

  • ({ chat_metrics: Anthropic::Beta::Organization::BetaAnalyticsChatMetrics, claude_code_metrics: Anthropic::Beta::Organization::BetaAnalyticsClaudeCodeMetrics, cowork_metrics: Anthropic::Beta::Organization::BetaAnalyticsCoworkMetrics, design_metrics: Anthropic::Beta::Organization::BetaAnalyticsDesignMetrics, distinct_user_count: Integer?, office_metrics: Anthropic::Beta::Organization::BetaAnalyticsOfficeMetrics, science_metrics: Anthropic::Beta::Organization::BetaAnalyticsScienceMetrics, user: Anthropic::Beta::Organization::BetaAnalyticsUser?, web_search_count: Integer, chat_cowork_unified_metrics: Anthropic::Beta::Organization::BetaAnalyticsChatCoworkUnifiedMetrics?, claude_tag_metrics: Anthropic::Beta::Organization::BetaAnalyticsClaudeTagMetrics?, last_activity_date: Date?, rbac_group_id: String?, rbac_group_name: String? })


69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
# File 'sig/anthropic/models/beta/organization/beta_analytics_user_activity.rbs', line 69

def to_hash: -> {
  chat_metrics: Anthropic::Beta::Organization::BetaAnalyticsChatMetrics,
  claude_code_metrics: Anthropic::Beta::Organization::BetaAnalyticsClaudeCodeMetrics,
  cowork_metrics: Anthropic::Beta::Organization::BetaAnalyticsCoworkMetrics,
  design_metrics: Anthropic::Beta::Organization::BetaAnalyticsDesignMetrics,
  distinct_user_count: Integer?,
  office_metrics: Anthropic::Beta::Organization::BetaAnalyticsOfficeMetrics,
  science_metrics: Anthropic::Beta::Organization::BetaAnalyticsScienceMetrics,
  user: Anthropic::Beta::Organization::BetaAnalyticsUser?,
  web_search_count: Integer,
  chat_cowork_unified_metrics: Anthropic::Beta::Organization::BetaAnalyticsChatCoworkUnifiedMetrics?,
  claude_tag_metrics: Anthropic::Beta::Organization::BetaAnalyticsClaudeTagMetrics?,
  last_activity_date: Date?,
  rbac_group_id: String?,
  rbac_group_name: String?
}