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
@@ -21,6 +21,24 @@ module Anthropic
21
21
  sig { returns(Time) }
22
22
  attr_accessor :created_at
23
23
 
24
+ # The enforcement actions open on this profile; empty when none is open. Absent
25
+ # under the `user-profiles-2026-09-04` and earlier beta headers.
26
+ sig do
27
+ returns(T::Array[Anthropic::UserProfileEnforcementAction::Variants])
28
+ end
29
+ attr_accessor :enforcement_actions
30
+
31
+ # Anthropic's enforcement status of this profile, from its open enforcement
32
+ # actions and any identity check under review, by the first rule that applies:
33
+ # `banned` while any open action is a `ban`; `pending` while a restriction that an
34
+ # identity check can clear is open, the end user has submitted that check,
35
+ # Anthropic's review of it has not ended, and no open action's `reason` is
36
+ # `account_compromise`; `restricted` while any action is open; `unrestricted`
37
+ # while none is. Absent under the `user-profiles-2026-09-04` and earlier beta
38
+ # headers.
39
+ sig { returns(Anthropic::UserProfileEnforcementStatus::TaggedSymbol) }
40
+ attr_accessor :enforcement_status
41
+
24
42
  # Details about the entity this profile represents, as the platform states them;
25
43
  # not verified by Anthropic. Every field is present, `null` until the platform
26
44
  # supplies a value. Absent under the legacy `user-profiles-2026-03-24` and
@@ -83,6 +101,14 @@ module Anthropic
83
101
  id: String,
84
102
  access_type: Anthropic::UserProfileAccessType::OrSymbol,
85
103
  created_at: Time,
104
+ enforcement_actions:
105
+ T::Array[
106
+ T.any(
107
+ Anthropic::UserProfileEnforcementActionRestriction::OrHash,
108
+ Anthropic::UserProfileEnforcementActionBan::OrHash
109
+ )
110
+ ],
111
+ enforcement_status: Anthropic::UserProfileEnforcementStatus::OrSymbol,
86
112
  external_user_details:
87
113
  Anthropic::UserProfileExternalUserDetails::OrHash,
88
114
  metadata: T::Hash[Symbol, String],
@@ -100,6 +126,18 @@ module Anthropic
100
126
  access_type:,
101
127
  # When this user profile was created, in RFC 3339 format.
102
128
  created_at:,
129
+ # The enforcement actions open on this profile; empty when none is open. Absent
130
+ # under the `user-profiles-2026-09-04` and earlier beta headers.
131
+ enforcement_actions:,
132
+ # Anthropic's enforcement status of this profile, from its open enforcement
133
+ # actions and any identity check under review, by the first rule that applies:
134
+ # `banned` while any open action is a `ban`; `pending` while a restriction that an
135
+ # identity check can clear is open, the end user has submitted that check,
136
+ # Anthropic's review of it has not ended, and no open action's `reason` is
137
+ # `account_compromise`; `restricted` while any action is open; `unrestricted`
138
+ # while none is. Absent under the `user-profiles-2026-09-04` and earlier beta
139
+ # headers.
140
+ enforcement_status:,
103
141
  # Details about the entity this profile represents, as the platform states them;
104
142
  # not verified by Anthropic. Every field is present, `null` until the platform
105
143
  # supplies a value. Absent under the legacy `user-profiles-2026-03-24` and
@@ -136,6 +174,10 @@ module Anthropic
136
174
  id: String,
137
175
  access_type: Anthropic::UserProfileAccessType::TaggedSymbol,
138
176
  created_at: Time,
177
+ enforcement_actions:
178
+ T::Array[Anthropic::UserProfileEnforcementAction::Variants],
179
+ enforcement_status:
180
+ Anthropic::UserProfileEnforcementStatus::TaggedSymbol,
139
181
  external_user_details: Anthropic::UserProfileExternalUserDetails,
140
182
  metadata: T::Hash[Symbol, String],
141
183
  name: T.nilable(String),
@@ -0,0 +1,95 @@
1
+ # typed: strong
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
+ Variants =
12
+ T.type_alias do
13
+ T.any(
14
+ Anthropic::UserProfileEnforcementActionRestriction,
15
+ Anthropic::UserProfileEnforcementActionBan
16
+ )
17
+ end
18
+
19
+ module Type
20
+ extend Anthropic::Internal::Type::Enum
21
+
22
+ TaggedSymbol =
23
+ T.type_alias do
24
+ T.all(Symbol, Anthropic::UserProfileEnforcementAction::Type)
25
+ end
26
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
27
+
28
+ RESTRICTION =
29
+ T.let(
30
+ :restriction,
31
+ Anthropic::UserProfileEnforcementAction::Type::TaggedSymbol
32
+ )
33
+ BAN =
34
+ T.let(
35
+ :ban,
36
+ Anthropic::UserProfileEnforcementAction::Type::TaggedSymbol
37
+ )
38
+
39
+ sig do
40
+ override.returns(
41
+ T::Array[
42
+ Anthropic::UserProfileEnforcementAction::Type::TaggedSymbol
43
+ ]
44
+ )
45
+ end
46
+ def self.values
47
+ end
48
+ end
49
+
50
+ sig do
51
+ override.returns(
52
+ T::Array[Anthropic::UserProfileEnforcementAction::Variants]
53
+ )
54
+ end
55
+ def self.variants
56
+ end
57
+
58
+ # Creates a new instance of the variant class whose `type` matches the given
59
+ # value, passing the remaining arguments to its constructor.
60
+ sig do
61
+ params(
62
+ type: Anthropic::UserProfileEnforcementAction::Type::OrSymbol,
63
+ id: String,
64
+ action:
65
+ T.nilable(
66
+ Anthropic::UserProfileEnforcementActionNextStep::OrSymbol
67
+ ),
68
+ expires_at: T.nilable(Time),
69
+ opened_at: Time,
70
+ reason: Anthropic::UserProfileEnforcementActionReason::OrSymbol
71
+ ).returns(Anthropic::UserProfileEnforcementAction::Variants)
72
+ end
73
+ def self.new(
74
+ type:,
75
+ # The action's ID (`enac_...`), stable while the action is open.
76
+ id:,
77
+ # The next step on the action: `verify` or `null`. `verify`: the end user can
78
+ # clear it now by passing an identity check. `null`: there is nothing the end user
79
+ # can do now to clear it, including while Anthropic reviews an identity check the
80
+ # end user submitted.
81
+ action:,
82
+ # When the action ends on its own, in RFC 3339 format; it stops showing once this
83
+ # time has passed. `null` when it has no end date, and always `null` when `reason`
84
+ # is `account_compromise`.
85
+ expires_at:,
86
+ # When Anthropic opened the action, in RFC 3339 format.
87
+ opened_at:,
88
+ # Why Anthropic placed the limit: `unsupported_region`, `fraud_or_abuse`,
89
+ # `high_harm`, `usage_policy_violation`, `account_compromise` or `unspecified`.
90
+ reason:
91
+ )
92
+ end
93
+ end
94
+ end
95
+ end
@@ -0,0 +1,96 @@
1
+ # typed: strong
2
+
3
+ module Anthropic
4
+ module Models
5
+ class UserProfileEnforcementActionBan < Anthropic::Internal::Type::BaseModel
6
+ OrHash =
7
+ T.type_alias do
8
+ T.any(
9
+ Anthropic::UserProfileEnforcementActionBan,
10
+ Anthropic::Internal::AnyHash
11
+ )
12
+ end
13
+
14
+ # The action's ID (`enac_...`), stable while the action is open.
15
+ sig { returns(String) }
16
+ attr_accessor :id
17
+
18
+ # Always `null`: the end user cannot clear a ban.
19
+ sig do
20
+ returns(
21
+ T.nilable(
22
+ Anthropic::UserProfileEnforcementActionNextStep::TaggedSymbol
23
+ )
24
+ )
25
+ end
26
+ attr_accessor :action
27
+
28
+ # Always `null`: a ban has no end date.
29
+ sig { returns(T.nilable(Time)) }
30
+ attr_accessor :expires_at
31
+
32
+ # When Anthropic opened the action, in RFC 3339 format.
33
+ sig { returns(Time) }
34
+ attr_accessor :opened_at
35
+
36
+ # Why Anthropic placed the limit: `unsupported_region`, `fraud_or_abuse`,
37
+ # `high_harm`, `usage_policy_violation`, `account_compromise` or `unspecified`.
38
+ sig do
39
+ returns(Anthropic::UserProfileEnforcementActionReason::TaggedSymbol)
40
+ end
41
+ attr_accessor :reason
42
+
43
+ sig { returns(Symbol) }
44
+ attr_accessor :type
45
+
46
+ # Anthropic has stopped serving the end user where the ban applies and does not
47
+ # plan to serve them there again.
48
+ sig do
49
+ params(
50
+ id: String,
51
+ action:
52
+ T.nilable(
53
+ Anthropic::UserProfileEnforcementActionNextStep::OrSymbol
54
+ ),
55
+ expires_at: T.nilable(Time),
56
+ opened_at: Time,
57
+ reason: Anthropic::UserProfileEnforcementActionReason::OrSymbol,
58
+ type: Symbol
59
+ ).returns(T.attached_class)
60
+ end
61
+ def self.new(
62
+ # The action's ID (`enac_...`), stable while the action is open.
63
+ id:,
64
+ # Always `null`: the end user cannot clear a ban.
65
+ action:,
66
+ # Always `null`: a ban has no end date.
67
+ expires_at:,
68
+ # When Anthropic opened the action, in RFC 3339 format.
69
+ opened_at:,
70
+ # Why Anthropic placed the limit: `unsupported_region`, `fraud_or_abuse`,
71
+ # `high_harm`, `usage_policy_violation`, `account_compromise` or `unspecified`.
72
+ reason:,
73
+ type: :ban
74
+ )
75
+ end
76
+
77
+ sig do
78
+ override.returns(
79
+ {
80
+ id: String,
81
+ action:
82
+ T.nilable(
83
+ Anthropic::UserProfileEnforcementActionNextStep::TaggedSymbol
84
+ ),
85
+ expires_at: T.nilable(Time),
86
+ opened_at: Time,
87
+ reason: Anthropic::UserProfileEnforcementActionReason::TaggedSymbol,
88
+ type: Symbol
89
+ }
90
+ )
91
+ end
92
+ def to_hash
93
+ end
94
+ end
95
+ end
96
+ end
@@ -0,0 +1,34 @@
1
+ # typed: strong
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
+ TaggedSymbol =
12
+ T.type_alias do
13
+ T.all(Symbol, Anthropic::UserProfileEnforcementActionNextStep)
14
+ end
15
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
16
+
17
+ VERIFY =
18
+ T.let(
19
+ :verify,
20
+ Anthropic::UserProfileEnforcementActionNextStep::TaggedSymbol
21
+ )
22
+
23
+ sig do
24
+ override.returns(
25
+ T::Array[
26
+ Anthropic::UserProfileEnforcementActionNextStep::TaggedSymbol
27
+ ]
28
+ )
29
+ end
30
+ def self.values
31
+ end
32
+ end
33
+ end
34
+ end
@@ -0,0 +1,58 @@
1
+ # typed: strong
2
+
3
+ module Anthropic
4
+ module Models
5
+ # Why Anthropic placed this enforcement action: `unsupported_region`,
6
+ # `fraud_or_abuse`, `high_harm`, `usage_policy_violation`, `account_compromise` or
7
+ # `unspecified`. More values may be added; read a value you do not recognize as
8
+ # `unspecified`.
9
+ module UserProfileEnforcementActionReason
10
+ extend Anthropic::Internal::Type::Enum
11
+
12
+ TaggedSymbol =
13
+ T.type_alias do
14
+ T.all(Symbol, Anthropic::UserProfileEnforcementActionReason)
15
+ end
16
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
17
+
18
+ UNSUPPORTED_REGION =
19
+ T.let(
20
+ :unsupported_region,
21
+ Anthropic::UserProfileEnforcementActionReason::TaggedSymbol
22
+ )
23
+ FRAUD_OR_ABUSE =
24
+ T.let(
25
+ :fraud_or_abuse,
26
+ Anthropic::UserProfileEnforcementActionReason::TaggedSymbol
27
+ )
28
+ HIGH_HARM =
29
+ T.let(
30
+ :high_harm,
31
+ Anthropic::UserProfileEnforcementActionReason::TaggedSymbol
32
+ )
33
+ USAGE_POLICY_VIOLATION =
34
+ T.let(
35
+ :usage_policy_violation,
36
+ Anthropic::UserProfileEnforcementActionReason::TaggedSymbol
37
+ )
38
+ ACCOUNT_COMPROMISE =
39
+ T.let(
40
+ :account_compromise,
41
+ Anthropic::UserProfileEnforcementActionReason::TaggedSymbol
42
+ )
43
+ UNSPECIFIED =
44
+ T.let(
45
+ :unspecified,
46
+ Anthropic::UserProfileEnforcementActionReason::TaggedSymbol
47
+ )
48
+
49
+ sig do
50
+ override.returns(
51
+ T::Array[Anthropic::UserProfileEnforcementActionReason::TaggedSymbol]
52
+ )
53
+ end
54
+ def self.values
55
+ end
56
+ end
57
+ end
58
+ end
@@ -0,0 +1,106 @@
1
+ # typed: strong
2
+
3
+ module Anthropic
4
+ module Models
5
+ class UserProfileEnforcementActionRestriction < Anthropic::Internal::Type::BaseModel
6
+ OrHash =
7
+ T.type_alias do
8
+ T.any(
9
+ Anthropic::UserProfileEnforcementActionRestriction,
10
+ Anthropic::Internal::AnyHash
11
+ )
12
+ end
13
+
14
+ # The action's ID (`enac_...`), stable while the action is open.
15
+ sig { returns(String) }
16
+ attr_accessor :id
17
+
18
+ # The next step on the action: `verify` or `null`. `verify`: the end user can
19
+ # clear it now by passing an identity check. `null`: there is nothing the end user
20
+ # can do now to clear it, including while Anthropic reviews an identity check the
21
+ # end user submitted.
22
+ sig do
23
+ returns(
24
+ T.nilable(
25
+ Anthropic::UserProfileEnforcementActionNextStep::TaggedSymbol
26
+ )
27
+ )
28
+ end
29
+ attr_accessor :action
30
+
31
+ # When the action ends on its own, in RFC 3339 format; it stops showing once this
32
+ # time has passed. `null` when it has no end date, and always `null` when `reason`
33
+ # is `account_compromise`.
34
+ sig { returns(T.nilable(Time)) }
35
+ attr_accessor :expires_at
36
+
37
+ # When Anthropic opened the action, in RFC 3339 format.
38
+ sig { returns(Time) }
39
+ attr_accessor :opened_at
40
+
41
+ # Why Anthropic placed the limit: `unsupported_region`, `fraud_or_abuse`,
42
+ # `high_harm`, `usage_policy_violation`, `account_compromise` or `unspecified`.
43
+ sig do
44
+ returns(Anthropic::UserProfileEnforcementActionReason::TaggedSymbol)
45
+ end
46
+ attr_accessor :reason
47
+
48
+ sig { returns(Symbol) }
49
+ attr_accessor :type
50
+
51
+ # Anthropic has limited how it serves the end user until the action is resolved.
52
+ # The end user may still be served in part.
53
+ sig do
54
+ params(
55
+ id: String,
56
+ action:
57
+ T.nilable(
58
+ Anthropic::UserProfileEnforcementActionNextStep::OrSymbol
59
+ ),
60
+ expires_at: T.nilable(Time),
61
+ opened_at: Time,
62
+ reason: Anthropic::UserProfileEnforcementActionReason::OrSymbol,
63
+ type: Symbol
64
+ ).returns(T.attached_class)
65
+ end
66
+ def self.new(
67
+ # The action's ID (`enac_...`), stable while the action is open.
68
+ id:,
69
+ # The next step on the action: `verify` or `null`. `verify`: the end user can
70
+ # clear it now by passing an identity check. `null`: there is nothing the end user
71
+ # can do now to clear it, including while Anthropic reviews an identity check the
72
+ # end user submitted.
73
+ action:,
74
+ # When the action ends on its own, in RFC 3339 format; it stops showing once this
75
+ # time has passed. `null` when it has no end date, and always `null` when `reason`
76
+ # is `account_compromise`.
77
+ expires_at:,
78
+ # When Anthropic opened the action, in RFC 3339 format.
79
+ opened_at:,
80
+ # Why Anthropic placed the limit: `unsupported_region`, `fraud_or_abuse`,
81
+ # `high_harm`, `usage_policy_violation`, `account_compromise` or `unspecified`.
82
+ reason:,
83
+ type: :restriction
84
+ )
85
+ end
86
+
87
+ sig do
88
+ override.returns(
89
+ {
90
+ id: String,
91
+ action:
92
+ T.nilable(
93
+ Anthropic::UserProfileEnforcementActionNextStep::TaggedSymbol
94
+ ),
95
+ expires_at: T.nilable(Time),
96
+ opened_at: Time,
97
+ reason: Anthropic::UserProfileEnforcementActionReason::TaggedSymbol,
98
+ type: Symbol
99
+ }
100
+ )
101
+ end
102
+ def to_hash
103
+ end
104
+ end
105
+ end
106
+ end
@@ -0,0 +1,39 @@
1
+ # typed: strong
2
+
3
+ module Anthropic
4
+ module Models
5
+ # Anthropic's enforcement status of this profile: `unrestricted`, `pending`,
6
+ # `restricted` or `banned`. More values may be added; read a value you do not
7
+ # recognize as `restricted`.
8
+ module UserProfileEnforcementStatus
9
+ extend Anthropic::Internal::Type::Enum
10
+
11
+ TaggedSymbol =
12
+ T.type_alias { T.all(Symbol, Anthropic::UserProfileEnforcementStatus) }
13
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
14
+
15
+ UNRESTRICTED =
16
+ T.let(
17
+ :unrestricted,
18
+ Anthropic::UserProfileEnforcementStatus::TaggedSymbol
19
+ )
20
+ PENDING =
21
+ T.let(:pending, Anthropic::UserProfileEnforcementStatus::TaggedSymbol)
22
+ RESTRICTED =
23
+ T.let(
24
+ :restricted,
25
+ Anthropic::UserProfileEnforcementStatus::TaggedSymbol
26
+ )
27
+ BANNED =
28
+ T.let(:banned, Anthropic::UserProfileEnforcementStatus::TaggedSymbol)
29
+
30
+ sig do
31
+ override.returns(
32
+ T::Array[Anthropic::UserProfileEnforcementStatus::TaggedSymbol]
33
+ )
34
+ end
35
+ def self.values
36
+ end
37
+ end
38
+ end
39
+ end
@@ -11,6 +11,29 @@ module Anthropic
11
11
  T.any(Anthropic::UserProfileListParams, Anthropic::Internal::AnyHash)
12
12
  end
13
13
 
14
+ # Return only the user profiles whose `enforcement_status` is one of these values:
15
+ # `unrestricted`, `pending`, `restricted` or `banned`. Repeat the parameter to
16
+ # match any of several. With it set, a page may hold fewer than `limit` profiles,
17
+ # or none, and still carry a `next_page`: the service examines a bounded number of
18
+ # profiles per request, and only a null `next_page` means the listing is complete.
19
+ # Rejected with `invalid_request_error` under the `user-profiles-2026-09-04` and
20
+ # earlier beta headers. Fails with `overloaded_error` when a profile's enforcement
21
+ # actions cannot be read for the moment.
22
+ sig do
23
+ returns(
24
+ T.nilable(T::Array[Anthropic::UserProfileEnforcementStatus::OrSymbol])
25
+ )
26
+ end
27
+ attr_reader :enforcement_status
28
+
29
+ sig do
30
+ params(
31
+ enforcement_status:
32
+ T::Array[Anthropic::UserProfileEnforcementStatus::OrSymbol]
33
+ ).void
34
+ end
35
+ attr_writer :enforcement_status
36
+
14
37
  # The maximum number of user profiles to return, from 1 to 100. Defaults to 20.
15
38
  sig { returns(T.nilable(Integer)) }
16
39
  attr_reader :limit
@@ -58,6 +81,8 @@ module Anthropic
58
81
 
59
82
  sig do
60
83
  params(
84
+ enforcement_status:
85
+ T::Array[Anthropic::UserProfileEnforcementStatus::OrSymbol],
61
86
  limit: Integer,
62
87
  order: Anthropic::UserProfileListOrder::OrSymbol,
63
88
  order_by: Anthropic::UserProfileListOrderBy::OrSymbol,
@@ -67,6 +92,15 @@ module Anthropic
67
92
  ).returns(T.attached_class)
68
93
  end
69
94
  def self.new(
95
+ # Return only the user profiles whose `enforcement_status` is one of these values:
96
+ # `unrestricted`, `pending`, `restricted` or `banned`. Repeat the parameter to
97
+ # match any of several. With it set, a page may hold fewer than `limit` profiles,
98
+ # or none, and still carry a `next_page`: the service examines a bounded number of
99
+ # profiles per request, and only a null `next_page` means the listing is complete.
100
+ # Rejected with `invalid_request_error` under the `user-profiles-2026-09-04` and
101
+ # earlier beta headers. Fails with `overloaded_error` when a profile's enforcement
102
+ # actions cannot be read for the moment.
103
+ enforcement_status: nil,
70
104
  # The maximum number of user profiles to return, from 1 to 100. Defaults to 20.
71
105
  limit: nil,
72
106
  # The sort direction, applied to the field that `order_by` selects. Defaults to
@@ -94,6 +128,8 @@ module Anthropic
94
128
  sig do
95
129
  override.returns(
96
130
  {
131
+ enforcement_status:
132
+ T::Array[Anthropic::UserProfileEnforcementStatus::OrSymbol],
97
133
  limit: Integer,
98
134
  order: Anthropic::UserProfileListOrder::OrSymbol,
99
135
  order_by: Anthropic::UserProfileListOrderBy::OrSymbol,
@@ -856,6 +856,22 @@ module Anthropic
856
856
 
857
857
  UserProfileEfsProgram = Anthropic::Models::UserProfileEfsProgram
858
858
 
859
+ UserProfileEnforcementAction = Anthropic::Models::UserProfileEnforcementAction
860
+
861
+ UserProfileEnforcementActionBan =
862
+ Anthropic::Models::UserProfileEnforcementActionBan
863
+
864
+ UserProfileEnforcementActionNextStep =
865
+ Anthropic::Models::UserProfileEnforcementActionNextStep
866
+
867
+ UserProfileEnforcementActionReason =
868
+ Anthropic::Models::UserProfileEnforcementActionReason
869
+
870
+ UserProfileEnforcementActionRestriction =
871
+ Anthropic::Models::UserProfileEnforcementActionRestriction
872
+
873
+ UserProfileEnforcementStatus = Anthropic::Models::UserProfileEnforcementStatus
874
+
859
875
  UserProfileExternalUserAccountStatus =
860
876
  Anthropic::Models::UserProfileExternalUserAccountStatus
861
877