anthropic 2.0.0 → 2.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +35 -0
- data/README.md +1 -1
- data/lib/anthropic/client.rb +8 -0
- data/lib/anthropic/helpers/bedrock/client.rb +5 -0
- data/lib/anthropic/helpers/bedrock/mantle_client.rb +5 -0
- data/lib/anthropic/helpers/stainless_helper_header.rb +1 -0
- data/lib/anthropic/helpers/threads/beta_message_thread.rb +635 -0
- data/lib/anthropic/helpers/tools/runner.rb +79 -11
- data/lib/anthropic/helpers/vertex/client.rb +5 -0
- data/lib/anthropic/internal/report_page_cursor.rb +2 -2
- data/lib/anthropic/internal/tracing.rb +2 -0
- data/lib/anthropic/models/anthropic_beta.rb +6 -0
- data/lib/anthropic/models/beta/beta_message_thread_param.rb +61 -0
- data/lib/anthropic/models/beta/beta_thread_continue_params.rb +29 -0
- data/lib/anthropic/models/beta/beta_thread_create_params.rb +21 -0
- data/lib/anthropic/models/beta/message_create_params.rb +13 -1
- data/lib/anthropic/models/beta/messages/batch_create_params.rb +13 -1
- data/lib/anthropic/models/beta/organization/analytics/beta_analytics_cost_group.rb +271 -0
- data/lib/anthropic/models/beta/organization/analytics/beta_analytics_cost_group_by.rb +40 -0
- data/lib/anthropic/models/beta/organization/analytics/beta_analytics_cost_item.rb +57 -0
- data/lib/anthropic/models/beta/organization/analytics/beta_analytics_cost_metrics.rb +57 -0
- data/lib/anthropic/models/beta/organization/analytics/beta_analytics_cost_order_by.rb +22 -0
- data/lib/anthropic/models/beta/organization/analytics/beta_analytics_usage_group.rb +247 -0
- data/lib/anthropic/models/beta/organization/analytics/beta_analytics_usage_group_by.rb +38 -0
- data/lib/anthropic/models/beta/organization/analytics/beta_analytics_usage_item.rb +57 -0
- data/lib/anthropic/models/beta/organization/analytics/beta_analytics_usage_metrics.rb +79 -0
- data/lib/anthropic/models/beta/organization/analytics/beta_analytics_usage_order_by.rb +24 -0
- data/lib/anthropic/models/beta/organization/analytics/cost_list_params.rb +360 -0
- data/lib/anthropic/models/beta/organization/analytics/usage_list_params.rb +353 -0
- data/lib/anthropic/models/beta/organization/beta_analytics_actor.rb +81 -0
- data/lib/anthropic/models/beta/organization/beta_analytics_actor_type.rb +22 -0
- data/lib/anthropic/models/beta/organization/beta_analytics_api_actor.rb +27 -0
- data/lib/anthropic/models/beta/organization/beta_analytics_federated_actor.rb +42 -0
- data/lib/anthropic/models/beta/organization/beta_analytics_federated_actor_aws_provider.rb +35 -0
- data/lib/anthropic/models/beta/organization/beta_analytics_federated_actor_azure_provider.rb +27 -0
- data/lib/anthropic/models/beta/organization/beta_analytics_federated_actor_gcp_provider.rb +27 -0
- data/lib/anthropic/models/beta/organization/beta_analytics_federated_actor_oidc_provider.rb +27 -0
- data/lib/anthropic/models/beta/organization/beta_analytics_federated_actor_provider.rb +72 -0
- data/lib/anthropic/models/beta/organization/beta_analytics_grouped_cost_type.rb +21 -0
- data/lib/anthropic/models/beta/organization/beta_analytics_report_user_actor.rb +65 -0
- data/lib/anthropic/models/beta/organization/beta_analytics_service_account_actor.rb +27 -0
- data/lib/anthropic/models/beta/organization/beta_analytics_service_tier.rb +23 -0
- data/lib/anthropic/models/beta/organization/beta_analytics_speed.rb +19 -0
- data/lib/anthropic/models/beta/organization/beta_analytics_time_bucket_width.rb +20 -0
- data/lib/anthropic/models/beta/organization/beta_analytics_usage_cost_inference_geo.rb +19 -0
- data/lib/anthropic/models/beta/organization/beta_analytics_usage_cost_product_filter.rb +34 -0
- data/lib/anthropic/models/beta/organization/beta_analytics_usage_cost_sort_order.rb +19 -0
- data/lib/anthropic/models/beta/organization/beta_organization_rate_limit.rb +2 -1
- data/lib/anthropic/models/beta/organization/beta_plugin.rb +12 -6
- data/lib/anthropic/models/beta/organization/beta_plugin_content_scan.rb +11 -5
- data/lib/anthropic/models/beta/organization/workspaces/beta_workspace_rate_limit.rb +2 -1
- data/lib/anthropic/models/organization/organization_rate_limit.rb +2 -1
- data/lib/anthropic/models/organization/workspaces/workspace_rate_limit.rb +2 -1
- data/lib/anthropic/models/user_profile.rb +26 -1
- data/lib/anthropic/models/user_profile_enforcement_action.rb +66 -0
- data/lib/anthropic/models/user_profile_enforcement_action_ban.rb +62 -0
- data/lib/anthropic/models/user_profile_enforcement_action_next_step.rb +17 -0
- data/lib/anthropic/models/user_profile_enforcement_action_reason.rb +23 -0
- data/lib/anthropic/models/user_profile_enforcement_action_restriction.rb +67 -0
- data/lib/anthropic/models/user_profile_enforcement_status.rb +20 -0
- data/lib/anthropic/models/user_profile_list_params.rb +17 -1
- data/lib/anthropic/models.rb +12 -0
- data/lib/anthropic/resources/beta/messages.rb +78 -4
- data/lib/anthropic/resources/beta/organization/analytics/cost.rb +175 -0
- data/lib/anthropic/resources/beta/organization/analytics/cost_report.rb +13 -6
- data/lib/anthropic/resources/beta/organization/analytics/usage.rb +176 -0
- data/lib/anthropic/resources/beta/organization/analytics/usage_report.rb +9 -2
- data/lib/anthropic/resources/beta/organization/analytics/user_cost_report.rb +12 -5
- data/lib/anthropic/resources/beta/organization/analytics/user_usage_report.rb +15 -8
- data/lib/anthropic/resources/beta/organization/analytics.rb +8 -0
- data/lib/anthropic/resources/beta/organization/plugin_marketplaces.rb +6 -6
- data/lib/anthropic/resources/beta/organization/plugins.rb +12 -9
- data/lib/anthropic/resources/user_profiles.rb +5 -3
- data/lib/anthropic/version.rb +1 -1
- data/lib/anthropic.rb +42 -0
- data/rbi/anthropic/client.rbi +5 -0
- data/rbi/anthropic/helpers/bedrock/client.rbi +5 -0
- data/rbi/anthropic/helpers/bedrock/mantle_client.rbi +5 -0
- data/rbi/anthropic/helpers/threads/beta_message_thread.rbi +100 -0
- data/rbi/anthropic/helpers/vertex/client.rbi +5 -0
- data/rbi/anthropic/internal/tracing.rbi +4 -0
- data/rbi/anthropic/models/anthropic_beta.rbi +10 -0
- data/rbi/anthropic/models/beta/beta_message_thread_param.rbi +80 -0
- data/rbi/anthropic/models/beta/beta_thread_continue_params.rbi +43 -0
- data/rbi/anthropic/models/beta/beta_thread_create_params.rbi +31 -0
- data/rbi/anthropic/models/beta/message_create_params.rbi +37 -0
- data/rbi/anthropic/models/beta/messages/batch_create_params.rbi +37 -0
- data/rbi/anthropic/models/beta/organization/analytics/beta_analytics_cost_group.rbi +439 -0
- data/rbi/anthropic/models/beta/organization/analytics/beta_analytics_cost_group_by.rbi +140 -0
- data/rbi/anthropic/models/beta/organization/analytics/beta_analytics_cost_item.rbi +110 -0
- data/rbi/anthropic/models/beta/organization/analytics/beta_analytics_cost_metrics.rbi +79 -0
- data/rbi/anthropic/models/beta/organization/analytics/beta_analytics_cost_order_by.rbi +50 -0
- data/rbi/anthropic/models/beta/organization/analytics/beta_analytics_usage_group.rbi +399 -0
- data/rbi/anthropic/models/beta/organization/analytics/beta_analytics_usage_group_by.rbi +130 -0
- data/rbi/anthropic/models/beta/organization/analytics/beta_analytics_usage_item.rbi +110 -0
- data/rbi/anthropic/models/beta/organization/analytics/beta_analytics_usage_metrics.rbi +120 -0
- data/rbi/anthropic/models/beta/organization/analytics/beta_analytics_usage_order_by.rbi +60 -0
- data/rbi/anthropic/models/beta/organization/analytics/cost_list_params.rbi +624 -0
- data/rbi/anthropic/models/beta/organization/analytics/usage_list_params.rbi +612 -0
- data/rbi/anthropic/models/beta/organization/beta_analytics_actor.rbi +134 -0
- data/rbi/anthropic/models/beta/organization/beta_analytics_actor_type.rbi +54 -0
- data/rbi/anthropic/models/beta/organization/beta_analytics_api_actor.rbi +40 -0
- data/rbi/anthropic/models/beta/organization/beta_analytics_federated_actor.rbi +75 -0
- data/rbi/anthropic/models/beta/organization/beta_analytics_federated_actor_aws_provider.rbi +54 -0
- data/rbi/anthropic/models/beta/organization/beta_analytics_federated_actor_azure_provider.rbi +42 -0
- data/rbi/anthropic/models/beta/organization/beta_analytics_federated_actor_gcp_provider.rbi +42 -0
- data/rbi/anthropic/models/beta/organization/beta_analytics_federated_actor_oidc_provider.rbi +42 -0
- data/rbi/anthropic/models/beta/organization/beta_analytics_federated_actor_provider.rbi +107 -0
- data/rbi/anthropic/models/beta/organization/beta_analytics_grouped_cost_type.rbi +53 -0
- data/rbi/anthropic/models/beta/organization/beta_analytics_report_user_actor.rbi +94 -0
- data/rbi/anthropic/models/beta/organization/beta_analytics_service_account_actor.rbi +42 -0
- data/rbi/anthropic/models/beta/organization/beta_analytics_service_tier.rbi +63 -0
- data/rbi/anthropic/models/beta/organization/beta_analytics_speed.rbi +40 -0
- data/rbi/anthropic/models/beta/organization/beta_analytics_time_bucket_width.rbi +48 -0
- data/rbi/anthropic/models/beta/organization/beta_analytics_usage_cost_inference_geo.rbi +43 -0
- data/rbi/anthropic/models/beta/organization/beta_analytics_usage_cost_product_filter.rbi +98 -0
- data/rbi/anthropic/models/beta/organization/beta_analytics_usage_cost_sort_order.rbi +43 -0
- data/rbi/anthropic/models/beta/organization/beta_organization_rate_limit.rbi +4 -2
- data/rbi/anthropic/models/beta/organization/beta_plugin.rbi +20 -8
- data/rbi/anthropic/models/beta/organization/beta_plugin_content_scan.rbi +15 -6
- data/rbi/anthropic/models/beta/organization/workspaces/beta_workspace_rate_limit.rbi +4 -2
- data/rbi/anthropic/models/organization/organization_rate_limit.rbi +4 -2
- data/rbi/anthropic/models/organization/workspaces/workspace_rate_limit.rbi +4 -2
- data/rbi/anthropic/models/user_profile.rbi +42 -0
- data/rbi/anthropic/models/user_profile_enforcement_action.rbi +95 -0
- data/rbi/anthropic/models/user_profile_enforcement_action_ban.rbi +96 -0
- data/rbi/anthropic/models/user_profile_enforcement_action_next_step.rbi +34 -0
- data/rbi/anthropic/models/user_profile_enforcement_action_reason.rbi +58 -0
- data/rbi/anthropic/models/user_profile_enforcement_action_restriction.rbi +106 -0
- data/rbi/anthropic/models/user_profile_enforcement_status.rbi +39 -0
- data/rbi/anthropic/models/user_profile_list_params.rbi +36 -0
- data/rbi/anthropic/models.rbi +16 -0
- data/rbi/anthropic/resources/beta/messages.rbi +191 -0
- data/rbi/anthropic/resources/beta/organization/analytics/cost.rbi +245 -0
- data/rbi/anthropic/resources/beta/organization/analytics/cost_report.rbi +12 -5
- data/rbi/anthropic/resources/beta/organization/analytics/usage.rbi +240 -0
- data/rbi/anthropic/resources/beta/organization/analytics/usage_report.rbi +9 -2
- data/rbi/anthropic/resources/beta/organization/analytics/user_cost_report.rbi +12 -5
- data/rbi/anthropic/resources/beta/organization/analytics/user_usage_report.rbi +14 -7
- data/rbi/anthropic/resources/beta/organization/analytics.rbi +10 -0
- data/rbi/anthropic/resources/beta/organization/plugin_marketplaces.rbi +6 -6
- data/rbi/anthropic/resources/beta/organization/plugins.rbi +12 -9
- data/rbi/anthropic/resources/user_profiles.rbi +12 -0
- data/rbi/lib/anthropic/helpers/stainless_helper_header.rbi +2 -0
- data/sig/anthropic/client.rbs +2 -0
- data/sig/anthropic/helpers/bedrock/client.rbs +2 -0
- data/sig/anthropic/helpers/threads/beta_message_thread.rbs +40 -0
- data/sig/anthropic/helpers/tools/runner.rbs +40 -0
- data/sig/anthropic/helpers/vertex/client.rbs +2 -0
- data/sig/anthropic/internal/tracing.rbs +2 -0
- data/sig/anthropic/models/anthropic_beta.rbs +4 -0
- data/sig/anthropic/models/beta/beta_message_thread_param.rbs +40 -0
- data/sig/anthropic/models/beta/beta_thread_continue_params.rbs +20 -0
- data/sig/anthropic/models/beta/beta_thread_create_params.rbs +17 -0
- data/sig/anthropic/models/beta/message_create_params.rbs +5 -0
- data/sig/anthropic/models/beta/messages/batch_create_params.rbs +5 -0
- data/sig/anthropic/models/beta/organization/analytics/beta_analytics_cost_group.rbs +126 -0
- data/sig/anthropic/models/beta/organization/analytics/beta_analytics_cost_group_by.rbs +60 -0
- data/sig/anthropic/models/beta/organization/analytics/beta_analytics_cost_item.rbs +41 -0
- data/sig/anthropic/models/beta/organization/analytics/beta_analytics_cost_metrics.rbs +41 -0
- data/sig/anthropic/models/beta/organization/analytics/beta_analytics_cost_order_by.rbs +21 -0
- data/sig/anthropic/models/beta/organization/analytics/beta_analytics_usage_group.rbs +116 -0
- data/sig/anthropic/models/beta/organization/analytics/beta_analytics_usage_group_by.rbs +56 -0
- data/sig/anthropic/models/beta/organization/analytics/beta_analytics_usage_item.rbs +41 -0
- data/sig/anthropic/models/beta/organization/analytics/beta_analytics_usage_metrics.rbs +56 -0
- data/sig/anthropic/models/beta/organization/analytics/beta_analytics_usage_order_by.rbs +28 -0
- data/sig/anthropic/models/beta/organization/analytics/cost_list_params.rbs +188 -0
- data/sig/anthropic/models/beta/organization/analytics/usage_list_params.rbs +188 -0
- data/sig/anthropic/models/beta/organization/beta_analytics_actor.rbs +67 -0
- data/sig/anthropic/models/beta/organization/beta_analytics_actor_type.rbs +21 -0
- data/sig/anthropic/models/beta/organization/beta_analytics_api_actor.rbs +19 -0
- data/sig/anthropic/models/beta/organization/beta_analytics_federated_actor.rbs +34 -0
- data/sig/anthropic/models/beta/organization/beta_analytics_federated_actor_aws_provider.rbs +30 -0
- data/sig/anthropic/models/beta/organization/beta_analytics_federated_actor_azure_provider.rbs +20 -0
- data/sig/anthropic/models/beta/organization/beta_analytics_federated_actor_gcp_provider.rbs +20 -0
- data/sig/anthropic/models/beta/organization/beta_analytics_federated_actor_oidc_provider.rbs +20 -0
- data/sig/anthropic/models/beta/organization/beta_analytics_federated_actor_provider.rbs +60 -0
- data/sig/anthropic/models/beta/organization/beta_analytics_grouped_cost_type.rbs +21 -0
- data/sig/anthropic/models/beta/organization/beta_analytics_report_user_actor.rbs +44 -0
- data/sig/anthropic/models/beta/organization/beta_analytics_service_account_actor.rbs +26 -0
- data/sig/anthropic/models/beta/organization/beta_analytics_service_tier.rbs +28 -0
- data/sig/anthropic/models/beta/organization/beta_analytics_speed.rbs +18 -0
- data/sig/anthropic/models/beta/organization/beta_analytics_time_bucket_width.rbs +19 -0
- data/sig/anthropic/models/beta/organization/beta_analytics_usage_cost_inference_geo.rbs +18 -0
- data/sig/anthropic/models/beta/organization/beta_analytics_usage_cost_product_filter.rbs +40 -0
- data/sig/anthropic/models/beta/organization/beta_analytics_usage_cost_sort_order.rbs +18 -0
- data/sig/anthropic/models/user_profile.rbs +10 -0
- data/sig/anthropic/models/user_profile_enforcement_action.rbs +50 -0
- data/sig/anthropic/models/user_profile_enforcement_action_ban.rbs +45 -0
- data/sig/anthropic/models/user_profile_enforcement_action_next_step.rbs +13 -0
- data/sig/anthropic/models/user_profile_enforcement_action_reason.rbs +24 -0
- data/sig/anthropic/models/user_profile_enforcement_action_restriction.rbs +45 -0
- data/sig/anthropic/models/user_profile_enforcement_status.rbs +17 -0
- data/sig/anthropic/models/user_profile_list_params.rbs +9 -0
- data/sig/anthropic/models.rbs +12 -0
- data/sig/anthropic/resources/beta/messages.rbs +33 -0
- data/sig/anthropic/resources/beta/organization/analytics/cost.rbs +46 -0
- data/sig/anthropic/resources/beta/organization/analytics/usage.rbs +46 -0
- data/sig/anthropic/resources/beta/organization/analytics.rbs +4 -0
- data/sig/anthropic/resources/user_profiles.rbs +1 -0
- metadata +130 -3
|
@@ -0,0 +1,353 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Anthropic
|
|
4
|
+
module Models
|
|
5
|
+
module Beta
|
|
6
|
+
module Organization
|
|
7
|
+
module Analytics
|
|
8
|
+
# @see Anthropic::Resources::Beta::Organization::Analytics::Usage#list
|
|
9
|
+
class UsageListParams < Anthropic::Internal::Type::BaseModel
|
|
10
|
+
extend Anthropic::Internal::Type::RequestParameters::Converter
|
|
11
|
+
include Anthropic::Internal::Type::RequestParameters
|
|
12
|
+
|
|
13
|
+
# @!attribute starting_at
|
|
14
|
+
# Start of range, inclusive. RFC 3339 tz-aware. Must be within the last 365 days
|
|
15
|
+
# and no earlier than 2026-01-01T00:00:00Z.
|
|
16
|
+
#
|
|
17
|
+
# @return [Time]
|
|
18
|
+
required :starting_at, Time
|
|
19
|
+
|
|
20
|
+
# @!attribute actor_ids
|
|
21
|
+
# Filter to usage attributed to specific identities, by tagged ID: a `user_...`,
|
|
22
|
+
# `svac_...` (service account), or `apikey_...` ID. An `apikey_` entry matches
|
|
23
|
+
# only usage attributed to the key itself, not usage on that key attributed to a
|
|
24
|
+
# user or service account (use `api_key_ids[]` for every request a key
|
|
25
|
+
# authenticated). Federated identities have no tagged ID; select them with
|
|
26
|
+
# `actor_types[]`. Use `group_by[]=actor` to break out per-identity values.
|
|
27
|
+
#
|
|
28
|
+
# @return [Array<String>, nil]
|
|
29
|
+
optional :actor_ids, Anthropic::Internal::Type::ArrayOf[String], nil?: true
|
|
30
|
+
|
|
31
|
+
# @!attribute actor_types
|
|
32
|
+
# Filter to usage attributed to specific kinds of identity. Use
|
|
33
|
+
# `group_by[]=actor_type` to break out per-kind values.
|
|
34
|
+
#
|
|
35
|
+
# @return [Array<Symbol, Anthropic::Models::Beta::Organization::BetaAnalyticsActorType>, nil]
|
|
36
|
+
optional :actor_types,
|
|
37
|
+
-> {
|
|
38
|
+
Anthropic::Internal::Type::ArrayOf[enum: Anthropic::Beta::Organization::BetaAnalyticsActorType]
|
|
39
|
+
},
|
|
40
|
+
nil?: true
|
|
41
|
+
|
|
42
|
+
# @!attribute agent_ids
|
|
43
|
+
# Filter to usage incurred by sessions of specific Claude Managed Agents agents.
|
|
44
|
+
# Use `group_by[]=agent_id` to break out per-agent values. Claude Developer
|
|
45
|
+
# Platform organizations only.
|
|
46
|
+
#
|
|
47
|
+
# @return [Array<String>, nil]
|
|
48
|
+
optional :agent_ids, Anthropic::Internal::Type::ArrayOf[String], nil?: true
|
|
49
|
+
|
|
50
|
+
# @!attribute api_key_ids
|
|
51
|
+
# Filter to usage authenticated by specific API keys, by tagged API key ID
|
|
52
|
+
# (`apikey_...`), whichever identity the usage is attributed to. Include an empty
|
|
53
|
+
# entry (`api_key_ids[]=`) to also match usage that no API key authenticated. Use
|
|
54
|
+
# `group_by[]=api_key_id` to break out per-key values; usage without a key has a
|
|
55
|
+
# null `api_key_id`. Claude Developer Platform organizations only.
|
|
56
|
+
#
|
|
57
|
+
# @return [Array<String>, nil]
|
|
58
|
+
optional :api_key_ids, Anthropic::Internal::Type::ArrayOf[String], nil?: true
|
|
59
|
+
|
|
60
|
+
# @!attribute claude_tag_categories
|
|
61
|
+
# Filter to Claude Tag (Claude in Slack) usage in specific spend categories. Usage
|
|
62
|
+
# with no category never matches. `dm` usage is reported under the user's product
|
|
63
|
+
# rather than `claude_tag`, so combining this filter with `products[]=claude_tag`
|
|
64
|
+
# excludes it. Use `group_by[]=claude_tag_category` to break out per-category
|
|
65
|
+
# values.
|
|
66
|
+
#
|
|
67
|
+
# @return [Array<Symbol, Anthropic::Models::Beta::Organization::BetaAnalyticsClaudeTagCategory>, nil]
|
|
68
|
+
optional :claude_tag_categories,
|
|
69
|
+
-> {
|
|
70
|
+
Anthropic::Internal::Type::ArrayOf[enum: Anthropic::Beta::Organization::BetaAnalyticsClaudeTagCategory]
|
|
71
|
+
},
|
|
72
|
+
nil?: true
|
|
73
|
+
|
|
74
|
+
# @!attribute claude_tag_user_ids
|
|
75
|
+
# Filter to Claude Tag (Claude in Slack) usage attributed to specific Slack users,
|
|
76
|
+
# by Slack user ID (for example `U0123ABCDEF`), not claude.ai user ID. Usage that
|
|
77
|
+
# is not Claude Tag, and Claude Tag usage not attributed to a single user, never
|
|
78
|
+
# matches. Use `group_by[]=claude_tag_user_id` to break out per-user values.
|
|
79
|
+
#
|
|
80
|
+
# @return [Array<String>, nil]
|
|
81
|
+
optional :claude_tag_user_ids, Anthropic::Internal::Type::ArrayOf[String], nil?: true
|
|
82
|
+
|
|
83
|
+
# @!attribute context_windows
|
|
84
|
+
# Filter to specific context-window pricing tiers. Use `group_by[]=context_window`
|
|
85
|
+
# to break out per-tier values.
|
|
86
|
+
#
|
|
87
|
+
# @return [Array<Symbol, Anthropic::Models::Beta::Organization::BetaAnalyticsContextWindow>, nil]
|
|
88
|
+
optional :context_windows,
|
|
89
|
+
-> {
|
|
90
|
+
Anthropic::Internal::Type::ArrayOf[enum: Anthropic::Beta::Organization::BetaAnalyticsContextWindow]
|
|
91
|
+
},
|
|
92
|
+
nil?: true
|
|
93
|
+
|
|
94
|
+
# @!attribute deployment_ids
|
|
95
|
+
# Filter to usage incurred by Claude Managed Agents sessions that specific
|
|
96
|
+
# deployments started. Use `group_by[]=deployment_id` to break out per-deployment
|
|
97
|
+
# values. Claude Developer Platform organizations only.
|
|
98
|
+
#
|
|
99
|
+
# @return [Array<String>, nil]
|
|
100
|
+
optional :deployment_ids, Anthropic::Internal::Type::ArrayOf[String], nil?: true
|
|
101
|
+
|
|
102
|
+
# @!attribute ending_at
|
|
103
|
+
# End of range, exclusive. Required when `time_bucket_width` is set. Without
|
|
104
|
+
# `time_bucket_width`, defaults to the earlier of now and `starting_at` + 31 days.
|
|
105
|
+
# The range may span at most 31 days.
|
|
106
|
+
#
|
|
107
|
+
# @return [Time, nil]
|
|
108
|
+
optional :ending_at, Time, nil?: true
|
|
109
|
+
|
|
110
|
+
# @!attribute environment_ids
|
|
111
|
+
# Filter to usage incurred by Claude Managed Agents sessions that ran in specific
|
|
112
|
+
# environments. Use `group_by[]=environment_id` to break out per-environment
|
|
113
|
+
# values. Claude Developer Platform organizations only.
|
|
114
|
+
#
|
|
115
|
+
# @return [Array<String>, nil]
|
|
116
|
+
optional :environment_ids, Anthropic::Internal::Type::ArrayOf[String], nil?: true
|
|
117
|
+
|
|
118
|
+
# @!attribute exclude_deleted_users
|
|
119
|
+
# If true, omit rows whose `actor` is a `user_actor` with `deleted: true`.
|
|
120
|
+
# Requires `group_by[]=actor`. Rows for other actor types, and rows whose `actor`
|
|
121
|
+
# is null, are always kept. A page may contain fewer than `limit` rows; use
|
|
122
|
+
# `has_more` and `next_page` to paginate as usual.
|
|
123
|
+
#
|
|
124
|
+
# @return [Boolean, nil]
|
|
125
|
+
optional :exclude_deleted_users, Anthropic::Internal::Type::Boolean
|
|
126
|
+
|
|
127
|
+
# @!attribute group_by
|
|
128
|
+
# Dimensions to break usage out by (at most 5): one row per combination of their
|
|
129
|
+
# values with usage in the range (and per time bucket, when `time_bucket_width` is
|
|
130
|
+
# set), every combination returned across pages rather than a capped top set. When
|
|
131
|
+
# omitted, a single row aggregates the whole range.
|
|
132
|
+
#
|
|
133
|
+
# @return [Array<Symbol, Anthropic::Models::Beta::Organization::Analytics::BetaAnalyticsUsageGroupBy>, nil]
|
|
134
|
+
optional :group_by,
|
|
135
|
+
-> {
|
|
136
|
+
Anthropic::Internal::Type::ArrayOf[enum: Anthropic::Beta::Organization::Analytics::BetaAnalyticsUsageGroupBy]
|
|
137
|
+
},
|
|
138
|
+
nil?: true
|
|
139
|
+
|
|
140
|
+
# @!attribute inference_geos
|
|
141
|
+
# Filter to specific inference regions. `not_available` matches rows where the
|
|
142
|
+
# region is unset. Use `group_by[]=inference_geo` to break out per-region values.
|
|
143
|
+
#
|
|
144
|
+
# @return [Array<Symbol, Anthropic::Models::Beta::Organization::BetaAnalyticsInferenceGeoFilter>, nil]
|
|
145
|
+
optional :inference_geos,
|
|
146
|
+
-> {
|
|
147
|
+
Anthropic::Internal::Type::ArrayOf[enum: Anthropic::Beta::Organization::BetaAnalyticsInferenceGeoFilter]
|
|
148
|
+
},
|
|
149
|
+
nil?: true
|
|
150
|
+
|
|
151
|
+
# @!attribute limit
|
|
152
|
+
# Number of rows per page (1-1000, default 20). `cost_type`/`token_type` fan-out
|
|
153
|
+
# rows (cost endpoint only) do not count toward this limit, so `data` can exceed
|
|
154
|
+
# it.
|
|
155
|
+
#
|
|
156
|
+
# @return [Integer, nil]
|
|
157
|
+
optional :limit, Integer
|
|
158
|
+
|
|
159
|
+
# @!attribute models
|
|
160
|
+
# Models to include. Defaults to all models. Use `group_by[]=model` to break out
|
|
161
|
+
# per-model values.
|
|
162
|
+
#
|
|
163
|
+
# @return [Array<String>, nil]
|
|
164
|
+
optional :models, Anthropic::Internal::Type::ArrayOf[String], nil?: true
|
|
165
|
+
|
|
166
|
+
# @!attribute order
|
|
167
|
+
# Sort direction of the `order_by` metric, or of the time buckets when `order_by`
|
|
168
|
+
# is `time` and `time_bucket_width` is set. Defaults to `desc`.
|
|
169
|
+
#
|
|
170
|
+
# @return [Symbol, Anthropic::Models::Beta::Organization::BetaAnalyticsUsageCostSortOrder, nil]
|
|
171
|
+
optional :order, enum: -> { Anthropic::Beta::Organization::BetaAnalyticsUsageCostSortOrder }
|
|
172
|
+
|
|
173
|
+
# @!attribute order_by
|
|
174
|
+
# Row order. A metric ranks rows by that metric in the `order` direction. `time`
|
|
175
|
+
# orders rows by time bucket in the `order` direction (newest first by default)
|
|
176
|
+
# and, within a bucket, by `total_tokens`, highest first. `time` takes effect only
|
|
177
|
+
# with `time_bucket_width`; without it, `time` is the same as `total_tokens`.
|
|
178
|
+
# Defaults to `total_tokens`.
|
|
179
|
+
#
|
|
180
|
+
# @return [Symbol, Anthropic::Models::Beta::Organization::Analytics::BetaAnalyticsUsageOrderBy, nil]
|
|
181
|
+
optional :order_by, enum: -> { Anthropic::Beta::Organization::Analytics::BetaAnalyticsUsageOrderBy }
|
|
182
|
+
|
|
183
|
+
# @!attribute page
|
|
184
|
+
# Opaque cursor from a previous response's `next_page` field.
|
|
185
|
+
#
|
|
186
|
+
# @return [String, nil]
|
|
187
|
+
optional :page, String, nil?: true
|
|
188
|
+
|
|
189
|
+
# @!attribute products
|
|
190
|
+
# Product surfaces to include. Defaults to all products.
|
|
191
|
+
#
|
|
192
|
+
# @return [Array<Symbol, Anthropic::Models::Beta::Organization::BetaAnalyticsUsageCostProductFilter>, nil]
|
|
193
|
+
optional :products,
|
|
194
|
+
-> {
|
|
195
|
+
Anthropic::Internal::Type::ArrayOf[enum: Anthropic::Beta::Organization::BetaAnalyticsUsageCostProductFilter]
|
|
196
|
+
},
|
|
197
|
+
nil?: true
|
|
198
|
+
|
|
199
|
+
# @!attribute rbac_group_ids
|
|
200
|
+
# Filter to usage attributed to specific RBAC groups. Accepts tagged RBAC group
|
|
201
|
+
# IDs (`rbac_group_...`) or bare group UUIDs. A row matches when the user belonged
|
|
202
|
+
# to any of the listed groups on the (UTC) day the usage occurred; usage with no
|
|
203
|
+
# group attribution never matches.
|
|
204
|
+
#
|
|
205
|
+
# @return [Array<String>, nil]
|
|
206
|
+
optional :rbac_group_ids, Anthropic::Internal::Type::ArrayOf[String], nil?: true
|
|
207
|
+
|
|
208
|
+
# @!attribute service_tiers
|
|
209
|
+
# Filter to specific service tiers. Use `group_by[]=service_tier` to break out
|
|
210
|
+
# per-tier values. Claude Developer Platform organizations only; matches nothing
|
|
211
|
+
# for a Claude Enterprise organization.
|
|
212
|
+
#
|
|
213
|
+
# @return [Array<Symbol, Anthropic::Models::Beta::Organization::BetaAnalyticsServiceTier>, nil]
|
|
214
|
+
optional :service_tiers,
|
|
215
|
+
-> {
|
|
216
|
+
Anthropic::Internal::Type::ArrayOf[enum: Anthropic::Beta::Organization::BetaAnalyticsServiceTier]
|
|
217
|
+
},
|
|
218
|
+
nil?: true
|
|
219
|
+
|
|
220
|
+
# @!attribute session_ids
|
|
221
|
+
# Filter to usage incurred by specific Claude Managed Agents sessions, by tagged
|
|
222
|
+
# session ID (`sesn_...`). Use `group_by[]=session_id` to break out per-session
|
|
223
|
+
# values. Claude Developer Platform organizations only.
|
|
224
|
+
#
|
|
225
|
+
# @return [Array<String>, nil]
|
|
226
|
+
optional :session_ids, Anthropic::Internal::Type::ArrayOf[String], nil?: true
|
|
227
|
+
|
|
228
|
+
# @!attribute slack_channel_ids
|
|
229
|
+
# Filter to usage originating from specific Slack channels. Use
|
|
230
|
+
# `group_by[]=slack_channel_id` to break out per-channel values.
|
|
231
|
+
#
|
|
232
|
+
# @return [Array<String>, nil]
|
|
233
|
+
optional :slack_channel_ids, Anthropic::Internal::Type::ArrayOf[String], nil?: true
|
|
234
|
+
|
|
235
|
+
# @!attribute speeds
|
|
236
|
+
# Filter to fast or standard inference mode. Use `group_by[]=speed` to break out
|
|
237
|
+
# per-mode values.
|
|
238
|
+
#
|
|
239
|
+
# @return [Array<Symbol, Anthropic::Models::Beta::Organization::BetaAnalyticsSpeed>, nil]
|
|
240
|
+
optional :speeds,
|
|
241
|
+
-> {
|
|
242
|
+
Anthropic::Internal::Type::ArrayOf[enum: Anthropic::Beta::Organization::BetaAnalyticsSpeed]
|
|
243
|
+
},
|
|
244
|
+
nil?: true
|
|
245
|
+
|
|
246
|
+
# @!attribute time_bucket_width
|
|
247
|
+
# Time-bucket granularity. When set, rows are returned per time bucket (one per
|
|
248
|
+
# bucket and dimension combination with usage) and each row's `starting_at` and
|
|
249
|
+
# `ending_at` are that bucket's bounds; the time bucket counts toward `limit`.
|
|
250
|
+
# `ending_at` is required when `time_bucket_width` is set, and with
|
|
251
|
+
# `time_bucket_width="1m"` the range may span at most 24 hours. When omitted, each
|
|
252
|
+
# row aggregates the requested range with `starting_at` and `ending_at` each
|
|
253
|
+
# rounded down to the hour.
|
|
254
|
+
#
|
|
255
|
+
# @return [Symbol, Anthropic::Models::Beta::Organization::BetaAnalyticsTimeBucketWidth, nil]
|
|
256
|
+
optional :time_bucket_width,
|
|
257
|
+
enum: -> { Anthropic::Beta::Organization::BetaAnalyticsTimeBucketWidth },
|
|
258
|
+
nil?: true
|
|
259
|
+
|
|
260
|
+
# @!attribute user_profile_ids
|
|
261
|
+
# Filter to usage attributed to specific user profiles, by tagged user profile ID
|
|
262
|
+
# (`uprof_...`). Use `group_by[]=user_profile_id` to break out per-profile values.
|
|
263
|
+
# Claude Developer Platform organizations only.
|
|
264
|
+
#
|
|
265
|
+
# @return [Array<String>, nil]
|
|
266
|
+
optional :user_profile_ids, Anthropic::Internal::Type::ArrayOf[String], nil?: true
|
|
267
|
+
|
|
268
|
+
# @!attribute workspace_ids
|
|
269
|
+
# Filter to usage in specific workspaces, by tagged workspace ID (`wrkspc_...`).
|
|
270
|
+
# Use `group_by[]=workspace_id` to break out per-workspace values. Claude
|
|
271
|
+
# Developer Platform organizations only; matches nothing for a Claude Enterprise
|
|
272
|
+
# organization.
|
|
273
|
+
#
|
|
274
|
+
# @return [Array<String>, nil]
|
|
275
|
+
optional :workspace_ids, Anthropic::Internal::Type::ArrayOf[String], nil?: true
|
|
276
|
+
|
|
277
|
+
# @!attribute betas
|
|
278
|
+
# This endpoint is in beta: requests must send `analytics-usage-cost-2026-08-24`
|
|
279
|
+
# in this header.
|
|
280
|
+
#
|
|
281
|
+
# @return [Array<Symbol, String, Anthropic::Models::AnthropicBeta>, nil]
|
|
282
|
+
optional :betas, -> { Anthropic::Internal::Type::ArrayOf[union: Anthropic::AnthropicBeta] }
|
|
283
|
+
|
|
284
|
+
# @!method initialize(starting_at:, actor_ids: nil, actor_types: nil, agent_ids: nil, api_key_ids: nil, claude_tag_categories: nil, claude_tag_user_ids: nil, context_windows: nil, deployment_ids: nil, ending_at: nil, environment_ids: nil, exclude_deleted_users: nil, group_by: nil, inference_geos: nil, limit: nil, models: nil, order: nil, order_by: nil, page: nil, products: nil, rbac_group_ids: nil, service_tiers: nil, session_ids: nil, slack_channel_ids: nil, speeds: nil, time_bucket_width: nil, user_profile_ids: nil, workspace_ids: nil, betas: nil, request_options: {})
|
|
285
|
+
# Some parameter documentations has been truncated, see
|
|
286
|
+
# {Anthropic::Models::Beta::Organization::Analytics::UsageListParams} for more
|
|
287
|
+
# details.
|
|
288
|
+
#
|
|
289
|
+
# @param starting_at [Time] Start of range, inclusive. RFC 3339 tz-aware. Must be within the last 365 days a
|
|
290
|
+
#
|
|
291
|
+
# @param actor_ids [Array<String>, nil] Filter to usage attributed to specific identities, by tagged ID: a `user_...`, `
|
|
292
|
+
#
|
|
293
|
+
# @param actor_types [Array<Symbol, Anthropic::Models::Beta::Organization::BetaAnalyticsActorType>, nil] Filter to usage attributed to specific kinds of identity. Use `group*by[]=actor*
|
|
294
|
+
#
|
|
295
|
+
# @param agent_ids [Array<String>, nil] Filter to usage incurred by sessions of specific Claude Managed Agents agents. U
|
|
296
|
+
#
|
|
297
|
+
# @param api_key_ids [Array<String>, nil] Filter to usage authenticated by specific API keys, by tagged API key ID (`apike
|
|
298
|
+
#
|
|
299
|
+
# @param claude_tag_categories [Array<Symbol, Anthropic::Models::Beta::Organization::BetaAnalyticsClaudeTagCategory>, nil] Filter to Claude Tag (Claude in Slack) usage in specific spend categories. Usage
|
|
300
|
+
#
|
|
301
|
+
# @param claude_tag_user_ids [Array<String>, nil] Filter to Claude Tag (Claude in Slack) usage attributed to specific Slack users,
|
|
302
|
+
#
|
|
303
|
+
# @param context_windows [Array<Symbol, Anthropic::Models::Beta::Organization::BetaAnalyticsContextWindow>, nil] Filter to specific context-window pricing tiers. Use `group_by[]=context_window`
|
|
304
|
+
#
|
|
305
|
+
# @param deployment_ids [Array<String>, nil] Filter to usage incurred by Claude Managed Agents sessions that specific deploym
|
|
306
|
+
#
|
|
307
|
+
# @param ending_at [Time, nil] End of range, exclusive. Required when `time_bucket_width` is set. Without `time
|
|
308
|
+
#
|
|
309
|
+
# @param environment_ids [Array<String>, nil] Filter to usage incurred by Claude Managed Agents sessions that ran in specific
|
|
310
|
+
#
|
|
311
|
+
# @param exclude_deleted_users [Boolean] If true, omit rows whose `actor` is a `user_actor` with `deleted: true`. Require
|
|
312
|
+
#
|
|
313
|
+
# @param group_by [Array<Symbol, Anthropic::Models::Beta::Organization::Analytics::BetaAnalyticsUsageGroupBy>, nil] Dimensions to break usage out by (at most 5): one row per combination of their v
|
|
314
|
+
#
|
|
315
|
+
# @param inference_geos [Array<Symbol, Anthropic::Models::Beta::Organization::BetaAnalyticsInferenceGeoFilter>, nil] Filter to specific inference regions. `not_available` matches rows where the reg
|
|
316
|
+
#
|
|
317
|
+
# @param limit [Integer] Number of rows per page (1-1000, default 20). `cost_type`/`token_type` fan-out r
|
|
318
|
+
#
|
|
319
|
+
# @param models [Array<String>, nil] Models to include. Defaults to all models. Use `group_by[]=model` to break out p
|
|
320
|
+
#
|
|
321
|
+
# @param order [Symbol, Anthropic::Models::Beta::Organization::BetaAnalyticsUsageCostSortOrder] Sort direction of the `order_by` metric, or of the time buckets when `order_by`
|
|
322
|
+
#
|
|
323
|
+
# @param order_by [Symbol, Anthropic::Models::Beta::Organization::Analytics::BetaAnalyticsUsageOrderBy] Row order. A metric ranks rows by that metric in the `order` direction. `time` o
|
|
324
|
+
#
|
|
325
|
+
# @param page [String, nil] Opaque cursor from a previous response's `next_page` field.
|
|
326
|
+
#
|
|
327
|
+
# @param products [Array<Symbol, Anthropic::Models::Beta::Organization::BetaAnalyticsUsageCostProductFilter>, nil] Product surfaces to include. Defaults to all products.
|
|
328
|
+
#
|
|
329
|
+
# @param rbac_group_ids [Array<String>, nil] Filter to usage attributed to specific RBAC groups. Accepts tagged RBAC group ID
|
|
330
|
+
#
|
|
331
|
+
# @param service_tiers [Array<Symbol, Anthropic::Models::Beta::Organization::BetaAnalyticsServiceTier>, nil] Filter to specific service tiers. Use `group_by[]=service_tier` to break out per
|
|
332
|
+
#
|
|
333
|
+
# @param session_ids [Array<String>, nil] Filter to usage incurred by specific Claude Managed Agents sessions, by tagged s
|
|
334
|
+
#
|
|
335
|
+
# @param slack_channel_ids [Array<String>, nil] Filter to usage originating from specific Slack channels. Use `group*by[]=slack*
|
|
336
|
+
#
|
|
337
|
+
# @param speeds [Array<Symbol, Anthropic::Models::Beta::Organization::BetaAnalyticsSpeed>, nil] Filter to fast or standard inference mode. Use `group_by[]=speed` to break out p
|
|
338
|
+
#
|
|
339
|
+
# @param time_bucket_width [Symbol, Anthropic::Models::Beta::Organization::BetaAnalyticsTimeBucketWidth, nil] Time-bucket granularity. When set, rows are returned per time bucket (one per bu
|
|
340
|
+
#
|
|
341
|
+
# @param user_profile_ids [Array<String>, nil] Filter to usage attributed to specific user profiles, by tagged user profile ID
|
|
342
|
+
#
|
|
343
|
+
# @param workspace_ids [Array<String>, nil] Filter to usage in specific workspaces, by tagged workspace ID (`wrkspc_...`). U
|
|
344
|
+
#
|
|
345
|
+
# @param betas [Array<Symbol, String, Anthropic::Models::AnthropicBeta>] This endpoint is in beta: requests must send `analytics-usage-cost-2026-08-24` i
|
|
346
|
+
#
|
|
347
|
+
# @param request_options [Anthropic::RequestOptions, Hash{Symbol=>Object}]
|
|
348
|
+
end
|
|
349
|
+
end
|
|
350
|
+
end
|
|
351
|
+
end
|
|
352
|
+
end
|
|
353
|
+
end
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Anthropic
|
|
4
|
+
module Models
|
|
5
|
+
module Beta
|
|
6
|
+
module Organization
|
|
7
|
+
module BetaAnalyticsActor
|
|
8
|
+
extend Anthropic::Internal::Type::Union
|
|
9
|
+
|
|
10
|
+
discriminator :type
|
|
11
|
+
|
|
12
|
+
variant :user_actor, -> { Anthropic::Beta::Organization::BetaAnalyticsReportUserActor }
|
|
13
|
+
|
|
14
|
+
variant :service_account_actor, -> { Anthropic::Beta::Organization::BetaAnalyticsServiceAccountActor }
|
|
15
|
+
|
|
16
|
+
variant :federated_actor, -> { Anthropic::Beta::Organization::BetaAnalyticsFederatedActor }
|
|
17
|
+
|
|
18
|
+
variant :api_actor, -> { Anthropic::Beta::Organization::BetaAnalyticsAPIActor }
|
|
19
|
+
|
|
20
|
+
module Type
|
|
21
|
+
extend Anthropic::Internal::Type::Enum
|
|
22
|
+
|
|
23
|
+
USER_ACTOR = :user_actor
|
|
24
|
+
SERVICE_ACCOUNT_ACTOR = :service_account_actor
|
|
25
|
+
FEDERATED_ACTOR = :federated_actor
|
|
26
|
+
API_ACTOR = :api_actor
|
|
27
|
+
|
|
28
|
+
# @!method self.values
|
|
29
|
+
# @return [Array<Symbol>]
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
# @!method self.variants
|
|
33
|
+
# @return [Array(Anthropic::Models::Beta::Organization::BetaAnalyticsReportUserActor, Anthropic::Models::Beta::Organization::BetaAnalyticsServiceAccountActor, Anthropic::Models::Beta::Organization::BetaAnalyticsFederatedActor, Anthropic::Models::Beta::Organization::BetaAnalyticsAPIActor)]
|
|
34
|
+
|
|
35
|
+
# Creates a new instance of the variant class whose `type` matches the given
|
|
36
|
+
# value, passing the remaining arguments to its constructor.
|
|
37
|
+
#
|
|
38
|
+
# Some parameter documentations has been truncated, see
|
|
39
|
+
# {Anthropic::Models::Beta::Organization::BetaAnalyticsActor} for more details.
|
|
40
|
+
#
|
|
41
|
+
# @param type [Symbol, Anthropic::Models::Beta::Organization::BetaAnalyticsActor::Type, String]
|
|
42
|
+
#
|
|
43
|
+
# @param args [Hash{Symbol=>Object}] Attributes for the chosen variant.
|
|
44
|
+
#
|
|
45
|
+
# @option args [Boolean] :deleted True when the account has been deleted, or when the user is no longer a member o
|
|
46
|
+
#
|
|
47
|
+
# @option args [String, nil] :email_address The user's current email address, including for users who are no longer members
|
|
48
|
+
#
|
|
49
|
+
# @option args [String, nil] :name The user's current full name. Null when the user has not set one. `"Deleted User
|
|
50
|
+
#
|
|
51
|
+
# @option args [String] :user_id Tagged user ID.
|
|
52
|
+
#
|
|
53
|
+
# @option args [String] :service_account_id Tagged service account ID.
|
|
54
|
+
#
|
|
55
|
+
# @option args [Anthropic::Models::Beta::Organization::BetaAnalyticsFederatedActorAWSProvider, Anthropic::Models::Beta::Organization::BetaAnalyticsFederatedActorAzureProvider, Anthropic::Models::Beta::Organization::BetaAnalyticsFederatedActorGCPProvider, Anthropic::Models::Beta::Organization::BetaAnalyticsFederatedActorOIDCProvider] :provider The trusted provider that asserted the caller's identity.
|
|
56
|
+
#
|
|
57
|
+
# @option args [String, nil] :subject The provider's identifier for the caller: on `aws`, the IAM principal ARN (one r
|
|
58
|
+
#
|
|
59
|
+
# @option args [String] :api_key_id Tagged API key ID.
|
|
60
|
+
#
|
|
61
|
+
# @raise [ArgumentError]
|
|
62
|
+
# @return [Anthropic::Models::Beta::Organization::BetaAnalyticsReportUserActor, Anthropic::Models::Beta::Organization::BetaAnalyticsServiceAccountActor, Anthropic::Models::Beta::Organization::BetaAnalyticsFederatedActor, Anthropic::Models::Beta::Organization::BetaAnalyticsAPIActor]
|
|
63
|
+
def self.new(type:, **args)
|
|
64
|
+
case type.to_sym
|
|
65
|
+
when :user_actor
|
|
66
|
+
Anthropic::Beta::Organization::BetaAnalyticsReportUserActor.new(**args)
|
|
67
|
+
when :service_account_actor
|
|
68
|
+
Anthropic::Beta::Organization::BetaAnalyticsServiceAccountActor.new(**args)
|
|
69
|
+
when :federated_actor
|
|
70
|
+
Anthropic::Beta::Organization::BetaAnalyticsFederatedActor.new(**args)
|
|
71
|
+
when :api_actor
|
|
72
|
+
Anthropic::Beta::Organization::BetaAnalyticsAPIActor.new(**args)
|
|
73
|
+
else
|
|
74
|
+
raise ArgumentError, "unknown type: #{type}"
|
|
75
|
+
end
|
|
76
|
+
end
|
|
77
|
+
end
|
|
78
|
+
end
|
|
79
|
+
end
|
|
80
|
+
end
|
|
81
|
+
end
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Anthropic
|
|
4
|
+
module Models
|
|
5
|
+
module Beta
|
|
6
|
+
module Organization
|
|
7
|
+
# Kind of identity a row's usage is attributed to.
|
|
8
|
+
module BetaAnalyticsActorType
|
|
9
|
+
extend Anthropic::Internal::Type::Enum
|
|
10
|
+
|
|
11
|
+
API_ACTOR = :api_actor
|
|
12
|
+
FEDERATED_ACTOR = :federated_actor
|
|
13
|
+
SERVICE_ACCOUNT_ACTOR = :service_account_actor
|
|
14
|
+
USER_ACTOR = :user_actor
|
|
15
|
+
|
|
16
|
+
# @!method self.values
|
|
17
|
+
# @return [Array<Symbol>]
|
|
18
|
+
end
|
|
19
|
+
end
|
|
20
|
+
end
|
|
21
|
+
end
|
|
22
|
+
end
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Anthropic
|
|
4
|
+
module Models
|
|
5
|
+
module Beta
|
|
6
|
+
module Organization
|
|
7
|
+
class BetaAnalyticsAPIActor < Anthropic::Internal::Type::BaseModel
|
|
8
|
+
# @!attribute api_key_id
|
|
9
|
+
# Tagged API key ID.
|
|
10
|
+
#
|
|
11
|
+
# @return [String]
|
|
12
|
+
required :api_key_id, String
|
|
13
|
+
|
|
14
|
+
# @!attribute type
|
|
15
|
+
#
|
|
16
|
+
# @return [Symbol, :api_actor]
|
|
17
|
+
required :type, const: :api_actor
|
|
18
|
+
|
|
19
|
+
# @!method initialize(api_key_id:, type: :api_actor)
|
|
20
|
+
# @param api_key_id [String] Tagged API key ID.
|
|
21
|
+
#
|
|
22
|
+
# @param type [Symbol, :api_actor]
|
|
23
|
+
end
|
|
24
|
+
end
|
|
25
|
+
end
|
|
26
|
+
end
|
|
27
|
+
end
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Anthropic
|
|
4
|
+
module Models
|
|
5
|
+
module Beta
|
|
6
|
+
module Organization
|
|
7
|
+
class BetaAnalyticsFederatedActor < Anthropic::Internal::Type::BaseModel
|
|
8
|
+
# @!attribute provider
|
|
9
|
+
# The trusted provider that asserted the caller's identity.
|
|
10
|
+
#
|
|
11
|
+
# @return [Anthropic::Models::Beta::Organization::BetaAnalyticsFederatedActorAWSProvider, Anthropic::Models::Beta::Organization::BetaAnalyticsFederatedActorAzureProvider, Anthropic::Models::Beta::Organization::BetaAnalyticsFederatedActorGCPProvider, Anthropic::Models::Beta::Organization::BetaAnalyticsFederatedActorOIDCProvider]
|
|
12
|
+
required :provider, union: -> { Anthropic::Beta::Organization::BetaAnalyticsFederatedActorProvider }
|
|
13
|
+
|
|
14
|
+
# @!attribute subject
|
|
15
|
+
# The provider's identifier for the caller: on `aws`, the IAM principal ARN (one
|
|
16
|
+
# role is one actor across its sessions); on `gcp`, the caller's IAM principal
|
|
17
|
+
# identifier as Google Cloud reports it, such as `serviceAccount:<email>`,
|
|
18
|
+
# `user:<email>`, or a `principal://...` URI.
|
|
19
|
+
#
|
|
20
|
+
# @return [String, nil]
|
|
21
|
+
required :subject, String, nil?: true
|
|
22
|
+
|
|
23
|
+
# @!attribute type
|
|
24
|
+
#
|
|
25
|
+
# @return [Symbol, :federated_actor]
|
|
26
|
+
required :type, const: :federated_actor
|
|
27
|
+
|
|
28
|
+
# @!method initialize(provider:, subject:, type: :federated_actor)
|
|
29
|
+
# Some parameter documentations has been truncated, see
|
|
30
|
+
# {Anthropic::Models::Beta::Organization::BetaAnalyticsFederatedActor} for more
|
|
31
|
+
# details.
|
|
32
|
+
#
|
|
33
|
+
# @param provider [Anthropic::Models::Beta::Organization::BetaAnalyticsFederatedActorAWSProvider, Anthropic::Models::Beta::Organization::BetaAnalyticsFederatedActorAzureProvider, Anthropic::Models::Beta::Organization::BetaAnalyticsFederatedActorGCPProvider, Anthropic::Models::Beta::Organization::BetaAnalyticsFederatedActorOIDCProvider] The trusted provider that asserted the caller's identity.
|
|
34
|
+
#
|
|
35
|
+
# @param subject [String, nil] The provider's identifier for the caller: on `aws`, the IAM principal ARN (one r
|
|
36
|
+
#
|
|
37
|
+
# @param type [Symbol, :federated_actor]
|
|
38
|
+
end
|
|
39
|
+
end
|
|
40
|
+
end
|
|
41
|
+
end
|
|
42
|
+
end
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Anthropic
|
|
4
|
+
module Models
|
|
5
|
+
module Beta
|
|
6
|
+
module Organization
|
|
7
|
+
class BetaAnalyticsFederatedActorAWSProvider < Anthropic::Internal::Type::BaseModel
|
|
8
|
+
# @!attribute account_id
|
|
9
|
+
# The AWS account the organization is bound to.
|
|
10
|
+
#
|
|
11
|
+
# @return [String]
|
|
12
|
+
required :account_id, String
|
|
13
|
+
|
|
14
|
+
# @!attribute signed_principal
|
|
15
|
+
# The AWS-signed ARN of the IAM principal that made the requests.
|
|
16
|
+
#
|
|
17
|
+
# @return [String]
|
|
18
|
+
required :signed_principal, String
|
|
19
|
+
|
|
20
|
+
# @!attribute type
|
|
21
|
+
#
|
|
22
|
+
# @return [Symbol, :aws]
|
|
23
|
+
required :type, const: :aws
|
|
24
|
+
|
|
25
|
+
# @!method initialize(account_id:, signed_principal:, type: :aws)
|
|
26
|
+
# @param account_id [String] The AWS account the organization is bound to.
|
|
27
|
+
#
|
|
28
|
+
# @param signed_principal [String] The AWS-signed ARN of the IAM principal that made the requests.
|
|
29
|
+
#
|
|
30
|
+
# @param type [Symbol, :aws]
|
|
31
|
+
end
|
|
32
|
+
end
|
|
33
|
+
end
|
|
34
|
+
end
|
|
35
|
+
end
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Anthropic
|
|
4
|
+
module Models
|
|
5
|
+
module Beta
|
|
6
|
+
module Organization
|
|
7
|
+
class BetaAnalyticsFederatedActorAzureProvider < Anthropic::Internal::Type::BaseModel
|
|
8
|
+
# @!attribute subscription_id
|
|
9
|
+
# The Azure subscription the organization is bound to.
|
|
10
|
+
#
|
|
11
|
+
# @return [String]
|
|
12
|
+
required :subscription_id, String
|
|
13
|
+
|
|
14
|
+
# @!attribute type
|
|
15
|
+
#
|
|
16
|
+
# @return [Symbol, :azure]
|
|
17
|
+
required :type, const: :azure
|
|
18
|
+
|
|
19
|
+
# @!method initialize(subscription_id:, type: :azure)
|
|
20
|
+
# @param subscription_id [String] The Azure subscription the organization is bound to.
|
|
21
|
+
#
|
|
22
|
+
# @param type [Symbol, :azure]
|
|
23
|
+
end
|
|
24
|
+
end
|
|
25
|
+
end
|
|
26
|
+
end
|
|
27
|
+
end
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Anthropic
|
|
4
|
+
module Models
|
|
5
|
+
module Beta
|
|
6
|
+
module Organization
|
|
7
|
+
class BetaAnalyticsFederatedActorGCPProvider < Anthropic::Internal::Type::BaseModel
|
|
8
|
+
# @!attribute project_number
|
|
9
|
+
# The Google Cloud project the organization is bound to.
|
|
10
|
+
#
|
|
11
|
+
# @return [String]
|
|
12
|
+
required :project_number, String
|
|
13
|
+
|
|
14
|
+
# @!attribute type
|
|
15
|
+
#
|
|
16
|
+
# @return [Symbol, :gcp]
|
|
17
|
+
required :type, const: :gcp
|
|
18
|
+
|
|
19
|
+
# @!method initialize(project_number:, type: :gcp)
|
|
20
|
+
# @param project_number [String] The Google Cloud project the organization is bound to.
|
|
21
|
+
#
|
|
22
|
+
# @param type [Symbol, :gcp]
|
|
23
|
+
end
|
|
24
|
+
end
|
|
25
|
+
end
|
|
26
|
+
end
|
|
27
|
+
end
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Anthropic
|
|
4
|
+
module Models
|
|
5
|
+
module Beta
|
|
6
|
+
module Organization
|
|
7
|
+
class BetaAnalyticsFederatedActorOIDCProvider < Anthropic::Internal::Type::BaseModel
|
|
8
|
+
# @!attribute issuer
|
|
9
|
+
# The federation issuer's URL.
|
|
10
|
+
#
|
|
11
|
+
# @return [String, nil]
|
|
12
|
+
required :issuer, String, nil?: true
|
|
13
|
+
|
|
14
|
+
# @!attribute type
|
|
15
|
+
#
|
|
16
|
+
# @return [Symbol, :oidc]
|
|
17
|
+
required :type, const: :oidc
|
|
18
|
+
|
|
19
|
+
# @!method initialize(issuer:, type: :oidc)
|
|
20
|
+
# @param issuer [String, nil] The federation issuer's URL.
|
|
21
|
+
#
|
|
22
|
+
# @param type [Symbol, :oidc]
|
|
23
|
+
end
|
|
24
|
+
end
|
|
25
|
+
end
|
|
26
|
+
end
|
|
27
|
+
end
|