workos 9.5.0 → 10.1.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 (208) hide show
  1. checksums.yaml +4 -4
  2. data/.claude/CLAUDE.md +38 -0
  3. data/.github/workflows/block-generated-edits.yml +13 -0
  4. data/.github/workflows/ci.yml +1 -1
  5. data/.github/workflows/docs.yml +1 -1
  6. data/.github/workflows/lint.yml +1 -1
  7. data/.github/workflows/release-please.yml +7 -1
  8. data/.github/workflows/release.yml +1 -1
  9. data/.last-synced-sha +1 -1
  10. data/.oagen-manifest.json +197 -75
  11. data/.release-please-manifest.json +1 -1
  12. data/AGENTS.md +1 -0
  13. data/CHANGELOG.md +118 -0
  14. data/Gemfile.lock +2 -2
  15. data/README.md +15 -14
  16. data/lib/workos/agents/agent_admin_link_claim_attempt_to_external_user_request.rb +28 -0
  17. data/lib/workos/agents/agent_admin_link_claim_attempt_to_external_user_request_user.rb +22 -0
  18. data/lib/workos/agents/agent_admin_validate_credential_request.rb +25 -0
  19. data/lib/workos/agents/agent_credential_validation.rb +25 -0
  20. data/lib/workos/agents/agent_registration.rb +40 -0
  21. data/lib/workos/agents/agent_registration_agent_identity.rb +28 -0
  22. data/lib/workos/agents/agent_registration_claim.rb +31 -0
  23. data/lib/workos/agents/agent_registration_claim_claim_completion.rb +31 -0
  24. data/lib/workos/agents/claim_view_response.rb +28 -0
  25. data/lib/workos/agents/claim_view_response_organization.rb +7 -0
  26. data/lib/workos/agents.rb +93 -0
  27. data/lib/workos/api_keys/api_key_validation_response.rb +6 -2
  28. data/lib/workos/api_keys.rb +3 -4
  29. data/lib/workos/authorization/permission_created_data.rb +1 -34
  30. data/lib/workos/authorization/permission_deleted_data.rb +1 -1
  31. data/lib/workos/authorization/permission_updated_data.rb +1 -1
  32. data/lib/workos/authorization.rb +24 -24
  33. data/lib/workos/base_client.rb +4 -4
  34. data/lib/workos/client.rb +4 -0
  35. data/lib/workos/connect.rb +23 -19
  36. data/lib/workos/directory_sync.rb +10 -2
  37. data/lib/workos/groups.rb +7 -7
  38. data/lib/workos/inflections.rb +0 -1
  39. data/lib/workos/organization_domains.rb +4 -4
  40. data/lib/workos/organizations/organization_authorized_connect_application_list_data.rb +34 -0
  41. data/lib/workos/organizations.rb +57 -10
  42. data/lib/workos/pipes/api_key_installation.rb +25 -0
  43. data/lib/workos/pipes/{connected_account_dto.rb → connected_account_input.rb} +1 -1
  44. data/lib/workos/pipes/create_data_integration.rb +10 -1
  45. data/lib/workos/pipes/data_integration.rb +9 -0
  46. data/lib/workos/pipes/{data_integration_credentials_dto.rb → data_integration_credentials_input.rb} +1 -1
  47. data/lib/workos/pipes/data_integration_installation.rb +28 -0
  48. data/lib/workos/pipes/data_integrations_get_data_integration_authorize_url_request.rb +5 -2
  49. data/lib/workos/pipes/data_integrations_upsert_api_key_request.rb +1 -19
  50. data/lib/workos/pipes/update_data_integration.rb +4 -1
  51. data/lib/workos/pipes.rb +32 -17
  52. data/lib/workos/pipes_provider/configure_data_integration_body.rb +5 -2
  53. data/lib/workos/pipes_provider/data_integration_configuration_response.rb +3 -0
  54. data/lib/workos/pipes_provider.rb +6 -3
  55. data/lib/workos/shared/access_token_agent_registration_credential_issued_data_detail.rb +25 -0
  56. data/lib/workos/shared/agent_registration_claim_attempt_created.rb +34 -0
  57. data/lib/workos/shared/agent_registration_claim_attempt_created_data.rb +40 -0
  58. data/lib/workos/shared/agent_registration_claim_completed.rb +34 -0
  59. data/lib/workos/shared/agent_registration_claim_completed_data.rb +40 -0
  60. data/lib/workos/shared/agent_registration_claim_completed_data_claimed_by.rb +22 -0
  61. data/lib/workos/shared/agent_registration_created.rb +34 -0
  62. data/lib/workos/{organization_domains/organization_domain_stand_alone.rb → shared/agent_registration_created_data.rb} +13 -16
  63. data/lib/workos/shared/agent_registration_created_data_agent_identity.rb +25 -0
  64. data/lib/workos/shared/agent_registration_credential_issued.rb +34 -0
  65. data/lib/workos/shared/agent_registration_credential_issued_data.rb +34 -0
  66. data/lib/workos/shared/agent_registration_credential_issued_data_detail.rb +22 -0
  67. data/lib/workos/shared/agent_registration_deleted.rb +34 -0
  68. data/lib/workos/shared/agent_registration_deleted_data.rb +18 -0
  69. data/lib/workos/shared/agent_registration_expired.rb +34 -0
  70. data/lib/workos/shared/agent_registration_expired_data.rb +7 -0
  71. data/lib/workos/shared/agent_registration_organization_switched.rb +34 -0
  72. data/lib/workos/shared/agent_registration_organization_switched_data.rb +25 -0
  73. data/lib/workos/shared/agent_registration_revoked.rb +34 -0
  74. data/lib/workos/shared/agent_registration_revoked_data.rb +7 -0
  75. data/lib/workos/shared/pipes_connected_account_connection_failed.rb +34 -0
  76. data/lib/workos/shared/pipes_connected_account_connection_failed_data.rb +46 -0
  77. data/lib/workos/shared/radar_challenge_created.rb +34 -0
  78. data/lib/workos/shared/radar_challenge_created_data.rb +28 -0
  79. data/lib/workos/sso/connection.rb +0 -3
  80. data/lib/workos/sso.rb +73 -26
  81. data/lib/workos/types/agent_admin_validate_credential_request_type.rb +13 -0
  82. data/lib/workos/types/agent_registration_created_data_kind.rb +14 -0
  83. data/lib/workos/types/agent_registration_created_data_method.rb +14 -0
  84. data/lib/workos/types/agent_registration_created_data_status.rb +15 -0
  85. data/lib/workos/types/{data_integration_credentials_type.rb → agent_registration_kind.rb} +1 -1
  86. data/lib/workos/types/{organization_domain_stand_alone_state.rb → agent_registration_status.rb} +1 -1
  87. data/lib/workos/types/applications_registration_types.rb +13 -0
  88. data/lib/workos/types/{organization_domain_stand_alone_verification_strategy.rb → claim_view_response_status.rb} +1 -1
  89. data/lib/workos/types/connected_account_auth_method.rb +2 -1
  90. data/lib/workos/types/connected_account_input_state.rb +13 -0
  91. data/lib/workos/types/connected_account_state.rb +2 -1
  92. data/lib/workos/types/create_data_integration_auth_methods.rb +13 -0
  93. data/lib/workos/types/create_user_password_hash_type.rb +2 -1
  94. data/lib/workos/types/create_webhook_endpoint_events.rb +5 -1
  95. data/lib/workos/types/data_integration_auth_methods.rb +9 -0
  96. data/lib/workos/types/data_integration_credentials_input_type.rb +9 -0
  97. data/lib/workos/types/data_integrations_list_response_data_connected_account_state.rb +1 -6
  98. data/lib/workos/types/pipe_connected_account_state.rb +1 -5
  99. data/lib/workos/types/vault_kek_deleted_data_actor_source.rb +9 -0
  100. data/lib/workos/user_management/authentication_reauthentication_succeeded.rb +34 -0
  101. data/lib/workos/user_management/authentication_reauthentication_succeeded_data.rb +34 -0
  102. data/lib/workos/user_management/radar_challenge.rb +43 -0
  103. data/lib/workos/user_management.rb +149 -67
  104. data/lib/workos/vault/vault_kek_deleted.rb +34 -0
  105. data/lib/workos/vault/vault_kek_deleted_data.rb +31 -0
  106. data/lib/workos/vault.rb +4 -4
  107. data/lib/workos/version.rb +1 -1
  108. data/lib/workos/widgets.rb +2 -2
  109. data/lib/workos.rb +11 -0
  110. data/rbi/workos/access_token_agent_registration_credential_issued_data_detail.rbi +36 -0
  111. data/rbi/workos/agent_admin_link_claim_attempt_to_external_user_request.rbi +42 -0
  112. data/rbi/workos/agent_admin_link_claim_attempt_to_external_user_request_user.rbi +30 -0
  113. data/rbi/workos/agent_admin_validate_credential_request.rbi +36 -0
  114. data/rbi/workos/{sso_intent_options.rbi → agent_credential_validation.rbi} +11 -5
  115. data/rbi/workos/agent_registration.rbi +66 -0
  116. data/rbi/workos/agent_registration_agent_identity.rbi +42 -0
  117. data/rbi/workos/agent_registration_claim.rbi +48 -0
  118. data/rbi/workos/agent_registration_claim_attempt_created.rbi +54 -0
  119. data/rbi/workos/agent_registration_claim_attempt_created_data.rbi +66 -0
  120. data/rbi/workos/agent_registration_claim_claim_completion.rbi +48 -0
  121. data/rbi/workos/agent_registration_claim_completed.rbi +54 -0
  122. data/rbi/workos/agent_registration_claim_completed_data.rbi +66 -0
  123. data/rbi/workos/agent_registration_claim_completed_data_claimed_by.rbi +30 -0
  124. data/rbi/workos/agent_registration_created.rbi +54 -0
  125. data/rbi/workos/agent_registration_created_data.rbi +72 -0
  126. data/rbi/workos/agent_registration_created_data_agent_identity.rbi +36 -0
  127. data/rbi/workos/agent_registration_credential_issued.rbi +54 -0
  128. data/rbi/workos/agent_registration_credential_issued_data.rbi +54 -0
  129. data/rbi/workos/agent_registration_credential_issued_data_detail.rbi +30 -0
  130. data/rbi/workos/agent_registration_deleted.rbi +54 -0
  131. data/rbi/workos/{connection_option.rbi → agent_registration_deleted_data.rbi} +5 -5
  132. data/rbi/workos/agent_registration_expired.rbi +54 -0
  133. data/rbi/workos/{domain_verification_intent_options.rbi → agent_registration_expired_data.rbi} +5 -5
  134. data/rbi/workos/agent_registration_organization_switched.rbi +54 -0
  135. data/rbi/workos/agent_registration_organization_switched_data.rbi +36 -0
  136. data/rbi/workos/agent_registration_revoked.rbi +54 -0
  137. data/rbi/workos/agent_registration_revoked_data.rbi +24 -0
  138. data/rbi/workos/agents.rbi +42 -0
  139. data/rbi/workos/api_key_installation.rbi +36 -0
  140. data/rbi/workos/api_key_validation_response.rbi +6 -0
  141. data/rbi/workos/authentication_reauthentication_succeeded.rbi +54 -0
  142. data/rbi/workos/authentication_reauthentication_succeeded_data.rbi +54 -0
  143. data/rbi/workos/claim_view_response.rbi +42 -0
  144. data/rbi/workos/claim_view_response_organization.rbi +30 -0
  145. data/rbi/workos/client.rbi +3 -0
  146. data/rbi/workos/configure_data_integration_body.rbi +6 -0
  147. data/rbi/workos/connect.rbi +2 -1
  148. data/rbi/workos/{connected_account_dto.rbi → connected_account_input.rbi} +1 -1
  149. data/rbi/workos/connection.rbi +0 -6
  150. data/rbi/workos/create_data_integration.rbi +20 -2
  151. data/rbi/workos/data_integration.rbi +18 -0
  152. data/rbi/workos/data_integration_configuration_response.rbi +6 -0
  153. data/rbi/workos/{data_integration_credentials_dto.rbi → data_integration_credentials_input.rbi} +1 -1
  154. data/rbi/workos/data_integration_installation.rbi +42 -0
  155. data/rbi/workos/data_integrations_get_data_integration_authorize_url_request.rbi +6 -0
  156. data/rbi/workos/directory_sync.rbi +3 -1
  157. data/rbi/workos/organization_authorized_connect_application_list_data.rbi +54 -0
  158. data/rbi/workos/organization_domains.rbi +2 -2
  159. data/rbi/workos/organizations.rbi +12 -0
  160. data/rbi/workos/permission_created_data.rbi +6 -0
  161. data/rbi/workos/permission_deleted_data.rbi +6 -0
  162. data/rbi/workos/permission_updated_data.rbi +6 -0
  163. data/rbi/workos/pipes.rbi +10 -5
  164. data/rbi/workos/pipes_connected_account_connection_failed.rbi +54 -0
  165. data/rbi/workos/{organization_domain_stand_alone.rbi → pipes_connected_account_connection_failed_data.rbi} +23 -23
  166. data/rbi/workos/pipes_provider.rbi +2 -1
  167. data/rbi/workos/radar_challenge.rbi +72 -0
  168. data/rbi/workos/radar_challenge_created.rbi +54 -0
  169. data/rbi/workos/radar_challenge_created_data.rbi +42 -0
  170. data/rbi/workos/sso.rbi +26 -0
  171. data/rbi/workos/update_data_integration.rbi +8 -2
  172. data/rbi/workos/user_management.rbi +46 -0
  173. data/rbi/workos/vault_kek_deleted.rbi +54 -0
  174. data/rbi/workos/vault_kek_deleted_data.rbi +48 -0
  175. data/rbi/workos/widget_session_token.rbi +2 -2
  176. data/rbi/workos/widgets.rbi +1 -1
  177. data/test/workos/test_agents.rb +49 -0
  178. data/test/workos/test_agents_model_round_trip.rb +165 -0
  179. data/test/workos/test_api_keys_model_round_trip.rb +307 -0
  180. data/test/workos/test_authkit_helpers.rb +22 -10
  181. data/test/workos/test_authorization_model_round_trip.rb +237 -0
  182. data/test/workos/test_base_client.rb +27 -0
  183. data/test/workos/test_client_api_model_round_trip.rb +31 -0
  184. data/test/workos/test_connect_model_round_trip.rb +175 -0
  185. data/test/workos/test_directory_sync_model_round_trip.rb +579 -0
  186. data/test/workos/test_feature_flags_model_round_trip.rb +580 -0
  187. data/test/workos/test_groups_model_round_trip.rb +56 -0
  188. data/test/workos/test_multi_factor_auth_model_round_trip.rb +192 -0
  189. data/test/workos/test_organization_domains_model_round_trip.rb +260 -0
  190. data/test/workos/test_organization_membership_model_round_trip.rb +89 -0
  191. data/test/workos/test_organizations.rb +9 -1
  192. data/test/workos/test_organizations_model_round_trip.rb +602 -0
  193. data/test/workos/test_pipes_model_round_trip.rb +44 -5
  194. data/test/workos/test_pipes_provider_model_round_trip.rb +77 -0
  195. data/test/workos/test_shared_model_round_trip.rb +725 -0
  196. data/test/workos/test_sso_model_round_trip.rb +421 -0
  197. data/test/workos/test_user_management.rb +16 -0
  198. data/test/workos/test_user_management_model_round_trip.rb +1501 -0
  199. data/test/workos/test_vault_model_round_trip.rb +571 -0
  200. data/test/workos/test_widgets.rb +2 -2
  201. data/test/workos/test_widgets_model_round_trip.rb +30 -0
  202. metadata +120 -19
  203. data/lib/workos/admin_portal/domain_verification_intent_options.rb +0 -18
  204. data/lib/workos/admin_portal/intent_options.rb +0 -22
  205. data/lib/workos/admin_portal/sso_intent_options.rb +0 -22
  206. data/lib/workos/sso/connection_option.rb +0 -18
  207. data/rbi/workos/intent_options.rbi +0 -30
  208. data/test/workos/test_model_round_trip.rb +0 -6
@@ -5,6 +5,17 @@
5
5
  require "test_helper"
6
6
 
7
7
  class SharedModelRoundTripTest < Minitest::Test
8
+ def test_error_response_round_trip
9
+ fixture = {
10
+ "error" => "stub"
11
+ }
12
+ model = WorkOS::ErrorResponse.new(fixture.to_json)
13
+ json = model.to_h
14
+ assert_kind_of Hash, json
15
+ assert_equal fixture["error"], json[:error]
16
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
17
+ end
18
+
8
19
  def test_connect_application_oauth_round_trip
9
20
  fixture = {
10
21
  "object" => "connect_application",
@@ -75,6 +86,720 @@ class SharedModelRoundTripTest < Minitest::Test
75
86
  fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
76
87
  end
77
88
 
89
+ def test_event_context_actor_round_trip
90
+ fixture = {
91
+ "id" => "stub",
92
+ "source" => "stub",
93
+ "name" => nil
94
+ }
95
+ model = WorkOS::EventContextActor.new(fixture.to_json)
96
+ json = model.to_h
97
+ assert_kind_of Hash, json
98
+ assert_equal fixture["id"], json[:id]
99
+ assert_nil json[:name]
100
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
101
+ end
102
+
103
+ def test_event_context_round_trip
104
+ fixture = {
105
+ "google_analytics_client_id" => "stub",
106
+ "google_analytics_sessions" => [],
107
+ "ajs_anonymous_id" => "stub",
108
+ "client_id" => "stub",
109
+ "actor" => {},
110
+ "previous_attributes" => {}
111
+ }
112
+ model = WorkOS::EventContext.new(fixture.to_json)
113
+ json = model.to_h
114
+ assert_kind_of Hash, json
115
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
116
+ end
117
+
118
+ def test_pipe_connected_account_round_trip
119
+ fixture = {
120
+ "object" => "connected_account",
121
+ "id" => "stub",
122
+ "data_integration_id" => "stub",
123
+ "provider_slug" => "stub",
124
+ "user_id" => nil,
125
+ "organization_id" => nil,
126
+ "scopes" => [],
127
+ "state" => "stub",
128
+ "created_at" => "stub",
129
+ "updated_at" => "stub"
130
+ }
131
+ model = WorkOS::PipeConnectedAccount.new(fixture.to_json)
132
+ json = model.to_h
133
+ assert_kind_of Hash, json
134
+ assert_equal fixture["id"], json[:id]
135
+ assert_equal fixture["data_integration_id"], json[:data_integration_id]
136
+ assert_equal fixture["provider_slug"], json[:provider_slug]
137
+ assert_nil json[:user_id]
138
+ assert_nil json[:organization_id]
139
+ assert_equal fixture["created_at"], json[:created_at]
140
+ assert_equal fixture["updated_at"], json[:updated_at]
141
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
142
+ end
143
+
144
+ def test_waitlist_user_round_trip
145
+ fixture = {
146
+ "object" => "waitlist_user",
147
+ "id" => "stub",
148
+ "email" => "stub",
149
+ "state" => "stub",
150
+ "approved_at" => nil,
151
+ "created_at" => "stub",
152
+ "updated_at" => "stub"
153
+ }
154
+ model = WorkOS::WaitlistUser.new(fixture.to_json)
155
+ json = model.to_h
156
+ assert_kind_of Hash, json
157
+ assert_equal fixture["id"], json[:id]
158
+ assert_equal fixture["email"], json[:email]
159
+ assert_nil json[:approved_at]
160
+ assert_equal fixture["created_at"], json[:created_at]
161
+ assert_equal fixture["updated_at"], json[:updated_at]
162
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
163
+ end
164
+
165
+ def test_agent_registration_claim_attempt_created_round_trip
166
+ fixture = {
167
+ "object" => "event",
168
+ "id" => "stub",
169
+ "event" => "agent.registration.claim.attempt.created",
170
+ "data" => {},
171
+ "created_at" => "stub",
172
+ "context" => {}
173
+ }
174
+ model = WorkOS::AgentRegistrationClaimAttemptCreated.new(fixture.to_json)
175
+ json = model.to_h
176
+ assert_kind_of Hash, json
177
+ assert_equal fixture["id"], json[:id]
178
+ assert_equal fixture["created_at"], json[:created_at]
179
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
180
+ end
181
+
182
+ def test_agent_registration_claim_attempt_created_data_round_trip
183
+ fixture = {
184
+ "object" => "agent_registration_claim_attempt",
185
+ "id" => "stub",
186
+ "agent_registration_id" => "stub",
187
+ "agent_registration_claim_id" => "stub",
188
+ "login_hint" => "stub",
189
+ "expires_at" => "stub",
190
+ "created_at" => "stub",
191
+ "updated_at" => "stub"
192
+ }
193
+ model = WorkOS::AgentRegistrationClaimAttemptCreatedData.new(fixture.to_json)
194
+ json = model.to_h
195
+ assert_kind_of Hash, json
196
+ assert_equal fixture["id"], json[:id]
197
+ assert_equal fixture["agent_registration_id"], json[:agent_registration_id]
198
+ assert_equal fixture["agent_registration_claim_id"], json[:agent_registration_claim_id]
199
+ assert_equal fixture["login_hint"], json[:login_hint]
200
+ assert_equal fixture["expires_at"], json[:expires_at]
201
+ assert_equal fixture["created_at"], json[:created_at]
202
+ assert_equal fixture["updated_at"], json[:updated_at]
203
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
204
+ end
205
+
206
+ def test_agent_registration_claim_completed_round_trip
207
+ fixture = {
208
+ "object" => "event",
209
+ "id" => "stub",
210
+ "event" => "agent.registration.claim.completed",
211
+ "data" => {},
212
+ "created_at" => "stub",
213
+ "context" => {}
214
+ }
215
+ model = WorkOS::AgentRegistrationClaimCompleted.new(fixture.to_json)
216
+ json = model.to_h
217
+ assert_kind_of Hash, json
218
+ assert_equal fixture["id"], json[:id]
219
+ assert_equal fixture["created_at"], json[:created_at]
220
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
221
+ end
222
+
223
+ def test_agent_registration_claim_completed_data_round_trip
224
+ fixture = {
225
+ "object" => "agent_registration_claim",
226
+ "id" => "stub",
227
+ "agent_registration_id" => "stub",
228
+ "completed_by_attempt_id" => "stub",
229
+ "claimed_by" => {},
230
+ "completed_at" => "stub",
231
+ "created_at" => "stub",
232
+ "updated_at" => "stub"
233
+ }
234
+ model = WorkOS::AgentRegistrationClaimCompletedData.new(fixture.to_json)
235
+ json = model.to_h
236
+ assert_kind_of Hash, json
237
+ assert_equal fixture["id"], json[:id]
238
+ assert_equal fixture["agent_registration_id"], json[:agent_registration_id]
239
+ assert_equal fixture["completed_by_attempt_id"], json[:completed_by_attempt_id]
240
+ assert_equal fixture["completed_at"], json[:completed_at]
241
+ assert_equal fixture["created_at"], json[:created_at]
242
+ assert_equal fixture["updated_at"], json[:updated_at]
243
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
244
+ end
245
+
246
+ def test_agent_registration_claim_completed_data_claimed_by_round_trip
247
+ fixture = {
248
+ "user_id" => "stub",
249
+ "organization_id" => "stub"
250
+ }
251
+ model = WorkOS::AgentRegistrationClaimCompletedDataClaimedBy.new(fixture.to_json)
252
+ json = model.to_h
253
+ assert_kind_of Hash, json
254
+ assert_equal fixture["user_id"], json[:user_id]
255
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
256
+ end
257
+
258
+ def test_agent_registration_created_round_trip
259
+ fixture = {
260
+ "object" => "event",
261
+ "id" => "stub",
262
+ "event" => "agent.registration.created",
263
+ "data" => {},
264
+ "created_at" => "stub",
265
+ "context" => {}
266
+ }
267
+ model = WorkOS::AgentRegistrationCreated.new(fixture.to_json)
268
+ json = model.to_h
269
+ assert_kind_of Hash, json
270
+ assert_equal fixture["id"], json[:id]
271
+ assert_equal fixture["created_at"], json[:created_at]
272
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
273
+ end
274
+
275
+ def test_agent_registration_created_data_round_trip
276
+ fixture = {
277
+ "object" => "agent_registration",
278
+ "id" => "stub",
279
+ "agent_identity" => {},
280
+ "organization_id" => "stub",
281
+ "status" => "stub",
282
+ "kind" => "stub",
283
+ "method" => "stub",
284
+ "created_at" => "stub",
285
+ "updated_at" => "stub"
286
+ }
287
+ model = WorkOS::AgentRegistrationCreatedData.new(fixture.to_json)
288
+ json = model.to_h
289
+ assert_kind_of Hash, json
290
+ assert_equal fixture["id"], json[:id]
291
+ assert_equal fixture["organization_id"], json[:organization_id]
292
+ assert_equal fixture["created_at"], json[:created_at]
293
+ assert_equal fixture["updated_at"], json[:updated_at]
294
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
295
+ end
296
+
297
+ def test_agent_registration_created_data_agent_identity_round_trip
298
+ fixture = {
299
+ "object" => "agent_identity",
300
+ "id" => "stub",
301
+ "userland_user_id" => "stub"
302
+ }
303
+ model = WorkOS::AgentRegistrationCreatedDataAgentIdentity.new(fixture.to_json)
304
+ json = model.to_h
305
+ assert_kind_of Hash, json
306
+ assert_equal fixture["id"], json[:id]
307
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
308
+ end
309
+
310
+ def test_agent_registration_credential_issued_round_trip
311
+ fixture = {
312
+ "object" => "event",
313
+ "id" => "stub",
314
+ "event" => "agent.registration.credential.issued",
315
+ "data" => {},
316
+ "created_at" => "stub",
317
+ "context" => {}
318
+ }
319
+ model = WorkOS::AgentRegistrationCredentialIssued.new(fixture.to_json)
320
+ json = model.to_h
321
+ assert_kind_of Hash, json
322
+ assert_equal fixture["id"], json[:id]
323
+ assert_equal fixture["created_at"], json[:created_at]
324
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
325
+ end
326
+
327
+ def test_agent_registration_credential_issued_data_round_trip
328
+ fixture = {
329
+ "object" => "agent_registration_credential",
330
+ "id" => "stub",
331
+ "agent_registration_id" => "stub",
332
+ "detail" => {},
333
+ "created_at" => "stub",
334
+ "updated_at" => "stub"
335
+ }
336
+ model = WorkOS::AgentRegistrationCredentialIssuedData.new(fixture.to_json)
337
+ json = model.to_h
338
+ assert_kind_of Hash, json
339
+ assert_equal fixture["id"], json[:id]
340
+ assert_equal fixture["agent_registration_id"], json[:agent_registration_id]
341
+ assert_equal fixture["created_at"], json[:created_at]
342
+ assert_equal fixture["updated_at"], json[:updated_at]
343
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
344
+ end
345
+
346
+ def test_agent_registration_credential_issued_data_detail_round_trip
347
+ fixture = {
348
+ "kind" => "api_key",
349
+ "api_key_id" => "stub"
350
+ }
351
+ model = WorkOS::AgentRegistrationCredentialIssuedDataDetail.new(fixture.to_json)
352
+ json = model.to_h
353
+ assert_kind_of Hash, json
354
+ assert_equal fixture["api_key_id"], json[:api_key_id]
355
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
356
+ end
357
+
358
+ def test_access_token_agent_registration_credential_issued_data_detail_round_trip
359
+ fixture = {
360
+ "kind" => "access_token",
361
+ "jti" => "stub",
362
+ "expires_at" => "stub"
363
+ }
364
+ model = WorkOS::AccessTokenAgentRegistrationCredentialIssuedDataDetail.new(fixture.to_json)
365
+ json = model.to_h
366
+ assert_kind_of Hash, json
367
+ assert_equal fixture["jti"], json[:jti]
368
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
369
+ end
370
+
371
+ def test_agent_registration_deleted_round_trip
372
+ fixture = {
373
+ "object" => "event",
374
+ "id" => "stub",
375
+ "event" => "agent.registration.deleted",
376
+ "data" => {},
377
+ "created_at" => "stub",
378
+ "context" => {}
379
+ }
380
+ model = WorkOS::AgentRegistrationDeleted.new(fixture.to_json)
381
+ json = model.to_h
382
+ assert_kind_of Hash, json
383
+ assert_equal fixture["id"], json[:id]
384
+ assert_equal fixture["created_at"], json[:created_at]
385
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
386
+ end
387
+
388
+ def test_agent_registration_deleted_data_round_trip
389
+ fixture = {
390
+ "agent_registration_id" => "stub"
391
+ }
392
+ model = WorkOS::AgentRegistrationDeletedData.new(fixture.to_json)
393
+ json = model.to_h
394
+ assert_kind_of Hash, json
395
+ assert_equal fixture["agent_registration_id"], json[:agent_registration_id]
396
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
397
+ end
398
+
399
+ def test_agent_registration_expired_round_trip
400
+ fixture = {
401
+ "object" => "event",
402
+ "id" => "stub",
403
+ "event" => "agent.registration.expired",
404
+ "data" => {},
405
+ "created_at" => "stub",
406
+ "context" => {}
407
+ }
408
+ model = WorkOS::AgentRegistrationExpired.new(fixture.to_json)
409
+ json = model.to_h
410
+ assert_kind_of Hash, json
411
+ assert_equal fixture["id"], json[:id]
412
+ assert_equal fixture["created_at"], json[:created_at]
413
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
414
+ end
415
+
416
+ def test_agent_registration_expired_data_round_trip
417
+ fixture = {
418
+ "agent_registration_id" => "stub"
419
+ }
420
+ model = WorkOS::AgentRegistrationExpiredData.new(fixture.to_json)
421
+ json = model.to_h
422
+ assert_kind_of Hash, json
423
+ assert_equal fixture["agent_registration_id"], json[:agent_registration_id]
424
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
425
+ end
426
+
427
+ def test_agent_registration_organization_switched_round_trip
428
+ fixture = {
429
+ "object" => "event",
430
+ "id" => "stub",
431
+ "event" => "agent.registration.organization.switched",
432
+ "data" => {},
433
+ "created_at" => "stub",
434
+ "context" => {}
435
+ }
436
+ model = WorkOS::AgentRegistrationOrganizationSwitched.new(fixture.to_json)
437
+ json = model.to_h
438
+ assert_kind_of Hash, json
439
+ assert_equal fixture["id"], json[:id]
440
+ assert_equal fixture["created_at"], json[:created_at]
441
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
442
+ end
443
+
444
+ def test_agent_registration_organization_switched_data_round_trip
445
+ fixture = {
446
+ "agent_registration_id" => "stub",
447
+ "from_organization_id" => "stub",
448
+ "to_organization_id" => "stub"
449
+ }
450
+ model = WorkOS::AgentRegistrationOrganizationSwitchedData.new(fixture.to_json)
451
+ json = model.to_h
452
+ assert_kind_of Hash, json
453
+ assert_equal fixture["agent_registration_id"], json[:agent_registration_id]
454
+ assert_equal fixture["from_organization_id"], json[:from_organization_id]
455
+ assert_equal fixture["to_organization_id"], json[:to_organization_id]
456
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
457
+ end
458
+
459
+ def test_agent_registration_revoked_round_trip
460
+ fixture = {
461
+ "object" => "event",
462
+ "id" => "stub",
463
+ "event" => "agent.registration.revoked",
464
+ "data" => {},
465
+ "created_at" => "stub",
466
+ "context" => {}
467
+ }
468
+ model = WorkOS::AgentRegistrationRevoked.new(fixture.to_json)
469
+ json = model.to_h
470
+ assert_kind_of Hash, json
471
+ assert_equal fixture["id"], json[:id]
472
+ assert_equal fixture["created_at"], json[:created_at]
473
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
474
+ end
475
+
476
+ def test_agent_registration_revoked_data_round_trip
477
+ fixture = {
478
+ "agent_registration_id" => "stub"
479
+ }
480
+ model = WorkOS::AgentRegistrationRevokedData.new(fixture.to_json)
481
+ json = model.to_h
482
+ assert_kind_of Hash, json
483
+ assert_equal fixture["agent_registration_id"], json[:agent_registration_id]
484
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
485
+ end
486
+
487
+ def test_group_created_round_trip
488
+ fixture = {
489
+ "object" => "event",
490
+ "id" => "stub",
491
+ "event" => "group.created",
492
+ "data" => {},
493
+ "created_at" => "stub",
494
+ "context" => {}
495
+ }
496
+ model = WorkOS::GroupCreated.new(fixture.to_json)
497
+ json = model.to_h
498
+ assert_kind_of Hash, json
499
+ assert_equal fixture["id"], json[:id]
500
+ assert_equal fixture["created_at"], json[:created_at]
501
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
502
+ end
503
+
504
+ def test_group_deleted_round_trip
505
+ fixture = {
506
+ "object" => "event",
507
+ "id" => "stub",
508
+ "event" => "group.deleted",
509
+ "data" => {},
510
+ "created_at" => "stub",
511
+ "context" => {}
512
+ }
513
+ model = WorkOS::GroupDeleted.new(fixture.to_json)
514
+ json = model.to_h
515
+ assert_kind_of Hash, json
516
+ assert_equal fixture["id"], json[:id]
517
+ assert_equal fixture["created_at"], json[:created_at]
518
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
519
+ end
520
+
521
+ def test_group_member_added_round_trip
522
+ fixture = {
523
+ "object" => "event",
524
+ "id" => "stub",
525
+ "event" => "group.member_added",
526
+ "data" => {},
527
+ "created_at" => "stub",
528
+ "context" => {}
529
+ }
530
+ model = WorkOS::GroupMemberAdded.new(fixture.to_json)
531
+ json = model.to_h
532
+ assert_kind_of Hash, json
533
+ assert_equal fixture["id"], json[:id]
534
+ assert_equal fixture["created_at"], json[:created_at]
535
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
536
+ end
537
+
538
+ def test_group_member_added_data_round_trip
539
+ fixture = {
540
+ "group_id" => "stub",
541
+ "organization_membership_id" => "stub"
542
+ }
543
+ model = WorkOS::GroupMemberAddedData.new(fixture.to_json)
544
+ json = model.to_h
545
+ assert_kind_of Hash, json
546
+ assert_equal fixture["group_id"], json[:group_id]
547
+ assert_equal fixture["organization_membership_id"], json[:organization_membership_id]
548
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
549
+ end
550
+
551
+ def test_group_member_removed_round_trip
552
+ fixture = {
553
+ "object" => "event",
554
+ "id" => "stub",
555
+ "event" => "group.member_removed",
556
+ "data" => {},
557
+ "created_at" => "stub",
558
+ "context" => {}
559
+ }
560
+ model = WorkOS::GroupMemberRemoved.new(fixture.to_json)
561
+ json = model.to_h
562
+ assert_kind_of Hash, json
563
+ assert_equal fixture["id"], json[:id]
564
+ assert_equal fixture["created_at"], json[:created_at]
565
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
566
+ end
567
+
568
+ def test_group_member_removed_data_round_trip
569
+ fixture = {
570
+ "group_id" => "stub",
571
+ "organization_membership_id" => "stub"
572
+ }
573
+ model = WorkOS::GroupMemberRemovedData.new(fixture.to_json)
574
+ json = model.to_h
575
+ assert_kind_of Hash, json
576
+ assert_equal fixture["group_id"], json[:group_id]
577
+ assert_equal fixture["organization_membership_id"], json[:organization_membership_id]
578
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
579
+ end
580
+
581
+ def test_group_updated_round_trip
582
+ fixture = {
583
+ "object" => "event",
584
+ "id" => "stub",
585
+ "event" => "group.updated",
586
+ "data" => {},
587
+ "created_at" => "stub",
588
+ "context" => {}
589
+ }
590
+ model = WorkOS::GroupUpdated.new(fixture.to_json)
591
+ json = model.to_h
592
+ assert_kind_of Hash, json
593
+ assert_equal fixture["id"], json[:id]
594
+ assert_equal fixture["created_at"], json[:created_at]
595
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
596
+ end
597
+
598
+ def test_pipes_connected_account_connected_round_trip
599
+ fixture = {
600
+ "object" => "event",
601
+ "id" => "stub",
602
+ "event" => "pipes.connected_account.connected",
603
+ "data" => {},
604
+ "created_at" => "stub",
605
+ "context" => {}
606
+ }
607
+ model = WorkOS::PipesConnectedAccountConnected.new(fixture.to_json)
608
+ json = model.to_h
609
+ assert_kind_of Hash, json
610
+ assert_equal fixture["id"], json[:id]
611
+ assert_equal fixture["created_at"], json[:created_at]
612
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
613
+ end
614
+
615
+ def test_pipes_connected_account_connection_failed_round_trip
616
+ fixture = {
617
+ "object" => "event",
618
+ "id" => "stub",
619
+ "event" => "pipes.connected_account.connection_failed",
620
+ "data" => {},
621
+ "created_at" => "stub",
622
+ "context" => {}
623
+ }
624
+ model = WorkOS::PipesConnectedAccountConnectionFailed.new(fixture.to_json)
625
+ json = model.to_h
626
+ assert_kind_of Hash, json
627
+ assert_equal fixture["id"], json[:id]
628
+ assert_equal fixture["created_at"], json[:created_at]
629
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
630
+ end
631
+
632
+ def test_pipes_connected_account_connection_failed_data_round_trip
633
+ fixture = {
634
+ "object" => "connection_failed",
635
+ "data_integration_id" => "stub",
636
+ "provider_slug" => "stub",
637
+ "user_id" => nil,
638
+ "organization_id" => nil,
639
+ "error_code" => "stub",
640
+ "error_reason" => nil,
641
+ "provider_error" => nil,
642
+ "provider_error_description" => nil,
643
+ "created_at" => "stub"
644
+ }
645
+ model = WorkOS::PipesConnectedAccountConnectionFailedData.new(fixture.to_json)
646
+ json = model.to_h
647
+ assert_kind_of Hash, json
648
+ assert_equal fixture["data_integration_id"], json[:data_integration_id]
649
+ assert_equal fixture["provider_slug"], json[:provider_slug]
650
+ assert_nil json[:user_id]
651
+ assert_nil json[:organization_id]
652
+ assert_equal fixture["error_code"], json[:error_code]
653
+ assert_nil json[:error_reason]
654
+ assert_nil json[:provider_error]
655
+ assert_nil json[:provider_error_description]
656
+ assert_equal fixture["created_at"], json[:created_at]
657
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
658
+ end
659
+
660
+ def test_pipes_connected_account_disconnected_round_trip
661
+ fixture = {
662
+ "object" => "event",
663
+ "id" => "stub",
664
+ "event" => "pipes.connected_account.disconnected",
665
+ "data" => {},
666
+ "created_at" => "stub",
667
+ "context" => {}
668
+ }
669
+ model = WorkOS::PipesConnectedAccountDisconnected.new(fixture.to_json)
670
+ json = model.to_h
671
+ assert_kind_of Hash, json
672
+ assert_equal fixture["id"], json[:id]
673
+ assert_equal fixture["created_at"], json[:created_at]
674
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
675
+ end
676
+
677
+ def test_pipes_connected_account_reauthorization_needed_round_trip
678
+ fixture = {
679
+ "object" => "event",
680
+ "id" => "stub",
681
+ "event" => "pipes.connected_account.reauthorization_needed",
682
+ "data" => {},
683
+ "created_at" => "stub",
684
+ "context" => {}
685
+ }
686
+ model = WorkOS::PipesConnectedAccountReauthorizationNeeded.new(fixture.to_json)
687
+ json = model.to_h
688
+ assert_kind_of Hash, json
689
+ assert_equal fixture["id"], json[:id]
690
+ assert_equal fixture["created_at"], json[:created_at]
691
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
692
+ end
693
+
694
+ def test_radar_challenge_created_round_trip
695
+ fixture = {
696
+ "object" => "event",
697
+ "id" => "stub",
698
+ "event" => "radar.challenge_created",
699
+ "data" => {},
700
+ "created_at" => "stub",
701
+ "context" => {}
702
+ }
703
+ model = WorkOS::RadarChallengeCreated.new(fixture.to_json)
704
+ json = model.to_h
705
+ assert_kind_of Hash, json
706
+ assert_equal fixture["id"], json[:id]
707
+ assert_equal fixture["created_at"], json[:created_at]
708
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
709
+ end
710
+
711
+ def test_radar_challenge_created_data_round_trip
712
+ fixture = {
713
+ "type" => "email",
714
+ "radar_challenge_id" => "stub",
715
+ "user_id" => "stub",
716
+ "email" => "stub"
717
+ }
718
+ model = WorkOS::RadarChallengeCreatedData.new(fixture.to_json)
719
+ json = model.to_h
720
+ assert_kind_of Hash, json
721
+ assert_equal fixture["radar_challenge_id"], json[:radar_challenge_id]
722
+ assert_equal fixture["user_id"], json[:user_id]
723
+ assert_equal fixture["email"], json[:email]
724
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
725
+ end
726
+
727
+ def test_waitlist_user_approved_round_trip
728
+ fixture = {
729
+ "object" => "event",
730
+ "id" => "stub",
731
+ "event" => "waitlist_user.approved",
732
+ "data" => {},
733
+ "created_at" => "stub",
734
+ "context" => {}
735
+ }
736
+ model = WorkOS::WaitlistUserApproved.new(fixture.to_json)
737
+ json = model.to_h
738
+ assert_kind_of Hash, json
739
+ assert_equal fixture["id"], json[:id]
740
+ assert_equal fixture["created_at"], json[:created_at]
741
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
742
+ end
743
+
744
+ def test_waitlist_user_created_round_trip
745
+ fixture = {
746
+ "object" => "event",
747
+ "id" => "stub",
748
+ "event" => "waitlist_user.created",
749
+ "data" => {},
750
+ "created_at" => "stub",
751
+ "context" => {}
752
+ }
753
+ model = WorkOS::WaitlistUserCreated.new(fixture.to_json)
754
+ json = model.to_h
755
+ assert_kind_of Hash, json
756
+ assert_equal fixture["id"], json[:id]
757
+ assert_equal fixture["created_at"], json[:created_at]
758
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
759
+ end
760
+
761
+ def test_waitlist_user_denied_round_trip
762
+ fixture = {
763
+ "object" => "event",
764
+ "id" => "stub",
765
+ "event" => "waitlist_user.denied",
766
+ "data" => {},
767
+ "created_at" => "stub",
768
+ "context" => {}
769
+ }
770
+ model = WorkOS::WaitlistUserDenied.new(fixture.to_json)
771
+ json = model.to_h
772
+ assert_kind_of Hash, json
773
+ assert_equal fixture["id"], json[:id]
774
+ assert_equal fixture["created_at"], json[:created_at]
775
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
776
+ end
777
+
778
+ def test_auth_method_mismatch_error_round_trip
779
+ fixture = {
780
+ "code" => "auth_method_mismatch",
781
+ "message" => "stub"
782
+ }
783
+ model = WorkOS::AuthMethodMismatchError.new(fixture.to_json)
784
+ json = model.to_h
785
+ assert_kind_of Hash, json
786
+ assert_equal fixture["message"], json[:message]
787
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
788
+ end
789
+
790
+ def test_event_context_google_analytics_session_round_trip
791
+ fixture = {
792
+ "containerId" => "stub",
793
+ "sessionId" => "stub",
794
+ "sessionNumber" => "stub"
795
+ }
796
+ model = WorkOS::EventContextGoogleAnalyticsSession.new(fixture.to_json)
797
+ json = model.to_h
798
+ assert_kind_of Hash, json
799
+ assert_equal fixture["containerId"], json[:containerId]
800
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
801
+ end
802
+
78
803
  def test_authorized_connect_application_list_data_round_trip
79
804
  fixture = {
80
805
  "object" => "authorized_connect_application",