Class: Anthropic::Models::Organization::AnalyticsArtifactActivity

Inherits:
Internal::Type::BaseModel show all
Defined in:
lib/anthropic/models/organization/analytics_artifact_activity.rb,
sig/anthropic/models/organization/analytics_artifact_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(artifact_type:, artifacts_created_count:, distinct_user_count:, is_shared:, published_artifacts_created_count:, product: nil, rbac_group_id: nil, rbac_group_name: nil, user_id: nil) ⇒ AnalyticsArtifactActivity

Artifact-creation activity for one (artifact_type, is_shared) bucket on a given day.

Artifacts form a small finite cube — the canonical MIME type (8 values incl. other) crossed with shared-vs-private — so the response is the full set of non-empty buckets, not a ranked/paginated list. Claude Code and Cowork artifacts report under text/html and are counted from 2026-08-17 onward; earlier days contain claude.ai chat artifacts only. With group_by[]=product / user_id / rbac_group_id each row is further split by the flat group keys and counts are scoped to that cut.

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

Parameters:

  • artifact_type (String) —

    Canonical artifact MIME type (e.g. text/markdown, application/vnd.ant.react,

  • artifacts_created_count (Integer) —

    Number of artifacts created in this bucket on the requested day

  • distinct_user_count (Integer) —

    Number of distinct users who created artifacts in this bucket on the requested d

  • is_shared (Boolean) —

    Whether the artifacts in this bucket have ever been shared (a Claude Code / Cowo

  • published_artifacts_created_count (Integer) —

    Number of those artifacts that have been published (for Claude Code / Cowork art

  • 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

  • artifact_type: (String)
  • artifacts_created_count: (Integer)
  • distinct_user_count: (Integer)
  • is_shared: (Boolean)
  • published_artifacts_created_count: (Integer)
  • 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/organization/analytics_artifact_activity.rb', line 81

Instance Attribute Details

#artifact_type ⇒ String

Canonical artifact MIME type (e.g. text/markdown, application/vnd.ant.react, image/svg+xml), or other. Claude Code and Cowork artifacts report as text/html.

Parameters:

  • value (String)

Returns:

  • (String)


13
# File 'lib/anthropic/models/organization/analytics_artifact_activity.rb', line 13

required :artifact_type, String

#artifacts_created_count ⇒ Integer

Number of artifacts created in this bucket on the requested day

Parameters:

  • value (Integer)

Returns:

  • (Integer)


19
# File 'lib/anthropic/models/organization/analytics_artifact_activity.rb', line 19

required :artifacts_created_count, Integer

#distinct_user_count ⇒ Integer

Number of distinct users who created artifacts in this bucket on the requested day

Parameters:

  • value (Integer)

Returns:

  • (Integer)


26
# File 'lib/anthropic/models/organization/analytics_artifact_activity.rb', line 26

required :distinct_user_count, Integer

#is_shared ⇒ Boolean

Whether the artifacts in this bucket have ever been shared (a Claude Code / Cowork artifact is shared once anyone beyond its creator may open it: named members, the whole organization, or anyone with the link).

Parameters:

Returns:



34
# File 'lib/anthropic/models/organization/analytics_artifact_activity.rb', line 34

required :is_shared, Anthropic::Internal::Type::Boolean

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


57
# File 'lib/anthropic/models/organization/analytics_artifact_activity.rb', line 57

optional :product, String, nil?: true

#published_artifacts_created_count ⇒ Integer

Number of those artifacts that have been published (for Claude Code / Cowork artifacts: open to anyone with the link); never exceeds artifacts_created_count

Parameters:

  • value (Integer)

Returns:

  • (Integer)


42
# File 'lib/anthropic/models/organization/analytics_artifact_activity.rb', line 42

required :published_artifacts_created_count, Integer

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


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

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)


72
# File 'lib/anthropic/models/organization/analytics_artifact_activity.rb', line 72

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)


79
# File 'lib/anthropic/models/organization/analytics_artifact_activity.rb', line 79

optional :user_id, String, nil?: true

Instance Method Details

#to_hash ⇒ { artifact_type: String, artifacts_created_count: Integer, distinct_user_count: Integer, is_shared: bool, published_artifacts_created_count: Integer, product: String?, rbac_group_id: String?, rbac_group_name: String?, user_id: String? }

Returns:

  • ({ artifact_type: String, artifacts_created_count: Integer, distinct_user_count: Integer, is_shared: bool, published_artifacts_created_count: Integer, product: String?, rbac_group_id: String?, rbac_group_name: String?, user_id: String? })


48
49
50
51
52
53
54
55
56
57
58
# File 'sig/anthropic/models/organization/analytics_artifact_activity.rbs', line 48

def to_hash: -> {
  artifact_type: String,
  artifacts_created_count: Integer,
  distinct_user_count: Integer,
  is_shared: bool,
  published_artifacts_created_count: Integer,
  product: String?,
  rbac_group_id: String?,
  rbac_group_name: String?,
  user_id: String?
}