workos 10.2.1 → 10.4.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 (292) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/ci.yml +2 -2
  3. data/.github/workflows/docs.yml +3 -3
  4. data/.github/workflows/lint.yml +2 -2
  5. data/.github/workflows/release-please.yml +3 -3
  6. data/.github/workflows/release.yml +2 -2
  7. data/.last-synced-sha +1 -1
  8. data/.oagen-manifest.json +393 -4
  9. data/.release-please-manifest.json +1 -1
  10. data/.ruby-version +1 -1
  11. data/CHANGELOG.md +328 -0
  12. data/Gemfile.lock +14 -14
  13. data/README.md +23 -0
  14. data/lib/workos/admin_portal.rb +2 -2
  15. data/lib/workos/agents/agent_blueprint.rb +43 -0
  16. data/lib/workos/agents/agent_blueprint_invocable_by.rb +7 -0
  17. data/lib/workos/agents/agent_blueprint_session_setting.rb +25 -0
  18. data/lib/workos/agents/agent_blueprints_create_request.rb +31 -0
  19. data/lib/workos/agents/agent_blueprints_create_request_invocable_by.rb +22 -0
  20. data/lib/workos/agents/agent_blueprints_create_request_session_setting.rb +7 -0
  21. data/lib/workos/agents/agent_blueprints_token_mint_token_request.rb +34 -0
  22. data/lib/workos/agents/agent_blueprints_token_validate_token_request.rb +18 -0
  23. data/lib/workos/agents/agent_blueprints_update_request.rb +31 -0
  24. data/lib/workos/agents/agent_blueprints_update_request_invocable_by.rb +7 -0
  25. data/lib/workos/agents/agent_blueprints_update_request_session_setting.rb +25 -0
  26. data/lib/workos/agents/agent_instance.rb +40 -0
  27. data/lib/workos/agents/agent_instance_session.rb +40 -0
  28. data/lib/workos/agents/agent_token.rb +40 -0
  29. data/lib/workos/agents/agent_token_validation.rb +40 -0
  30. data/lib/workos/agents.rb +399 -0
  31. data/lib/workos/audit_logs.rb +23 -5
  32. data/lib/workos/authorization.rb +3 -3
  33. data/lib/workos/base_client.rb +6 -2
  34. data/lib/workos/client.rb +4 -0
  35. data/lib/workos/configuration.rb +3 -2
  36. data/lib/workos/inflections.rb +17 -0
  37. data/lib/workos/multi_factor_auth.rb +1 -1
  38. data/lib/workos/organizations/create_it_contact.rb +18 -0
  39. data/lib/workos/organizations/invite_it_contact.rb +18 -0
  40. data/lib/workos/organizations/it_contact.rb +31 -0
  41. data/lib/workos/organizations/it_contact_list.rb +25 -0
  42. data/lib/workos/organizations/organization_input.rb +10 -1
  43. data/lib/workos/organizations/update_audit_logs_retention.rb +13 -1
  44. data/lib/workos/organizations.rb +110 -1
  45. data/lib/workos/pipes/connected_account.rb +9 -0
  46. data/lib/workos/pipes/create_data_integration.rb +3 -0
  47. data/lib/workos/pipes/data_integration.rb +3 -0
  48. data/lib/workos/pipes/data_integration_installation.rb +9 -0
  49. data/lib/workos/pipes/data_integrations_get_data_integration_authorize_url_request.rb +3 -0
  50. data/lib/workos/pipes/data_integrations_get_user_token_request.rb +11 -2
  51. data/lib/workos/pipes/data_integrations_list_response_data.rb +18 -3
  52. data/lib/workos/pipes/data_integrations_list_response_data_connected_account.rb +9 -0
  53. data/lib/workos/pipes/data_integrations_upsert_api_key_request.rb +25 -1
  54. data/lib/workos/pipes/data_integrations_upsert_client_credentials_request.rb +6 -0
  55. data/lib/workos/pipes/data_integrations_vend_credentials_request.rb +11 -2
  56. data/lib/workos/pipes.rb +324 -17
  57. data/lib/workos/platform_teams/create_team.rb +22 -0
  58. data/lib/workos/platform_teams/team.rb +37 -0
  59. data/lib/workos/platform_teams.rb +58 -0
  60. data/lib/workos/session_manager.rb +11 -6
  61. data/lib/workos/shared/account_selection_required_error.rb +22 -0
  62. data/lib/workos/shared/agent_blueprint_created.rb +34 -0
  63. data/lib/workos/shared/agent_blueprint_created_data.rb +43 -0
  64. data/lib/workos/shared/agent_blueprint_created_data_invocable_by.rb +22 -0
  65. data/lib/workos/shared/agent_blueprint_created_data_session_setting.rb +25 -0
  66. data/lib/workos/shared/agent_blueprint_deleted.rb +34 -0
  67. data/lib/workos/shared/agent_blueprint_deleted_data.rb +31 -0
  68. data/lib/workos/shared/agent_blueprint_updated.rb +34 -0
  69. data/lib/workos/shared/agent_blueprint_updated_data.rb +7 -0
  70. data/lib/workos/shared/agent_blueprint_updated_data_invocable_by.rb +7 -0
  71. data/lib/workos/shared/agent_blueprint_updated_data_session_setting.rb +7 -0
  72. data/lib/workos/shared/agent_instance_created.rb +34 -0
  73. data/lib/workos/shared/agent_instance_created_data.rb +40 -0
  74. data/lib/workos/shared/agent_instance_deleted.rb +34 -0
  75. data/lib/workos/shared/agent_instance_deleted_data.rb +40 -0
  76. data/lib/workos/shared/agent_instance_session_created.rb +34 -0
  77. data/lib/workos/shared/agent_instance_session_created_data.rb +43 -0
  78. data/lib/workos/shared/agent_instance_session_revoked.rb +34 -0
  79. data/lib/workos/shared/agent_instance_session_revoked_data.rb +40 -0
  80. data/lib/workos/shared/pipe_connected_account.rb +15 -0
  81. data/lib/workos/shared/pipes_account_connection_add_failed.rb +34 -0
  82. data/lib/workos/shared/pipes_account_connection_add_failed_data.rb +49 -0
  83. data/lib/workos/shared/pipes_account_connection_connected.rb +34 -0
  84. data/lib/workos/shared/pipes_account_connection_connection_failed.rb +34 -0
  85. data/lib/workos/shared/pipes_account_connection_connection_failed_data.rb +7 -0
  86. data/lib/workos/shared/pipes_account_connection_disconnected.rb +34 -0
  87. data/lib/workos/shared/pipes_account_connection_reauthorization_needed.rb +34 -0
  88. data/lib/workos/shared/pipes_connected_account_connection_failed_data.rb +1 -40
  89. data/lib/workos/shared/resource_export_completed.rb +34 -0
  90. data/lib/workos/shared/resource_export_completed_data.rb +22 -0
  91. data/lib/workos/shared/resource_export_created.rb +34 -0
  92. data/lib/workos/shared/resource_export_created_data.rb +22 -0
  93. data/lib/workos/shared/resource_export_downloaded.rb +34 -0
  94. data/lib/workos/shared/resource_export_downloaded_data.rb +22 -0
  95. data/lib/workos/shared/resource_export_failed.rb +34 -0
  96. data/lib/workos/shared/resource_export_failed_data.rb +22 -0
  97. data/lib/workos/shared/waitlist_user.rb +8 -5
  98. data/lib/workos/sso/create_connection.rb +37 -0
  99. data/lib/workos/sso/create_connection_attribute_maps.rb +22 -0
  100. data/lib/workos/sso/create_connection_key_pair.rb +22 -0
  101. data/lib/workos/sso/create_connection_oidc_options.rb +43 -0
  102. data/lib/workos/sso/create_connection_saml_options.rb +40 -0
  103. data/lib/workos/sso/create_connection_standard_attributes.rb +34 -0
  104. data/lib/workos/sso/create_saml_idp_signing_certificate.rb +18 -0
  105. data/lib/workos/sso/patch_connection.rb +34 -0
  106. data/lib/workos/sso/patch_connection_attribute_maps.rb +22 -0
  107. data/lib/workos/sso/patch_connection_oidc_options.rb +40 -0
  108. data/lib/workos/sso/patch_connection_saml_options.rb +31 -0
  109. data/lib/workos/sso/patch_connection_standard_attributes.rb +7 -0
  110. data/lib/workos/sso/saml_idp_signing_certificate.rb +34 -0
  111. data/lib/workos/sso/saml_idp_signing_certificate_list.rb +22 -0
  112. data/lib/workos/sso/saml_sp_encryption_certificate.rb +34 -0
  113. data/lib/workos/sso/saml_sp_encryption_certificate_list.rb +22 -0
  114. data/lib/workos/sso/saml_sp_signing_certificate.rb +34 -0
  115. data/lib/workos/sso/token_query.rb +11 -2
  116. data/lib/workos/sso.rb +305 -4
  117. data/lib/workos/types/agent_blueprints_token_mint_token_request_type.rb +15 -0
  118. data/lib/workos/types/agent_instance_created_data_type.rb +13 -0
  119. data/lib/workos/types/agent_instance_deleted_data_type.rb +9 -0
  120. data/lib/workos/types/agent_instance_session_status.rb +14 -0
  121. data/lib/workos/types/agent_instance_type.rb +9 -0
  122. data/lib/workos/types/authenticate_response_authentication_method.rb +1 -4
  123. data/lib/workos/types/connected_account_connection_role.rb +13 -0
  124. data/lib/workos/types/connection_activated_data_connection_type.rb +1 -4
  125. data/lib/workos/types/connection_type.rb +1 -4
  126. data/lib/workos/types/connections_connection_type.rb +1 -4
  127. data/lib/workos/types/create_connection_oidc_options_id_token_signature_algorithm.rb +24 -0
  128. data/lib/workos/types/create_connection_oidc_options_token_authentication_method.rb +14 -0
  129. data/lib/workos/types/create_data_integration_ownership.rb +13 -0
  130. data/lib/workos/types/create_webhook_endpoint_events.rb +13 -1
  131. data/lib/workos/types/data_integration_installation_connection_role.rb +9 -0
  132. data/lib/workos/types/data_integration_ownership.rb +9 -0
  133. data/lib/workos/types/data_integrations_get_data_integration_authorize_url_request_connection_owner.rb +9 -0
  134. data/lib/workos/types/data_integrations_get_user_token_request_connection_owner.rb +9 -0
  135. data/lib/workos/types/data_integrations_list_response_data_connected_account_connection_role.rb +9 -0
  136. data/lib/workos/types/data_integrations_list_response_data_connection_owner.rb +9 -0
  137. data/lib/workos/types/data_integrations_upsert_api_key_request_connection_owner.rb +9 -0
  138. data/lib/workos/types/data_integrations_upsert_client_credentials_request_connection_owner.rb +9 -0
  139. data/lib/workos/types/data_integrations_vend_credentials_request_connection_owner.rb +9 -0
  140. data/lib/workos/types/invite_it_contact_intents.rb +16 -0
  141. data/lib/workos/types/patch_connection_oidc_options_id_token_signature_algorithm.rb +9 -0
  142. data/lib/workos/types/patch_connection_oidc_options_token_authentication_method.rb +9 -0
  143. data/lib/workos/types/pipe_connected_account_auth_method.rb +9 -0
  144. data/lib/workos/types/pipe_connected_account_connection_role.rb +9 -0
  145. data/lib/workos/types/pipes_ownership.rb +9 -0
  146. data/lib/workos/types/resource_export_completed_data_resource_type.rb +18 -0
  147. data/lib/workos/types/resource_export_created_data_resource_type.rb +9 -0
  148. data/lib/workos/types/resource_export_downloaded_data_resource_type.rb +9 -0
  149. data/lib/workos/types/resource_export_failed_data_resource_type.rb +9 -0
  150. data/lib/workos/types/session_created_data_status.rb +1 -6
  151. data/lib/workos/types/session_revoked_data_status.rb +1 -1
  152. data/lib/workos/types/sso_grant_type.rb +13 -0
  153. data/lib/workos/types/team_production_state.rb +15 -0
  154. data/lib/workos/types/token_query_grant_type.rb +9 -0
  155. data/lib/workos/types/update_audit_logs_retention_retention_period.rb +32 -0
  156. data/lib/workos/types/user_identities_get_item_provider.rb +1 -4
  157. data/lib/workos/types/user_management_waitlists_state.rb +14 -0
  158. data/lib/workos/types/user_sessions_status.rb +1 -1
  159. data/lib/workos/types/waitlist_entry_state.rb +9 -0
  160. data/lib/workos/types/waitlist_user_state.rb +1 -6
  161. data/lib/workos/user_management/authentication_oauth_failed_data.rb +5 -2
  162. data/lib/workos/user_management/authentication_oauth_succeeded_data.rb +5 -2
  163. data/lib/workos/user_management/authkit_oauth_resource.rb +34 -0
  164. data/lib/workos/user_management/create_authkit_oauth_resource.rb +22 -0
  165. data/lib/workos/user_management/create_password_reset_token.rb +1 -12
  166. data/lib/workos/user_management/create_waitlist_entry.rb +25 -0
  167. data/lib/workos/user_management/email_completion_session_authenticate_request.rb +43 -0
  168. data/lib/workos/user_management/waitlist.rb +28 -0
  169. data/lib/workos/user_management/waitlist_entry.rb +43 -0
  170. data/lib/workos/user_management.rb +263 -0
  171. data/lib/workos/version.rb +1 -1
  172. data/lib/workos.rb +1 -0
  173. data/rbi/workos/account_selection_required_error.rbi +30 -0
  174. data/rbi/workos/agent_blueprint.rbi +72 -0
  175. data/rbi/workos/agent_blueprint_created.rbi +54 -0
  176. data/rbi/workos/agent_blueprint_created_data.rbi +72 -0
  177. data/rbi/workos/agent_blueprint_created_data_invocable_by.rbi +30 -0
  178. data/rbi/workos/agent_blueprint_created_data_session_setting.rbi +36 -0
  179. data/rbi/workos/agent_blueprint_deleted.rbi +54 -0
  180. data/rbi/workos/agent_blueprint_deleted_data.rbi +48 -0
  181. data/rbi/workos/agent_blueprint_invocable_by.rbi +30 -0
  182. data/rbi/workos/agent_blueprint_session_setting.rbi +36 -0
  183. data/rbi/workos/agent_blueprint_updated.rbi +54 -0
  184. data/rbi/workos/agent_blueprint_updated_data.rbi +72 -0
  185. data/rbi/workos/agent_blueprint_updated_data_invocable_by.rbi +30 -0
  186. data/rbi/workos/agent_blueprint_updated_data_session_setting.rbi +36 -0
  187. data/rbi/workos/agent_blueprints_create_request.rbi +48 -0
  188. data/rbi/workos/agent_blueprints_create_request_invocable_by.rbi +30 -0
  189. data/rbi/workos/agent_blueprints_create_request_session_setting.rbi +36 -0
  190. data/rbi/workos/agent_blueprints_token_mint_token_request.rbi +54 -0
  191. data/rbi/workos/agent_blueprints_token_validate_token_request.rbi +24 -0
  192. data/rbi/workos/agent_blueprints_update_request.rbi +48 -0
  193. data/rbi/workos/agent_blueprints_update_request_invocable_by.rbi +30 -0
  194. data/rbi/workos/agent_blueprints_update_request_session_setting.rbi +36 -0
  195. data/rbi/workos/agent_instance.rbi +66 -0
  196. data/rbi/workos/agent_instance_created.rbi +54 -0
  197. data/rbi/workos/agent_instance_created_data.rbi +66 -0
  198. data/rbi/workos/agent_instance_deleted.rbi +54 -0
  199. data/rbi/workos/agent_instance_deleted_data.rbi +66 -0
  200. data/rbi/workos/agent_instance_session.rbi +66 -0
  201. data/rbi/workos/agent_instance_session_created.rbi +54 -0
  202. data/rbi/workos/agent_instance_session_created_data.rbi +72 -0
  203. data/rbi/workos/agent_instance_session_revoked.rbi +54 -0
  204. data/rbi/workos/agent_instance_session_revoked_data.rbi +66 -0
  205. data/rbi/workos/agent_token.rbi +66 -0
  206. data/rbi/workos/agent_token_validation.rbi +66 -0
  207. data/rbi/workos/agents.rbi +134 -0
  208. data/rbi/workos/audit_logs.rbi +26 -2
  209. data/rbi/workos/authentication_oauth_failed_data.rbi +6 -0
  210. data/rbi/workos/authentication_oauth_succeeded_data.rbi +6 -0
  211. data/rbi/workos/authkit_oauth_resource.rbi +54 -0
  212. data/rbi/workos/client.rbi +3 -0
  213. data/rbi/workos/connected_account.rbi +18 -0
  214. data/rbi/workos/create_authkit_oauth_resource.rbi +30 -0
  215. data/rbi/workos/create_connection.rbi +60 -0
  216. data/rbi/workos/create_connection_attribute_maps.rbi +30 -0
  217. data/rbi/workos/create_connection_key_pair.rbi +30 -0
  218. data/rbi/workos/create_connection_oidc_options.rbi +72 -0
  219. data/rbi/workos/create_connection_saml_options.rbi +66 -0
  220. data/rbi/workos/create_connection_standard_attributes.rbi +54 -0
  221. data/rbi/workos/create_data_integration.rbi +6 -0
  222. data/rbi/workos/create_it_contact.rbi +24 -0
  223. data/rbi/workos/create_saml_idp_signing_certificate.rbi +24 -0
  224. data/rbi/workos/create_team.rbi +30 -0
  225. data/rbi/workos/create_waitlist_entry.rbi +36 -0
  226. data/rbi/workos/data_integration.rbi +6 -0
  227. data/rbi/workos/data_integration_installation.rbi +19 -1
  228. data/rbi/workos/data_integrations_get_data_integration_authorize_url_request.rbi +6 -0
  229. data/rbi/workos/data_integrations_get_user_token_request.rbi +18 -0
  230. data/rbi/workos/data_integrations_list_response_data.rbi +12 -0
  231. data/rbi/workos/data_integrations_list_response_data_connected_account.rbi +18 -0
  232. data/rbi/workos/data_integrations_upsert_api_key_request.rbi +12 -0
  233. data/rbi/workos/data_integrations_upsert_client_credentials_request.rbi +12 -0
  234. data/rbi/workos/data_integrations_vend_credentials_request.rbi +18 -0
  235. data/rbi/workos/email_completion_session_authenticate_request.rbi +72 -0
  236. data/rbi/workos/invite_it_contact.rbi +24 -0
  237. data/rbi/workos/it_contact.rbi +48 -0
  238. data/rbi/workos/organizations.rbi +45 -0
  239. data/rbi/workos/patch_connection.rbi +54 -0
  240. data/rbi/workos/patch_connection_attribute_maps.rbi +30 -0
  241. data/rbi/workos/patch_connection_oidc_options.rbi +66 -0
  242. data/rbi/workos/patch_connection_saml_options.rbi +48 -0
  243. data/rbi/workos/patch_connection_standard_attributes.rbi +54 -0
  244. data/rbi/workos/pipe_connected_account.rbi +30 -0
  245. data/rbi/workos/pipes.rbi +122 -11
  246. data/rbi/workos/pipes_account_connection_add_failed.rbi +54 -0
  247. data/rbi/workos/pipes_account_connection_add_failed_data.rbi +84 -0
  248. data/rbi/workos/pipes_account_connection_connected.rbi +54 -0
  249. data/rbi/workos/pipes_account_connection_connection_failed.rbi +54 -0
  250. data/rbi/workos/pipes_account_connection_connection_failed_data.rbi +84 -0
  251. data/rbi/workos/pipes_account_connection_disconnected.rbi +54 -0
  252. data/rbi/workos/pipes_account_connection_reauthorization_needed.rbi +54 -0
  253. data/rbi/workos/pipes_connected_account_connection_failed_data.rbi +6 -0
  254. data/rbi/workos/platform_teams.rbi +30 -0
  255. data/rbi/workos/resource_export_completed.rbi +54 -0
  256. data/rbi/workos/resource_export_completed_data.rbi +30 -0
  257. data/rbi/workos/resource_export_created.rbi +54 -0
  258. data/rbi/workos/resource_export_created_data.rbi +30 -0
  259. data/rbi/workos/resource_export_downloaded.rbi +54 -0
  260. data/rbi/workos/resource_export_downloaded_data.rbi +30 -0
  261. data/rbi/workos/resource_export_failed.rbi +54 -0
  262. data/rbi/workos/resource_export_failed_data.rbi +30 -0
  263. data/rbi/workos/saml_idp_signing_certificate.rbi +54 -0
  264. data/rbi/workos/saml_idp_signing_certificate_list.rbi +30 -0
  265. data/rbi/workos/saml_sp_encryption_certificate.rbi +54 -0
  266. data/rbi/workos/saml_sp_encryption_certificate_list.rbi +30 -0
  267. data/rbi/workos/saml_sp_signing_certificate.rbi +54 -0
  268. data/rbi/workos/sso.rbi +155 -2
  269. data/rbi/workos/team.rbi +60 -0
  270. data/rbi/workos/token_query.rbi +20 -2
  271. data/rbi/workos/update_audit_logs_retention.rbi +8 -2
  272. data/rbi/workos/user_management.rbi +92 -0
  273. data/rbi/workos/waitlist.rbi +42 -0
  274. data/rbi/workos/waitlist_entry.rbi +72 -0
  275. data/rbi/workos/waitlist_user.rbi +12 -6
  276. data/test/workos/test_agents.rb +105 -1
  277. data/test/workos/test_agents_model_round_trip.rb +245 -0
  278. data/test/workos/test_audit_logs.rb +11 -2
  279. data/test/workos/test_authorization.rb +6 -6
  280. data/test/workos/test_organizations.rb +41 -1
  281. data/test/workos/test_organizations_model_round_trip.rb +40 -1
  282. data/test/workos/test_pipes.rb +64 -0
  283. data/test/workos/test_pipes_model_round_trip.rb +35 -5
  284. data/test/workos/test_platform_teams.rb +41 -0
  285. data/test/workos/test_platform_teams_model_round_trip.rb +41 -0
  286. data/test/workos/test_session.rb +63 -0
  287. data/test/workos/test_shared_model_round_trip.rb +610 -2
  288. data/test/workos/test_sso.rb +108 -2
  289. data/test/workos/test_sso_model_round_trip.rb +262 -2
  290. data/test/workos/test_user_management.rb +80 -0
  291. data/test/workos/test_user_management_model_round_trip.rb +110 -2
  292. metadata +194 -1
@@ -152,11 +152,16 @@ class SharedModelRoundTripTest < Minitest::Test
152
152
  fixture = {
153
153
  "object" => "connected_account",
154
154
  "id" => "stub",
155
+ "connection_role" => "stub",
156
+ "account_identifier" => nil,
157
+ "account_display_name" => nil,
155
158
  "data_integration_id" => "stub",
156
159
  "provider_slug" => "stub",
157
160
  "user_id" => nil,
158
161
  "organization_id" => nil,
159
162
  "scopes" => [],
163
+ "auth_method" => "stub",
164
+ "api_key_last_4" => nil,
160
165
  "state" => "stub",
161
166
  "created_at" => "stub",
162
167
  "updated_at" => "stub"
@@ -176,14 +181,15 @@ class SharedModelRoundTripTest < Minitest::Test
176
181
 
177
182
  def test_waitlist_user_round_trip
178
183
  fixture = {
179
- "object" => "waitlist_user",
180
184
  "id" => "stub",
181
185
  "email" => "stub",
182
186
  "state" => "stub",
183
187
  "approved_at" => nil,
188
+ "additional_fields" => {},
184
189
  "waitlist_id" => nil,
185
190
  "created_at" => "stub",
186
- "updated_at" => "stub"
191
+ "updated_at" => "stub",
192
+ "object" => "waitlist_user"
187
193
  }
188
194
  model = WorkOS::WaitlistUser.new(fixture.to_json)
189
195
  json = model.to_h
@@ -214,6 +220,336 @@ class SharedModelRoundTripTest < Minitest::Test
214
220
  fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
215
221
  end
216
222
 
223
+ def test_agent_blueprint_created_round_trip
224
+ fixture = {
225
+ "object" => "event",
226
+ "id" => "stub",
227
+ "event" => "agent.blueprint.created",
228
+ "data" => {},
229
+ "created_at" => "stub",
230
+ "context" => {}
231
+ }
232
+ model = WorkOS::AgentBlueprintCreated.new(fixture.to_json)
233
+ json = model.to_h
234
+ assert_kind_of Hash, json
235
+ assert_equal fixture["id"], json[:id]
236
+ assert_equal fixture["created_at"], json[:created_at]
237
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
238
+ end
239
+
240
+ def test_agent_blueprint_created_data_round_trip
241
+ fixture = {
242
+ "object" => "agent_blueprint",
243
+ "id" => "stub",
244
+ "name" => "stub",
245
+ "description" => nil,
246
+ "permissions" => [],
247
+ "invocable_by" => {},
248
+ "session_settings" => {},
249
+ "created_at" => "stub",
250
+ "updated_at" => "stub"
251
+ }
252
+ model = WorkOS::AgentBlueprintCreatedData.new(fixture.to_json)
253
+ json = model.to_h
254
+ assert_kind_of Hash, json
255
+ assert_equal fixture["id"], json[:id]
256
+ assert_equal fixture["name"], json[:name]
257
+ assert_nil json[:description]
258
+ assert_equal fixture["created_at"], json[:created_at]
259
+ assert_equal fixture["updated_at"], json[:updated_at]
260
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
261
+ end
262
+
263
+ def test_agent_blueprint_created_data_invocable_by_round_trip
264
+ fixture = {
265
+ "role_slugs" => [],
266
+ "organization_ids" => []
267
+ }
268
+ model = WorkOS::AgentBlueprintCreatedDataInvocableBy.new(fixture.to_json)
269
+ json = model.to_h
270
+ assert_kind_of Hash, json
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_blueprint_created_data_session_setting_round_trip
275
+ fixture = {
276
+ "max_age_seconds" => 1.0,
277
+ "access_token_ttl_seconds" => 1.0,
278
+ "refresh_token_ttl_seconds" => 1.0
279
+ }
280
+ model = WorkOS::AgentBlueprintCreatedDataSessionSetting.new(fixture.to_json)
281
+ json = model.to_h
282
+ assert_kind_of Hash, json
283
+ assert_equal fixture["max_age_seconds"], json[:max_age_seconds]
284
+ assert_equal fixture["access_token_ttl_seconds"], json[:access_token_ttl_seconds]
285
+ assert_equal fixture["refresh_token_ttl_seconds"], json[:refresh_token_ttl_seconds]
286
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
287
+ end
288
+
289
+ def test_agent_blueprint_deleted_round_trip
290
+ fixture = {
291
+ "object" => "event",
292
+ "id" => "stub",
293
+ "event" => "agent.blueprint.deleted",
294
+ "data" => {},
295
+ "created_at" => "stub",
296
+ "context" => {}
297
+ }
298
+ model = WorkOS::AgentBlueprintDeleted.new(fixture.to_json)
299
+ json = model.to_h
300
+ assert_kind_of Hash, json
301
+ assert_equal fixture["id"], json[:id]
302
+ assert_equal fixture["created_at"], json[:created_at]
303
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
304
+ end
305
+
306
+ def test_agent_blueprint_deleted_data_round_trip
307
+ fixture = {
308
+ "object" => "agent_blueprint",
309
+ "id" => "stub",
310
+ "name" => "stub",
311
+ "created_at" => "stub",
312
+ "updated_at" => "stub"
313
+ }
314
+ model = WorkOS::AgentBlueprintDeletedData.new(fixture.to_json)
315
+ json = model.to_h
316
+ assert_kind_of Hash, json
317
+ assert_equal fixture["id"], json[:id]
318
+ assert_equal fixture["name"], json[:name]
319
+ assert_equal fixture["created_at"], json[:created_at]
320
+ assert_equal fixture["updated_at"], json[:updated_at]
321
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
322
+ end
323
+
324
+ def test_agent_blueprint_updated_round_trip
325
+ fixture = {
326
+ "object" => "event",
327
+ "id" => "stub",
328
+ "event" => "agent.blueprint.updated",
329
+ "data" => {},
330
+ "created_at" => "stub",
331
+ "context" => {}
332
+ }
333
+ model = WorkOS::AgentBlueprintUpdated.new(fixture.to_json)
334
+ json = model.to_h
335
+ assert_kind_of Hash, json
336
+ assert_equal fixture["id"], json[:id]
337
+ assert_equal fixture["created_at"], json[:created_at]
338
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
339
+ end
340
+
341
+ def test_agent_blueprint_updated_data_round_trip
342
+ fixture = {
343
+ "object" => "agent_blueprint",
344
+ "id" => "stub",
345
+ "name" => "stub",
346
+ "description" => nil,
347
+ "permissions" => [],
348
+ "invocable_by" => {},
349
+ "session_settings" => {},
350
+ "created_at" => "stub",
351
+ "updated_at" => "stub"
352
+ }
353
+ model = WorkOS::AgentBlueprintUpdatedData.new(fixture.to_json)
354
+ json = model.to_h
355
+ assert_kind_of Hash, json
356
+ assert_equal fixture["id"], json[:id]
357
+ assert_equal fixture["name"], json[:name]
358
+ assert_nil json[:description]
359
+ assert_equal fixture["created_at"], json[:created_at]
360
+ assert_equal fixture["updated_at"], json[:updated_at]
361
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
362
+ end
363
+
364
+ def test_agent_blueprint_updated_data_invocable_by_round_trip
365
+ fixture = {
366
+ "role_slugs" => [],
367
+ "organization_ids" => []
368
+ }
369
+ model = WorkOS::AgentBlueprintUpdatedDataInvocableBy.new(fixture.to_json)
370
+ json = model.to_h
371
+ assert_kind_of Hash, json
372
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
373
+ end
374
+
375
+ def test_agent_blueprint_updated_data_session_setting_round_trip
376
+ fixture = {
377
+ "max_age_seconds" => 1.0,
378
+ "access_token_ttl_seconds" => 1.0,
379
+ "refresh_token_ttl_seconds" => 1.0
380
+ }
381
+ model = WorkOS::AgentBlueprintUpdatedDataSessionSetting.new(fixture.to_json)
382
+ json = model.to_h
383
+ assert_kind_of Hash, json
384
+ assert_equal fixture["max_age_seconds"], json[:max_age_seconds]
385
+ assert_equal fixture["access_token_ttl_seconds"], json[:access_token_ttl_seconds]
386
+ assert_equal fixture["refresh_token_ttl_seconds"], json[:refresh_token_ttl_seconds]
387
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
388
+ end
389
+
390
+ def test_agent_instance_created_round_trip
391
+ fixture = {
392
+ "object" => "event",
393
+ "id" => "stub",
394
+ "event" => "agent.instance.created",
395
+ "data" => {},
396
+ "created_at" => "stub",
397
+ "context" => {}
398
+ }
399
+ model = WorkOS::AgentInstanceCreated.new(fixture.to_json)
400
+ json = model.to_h
401
+ assert_kind_of Hash, json
402
+ assert_equal fixture["id"], json[:id]
403
+ assert_equal fixture["created_at"], json[:created_at]
404
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
405
+ end
406
+
407
+ def test_agent_instance_created_data_round_trip
408
+ fixture = {
409
+ "object" => "agent_instance",
410
+ "id" => "stub",
411
+ "agent_blueprint_id" => "stub",
412
+ "organization_id" => "stub",
413
+ "organization_membership_id" => nil,
414
+ "type" => "stub",
415
+ "created_at" => "stub",
416
+ "updated_at" => "stub"
417
+ }
418
+ model = WorkOS::AgentInstanceCreatedData.new(fixture.to_json)
419
+ json = model.to_h
420
+ assert_kind_of Hash, json
421
+ assert_equal fixture["id"], json[:id]
422
+ assert_equal fixture["agent_blueprint_id"], json[:agent_blueprint_id]
423
+ assert_equal fixture["organization_id"], json[:organization_id]
424
+ assert_nil json[:organization_membership_id]
425
+ assert_equal fixture["created_at"], json[:created_at]
426
+ assert_equal fixture["updated_at"], json[:updated_at]
427
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
428
+ end
429
+
430
+ def test_agent_instance_deleted_round_trip
431
+ fixture = {
432
+ "object" => "event",
433
+ "id" => "stub",
434
+ "event" => "agent.instance.deleted",
435
+ "data" => {},
436
+ "created_at" => "stub",
437
+ "context" => {}
438
+ }
439
+ model = WorkOS::AgentInstanceDeleted.new(fixture.to_json)
440
+ json = model.to_h
441
+ assert_kind_of Hash, json
442
+ assert_equal fixture["id"], json[:id]
443
+ assert_equal fixture["created_at"], json[:created_at]
444
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
445
+ end
446
+
447
+ def test_agent_instance_deleted_data_round_trip
448
+ fixture = {
449
+ "object" => "agent_instance",
450
+ "id" => "stub",
451
+ "agent_blueprint_id" => "stub",
452
+ "organization_id" => "stub",
453
+ "organization_membership_id" => nil,
454
+ "type" => "stub",
455
+ "created_at" => "stub",
456
+ "updated_at" => "stub"
457
+ }
458
+ model = WorkOS::AgentInstanceDeletedData.new(fixture.to_json)
459
+ json = model.to_h
460
+ assert_kind_of Hash, json
461
+ assert_equal fixture["id"], json[:id]
462
+ assert_equal fixture["agent_blueprint_id"], json[:agent_blueprint_id]
463
+ assert_equal fixture["organization_id"], json[:organization_id]
464
+ assert_nil json[:organization_membership_id]
465
+ assert_equal fixture["created_at"], json[:created_at]
466
+ assert_equal fixture["updated_at"], json[:updated_at]
467
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
468
+ end
469
+
470
+ def test_agent_instance_session_created_round_trip
471
+ fixture = {
472
+ "object" => "event",
473
+ "id" => "stub",
474
+ "event" => "agent.instance.session.created",
475
+ "data" => {},
476
+ "created_at" => "stub",
477
+ "context" => {}
478
+ }
479
+ model = WorkOS::AgentInstanceSessionCreated.new(fixture.to_json)
480
+ json = model.to_h
481
+ assert_kind_of Hash, json
482
+ assert_equal fixture["id"], json[:id]
483
+ assert_equal fixture["created_at"], json[:created_at]
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_agent_instance_session_created_data_round_trip
488
+ fixture = {
489
+ "object" => "agent_instance_session",
490
+ "id" => "stub",
491
+ "agent_instance_id" => "stub",
492
+ "organization_id" => "stub",
493
+ "expires_at" => "stub",
494
+ "revoked_at" => nil,
495
+ "created_at" => "stub",
496
+ "updated_at" => "stub",
497
+ "permission_slugs" => []
498
+ }
499
+ model = WorkOS::AgentInstanceSessionCreatedData.new(fixture.to_json)
500
+ json = model.to_h
501
+ assert_kind_of Hash, json
502
+ assert_equal fixture["id"], json[:id]
503
+ assert_equal fixture["agent_instance_id"], json[:agent_instance_id]
504
+ assert_equal fixture["organization_id"], json[:organization_id]
505
+ assert_equal fixture["expires_at"], json[:expires_at]
506
+ assert_nil json[:revoked_at]
507
+ assert_equal fixture["created_at"], json[:created_at]
508
+ assert_equal fixture["updated_at"], json[:updated_at]
509
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
510
+ end
511
+
512
+ def test_agent_instance_session_revoked_round_trip
513
+ fixture = {
514
+ "object" => "event",
515
+ "id" => "stub",
516
+ "event" => "agent.instance.session.revoked",
517
+ "data" => {},
518
+ "created_at" => "stub",
519
+ "context" => {}
520
+ }
521
+ model = WorkOS::AgentInstanceSessionRevoked.new(fixture.to_json)
522
+ json = model.to_h
523
+ assert_kind_of Hash, json
524
+ assert_equal fixture["id"], json[:id]
525
+ assert_equal fixture["created_at"], json[:created_at]
526
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
527
+ end
528
+
529
+ def test_agent_instance_session_revoked_data_round_trip
530
+ fixture = {
531
+ "object" => "agent_instance_session",
532
+ "id" => "stub",
533
+ "agent_instance_id" => "stub",
534
+ "organization_id" => "stub",
535
+ "expires_at" => "stub",
536
+ "revoked_at" => nil,
537
+ "created_at" => "stub",
538
+ "updated_at" => "stub"
539
+ }
540
+ model = WorkOS::AgentInstanceSessionRevokedData.new(fixture.to_json)
541
+ json = model.to_h
542
+ assert_kind_of Hash, json
543
+ assert_equal fixture["id"], json[:id]
544
+ assert_equal fixture["agent_instance_id"], json[:agent_instance_id]
545
+ assert_equal fixture["organization_id"], json[:organization_id]
546
+ assert_equal fixture["expires_at"], json[:expires_at]
547
+ assert_nil json[:revoked_at]
548
+ assert_equal fixture["created_at"], json[:created_at]
549
+ assert_equal fixture["updated_at"], json[:updated_at]
550
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
551
+ end
552
+
217
553
  def test_agent_registration_claim_attempt_created_round_trip
218
554
  fixture = {
219
555
  "object" => "event",
@@ -675,6 +1011,149 @@ class SharedModelRoundTripTest < Minitest::Test
675
1011
  fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
676
1012
  end
677
1013
 
1014
+ def test_pipes_account_connection_add_failed_round_trip
1015
+ fixture = {
1016
+ "object" => "event",
1017
+ "id" => "stub",
1018
+ "event" => "pipes.account_connection.add_failed",
1019
+ "data" => {},
1020
+ "created_at" => "stub",
1021
+ "context" => {}
1022
+ }
1023
+ model = WorkOS::PipesAccountConnectionAddFailed.new(fixture.to_json)
1024
+ json = model.to_h
1025
+ assert_kind_of Hash, json
1026
+ assert_equal fixture["id"], json[:id]
1027
+ assert_equal fixture["created_at"], json[:created_at]
1028
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
1029
+ end
1030
+
1031
+ def test_pipes_account_connection_add_failed_data_round_trip
1032
+ fixture = {
1033
+ "object" => "connection_failed",
1034
+ "data_integration_id" => "stub",
1035
+ "provider_slug" => "stub",
1036
+ "user_id" => nil,
1037
+ "organization_id" => nil,
1038
+ "account_identifier" => nil,
1039
+ "error_code" => "stub",
1040
+ "error_reason" => nil,
1041
+ "provider_error" => nil,
1042
+ "provider_error_description" => nil,
1043
+ "created_at" => "stub"
1044
+ }
1045
+ model = WorkOS::PipesAccountConnectionAddFailedData.new(fixture.to_json)
1046
+ json = model.to_h
1047
+ assert_kind_of Hash, json
1048
+ assert_equal fixture["data_integration_id"], json[:data_integration_id]
1049
+ assert_equal fixture["provider_slug"], json[:provider_slug]
1050
+ assert_nil json[:user_id]
1051
+ assert_nil json[:organization_id]
1052
+ assert_equal fixture["error_code"], json[:error_code]
1053
+ assert_nil json[:error_reason]
1054
+ assert_nil json[:provider_error]
1055
+ assert_nil json[:provider_error_description]
1056
+ assert_equal fixture["created_at"], json[:created_at]
1057
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
1058
+ end
1059
+
1060
+ def test_pipes_account_connection_connected_round_trip
1061
+ fixture = {
1062
+ "object" => "event",
1063
+ "id" => "stub",
1064
+ "event" => "pipes.account_connection.connected",
1065
+ "data" => {},
1066
+ "created_at" => "stub",
1067
+ "context" => {}
1068
+ }
1069
+ model = WorkOS::PipesAccountConnectionConnected.new(fixture.to_json)
1070
+ json = model.to_h
1071
+ assert_kind_of Hash, json
1072
+ assert_equal fixture["id"], json[:id]
1073
+ assert_equal fixture["created_at"], json[:created_at]
1074
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
1075
+ end
1076
+
1077
+ def test_pipes_account_connection_connection_failed_round_trip
1078
+ fixture = {
1079
+ "object" => "event",
1080
+ "id" => "stub",
1081
+ "event" => "pipes.account_connection.connection_failed",
1082
+ "data" => {},
1083
+ "created_at" => "stub",
1084
+ "context" => {}
1085
+ }
1086
+ model = WorkOS::PipesAccountConnectionConnectionFailed.new(fixture.to_json)
1087
+ json = model.to_h
1088
+ assert_kind_of Hash, json
1089
+ assert_equal fixture["id"], json[:id]
1090
+ assert_equal fixture["created_at"], json[:created_at]
1091
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
1092
+ end
1093
+
1094
+ def test_pipes_account_connection_connection_failed_data_round_trip
1095
+ fixture = {
1096
+ "object" => "connection_failed",
1097
+ "data_integration_id" => "stub",
1098
+ "provider_slug" => "stub",
1099
+ "user_id" => nil,
1100
+ "organization_id" => nil,
1101
+ "account_identifier" => nil,
1102
+ "error_code" => "stub",
1103
+ "error_reason" => nil,
1104
+ "provider_error" => nil,
1105
+ "provider_error_description" => nil,
1106
+ "created_at" => "stub"
1107
+ }
1108
+ model = WorkOS::PipesAccountConnectionConnectionFailedData.new(fixture.to_json)
1109
+ json = model.to_h
1110
+ assert_kind_of Hash, json
1111
+ assert_equal fixture["data_integration_id"], json[:data_integration_id]
1112
+ assert_equal fixture["provider_slug"], json[:provider_slug]
1113
+ assert_nil json[:user_id]
1114
+ assert_nil json[:organization_id]
1115
+ assert_equal fixture["error_code"], json[:error_code]
1116
+ assert_nil json[:error_reason]
1117
+ assert_nil json[:provider_error]
1118
+ assert_nil json[:provider_error_description]
1119
+ assert_equal fixture["created_at"], json[:created_at]
1120
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
1121
+ end
1122
+
1123
+ def test_pipes_account_connection_disconnected_round_trip
1124
+ fixture = {
1125
+ "object" => "event",
1126
+ "id" => "stub",
1127
+ "event" => "pipes.account_connection.disconnected",
1128
+ "data" => {},
1129
+ "created_at" => "stub",
1130
+ "context" => {}
1131
+ }
1132
+ model = WorkOS::PipesAccountConnectionDisconnected.new(fixture.to_json)
1133
+ json = model.to_h
1134
+ assert_kind_of Hash, json
1135
+ assert_equal fixture["id"], json[:id]
1136
+ assert_equal fixture["created_at"], json[:created_at]
1137
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
1138
+ end
1139
+
1140
+ def test_pipes_account_connection_reauthorization_needed_round_trip
1141
+ fixture = {
1142
+ "object" => "event",
1143
+ "id" => "stub",
1144
+ "event" => "pipes.account_connection.reauthorization_needed",
1145
+ "data" => {},
1146
+ "created_at" => "stub",
1147
+ "context" => {}
1148
+ }
1149
+ model = WorkOS::PipesAccountConnectionReauthorizationNeeded.new(fixture.to_json)
1150
+ json = model.to_h
1151
+ assert_kind_of Hash, json
1152
+ assert_equal fixture["id"], json[:id]
1153
+ assert_equal fixture["created_at"], json[:created_at]
1154
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
1155
+ end
1156
+
678
1157
  def test_pipes_connected_account_connected_round_trip
679
1158
  fixture = {
680
1159
  "object" => "event",
@@ -716,6 +1195,7 @@ class SharedModelRoundTripTest < Minitest::Test
716
1195
  "provider_slug" => "stub",
717
1196
  "user_id" => nil,
718
1197
  "organization_id" => nil,
1198
+ "account_identifier" => nil,
719
1199
  "error_code" => "stub",
720
1200
  "error_reason" => nil,
721
1201
  "provider_error" => nil,
@@ -804,6 +1284,122 @@ class SharedModelRoundTripTest < Minitest::Test
804
1284
  fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
805
1285
  end
806
1286
 
1287
+ def test_resource_export_completed_round_trip
1288
+ fixture = {
1289
+ "object" => "event",
1290
+ "id" => "stub",
1291
+ "event" => "resource_export.completed",
1292
+ "data" => {},
1293
+ "created_at" => "stub",
1294
+ "context" => {}
1295
+ }
1296
+ model = WorkOS::ResourceExportCompleted.new(fixture.to_json)
1297
+ json = model.to_h
1298
+ assert_kind_of Hash, json
1299
+ assert_equal fixture["id"], json[:id]
1300
+ assert_equal fixture["created_at"], json[:created_at]
1301
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
1302
+ end
1303
+
1304
+ def test_resource_export_completed_data_round_trip
1305
+ fixture = {
1306
+ "id" => "stub",
1307
+ "resource_type" => "stub"
1308
+ }
1309
+ model = WorkOS::ResourceExportCompletedData.new(fixture.to_json)
1310
+ json = model.to_h
1311
+ assert_kind_of Hash, json
1312
+ assert_equal fixture["id"], json[:id]
1313
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
1314
+ end
1315
+
1316
+ def test_resource_export_created_round_trip
1317
+ fixture = {
1318
+ "object" => "event",
1319
+ "id" => "stub",
1320
+ "event" => "resource_export.created",
1321
+ "data" => {},
1322
+ "created_at" => "stub",
1323
+ "context" => {}
1324
+ }
1325
+ model = WorkOS::ResourceExportCreated.new(fixture.to_json)
1326
+ json = model.to_h
1327
+ assert_kind_of Hash, json
1328
+ assert_equal fixture["id"], json[:id]
1329
+ assert_equal fixture["created_at"], json[:created_at]
1330
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
1331
+ end
1332
+
1333
+ def test_resource_export_created_data_round_trip
1334
+ fixture = {
1335
+ "id" => "stub",
1336
+ "resource_type" => "stub"
1337
+ }
1338
+ model = WorkOS::ResourceExportCreatedData.new(fixture.to_json)
1339
+ json = model.to_h
1340
+ assert_kind_of Hash, json
1341
+ assert_equal fixture["id"], json[:id]
1342
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
1343
+ end
1344
+
1345
+ def test_resource_export_downloaded_round_trip
1346
+ fixture = {
1347
+ "object" => "event",
1348
+ "id" => "stub",
1349
+ "event" => "resource_export.downloaded",
1350
+ "data" => {},
1351
+ "created_at" => "stub",
1352
+ "context" => {}
1353
+ }
1354
+ model = WorkOS::ResourceExportDownloaded.new(fixture.to_json)
1355
+ json = model.to_h
1356
+ assert_kind_of Hash, json
1357
+ assert_equal fixture["id"], json[:id]
1358
+ assert_equal fixture["created_at"], json[:created_at]
1359
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
1360
+ end
1361
+
1362
+ def test_resource_export_downloaded_data_round_trip
1363
+ fixture = {
1364
+ "id" => "stub",
1365
+ "resource_type" => "stub"
1366
+ }
1367
+ model = WorkOS::ResourceExportDownloadedData.new(fixture.to_json)
1368
+ json = model.to_h
1369
+ assert_kind_of Hash, json
1370
+ assert_equal fixture["id"], json[:id]
1371
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
1372
+ end
1373
+
1374
+ def test_resource_export_failed_round_trip
1375
+ fixture = {
1376
+ "object" => "event",
1377
+ "id" => "stub",
1378
+ "event" => "resource_export.failed",
1379
+ "data" => {},
1380
+ "created_at" => "stub",
1381
+ "context" => {}
1382
+ }
1383
+ model = WorkOS::ResourceExportFailed.new(fixture.to_json)
1384
+ json = model.to_h
1385
+ assert_kind_of Hash, json
1386
+ assert_equal fixture["id"], json[:id]
1387
+ assert_equal fixture["created_at"], json[:created_at]
1388
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
1389
+ end
1390
+
1391
+ def test_resource_export_failed_data_round_trip
1392
+ fixture = {
1393
+ "id" => "stub",
1394
+ "resource_type" => "stub"
1395
+ }
1396
+ model = WorkOS::ResourceExportFailedData.new(fixture.to_json)
1397
+ json = model.to_h
1398
+ assert_kind_of Hash, json
1399
+ assert_equal fixture["id"], json[:id]
1400
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
1401
+ end
1402
+
807
1403
  def test_waitlist_user_approved_round_trip
808
1404
  fixture = {
809
1405
  "object" => "event",
@@ -855,6 +1451,18 @@ class SharedModelRoundTripTest < Minitest::Test
855
1451
  fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
856
1452
  end
857
1453
 
1454
+ def test_account_selection_required_error_round_trip
1455
+ fixture = {
1456
+ "code" => "account_selection_required",
1457
+ "message" => "stub"
1458
+ }
1459
+ model = WorkOS::AccountSelectionRequiredError.new(fixture.to_json)
1460
+ json = model.to_h
1461
+ assert_kind_of Hash, json
1462
+ assert_equal fixture["message"], json[:message]
1463
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
1464
+ end
1465
+
858
1466
  def test_auth_method_mismatch_error_round_trip
859
1467
  fixture = {
860
1468
  "code" => "auth_method_mismatch",