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.
Files changed (202) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +35 -0
  3. data/README.md +1 -1
  4. data/lib/anthropic/client.rb +8 -0
  5. data/lib/anthropic/helpers/bedrock/client.rb +5 -0
  6. data/lib/anthropic/helpers/bedrock/mantle_client.rb +5 -0
  7. data/lib/anthropic/helpers/stainless_helper_header.rb +1 -0
  8. data/lib/anthropic/helpers/threads/beta_message_thread.rb +635 -0
  9. data/lib/anthropic/helpers/tools/runner.rb +79 -11
  10. data/lib/anthropic/helpers/vertex/client.rb +5 -0
  11. data/lib/anthropic/internal/report_page_cursor.rb +2 -2
  12. data/lib/anthropic/internal/tracing.rb +2 -0
  13. data/lib/anthropic/models/anthropic_beta.rb +6 -0
  14. data/lib/anthropic/models/beta/beta_message_thread_param.rb +61 -0
  15. data/lib/anthropic/models/beta/beta_thread_continue_params.rb +29 -0
  16. data/lib/anthropic/models/beta/beta_thread_create_params.rb +21 -0
  17. data/lib/anthropic/models/beta/message_create_params.rb +13 -1
  18. data/lib/anthropic/models/beta/messages/batch_create_params.rb +13 -1
  19. data/lib/anthropic/models/beta/organization/analytics/beta_analytics_cost_group.rb +271 -0
  20. data/lib/anthropic/models/beta/organization/analytics/beta_analytics_cost_group_by.rb +40 -0
  21. data/lib/anthropic/models/beta/organization/analytics/beta_analytics_cost_item.rb +57 -0
  22. data/lib/anthropic/models/beta/organization/analytics/beta_analytics_cost_metrics.rb +57 -0
  23. data/lib/anthropic/models/beta/organization/analytics/beta_analytics_cost_order_by.rb +22 -0
  24. data/lib/anthropic/models/beta/organization/analytics/beta_analytics_usage_group.rb +247 -0
  25. data/lib/anthropic/models/beta/organization/analytics/beta_analytics_usage_group_by.rb +38 -0
  26. data/lib/anthropic/models/beta/organization/analytics/beta_analytics_usage_item.rb +57 -0
  27. data/lib/anthropic/models/beta/organization/analytics/beta_analytics_usage_metrics.rb +79 -0
  28. data/lib/anthropic/models/beta/organization/analytics/beta_analytics_usage_order_by.rb +24 -0
  29. data/lib/anthropic/models/beta/organization/analytics/cost_list_params.rb +360 -0
  30. data/lib/anthropic/models/beta/organization/analytics/usage_list_params.rb +353 -0
  31. data/lib/anthropic/models/beta/organization/beta_analytics_actor.rb +81 -0
  32. data/lib/anthropic/models/beta/organization/beta_analytics_actor_type.rb +22 -0
  33. data/lib/anthropic/models/beta/organization/beta_analytics_api_actor.rb +27 -0
  34. data/lib/anthropic/models/beta/organization/beta_analytics_federated_actor.rb +42 -0
  35. data/lib/anthropic/models/beta/organization/beta_analytics_federated_actor_aws_provider.rb +35 -0
  36. data/lib/anthropic/models/beta/organization/beta_analytics_federated_actor_azure_provider.rb +27 -0
  37. data/lib/anthropic/models/beta/organization/beta_analytics_federated_actor_gcp_provider.rb +27 -0
  38. data/lib/anthropic/models/beta/organization/beta_analytics_federated_actor_oidc_provider.rb +27 -0
  39. data/lib/anthropic/models/beta/organization/beta_analytics_federated_actor_provider.rb +72 -0
  40. data/lib/anthropic/models/beta/organization/beta_analytics_grouped_cost_type.rb +21 -0
  41. data/lib/anthropic/models/beta/organization/beta_analytics_report_user_actor.rb +65 -0
  42. data/lib/anthropic/models/beta/organization/beta_analytics_service_account_actor.rb +27 -0
  43. data/lib/anthropic/models/beta/organization/beta_analytics_service_tier.rb +23 -0
  44. data/lib/anthropic/models/beta/organization/beta_analytics_speed.rb +19 -0
  45. data/lib/anthropic/models/beta/organization/beta_analytics_time_bucket_width.rb +20 -0
  46. data/lib/anthropic/models/beta/organization/beta_analytics_usage_cost_inference_geo.rb +19 -0
  47. data/lib/anthropic/models/beta/organization/beta_analytics_usage_cost_product_filter.rb +34 -0
  48. data/lib/anthropic/models/beta/organization/beta_analytics_usage_cost_sort_order.rb +19 -0
  49. data/lib/anthropic/models/beta/organization/beta_organization_rate_limit.rb +2 -1
  50. data/lib/anthropic/models/beta/organization/beta_plugin.rb +12 -6
  51. data/lib/anthropic/models/beta/organization/beta_plugin_content_scan.rb +11 -5
  52. data/lib/anthropic/models/beta/organization/workspaces/beta_workspace_rate_limit.rb +2 -1
  53. data/lib/anthropic/models/organization/organization_rate_limit.rb +2 -1
  54. data/lib/anthropic/models/organization/workspaces/workspace_rate_limit.rb +2 -1
  55. data/lib/anthropic/models/user_profile.rb +26 -1
  56. data/lib/anthropic/models/user_profile_enforcement_action.rb +66 -0
  57. data/lib/anthropic/models/user_profile_enforcement_action_ban.rb +62 -0
  58. data/lib/anthropic/models/user_profile_enforcement_action_next_step.rb +17 -0
  59. data/lib/anthropic/models/user_profile_enforcement_action_reason.rb +23 -0
  60. data/lib/anthropic/models/user_profile_enforcement_action_restriction.rb +67 -0
  61. data/lib/anthropic/models/user_profile_enforcement_status.rb +20 -0
  62. data/lib/anthropic/models/user_profile_list_params.rb +17 -1
  63. data/lib/anthropic/models.rb +12 -0
  64. data/lib/anthropic/resources/beta/messages.rb +78 -4
  65. data/lib/anthropic/resources/beta/organization/analytics/cost.rb +175 -0
  66. data/lib/anthropic/resources/beta/organization/analytics/cost_report.rb +13 -6
  67. data/lib/anthropic/resources/beta/organization/analytics/usage.rb +176 -0
  68. data/lib/anthropic/resources/beta/organization/analytics/usage_report.rb +9 -2
  69. data/lib/anthropic/resources/beta/organization/analytics/user_cost_report.rb +12 -5
  70. data/lib/anthropic/resources/beta/organization/analytics/user_usage_report.rb +15 -8
  71. data/lib/anthropic/resources/beta/organization/analytics.rb +8 -0
  72. data/lib/anthropic/resources/beta/organization/plugin_marketplaces.rb +6 -6
  73. data/lib/anthropic/resources/beta/organization/plugins.rb +12 -9
  74. data/lib/anthropic/resources/user_profiles.rb +5 -3
  75. data/lib/anthropic/version.rb +1 -1
  76. data/lib/anthropic.rb +42 -0
  77. data/rbi/anthropic/client.rbi +5 -0
  78. data/rbi/anthropic/helpers/bedrock/client.rbi +5 -0
  79. data/rbi/anthropic/helpers/bedrock/mantle_client.rbi +5 -0
  80. data/rbi/anthropic/helpers/threads/beta_message_thread.rbi +100 -0
  81. data/rbi/anthropic/helpers/vertex/client.rbi +5 -0
  82. data/rbi/anthropic/internal/tracing.rbi +4 -0
  83. data/rbi/anthropic/models/anthropic_beta.rbi +10 -0
  84. data/rbi/anthropic/models/beta/beta_message_thread_param.rbi +80 -0
  85. data/rbi/anthropic/models/beta/beta_thread_continue_params.rbi +43 -0
  86. data/rbi/anthropic/models/beta/beta_thread_create_params.rbi +31 -0
  87. data/rbi/anthropic/models/beta/message_create_params.rbi +37 -0
  88. data/rbi/anthropic/models/beta/messages/batch_create_params.rbi +37 -0
  89. data/rbi/anthropic/models/beta/organization/analytics/beta_analytics_cost_group.rbi +439 -0
  90. data/rbi/anthropic/models/beta/organization/analytics/beta_analytics_cost_group_by.rbi +140 -0
  91. data/rbi/anthropic/models/beta/organization/analytics/beta_analytics_cost_item.rbi +110 -0
  92. data/rbi/anthropic/models/beta/organization/analytics/beta_analytics_cost_metrics.rbi +79 -0
  93. data/rbi/anthropic/models/beta/organization/analytics/beta_analytics_cost_order_by.rbi +50 -0
  94. data/rbi/anthropic/models/beta/organization/analytics/beta_analytics_usage_group.rbi +399 -0
  95. data/rbi/anthropic/models/beta/organization/analytics/beta_analytics_usage_group_by.rbi +130 -0
  96. data/rbi/anthropic/models/beta/organization/analytics/beta_analytics_usage_item.rbi +110 -0
  97. data/rbi/anthropic/models/beta/organization/analytics/beta_analytics_usage_metrics.rbi +120 -0
  98. data/rbi/anthropic/models/beta/organization/analytics/beta_analytics_usage_order_by.rbi +60 -0
  99. data/rbi/anthropic/models/beta/organization/analytics/cost_list_params.rbi +624 -0
  100. data/rbi/anthropic/models/beta/organization/analytics/usage_list_params.rbi +612 -0
  101. data/rbi/anthropic/models/beta/organization/beta_analytics_actor.rbi +134 -0
  102. data/rbi/anthropic/models/beta/organization/beta_analytics_actor_type.rbi +54 -0
  103. data/rbi/anthropic/models/beta/organization/beta_analytics_api_actor.rbi +40 -0
  104. data/rbi/anthropic/models/beta/organization/beta_analytics_federated_actor.rbi +75 -0
  105. data/rbi/anthropic/models/beta/organization/beta_analytics_federated_actor_aws_provider.rbi +54 -0
  106. data/rbi/anthropic/models/beta/organization/beta_analytics_federated_actor_azure_provider.rbi +42 -0
  107. data/rbi/anthropic/models/beta/organization/beta_analytics_federated_actor_gcp_provider.rbi +42 -0
  108. data/rbi/anthropic/models/beta/organization/beta_analytics_federated_actor_oidc_provider.rbi +42 -0
  109. data/rbi/anthropic/models/beta/organization/beta_analytics_federated_actor_provider.rbi +107 -0
  110. data/rbi/anthropic/models/beta/organization/beta_analytics_grouped_cost_type.rbi +53 -0
  111. data/rbi/anthropic/models/beta/organization/beta_analytics_report_user_actor.rbi +94 -0
  112. data/rbi/anthropic/models/beta/organization/beta_analytics_service_account_actor.rbi +42 -0
  113. data/rbi/anthropic/models/beta/organization/beta_analytics_service_tier.rbi +63 -0
  114. data/rbi/anthropic/models/beta/organization/beta_analytics_speed.rbi +40 -0
  115. data/rbi/anthropic/models/beta/organization/beta_analytics_time_bucket_width.rbi +48 -0
  116. data/rbi/anthropic/models/beta/organization/beta_analytics_usage_cost_inference_geo.rbi +43 -0
  117. data/rbi/anthropic/models/beta/organization/beta_analytics_usage_cost_product_filter.rbi +98 -0
  118. data/rbi/anthropic/models/beta/organization/beta_analytics_usage_cost_sort_order.rbi +43 -0
  119. data/rbi/anthropic/models/beta/organization/beta_organization_rate_limit.rbi +4 -2
  120. data/rbi/anthropic/models/beta/organization/beta_plugin.rbi +20 -8
  121. data/rbi/anthropic/models/beta/organization/beta_plugin_content_scan.rbi +15 -6
  122. data/rbi/anthropic/models/beta/organization/workspaces/beta_workspace_rate_limit.rbi +4 -2
  123. data/rbi/anthropic/models/organization/organization_rate_limit.rbi +4 -2
  124. data/rbi/anthropic/models/organization/workspaces/workspace_rate_limit.rbi +4 -2
  125. data/rbi/anthropic/models/user_profile.rbi +42 -0
  126. data/rbi/anthropic/models/user_profile_enforcement_action.rbi +95 -0
  127. data/rbi/anthropic/models/user_profile_enforcement_action_ban.rbi +96 -0
  128. data/rbi/anthropic/models/user_profile_enforcement_action_next_step.rbi +34 -0
  129. data/rbi/anthropic/models/user_profile_enforcement_action_reason.rbi +58 -0
  130. data/rbi/anthropic/models/user_profile_enforcement_action_restriction.rbi +106 -0
  131. data/rbi/anthropic/models/user_profile_enforcement_status.rbi +39 -0
  132. data/rbi/anthropic/models/user_profile_list_params.rbi +36 -0
  133. data/rbi/anthropic/models.rbi +16 -0
  134. data/rbi/anthropic/resources/beta/messages.rbi +191 -0
  135. data/rbi/anthropic/resources/beta/organization/analytics/cost.rbi +245 -0
  136. data/rbi/anthropic/resources/beta/organization/analytics/cost_report.rbi +12 -5
  137. data/rbi/anthropic/resources/beta/organization/analytics/usage.rbi +240 -0
  138. data/rbi/anthropic/resources/beta/organization/analytics/usage_report.rbi +9 -2
  139. data/rbi/anthropic/resources/beta/organization/analytics/user_cost_report.rbi +12 -5
  140. data/rbi/anthropic/resources/beta/organization/analytics/user_usage_report.rbi +14 -7
  141. data/rbi/anthropic/resources/beta/organization/analytics.rbi +10 -0
  142. data/rbi/anthropic/resources/beta/organization/plugin_marketplaces.rbi +6 -6
  143. data/rbi/anthropic/resources/beta/organization/plugins.rbi +12 -9
  144. data/rbi/anthropic/resources/user_profiles.rbi +12 -0
  145. data/rbi/lib/anthropic/helpers/stainless_helper_header.rbi +2 -0
  146. data/sig/anthropic/client.rbs +2 -0
  147. data/sig/anthropic/helpers/bedrock/client.rbs +2 -0
  148. data/sig/anthropic/helpers/threads/beta_message_thread.rbs +40 -0
  149. data/sig/anthropic/helpers/tools/runner.rbs +40 -0
  150. data/sig/anthropic/helpers/vertex/client.rbs +2 -0
  151. data/sig/anthropic/internal/tracing.rbs +2 -0
  152. data/sig/anthropic/models/anthropic_beta.rbs +4 -0
  153. data/sig/anthropic/models/beta/beta_message_thread_param.rbs +40 -0
  154. data/sig/anthropic/models/beta/beta_thread_continue_params.rbs +20 -0
  155. data/sig/anthropic/models/beta/beta_thread_create_params.rbs +17 -0
  156. data/sig/anthropic/models/beta/message_create_params.rbs +5 -0
  157. data/sig/anthropic/models/beta/messages/batch_create_params.rbs +5 -0
  158. data/sig/anthropic/models/beta/organization/analytics/beta_analytics_cost_group.rbs +126 -0
  159. data/sig/anthropic/models/beta/organization/analytics/beta_analytics_cost_group_by.rbs +60 -0
  160. data/sig/anthropic/models/beta/organization/analytics/beta_analytics_cost_item.rbs +41 -0
  161. data/sig/anthropic/models/beta/organization/analytics/beta_analytics_cost_metrics.rbs +41 -0
  162. data/sig/anthropic/models/beta/organization/analytics/beta_analytics_cost_order_by.rbs +21 -0
  163. data/sig/anthropic/models/beta/organization/analytics/beta_analytics_usage_group.rbs +116 -0
  164. data/sig/anthropic/models/beta/organization/analytics/beta_analytics_usage_group_by.rbs +56 -0
  165. data/sig/anthropic/models/beta/organization/analytics/beta_analytics_usage_item.rbs +41 -0
  166. data/sig/anthropic/models/beta/organization/analytics/beta_analytics_usage_metrics.rbs +56 -0
  167. data/sig/anthropic/models/beta/organization/analytics/beta_analytics_usage_order_by.rbs +28 -0
  168. data/sig/anthropic/models/beta/organization/analytics/cost_list_params.rbs +188 -0
  169. data/sig/anthropic/models/beta/organization/analytics/usage_list_params.rbs +188 -0
  170. data/sig/anthropic/models/beta/organization/beta_analytics_actor.rbs +67 -0
  171. data/sig/anthropic/models/beta/organization/beta_analytics_actor_type.rbs +21 -0
  172. data/sig/anthropic/models/beta/organization/beta_analytics_api_actor.rbs +19 -0
  173. data/sig/anthropic/models/beta/organization/beta_analytics_federated_actor.rbs +34 -0
  174. data/sig/anthropic/models/beta/organization/beta_analytics_federated_actor_aws_provider.rbs +30 -0
  175. data/sig/anthropic/models/beta/organization/beta_analytics_federated_actor_azure_provider.rbs +20 -0
  176. data/sig/anthropic/models/beta/organization/beta_analytics_federated_actor_gcp_provider.rbs +20 -0
  177. data/sig/anthropic/models/beta/organization/beta_analytics_federated_actor_oidc_provider.rbs +20 -0
  178. data/sig/anthropic/models/beta/organization/beta_analytics_federated_actor_provider.rbs +60 -0
  179. data/sig/anthropic/models/beta/organization/beta_analytics_grouped_cost_type.rbs +21 -0
  180. data/sig/anthropic/models/beta/organization/beta_analytics_report_user_actor.rbs +44 -0
  181. data/sig/anthropic/models/beta/organization/beta_analytics_service_account_actor.rbs +26 -0
  182. data/sig/anthropic/models/beta/organization/beta_analytics_service_tier.rbs +28 -0
  183. data/sig/anthropic/models/beta/organization/beta_analytics_speed.rbs +18 -0
  184. data/sig/anthropic/models/beta/organization/beta_analytics_time_bucket_width.rbs +19 -0
  185. data/sig/anthropic/models/beta/organization/beta_analytics_usage_cost_inference_geo.rbs +18 -0
  186. data/sig/anthropic/models/beta/organization/beta_analytics_usage_cost_product_filter.rbs +40 -0
  187. data/sig/anthropic/models/beta/organization/beta_analytics_usage_cost_sort_order.rbs +18 -0
  188. data/sig/anthropic/models/user_profile.rbs +10 -0
  189. data/sig/anthropic/models/user_profile_enforcement_action.rbs +50 -0
  190. data/sig/anthropic/models/user_profile_enforcement_action_ban.rbs +45 -0
  191. data/sig/anthropic/models/user_profile_enforcement_action_next_step.rbs +13 -0
  192. data/sig/anthropic/models/user_profile_enforcement_action_reason.rbs +24 -0
  193. data/sig/anthropic/models/user_profile_enforcement_action_restriction.rbs +45 -0
  194. data/sig/anthropic/models/user_profile_enforcement_status.rbs +17 -0
  195. data/sig/anthropic/models/user_profile_list_params.rbs +9 -0
  196. data/sig/anthropic/models.rbs +12 -0
  197. data/sig/anthropic/resources/beta/messages.rbs +33 -0
  198. data/sig/anthropic/resources/beta/organization/analytics/cost.rbs +46 -0
  199. data/sig/anthropic/resources/beta/organization/analytics/usage.rbs +46 -0
  200. data/sig/anthropic/resources/beta/organization/analytics.rbs +4 -0
  201. data/sig/anthropic/resources/user_profiles.rbs +1 -0
  202. metadata +130 -3
@@ -0,0 +1,72 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Anthropic
4
+ module Models
5
+ module Beta
6
+ module Organization
7
+ module BetaAnalyticsFederatedActorProvider
8
+ extend Anthropic::Internal::Type::Union
9
+
10
+ discriminator :type
11
+
12
+ variant :aws, -> { Anthropic::Beta::Organization::BetaAnalyticsFederatedActorAWSProvider }
13
+
14
+ variant :azure, -> { Anthropic::Beta::Organization::BetaAnalyticsFederatedActorAzureProvider }
15
+
16
+ variant :gcp, -> { Anthropic::Beta::Organization::BetaAnalyticsFederatedActorGCPProvider }
17
+
18
+ variant :oidc, -> { Anthropic::Beta::Organization::BetaAnalyticsFederatedActorOIDCProvider }
19
+
20
+ module Type
21
+ extend Anthropic::Internal::Type::Enum
22
+
23
+ AWS = :aws
24
+ AZURE = :azure
25
+ GCP = :gcp
26
+ OIDC = :oidc
27
+
28
+ # @!method self.values
29
+ # @return [Array<Symbol>]
30
+ end
31
+
32
+ # @!method self.variants
33
+ # @return [Array(Anthropic::Models::Beta::Organization::BetaAnalyticsFederatedActorAWSProvider, Anthropic::Models::Beta::Organization::BetaAnalyticsFederatedActorAzureProvider, Anthropic::Models::Beta::Organization::BetaAnalyticsFederatedActorGCPProvider, Anthropic::Models::Beta::Organization::BetaAnalyticsFederatedActorOIDCProvider)]
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
+ # @param type [Symbol, Anthropic::Models::Beta::Organization::BetaAnalyticsFederatedActorProvider::Type, String]
39
+ #
40
+ # @param args [Hash{Symbol=>Object}] Attributes for the chosen variant.
41
+ #
42
+ # @option args [String] :account_id The AWS account the organization is bound to.
43
+ #
44
+ # @option args [String] :signed_principal The AWS-signed ARN of the IAM principal that made the requests.
45
+ #
46
+ # @option args [String] :subscription_id The Azure subscription the organization is bound to.
47
+ #
48
+ # @option args [String] :project_number The Google Cloud project the organization is bound to.
49
+ #
50
+ # @option args [String, nil] :issuer The federation issuer's URL.
51
+ #
52
+ # @raise [ArgumentError]
53
+ # @return [Anthropic::Models::Beta::Organization::BetaAnalyticsFederatedActorAWSProvider, Anthropic::Models::Beta::Organization::BetaAnalyticsFederatedActorAzureProvider, Anthropic::Models::Beta::Organization::BetaAnalyticsFederatedActorGCPProvider, Anthropic::Models::Beta::Organization::BetaAnalyticsFederatedActorOIDCProvider]
54
+ def self.new(type:, **args)
55
+ case type.to_sym
56
+ when :aws
57
+ Anthropic::Beta::Organization::BetaAnalyticsFederatedActorAWSProvider.new(**args)
58
+ when :azure
59
+ Anthropic::Beta::Organization::BetaAnalyticsFederatedActorAzureProvider.new(**args)
60
+ when :gcp
61
+ Anthropic::Beta::Organization::BetaAnalyticsFederatedActorGCPProvider.new(**args)
62
+ when :oidc
63
+ Anthropic::Beta::Organization::BetaAnalyticsFederatedActorOIDCProvider.new(**args)
64
+ else
65
+ raise ArgumentError, "unknown type: #{type}"
66
+ end
67
+ end
68
+ end
69
+ end
70
+ end
71
+ end
72
+ end
@@ -0,0 +1,21 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Anthropic
4
+ module Models
5
+ module Beta
6
+ module Organization
7
+ module BetaAnalyticsGroupedCostType
8
+ extend Anthropic::Internal::Type::Enum
9
+
10
+ CODE_EXECUTION = :code_execution
11
+ SESSION_USAGE = :session_usage
12
+ TOKENS = :tokens
13
+ WEB_SEARCH = :web_search
14
+
15
+ # @!method self.values
16
+ # @return [Array<Symbol>]
17
+ end
18
+ end
19
+ end
20
+ end
21
+ end
@@ -0,0 +1,65 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Anthropic
4
+ module Models
5
+ module Beta
6
+ module Organization
7
+ class BetaAnalyticsReportUserActor < Anthropic::Internal::Type::BaseModel
8
+ # @!attribute deleted
9
+ # True when the account has been deleted, or when the user is no longer a member
10
+ # of the organization or its associated organizations (for example, their
11
+ # membership was removed or they were deprovisioned via your identity provider).
12
+ # `email_address` stays populated for removed users and is null when the account
13
+ # has been deleted. `name` follows the rules described on that field. The
14
+ # `user_id` is still populated for reconciliation.
15
+ #
16
+ # @return [Boolean]
17
+ required :deleted, Anthropic::Internal::Type::Boolean
18
+
19
+ # @!attribute email_address
20
+ # The user's current email address, including for users who are no longer members
21
+ # of the organization. Null when the account has been deleted and for
22
+ # system-minted service accounts.
23
+ #
24
+ # @return [String, nil]
25
+ required :email_address, String, nil?: true
26
+
27
+ # @!attribute name
28
+ # The user's current full name. Null when the user has not set one.
29
+ # `"Deleted User"` when the account has been deleted, or when the user is no
30
+ # longer a member and the organization hides removed users' names.
31
+ #
32
+ # @return [String, nil]
33
+ required :name, String, nil?: true
34
+
35
+ # @!attribute type
36
+ # Actor type. Always `"user_actor"`.
37
+ #
38
+ # @return [Symbol, :user_actor]
39
+ required :type, const: :user_actor
40
+
41
+ # @!attribute user_id
42
+ # Tagged user ID.
43
+ #
44
+ # @return [String]
45
+ required :user_id, String
46
+
47
+ # @!method initialize(deleted:, email_address:, name:, user_id:, type: :user_actor)
48
+ # Some parameter documentations has been truncated, see
49
+ # {Anthropic::Models::Beta::Organization::BetaAnalyticsReportUserActor} for more
50
+ # details.
51
+ #
52
+ # @param deleted [Boolean] True when the account has been deleted, or when the user is no longer a member o
53
+ #
54
+ # @param email_address [String, nil] The user's current email address, including for users who are no longer members
55
+ #
56
+ # @param name [String, nil] The user's current full name. Null when the user has not set one. `"Deleted User
57
+ #
58
+ # @param user_id [String] Tagged user ID.
59
+ #
60
+ # @param type [Symbol, :user_actor] Actor type. Always `"user_actor"`.
61
+ end
62
+ end
63
+ end
64
+ end
65
+ 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 BetaAnalyticsServiceAccountActor < Anthropic::Internal::Type::BaseModel
8
+ # @!attribute service_account_id
9
+ # Tagged service account ID.
10
+ #
11
+ # @return [String]
12
+ required :service_account_id, String
13
+
14
+ # @!attribute type
15
+ #
16
+ # @return [Symbol, :service_account_actor]
17
+ required :type, const: :service_account_actor
18
+
19
+ # @!method initialize(service_account_id:, type: :service_account_actor)
20
+ # @param service_account_id [String] Tagged service account ID.
21
+ #
22
+ # @param type [Symbol, :service_account_actor]
23
+ end
24
+ end
25
+ end
26
+ end
27
+ end
@@ -0,0 +1,23 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Anthropic
4
+ module Models
5
+ module Beta
6
+ module Organization
7
+ module BetaAnalyticsServiceTier
8
+ extend Anthropic::Internal::Type::Enum
9
+
10
+ BATCH = :batch
11
+ FLEX = :flex
12
+ FLEX_DISCOUNT = :flex_discount
13
+ PRIORITY = :priority
14
+ PRIORITY_ON_DEMAND = :priority_on_demand
15
+ STANDARD = :standard
16
+
17
+ # @!method self.values
18
+ # @return [Array<Symbol>]
19
+ end
20
+ end
21
+ end
22
+ end
23
+ end
@@ -0,0 +1,19 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Anthropic
4
+ module Models
5
+ module Beta
6
+ module Organization
7
+ module BetaAnalyticsSpeed
8
+ extend Anthropic::Internal::Type::Enum
9
+
10
+ FAST = :fast
11
+ STANDARD = :standard
12
+
13
+ # @!method self.values
14
+ # @return [Array<Symbol>]
15
+ end
16
+ end
17
+ end
18
+ end
19
+ end
@@ -0,0 +1,20 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Anthropic
4
+ module Models
5
+ module Beta
6
+ module Organization
7
+ module BetaAnalyticsTimeBucketWidth
8
+ extend Anthropic::Internal::Type::Enum
9
+
10
+ DAY = :"1d"
11
+ HOUR = :"1h"
12
+ MINUTE = :"1m"
13
+
14
+ # @!method self.values
15
+ # @return [Array<Symbol>]
16
+ end
17
+ end
18
+ end
19
+ end
20
+ end
@@ -0,0 +1,19 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Anthropic
4
+ module Models
5
+ module Beta
6
+ module Organization
7
+ module BetaAnalyticsUsageCostInferenceGeo
8
+ extend Anthropic::Internal::Type::Enum
9
+
10
+ GLOBAL = :global
11
+ US = :us
12
+
13
+ # @!method self.values
14
+ # @return [Array<Symbol>]
15
+ end
16
+ end
17
+ end
18
+ end
19
+ end
@@ -0,0 +1,34 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Anthropic
4
+ module Models
5
+ module Beta
6
+ module Organization
7
+ # Publicly documented product surfaces. `claude_tag` is Claude Tag, the Claude
8
+ # product in Slack. `chat_cowork_unified` is Chat and Cowork unified, Cowork's
9
+ # features inside claude.ai chat: chat and Cowork usage by a member who has it
10
+ # turned on is reported under this value instead of `chat` or `cowork`. It is
11
+ # accepted as a filter only on deployments that offer Chat and Cowork unified.
12
+ module BetaAnalyticsUsageCostProductFilter
13
+ extend Anthropic::Internal::Type::Enum
14
+
15
+ CHAT = :chat
16
+ CHAT_COWORK_UNIFIED = :chat_cowork_unified
17
+ CLAUDE_CODE = :claude_code
18
+ CLAUDE_CONSOLE = :claude_console
19
+ CLAUDE_DESIGN = :claude_design
20
+ CLAUDE_IN_CHROME = :claude_in_chrome
21
+ CLAUDE_TAG = :claude_tag
22
+ COWORK = :cowork
23
+ MANAGED_AGENTS_API = :managed_agents_api
24
+ MESSAGE_BATCHES_API = :message_batches_api
25
+ MESSAGES_API = :messages_api
26
+ OFFICE_AGENT = :office_agent
27
+
28
+ # @!method self.values
29
+ # @return [Array<Symbol>]
30
+ end
31
+ end
32
+ end
33
+ end
34
+ end
@@ -0,0 +1,19 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Anthropic
4
+ module Models
5
+ module Beta
6
+ module Organization
7
+ module BetaAnalyticsUsageCostSortOrder
8
+ extend Anthropic::Internal::Type::Enum
9
+
10
+ ASC = :asc
11
+ DESC = :desc
12
+
13
+ # @!method self.values
14
+ # @return [Array<Symbol>]
15
+ end
16
+ end
17
+ end
18
+ end
19
+ end
@@ -29,7 +29,8 @@ module Anthropic
29
29
 
30
30
  # @!attribute models
31
31
  # Model names this entry's limits apply to, including aliases. `null` when
32
- # `group.type` is not `"model_group"`.
32
+ # `group.type` is not `"model_group"`. The list covers the models your
33
+ # organization has access to, so it can differ between organizations.
33
34
  #
34
35
  # @return [Array<String>, nil]
35
36
  required :models, Anthropic::Internal::Type::ArrayOf[String], nil?: true
@@ -135,8 +135,11 @@ module Anthropic
135
135
  required :served_version_id, String
136
136
 
137
137
  # @!attribute served_version_pinned
138
- # False while the served version follows each new version; true once it has been
139
- # pinned to one.
138
+ # True once the served version has been pinned, through Update Plugin or in
139
+ # claude.ai. While false, a new version normally becomes the served version when
140
+ # it is stored. While the newest version is not the served version, as when a
141
+ # version saved in claude.ai is waiting for its content scan, `served_version_id`
142
+ # differs from `latest_version_id`.
140
143
  #
141
144
  # @return [Boolean]
142
145
  required :served_version_pinned, Anthropic::Internal::Type::Boolean
@@ -148,8 +151,11 @@ module Anthropic
148
151
  required :type, const: :plugin
149
152
 
150
153
  # @!attribute updated_at
151
- # RFC 3339. Moves on a new version and on a served-version change; a change to the
152
- # Plugin's installation settings or shares does not move it.
154
+ # RFC 3339. Moves on a served-version change (including pinning an unpinned Plugin
155
+ # to the version it already serves) and, normally, on a new version. A version
156
+ # saved in claude.ai that waits for its content scan moves it when it becomes the
157
+ # served version, and not necessarily when it is stored. A change to the Plugin's
158
+ # installation settings or shares does not move it.
153
159
  #
154
160
  # @return [Time]
155
161
  required :updated_at, Time
@@ -190,9 +196,9 @@ module Anthropic
190
196
  #
191
197
  # @param served_version_id [String] The version claude.ai serves to members.
192
198
  #
193
- # @param served_version_pinned [Boolean] False while the served version follows each new version; true once it has been p
199
+ # @param served_version_pinned [Boolean] True once the served version has been pinned, through Update Plugin or in claude
194
200
  #
195
- # @param updated_at [Time] RFC 3339. Moves on a new version and on a served-version change; a change to the
201
+ # @param updated_at [Time] RFC 3339. Moves on a served-version change (including pinning an unpinned Plugin
196
202
  #
197
203
  # @param type [Symbol, :plugin] Always `plugin`.
198
204
 
@@ -6,7 +6,8 @@ module Anthropic
6
6
  module Organization
7
7
  class BetaPluginContentScan < Anthropic::Internal::Type::BaseModel
8
8
  # @!attribute assessment
9
- # The scan's verdict; set only when `status` is `completed`.
9
+ # The scan's verdict; set only when `status` is `completed`. A `warn` can mean a
10
+ # `fail` that was allowed in claude.ai.
10
11
  #
11
12
  # @return [Symbol, Anthropic::Models::Beta::Organization::BetaPluginContentScan::Assessment, nil]
12
13
  required :assessment,
@@ -24,7 +25,9 @@ module Anthropic
24
25
 
25
26
  # @!attribute status
26
27
  # `processing` while a scan runs, `completed` when it ran to completion, `errored`
27
- # when it could not run or its outcome cannot be read.
28
+ # when it could not run. Once a scan of the version has completed, `content_scan`
29
+ # describes the newest completed scan, even while a later scan runs. While the
30
+ # scan outcome cannot be read, `status` is `errored` instead.
28
31
  #
29
32
  # @return [Symbol, Anthropic::Models::Beta::Organization::BetaPluginContentScan::Status]
30
33
  required :status, enum: -> { Anthropic::Beta::Organization::BetaPluginContentScan::Status }
@@ -33,13 +36,14 @@ module Anthropic
33
36
  # Some parameter documentations has been truncated, see
34
37
  # {Anthropic::Models::Beta::Organization::BetaPluginContentScan} for more details.
35
38
  #
36
- # @param assessment [Symbol, Anthropic::Models::Beta::Organization::BetaPluginContentScan::Assessment, nil] The scan's verdict; set only when `status` is `completed`.
39
+ # @param assessment [Symbol, Anthropic::Models::Beta::Organization::BetaPluginContentScan::Assessment, nil] The scan's verdict; set only when `status` is `completed`. A `warn` can mean a `
37
40
  #
38
41
  # @param reason [String, nil] The primary mechanism behind a `warn` or `fail`, such as `credential-exposure` o
39
42
  #
40
43
  # @param status [Symbol, Anthropic::Models::Beta::Organization::BetaPluginContentScan::Status] `processing` while a scan runs, `completed` when it ran to completion, `errored`
41
44
 
42
- # The scan's verdict; set only when `status` is `completed`.
45
+ # The scan's verdict; set only when `status` is `completed`. A `warn` can mean a
46
+ # `fail` that was allowed in claude.ai.
43
47
  #
44
48
  # @see Anthropic::Models::Beta::Organization::BetaPluginContentScan#assessment
45
49
  module Assessment
@@ -55,7 +59,9 @@ module Anthropic
55
59
  end
56
60
 
57
61
  # `processing` while a scan runs, `completed` when it ran to completion, `errored`
58
- # when it could not run or its outcome cannot be read.
62
+ # when it could not run. Once a scan of the version has completed, `content_scan`
63
+ # describes the newest completed scan, even while a later scan runs. While the
64
+ # scan outcome cannot be read, `status` is `errored` instead.
59
65
  #
60
66
  # @see Anthropic::Models::Beta::Organization::BetaPluginContentScan#status
61
67
  module Status
@@ -25,7 +25,8 @@ module Anthropic
25
25
 
26
26
  # @!attribute models
27
27
  # Model names this entry's limits apply to, including aliases. `null` when
28
- # `group.type` is not `"model_group"`.
28
+ # `group.type` is not `"model_group"`. The list covers the models this workspace
29
+ # has access to, so it can differ between workspaces.
29
30
  #
30
31
  # @return [Array<String>, nil]
31
32
  required :models, Anthropic::Internal::Type::ArrayOf[String], nil?: true
@@ -28,7 +28,8 @@ module Anthropic
28
28
 
29
29
  # @!attribute models
30
30
  # Model names this entry's limits apply to, including aliases. `null` when
31
- # `group.type` is not `"model_group"`.
31
+ # `group.type` is not `"model_group"`. The list covers the models your
32
+ # organization has access to, so it can differ between organizations.
32
33
  #
33
34
  # @return [Array<String>, nil]
34
35
  required :models, Anthropic::Internal::Type::ArrayOf[String], nil?: true
@@ -24,7 +24,8 @@ module Anthropic
24
24
 
25
25
  # @!attribute models
26
26
  # Model names this entry's limits apply to, including aliases. `null` when
27
- # `group.type` is not `"model_group"`.
27
+ # `group.type` is not `"model_group"`. The list covers the models this workspace
28
+ # has access to, so it can differ between workspaces.
28
29
  #
29
30
  # @return [Array<String>, nil]
30
31
  required :models, Anthropic::Internal::Type::ArrayOf[String], nil?: true
@@ -23,6 +23,27 @@ module Anthropic
23
23
  # @return [Time]
24
24
  required :created_at, Time
25
25
 
26
+ # @!attribute enforcement_actions
27
+ # The enforcement actions open on this profile; empty when none is open. Absent
28
+ # under the `user-profiles-2026-09-04` and earlier beta headers.
29
+ #
30
+ # @return [Array<Anthropic::Models::UserProfileEnforcementActionRestriction, Anthropic::Models::UserProfileEnforcementActionBan>]
31
+ required :enforcement_actions,
32
+ -> { Anthropic::Internal::Type::ArrayOf[union: Anthropic::UserProfileEnforcementAction] }
33
+
34
+ # @!attribute enforcement_status
35
+ # Anthropic's enforcement status of this profile, from its open enforcement
36
+ # actions and any identity check under review, by the first rule that applies:
37
+ # `banned` while any open action is a `ban`; `pending` while a restriction that an
38
+ # identity check can clear is open, the end user has submitted that check,
39
+ # Anthropic's review of it has not ended, and no open action's `reason` is
40
+ # `account_compromise`; `restricted` while any action is open; `unrestricted`
41
+ # while none is. Absent under the `user-profiles-2026-09-04` and earlier beta
42
+ # headers.
43
+ #
44
+ # @return [Symbol, Anthropic::Models::UserProfileEnforcementStatus]
45
+ required :enforcement_status, enum: -> { Anthropic::UserProfileEnforcementStatus }
46
+
26
47
  # @!attribute external_user_details
27
48
  # Details about the entity this profile represents, as the platform states them;
28
49
  # not verified by Anthropic. Every field is present, `null` until the platform
@@ -74,7 +95,7 @@ module Anthropic
74
95
  # @return [Time]
75
96
  required :updated_at, Time
76
97
 
77
- # @!method initialize(id:, access_type:, created_at:, external_user_details:, metadata:, name:, programs:, updated_at:, type: :user_profile)
98
+ # @!method initialize(id:, access_type:, created_at:, enforcement_actions:, enforcement_status:, external_user_details:, metadata:, name:, programs:, updated_at:, type: :user_profile)
78
99
  # A record of an entity that the platform serves through the API, such as an
79
100
  # end-user of the platform's product or a company that the platform resells Claude
80
101
  # access to.
@@ -92,6 +113,10 @@ module Anthropic
92
113
  #
93
114
  # @param created_at [Time] When this user profile was created, in RFC 3339 format.
94
115
  #
116
+ # @param enforcement_actions [Array<Anthropic::Models::UserProfileEnforcementActionRestriction, Anthropic::Models::UserProfileEnforcementActionBan>] The enforcement actions open on this profile; empty when none is open. Absent un
117
+ #
118
+ # @param enforcement_status [Symbol, Anthropic::Models::UserProfileEnforcementStatus] Anthropic's enforcement status of this profile, from its open enforcement action
119
+ #
95
120
  # @param external_user_details [Anthropic::Models::UserProfileExternalUserDetails] Details about the entity this profile represents, as the platform states them; n
96
121
  #
97
122
  # @param metadata [Hash{Symbol=>String}] Arbitrary key-value metadata. Maximum 16 pairs, keys up to 64 chars, values up t
@@ -0,0 +1,66 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Anthropic
4
+ module Models
5
+ # A limit Anthropic has placed on the entity this profile represents and not yet
6
+ # resolved, discriminated by `type`: `restriction` or `ban`. More types may be
7
+ # added; read a `type` you do not recognize as `restriction`.
8
+ module UserProfileEnforcementAction
9
+ extend Anthropic::Internal::Type::Union
10
+
11
+ discriminator :type
12
+
13
+ # Anthropic has limited how it serves the end user until the action is resolved. The end user may still be served in part.
14
+ variant :restriction, -> { Anthropic::UserProfileEnforcementActionRestriction }
15
+
16
+ # Anthropic has stopped serving the end user where the ban applies and does not plan to serve them there again.
17
+ variant :ban, -> { Anthropic::UserProfileEnforcementActionBan }
18
+
19
+ module Type
20
+ extend Anthropic::Internal::Type::Enum
21
+
22
+ RESTRICTION = :restriction
23
+ BAN = :ban
24
+
25
+ # @!method self.values
26
+ # @return [Array<Symbol>]
27
+ end
28
+
29
+ # @!method self.variants
30
+ # @return [Array(Anthropic::Models::UserProfileEnforcementActionRestriction, Anthropic::Models::UserProfileEnforcementActionBan)]
31
+
32
+ # Creates a new instance of the variant class whose `type` matches the given
33
+ # value, passing the remaining arguments to its constructor.
34
+ #
35
+ # Some parameter documentations has been truncated, see
36
+ # {Anthropic::Models::UserProfileEnforcementAction} for more details.
37
+ #
38
+ # @param type [Symbol, Anthropic::Models::UserProfileEnforcementAction::Type, String]
39
+ #
40
+ # @param args [Hash{Symbol=>Object}] Attributes for the chosen variant.
41
+ #
42
+ # @option args [String] :id The action's ID (`enac_...`), stable while the action is open.
43
+ #
44
+ # @option args [Symbol, Anthropic::Models::UserProfileEnforcementActionNextStep, nil] :action The next step on the action: `verify` or `null`. `verify`: the end user can clea
45
+ #
46
+ # @option args [Time, nil] :expires_at When the action ends on its own, in RFC 3339 format; it stops showing once this
47
+ #
48
+ # @option args [Time] :opened_at When Anthropic opened the action, in RFC 3339 format.
49
+ #
50
+ # @option args [Symbol, Anthropic::Models::UserProfileEnforcementActionReason] :reason Why Anthropic placed the limit: `unsupported_region`, `fraud_or_abuse`, `high_ha
51
+ #
52
+ # @raise [ArgumentError]
53
+ # @return [Anthropic::Models::UserProfileEnforcementActionRestriction, Anthropic::Models::UserProfileEnforcementActionBan]
54
+ def self.new(type:, **args)
55
+ case type.to_sym
56
+ when :restriction
57
+ Anthropic::UserProfileEnforcementActionRestriction.new(**args)
58
+ when :ban
59
+ Anthropic::UserProfileEnforcementActionBan.new(**args)
60
+ else
61
+ raise ArgumentError, "unknown type: #{type}"
62
+ end
63
+ end
64
+ end
65
+ end
66
+ end
@@ -0,0 +1,62 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Anthropic
4
+ module Models
5
+ class UserProfileEnforcementActionBan < Anthropic::Internal::Type::BaseModel
6
+ # @!attribute id
7
+ # The action's ID (`enac_...`), stable while the action is open.
8
+ #
9
+ # @return [String]
10
+ required :id, String
11
+
12
+ # @!attribute action
13
+ # Always `null`: the end user cannot clear a ban.
14
+ #
15
+ # @return [Symbol, Anthropic::Models::UserProfileEnforcementActionNextStep, nil]
16
+ required :action, enum: -> { Anthropic::UserProfileEnforcementActionNextStep }, nil?: true
17
+
18
+ # @!attribute expires_at
19
+ # Always `null`: a ban has no end date.
20
+ #
21
+ # @return [Time, nil]
22
+ required :expires_at, Time, nil?: true
23
+
24
+ # @!attribute opened_at
25
+ # When Anthropic opened the action, in RFC 3339 format.
26
+ #
27
+ # @return [Time]
28
+ required :opened_at, Time
29
+
30
+ # @!attribute reason
31
+ # Why Anthropic placed the limit: `unsupported_region`, `fraud_or_abuse`,
32
+ # `high_harm`, `usage_policy_violation`, `account_compromise` or `unspecified`.
33
+ #
34
+ # @return [Symbol, Anthropic::Models::UserProfileEnforcementActionReason]
35
+ required :reason, enum: -> { Anthropic::UserProfileEnforcementActionReason }
36
+
37
+ # @!attribute type
38
+ #
39
+ # @return [Symbol, :ban]
40
+ required :type, const: :ban
41
+
42
+ # @!method initialize(id:, action:, expires_at:, opened_at:, reason:, type: :ban)
43
+ # Anthropic has stopped serving the end user where the ban applies and does not
44
+ # plan to serve them there again.
45
+ #
46
+ # Some parameter documentations has been truncated, see
47
+ # {Anthropic::Models::UserProfileEnforcementActionBan} for more details.
48
+ #
49
+ # @param id [String] The action's ID (`enac_...`), stable while the action is open.
50
+ #
51
+ # @param action [Symbol, Anthropic::Models::UserProfileEnforcementActionNextStep, nil] Always `null`: the end user cannot clear a ban.
52
+ #
53
+ # @param expires_at [Time, nil] Always `null`: a ban has no end date.
54
+ #
55
+ # @param opened_at [Time] When Anthropic opened the action, in RFC 3339 format.
56
+ #
57
+ # @param reason [Symbol, Anthropic::Models::UserProfileEnforcementActionReason] Why Anthropic placed the limit: `unsupported_region`, `fraud_or_abuse`, `high_ha
58
+ #
59
+ # @param type [Symbol, :ban]
60
+ end
61
+ end
62
+ end
@@ -0,0 +1,17 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Anthropic
4
+ module Models
5
+ # The next step on this enforcement action: `verify` means the end user can clear
6
+ # the action by passing an identity check. More values may be added; read a value
7
+ # you do not recognize as `null`.
8
+ module UserProfileEnforcementActionNextStep
9
+ extend Anthropic::Internal::Type::Enum
10
+
11
+ VERIFY = :verify
12
+
13
+ # @!method self.values
14
+ # @return [Array<Symbol>]
15
+ end
16
+ end
17
+ end