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