workos 9.5.1 → 10.3.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 (415) 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 +2 -2
  5. data/.github/workflows/docs.yml +2 -2
  6. data/.github/workflows/lint.yml +2 -2
  7. data/.github/workflows/release-please.yml +11 -6
  8. data/.github/workflows/release.yml +2 -2
  9. data/.last-synced-sha +1 -1
  10. data/.oagen-manifest.json +502 -57
  11. data/.release-please-manifest.json +1 -1
  12. data/AGENTS.md +1 -0
  13. data/CHANGELOG.md +330 -2
  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_blueprint.rb +43 -0
  20. data/lib/workos/agents/agent_blueprint_invocable_by.rb +7 -0
  21. data/lib/workos/agents/agent_blueprint_session_setting.rb +25 -0
  22. data/lib/workos/agents/agent_blueprints_create_request.rb +31 -0
  23. data/lib/workos/agents/agent_blueprints_create_request_invocable_by.rb +22 -0
  24. data/lib/workos/agents/agent_blueprints_create_request_session_setting.rb +7 -0
  25. data/lib/workos/agents/agent_blueprints_token_mint_token_request.rb +34 -0
  26. data/lib/workos/agents/agent_blueprints_token_validate_token_request.rb +18 -0
  27. data/lib/workos/agents/agent_blueprints_update_request.rb +31 -0
  28. data/lib/workos/agents/agent_blueprints_update_request_invocable_by.rb +7 -0
  29. data/lib/workos/agents/agent_blueprints_update_request_session_setting.rb +25 -0
  30. data/lib/workos/agents/agent_credential_validation.rb +25 -0
  31. data/lib/workos/{organization_domains/organization_domain_stand_alone.rb → agents/agent_instance.rb} +10 -16
  32. data/lib/workos/agents/agent_instance_session.rb +40 -0
  33. data/lib/workos/agents/agent_registration.rb +40 -0
  34. data/lib/workos/agents/agent_registration_agent_identity.rb +28 -0
  35. data/lib/workos/agents/agent_registration_claim.rb +31 -0
  36. data/lib/workos/agents/agent_registration_claim_claim_completion.rb +31 -0
  37. data/lib/workos/agents/agent_token.rb +40 -0
  38. data/lib/workos/agents/agent_token_validation.rb +40 -0
  39. data/lib/workos/agents/claim_view_response.rb +28 -0
  40. data/lib/workos/agents/claim_view_response_organization.rb +7 -0
  41. data/lib/workos/agents.rb +488 -0
  42. data/lib/workos/api_keys/api_key_validation_response.rb +6 -2
  43. data/lib/workos/api_keys/validate_api_key.rb +1 -12
  44. data/lib/workos/api_keys.rb +3 -4
  45. data/lib/workos/audit_logs.rb +23 -5
  46. data/lib/workos/authorization/permission_created_data.rb +1 -34
  47. data/lib/workos/authorization/permission_deleted_data.rb +1 -1
  48. data/lib/workos/authorization/permission_updated_data.rb +1 -1
  49. data/lib/workos/authorization.rb +27 -27
  50. data/lib/workos/base_client.rb +4 -4
  51. data/lib/workos/client.rb +8 -0
  52. data/lib/workos/connect.rb +25 -21
  53. data/lib/workos/directory_sync.rb +10 -2
  54. data/lib/workos/events.rb +2 -2
  55. data/lib/workos/groups.rb +13 -9
  56. data/lib/workos/inflections.rb +15 -1
  57. data/lib/workos/organization_domains.rb +4 -4
  58. data/lib/workos/{sso/connection_option.rb → organizations/create_it_contact.rb} +4 -4
  59. data/lib/workos/organizations/invite_it_contact.rb +18 -0
  60. data/lib/workos/organizations/it_contact.rb +31 -0
  61. data/lib/workos/organizations/it_contact_list.rb +25 -0
  62. data/lib/workos/organizations/organization_authorized_connect_application_list_data.rb +34 -0
  63. data/lib/workos/organizations/organization_input.rb +10 -1
  64. data/lib/workos/organizations/update_audit_logs_retention.rb +13 -1
  65. data/lib/workos/organizations.rb +167 -11
  66. data/lib/workos/pipes/api_key_installation.rb +25 -0
  67. data/lib/workos/pipes/connected_account.rb +9 -0
  68. data/lib/workos/pipes/{connected_account_dto.rb → connected_account_input.rb} +1 -1
  69. data/lib/workos/pipes/create_data_integration.rb +10 -1
  70. data/lib/workos/pipes/data_integration.rb +9 -0
  71. data/lib/workos/pipes/{data_integration_credentials_dto.rb → data_integration_credentials_input.rb} +1 -1
  72. data/lib/workos/pipes/data_integration_installation.rb +28 -0
  73. data/lib/workos/pipes/data_integrations_get_data_integration_authorize_url_request.rb +5 -2
  74. data/lib/workos/pipes/data_integrations_list_response_data_connected_account.rb +9 -0
  75. data/lib/workos/pipes/data_integrations_upsert_api_key_request.rb +1 -19
  76. data/lib/workos/pipes/data_integrations_upsert_client_credentials_request.rb +31 -0
  77. data/lib/workos/pipes/update_data_integration.rb +4 -1
  78. data/lib/workos/pipes.rb +69 -17
  79. data/lib/workos/pipes_provider/configure_data_integration_body.rb +5 -2
  80. data/lib/workos/pipes_provider/data_integration_configuration_response.rb +3 -0
  81. data/lib/workos/pipes_provider.rb +6 -3
  82. data/lib/workos/platform_teams/create_team.rb +22 -0
  83. data/lib/workos/platform_teams/team.rb +37 -0
  84. data/lib/workos/platform_teams.rb +58 -0
  85. data/lib/workos/shared/access_token_agent_registration_credential_issued_data_detail.rb +25 -0
  86. data/lib/workos/shared/agent_blueprint_created.rb +34 -0
  87. data/lib/workos/shared/agent_blueprint_created_data.rb +43 -0
  88. data/lib/workos/shared/agent_blueprint_created_data_invocable_by.rb +22 -0
  89. data/lib/workos/shared/agent_blueprint_created_data_session_setting.rb +25 -0
  90. data/lib/workos/shared/agent_blueprint_deleted.rb +34 -0
  91. data/lib/workos/shared/agent_blueprint_deleted_data.rb +31 -0
  92. data/lib/workos/shared/agent_blueprint_updated.rb +34 -0
  93. data/lib/workos/shared/agent_blueprint_updated_data.rb +7 -0
  94. data/lib/workos/shared/agent_blueprint_updated_data_invocable_by.rb +7 -0
  95. data/lib/workos/shared/agent_blueprint_updated_data_session_setting.rb +7 -0
  96. data/lib/workos/shared/agent_instance_created.rb +34 -0
  97. data/lib/workos/shared/agent_instance_created_data.rb +40 -0
  98. data/lib/workos/shared/agent_instance_deleted.rb +34 -0
  99. data/lib/workos/shared/agent_instance_deleted_data.rb +40 -0
  100. data/lib/workos/shared/agent_instance_session_created.rb +34 -0
  101. data/lib/workos/shared/agent_instance_session_created_data.rb +43 -0
  102. data/lib/workos/shared/agent_instance_session_revoked.rb +34 -0
  103. data/lib/workos/shared/agent_instance_session_revoked_data.rb +40 -0
  104. data/lib/workos/shared/agent_registration_claim_attempt_created.rb +34 -0
  105. data/lib/workos/shared/agent_registration_claim_attempt_created_data.rb +40 -0
  106. data/lib/workos/shared/agent_registration_claim_completed.rb +34 -0
  107. data/lib/workos/shared/agent_registration_claim_completed_data.rb +40 -0
  108. data/lib/workos/shared/agent_registration_claim_completed_data_claimed_by.rb +22 -0
  109. data/lib/workos/shared/agent_registration_created.rb +34 -0
  110. data/lib/workos/shared/agent_registration_created_data.rb +43 -0
  111. data/lib/workos/shared/agent_registration_created_data_agent_identity.rb +25 -0
  112. data/lib/workos/shared/agent_registration_credential_issued.rb +34 -0
  113. data/lib/workos/shared/agent_registration_credential_issued_data.rb +34 -0
  114. data/lib/workos/shared/agent_registration_credential_issued_data_detail.rb +22 -0
  115. data/lib/workos/shared/agent_registration_deleted.rb +34 -0
  116. data/lib/workos/shared/agent_registration_deleted_data.rb +18 -0
  117. data/lib/workos/shared/agent_registration_expired.rb +34 -0
  118. data/lib/workos/shared/agent_registration_expired_data.rb +7 -0
  119. data/lib/workos/shared/agent_registration_organization_switched.rb +34 -0
  120. data/lib/workos/shared/agent_registration_organization_switched_data.rb +25 -0
  121. data/lib/workos/shared/agent_registration_refreshed.rb +34 -0
  122. data/lib/workos/shared/agent_registration_refreshed_data.rb +7 -0
  123. data/lib/workos/shared/agent_registration_revoked.rb +34 -0
  124. data/lib/workos/shared/agent_registration_revoked_data.rb +7 -0
  125. data/lib/workos/shared/pipes_connected_account_connection_failed.rb +34 -0
  126. data/lib/workos/shared/pipes_connected_account_connection_failed_data.rb +46 -0
  127. data/lib/workos/shared/radar_challenge_created.rb +34 -0
  128. data/lib/workos/shared/radar_challenge_created_data.rb +28 -0
  129. data/lib/workos/shared/resource_export_completed.rb +34 -0
  130. data/lib/workos/shared/resource_export_completed_data.rb +22 -0
  131. data/lib/workos/shared/resource_export_created.rb +34 -0
  132. data/lib/workos/shared/resource_export_created_data.rb +22 -0
  133. data/lib/workos/shared/resource_export_downloaded.rb +34 -0
  134. data/lib/workos/shared/resource_export_downloaded_data.rb +22 -0
  135. data/lib/workos/shared/resource_export_failed.rb +34 -0
  136. data/lib/workos/shared/resource_export_failed_data.rb +22 -0
  137. data/lib/workos/shared/waitlist_user.rb +11 -5
  138. data/lib/workos/sso/connection.rb +0 -3
  139. data/lib/workos/sso/create_connection.rb +37 -0
  140. data/lib/workos/sso/create_connection_attribute_maps.rb +22 -0
  141. data/lib/workos/sso/create_connection_key_pair.rb +22 -0
  142. data/lib/workos/sso/create_connection_oidc_options.rb +43 -0
  143. data/lib/workos/sso/create_connection_saml_options.rb +40 -0
  144. data/lib/workos/sso/create_connection_standard_attributes.rb +34 -0
  145. data/lib/workos/{admin_portal/domain_verification_intent_options.rb → sso/create_saml_idp_signing_certificate.rb} +4 -4
  146. data/lib/workos/sso/patch_connection.rb +34 -0
  147. data/lib/workos/sso/patch_connection_attribute_maps.rb +22 -0
  148. data/lib/workos/sso/patch_connection_oidc_options.rb +40 -0
  149. data/lib/workos/sso/patch_connection_saml_options.rb +31 -0
  150. data/lib/workos/sso/patch_connection_standard_attributes.rb +7 -0
  151. data/lib/workos/sso/saml_idp_signing_certificate.rb +34 -0
  152. data/lib/workos/sso/saml_idp_signing_certificate_list.rb +22 -0
  153. data/lib/workos/sso/saml_sp_encryption_certificate.rb +34 -0
  154. data/lib/workos/sso/saml_sp_encryption_certificate_list.rb +22 -0
  155. data/lib/workos/sso/saml_sp_signing_certificate.rb +34 -0
  156. data/lib/workos/sso/token_query.rb +11 -2
  157. data/lib/workos/sso.rb +378 -30
  158. data/lib/workos/types/agent_admin_validate_credential_request_type.rb +13 -0
  159. data/lib/workos/types/agent_blueprints_token_mint_token_request_type.rb +15 -0
  160. data/lib/workos/types/agent_instance_created_data_type.rb +13 -0
  161. data/lib/workos/types/{data_integration_credentials_type.rb → agent_instance_deleted_data_type.rb} +1 -1
  162. data/lib/workos/types/agent_instance_session_status.rb +14 -0
  163. data/lib/workos/types/{organization_domain_stand_alone_state.rb → agent_instance_type.rb} +1 -1
  164. data/lib/workos/types/agent_registration_created_data_kind.rb +14 -0
  165. data/lib/workos/types/agent_registration_created_data_method.rb +14 -0
  166. data/lib/workos/types/agent_registration_created_data_status.rb +15 -0
  167. data/lib/workos/types/{organization_domain_stand_alone_verification_strategy.rb → agent_registration_kind.rb} +1 -1
  168. data/lib/workos/types/agent_registration_status.rb +9 -0
  169. data/lib/workos/types/applications_registration_types.rb +13 -0
  170. data/lib/workos/types/authenticate_response_authentication_method.rb +1 -2
  171. data/lib/workos/types/claim_view_response_status.rb +9 -0
  172. data/lib/workos/types/connected_account_auth_method.rb +2 -1
  173. data/lib/workos/types/connected_account_input_state.rb +13 -0
  174. data/lib/workos/types/connected_account_state.rb +2 -1
  175. data/lib/workos/types/connection_activated_data_connection_type.rb +1 -2
  176. data/lib/workos/types/connection_type.rb +1 -2
  177. data/lib/workos/types/connections_connection_type.rb +1 -2
  178. data/lib/workos/types/create_connection_oidc_options_id_token_signature_algorithm.rb +24 -0
  179. data/lib/workos/types/create_connection_oidc_options_token_authentication_method.rb +14 -0
  180. data/lib/workos/types/create_data_integration_auth_methods.rb +9 -0
  181. data/lib/workos/types/create_user_password_hash_type.rb +2 -1
  182. data/lib/workos/types/create_user_password_salt_position.rb +13 -0
  183. data/lib/workos/types/create_webhook_endpoint_events.rb +13 -1
  184. data/lib/workos/types/data_integration_auth_methods.rb +9 -0
  185. data/lib/workos/types/data_integration_credentials_input_type.rb +9 -0
  186. data/lib/workos/types/data_integrations_list_response_data_connected_account_state.rb +1 -6
  187. data/lib/workos/types/invite_it_contact_intents.rb +16 -0
  188. data/lib/workos/types/patch_connection_oidc_options_id_token_signature_algorithm.rb +9 -0
  189. data/lib/workos/types/patch_connection_oidc_options_token_authentication_method.rb +9 -0
  190. data/lib/workos/types/pipe_connected_account_state.rb +1 -5
  191. data/lib/workos/types/resource_export_completed_data_resource_type.rb +16 -0
  192. data/lib/workos/types/resource_export_created_data_resource_type.rb +9 -0
  193. data/lib/workos/types/resource_export_downloaded_data_resource_type.rb +9 -0
  194. data/lib/workos/types/resource_export_failed_data_resource_type.rb +9 -0
  195. data/lib/workos/types/session_created_data_status.rb +1 -6
  196. data/lib/workos/types/session_revoked_data_status.rb +1 -1
  197. data/lib/workos/types/sso_grant_type.rb +13 -0
  198. data/lib/workos/types/team_production_state.rb +15 -0
  199. data/lib/workos/types/token_query_grant_type.rb +9 -0
  200. data/lib/workos/types/update_audit_logs_retention_retention_period.rb +32 -0
  201. data/lib/workos/types/update_user_password_salt_position.rb +9 -0
  202. data/lib/workos/types/user_identities_get_item_provider.rb +1 -2
  203. data/lib/workos/types/user_management_waitlists_state.rb +14 -0
  204. data/lib/workos/types/user_sessions_status.rb +1 -1
  205. data/lib/workos/types/vault_kek_deleted_data_actor_source.rb +9 -0
  206. data/lib/workos/types/waitlist_entry_state.rb +9 -0
  207. data/lib/workos/types/waitlist_user_state.rb +1 -6
  208. data/lib/workos/user_management/authentication_oauth_failed_data.rb +5 -2
  209. data/lib/workos/user_management/authentication_oauth_succeeded_data.rb +5 -2
  210. data/lib/workos/user_management/authentication_reauthentication_succeeded.rb +34 -0
  211. data/lib/workos/user_management/authentication_reauthentication_succeeded_data.rb +34 -0
  212. data/lib/workos/user_management/create_password_reset_token.rb +1 -12
  213. data/lib/workos/user_management/create_user.rb +5 -2
  214. data/lib/workos/user_management/create_waitlist_entry.rb +25 -0
  215. data/lib/workos/user_management/email_completion_session_authenticate_request.rb +43 -0
  216. data/lib/workos/user_management/radar_challenge.rb +43 -0
  217. data/lib/workos/user_management/update_user.rb +5 -2
  218. data/lib/workos/user_management/waitlist.rb +28 -0
  219. data/lib/workos/user_management/waitlist_entry.rb +43 -0
  220. data/lib/workos/user_management.rb +340 -74
  221. data/lib/workos/vault/vault_kek_deleted.rb +34 -0
  222. data/lib/workos/vault/vault_kek_deleted_data.rb +31 -0
  223. data/lib/workos/vault.rb +4 -4
  224. data/lib/workos/version.rb +1 -1
  225. data/lib/workos/widgets.rb +2 -2
  226. data/lib/workos.rb +12 -0
  227. data/rbi/workos/access_token_agent_registration_credential_issued_data_detail.rbi +36 -0
  228. data/rbi/workos/agent_admin_link_claim_attempt_to_external_user_request.rbi +42 -0
  229. data/rbi/workos/agent_admin_link_claim_attempt_to_external_user_request_user.rbi +30 -0
  230. data/rbi/workos/agent_admin_validate_credential_request.rbi +36 -0
  231. data/rbi/workos/agent_blueprint.rbi +72 -0
  232. data/rbi/workos/agent_blueprint_created.rbi +54 -0
  233. data/rbi/workos/agent_blueprint_created_data.rbi +72 -0
  234. data/rbi/workos/agent_blueprint_created_data_invocable_by.rbi +30 -0
  235. data/rbi/workos/agent_blueprint_created_data_session_setting.rbi +36 -0
  236. data/rbi/workos/agent_blueprint_deleted.rbi +54 -0
  237. data/rbi/workos/agent_blueprint_deleted_data.rbi +48 -0
  238. data/rbi/workos/agent_blueprint_invocable_by.rbi +30 -0
  239. data/rbi/workos/agent_blueprint_session_setting.rbi +36 -0
  240. data/rbi/workos/agent_blueprint_updated.rbi +54 -0
  241. data/rbi/workos/agent_blueprint_updated_data.rbi +72 -0
  242. data/rbi/workos/agent_blueprint_updated_data_invocable_by.rbi +30 -0
  243. data/rbi/workos/agent_blueprint_updated_data_session_setting.rbi +36 -0
  244. data/rbi/workos/agent_blueprints_create_request.rbi +48 -0
  245. data/rbi/workos/agent_blueprints_create_request_invocable_by.rbi +30 -0
  246. data/rbi/workos/agent_blueprints_create_request_session_setting.rbi +36 -0
  247. data/rbi/workos/agent_blueprints_token_mint_token_request.rbi +54 -0
  248. data/rbi/workos/{domain_verification_intent_options.rbi → agent_blueprints_token_validate_token_request.rbi} +5 -5
  249. data/rbi/workos/agent_blueprints_update_request.rbi +48 -0
  250. data/rbi/workos/agent_blueprints_update_request_invocable_by.rbi +30 -0
  251. data/rbi/workos/agent_blueprints_update_request_session_setting.rbi +36 -0
  252. data/rbi/workos/{sso_intent_options.rbi → agent_credential_validation.rbi} +11 -5
  253. data/rbi/workos/agent_instance.rbi +66 -0
  254. data/rbi/workos/agent_instance_created.rbi +54 -0
  255. data/rbi/workos/agent_instance_created_data.rbi +66 -0
  256. data/rbi/workos/agent_instance_deleted.rbi +54 -0
  257. data/rbi/workos/agent_instance_deleted_data.rbi +66 -0
  258. data/rbi/workos/agent_instance_session.rbi +66 -0
  259. data/rbi/workos/agent_instance_session_created.rbi +54 -0
  260. data/rbi/workos/agent_instance_session_created_data.rbi +72 -0
  261. data/rbi/workos/agent_instance_session_revoked.rbi +54 -0
  262. data/rbi/workos/agent_instance_session_revoked_data.rbi +66 -0
  263. data/rbi/workos/agent_registration.rbi +66 -0
  264. data/rbi/workos/agent_registration_agent_identity.rbi +42 -0
  265. data/rbi/workos/agent_registration_claim.rbi +48 -0
  266. data/rbi/workos/agent_registration_claim_attempt_created.rbi +54 -0
  267. data/rbi/workos/agent_registration_claim_attempt_created_data.rbi +66 -0
  268. data/rbi/workos/agent_registration_claim_claim_completion.rbi +48 -0
  269. data/rbi/workos/agent_registration_claim_completed.rbi +54 -0
  270. data/rbi/workos/agent_registration_claim_completed_data.rbi +66 -0
  271. data/rbi/workos/agent_registration_claim_completed_data_claimed_by.rbi +30 -0
  272. data/rbi/workos/agent_registration_created.rbi +54 -0
  273. data/rbi/workos/agent_registration_created_data.rbi +72 -0
  274. data/rbi/workos/agent_registration_created_data_agent_identity.rbi +36 -0
  275. data/rbi/workos/agent_registration_credential_issued.rbi +54 -0
  276. data/rbi/workos/agent_registration_credential_issued_data.rbi +54 -0
  277. data/rbi/workos/agent_registration_credential_issued_data_detail.rbi +30 -0
  278. data/rbi/workos/agent_registration_deleted.rbi +54 -0
  279. data/rbi/workos/{connection_option.rbi → agent_registration_deleted_data.rbi} +5 -5
  280. data/rbi/workos/agent_registration_expired.rbi +54 -0
  281. data/rbi/workos/agent_registration_expired_data.rbi +24 -0
  282. data/rbi/workos/agent_registration_organization_switched.rbi +54 -0
  283. data/rbi/workos/agent_registration_organization_switched_data.rbi +36 -0
  284. data/rbi/workos/agent_registration_refreshed.rbi +54 -0
  285. data/rbi/workos/agent_registration_refreshed_data.rbi +24 -0
  286. data/rbi/workos/agent_registration_revoked.rbi +54 -0
  287. data/rbi/workos/agent_registration_revoked_data.rbi +24 -0
  288. data/rbi/workos/agent_token.rbi +66 -0
  289. data/rbi/workos/agent_token_validation.rbi +66 -0
  290. data/rbi/workos/agents.rbi +175 -0
  291. data/rbi/workos/api_key_installation.rbi +36 -0
  292. data/rbi/workos/api_key_validation_response.rbi +6 -0
  293. data/rbi/workos/audit_logs.rbi +26 -2
  294. data/rbi/workos/authentication_oauth_failed_data.rbi +6 -0
  295. data/rbi/workos/authentication_oauth_succeeded_data.rbi +6 -0
  296. data/rbi/workos/authentication_reauthentication_succeeded.rbi +54 -0
  297. data/rbi/workos/authentication_reauthentication_succeeded_data.rbi +54 -0
  298. data/rbi/workos/claim_view_response.rbi +42 -0
  299. data/rbi/workos/claim_view_response_organization.rbi +30 -0
  300. data/rbi/workos/client.rbi +6 -0
  301. data/rbi/workos/configure_data_integration_body.rbi +6 -0
  302. data/rbi/workos/connect.rbi +2 -1
  303. data/rbi/workos/connected_account.rbi +18 -0
  304. data/rbi/workos/{connected_account_dto.rbi → connected_account_input.rbi} +1 -1
  305. data/rbi/workos/connection.rbi +0 -6
  306. data/rbi/workos/create_connection.rbi +60 -0
  307. data/rbi/workos/create_connection_attribute_maps.rbi +30 -0
  308. data/rbi/workos/create_connection_key_pair.rbi +30 -0
  309. data/rbi/workos/create_connection_oidc_options.rbi +72 -0
  310. data/rbi/workos/create_connection_saml_options.rbi +66 -0
  311. data/rbi/workos/create_connection_standard_attributes.rbi +54 -0
  312. data/rbi/workos/create_data_integration.rbi +20 -2
  313. data/rbi/workos/create_it_contact.rbi +24 -0
  314. data/rbi/workos/create_saml_idp_signing_certificate.rbi +24 -0
  315. data/rbi/workos/create_team.rbi +30 -0
  316. data/rbi/workos/create_user.rbi +6 -0
  317. data/rbi/workos/create_waitlist_entry.rbi +36 -0
  318. data/rbi/workos/custom_provider_definition.rbi +4 -4
  319. data/rbi/workos/data_integration.rbi +20 -2
  320. data/rbi/workos/data_integration_configuration_response.rbi +6 -0
  321. data/rbi/workos/{data_integration_credentials_dto.rbi → data_integration_credentials_input.rbi} +1 -1
  322. data/rbi/workos/data_integration_installation.rbi +42 -0
  323. data/rbi/workos/data_integrations_get_data_integration_authorize_url_request.rbi +6 -0
  324. data/rbi/workos/data_integrations_list_response_data_connected_account.rbi +18 -0
  325. data/rbi/workos/data_integrations_upsert_client_credentials_request.rbi +48 -0
  326. data/rbi/workos/directory_sync.rbi +3 -1
  327. data/rbi/workos/email_completion_session_authenticate_request.rbi +72 -0
  328. data/rbi/workos/events.rbi +2 -2
  329. data/rbi/workos/groups.rbi +2 -1
  330. data/rbi/workos/invite_it_contact.rbi +24 -0
  331. data/rbi/workos/it_contact.rbi +48 -0
  332. data/rbi/workos/organization_authorized_connect_application_list_data.rbi +54 -0
  333. data/rbi/workos/organization_domains.rbi +2 -2
  334. data/rbi/workos/organizations.rbi +57 -0
  335. data/rbi/workos/patch_connection.rbi +54 -0
  336. data/rbi/workos/patch_connection_attribute_maps.rbi +30 -0
  337. data/rbi/workos/patch_connection_oidc_options.rbi +66 -0
  338. data/rbi/workos/patch_connection_saml_options.rbi +48 -0
  339. data/rbi/workos/patch_connection_standard_attributes.rbi +54 -0
  340. data/rbi/workos/permission_created_data.rbi +6 -0
  341. data/rbi/workos/permission_deleted_data.rbi +6 -0
  342. data/rbi/workos/permission_updated_data.rbi +6 -0
  343. data/rbi/workos/pipes.rbi +23 -5
  344. data/rbi/workos/pipes_connected_account_connection_failed.rbi +54 -0
  345. data/rbi/workos/{organization_domain_stand_alone.rbi → pipes_connected_account_connection_failed_data.rbi} +23 -23
  346. data/rbi/workos/pipes_provider.rbi +2 -1
  347. data/rbi/workos/platform_teams.rbi +30 -0
  348. data/rbi/workos/radar_challenge.rbi +72 -0
  349. data/rbi/workos/radar_challenge_created.rbi +54 -0
  350. data/rbi/workos/radar_challenge_created_data.rbi +42 -0
  351. data/rbi/workos/radar_sms_challenge_code_session_authenticate_request.rbi +4 -4
  352. data/rbi/workos/resource_export_completed.rbi +54 -0
  353. data/rbi/workos/resource_export_completed_data.rbi +30 -0
  354. data/rbi/workos/resource_export_created.rbi +54 -0
  355. data/rbi/workos/resource_export_created_data.rbi +30 -0
  356. data/rbi/workos/resource_export_downloaded.rbi +54 -0
  357. data/rbi/workos/resource_export_downloaded_data.rbi +30 -0
  358. data/rbi/workos/resource_export_failed.rbi +54 -0
  359. data/rbi/workos/resource_export_failed_data.rbi +30 -0
  360. data/rbi/workos/saml_idp_signing_certificate.rbi +54 -0
  361. data/rbi/workos/saml_idp_signing_certificate_list.rbi +30 -0
  362. data/rbi/workos/saml_sp_encryption_certificate.rbi +54 -0
  363. data/rbi/workos/saml_sp_encryption_certificate_list.rbi +30 -0
  364. data/rbi/workos/saml_sp_signing_certificate.rbi +54 -0
  365. data/rbi/workos/sso.rbi +181 -2
  366. data/rbi/workos/team.rbi +60 -0
  367. data/rbi/workos/token_query.rbi +20 -2
  368. data/rbi/workos/update_audit_logs_retention.rbi +8 -2
  369. data/rbi/workos/update_data_integration.rbi +8 -2
  370. data/rbi/workos/update_user.rbi +6 -0
  371. data/rbi/workos/user_management.rbi +116 -2
  372. data/rbi/workos/vault_kek_deleted.rbi +54 -0
  373. data/rbi/workos/vault_kek_deleted_data.rbi +48 -0
  374. data/rbi/workos/waitlist.rbi +42 -0
  375. data/rbi/workos/waitlist_entry.rbi +72 -0
  376. data/rbi/workos/waitlist_user.rbi +18 -6
  377. data/rbi/workos/widget_session_token.rbi +2 -2
  378. data/rbi/workos/widgets.rbi +1 -1
  379. data/test/workos/test_agents.rb +153 -0
  380. data/test/workos/test_agents_model_round_trip.rb +410 -0
  381. data/test/workos/test_api_keys_model_round_trip.rb +307 -0
  382. data/test/workos/test_audit_logs.rb +11 -2
  383. data/test/workos/test_authkit_helpers.rb +22 -10
  384. data/test/workos/test_authorization.rb +6 -6
  385. data/test/workos/test_authorization_model_round_trip.rb +237 -0
  386. data/test/workos/test_base_client.rb +27 -0
  387. data/test/workos/test_client_api_model_round_trip.rb +31 -0
  388. data/test/workos/test_connect_model_round_trip.rb +175 -0
  389. data/test/workos/test_directory_sync_model_round_trip.rb +579 -0
  390. data/test/workos/test_events.rb +2 -2
  391. data/test/workos/test_feature_flags_model_round_trip.rb +580 -0
  392. data/test/workos/test_groups_model_round_trip.rb +56 -0
  393. data/test/workos/test_multi_factor_auth_model_round_trip.rb +192 -0
  394. data/test/workos/test_organization_domains_model_round_trip.rb +260 -0
  395. data/test/workos/test_organization_membership_model_round_trip.rb +89 -0
  396. data/test/workos/test_organizations.rb +49 -1
  397. data/test/workos/test_organizations_model_round_trip.rb +642 -1
  398. data/test/workos/test_pipes.rb +8 -0
  399. data/test/workos/test_pipes_model_round_trip.rb +68 -8
  400. data/test/workos/test_pipes_provider_model_round_trip.rb +77 -0
  401. data/test/workos/test_platform_teams.rb +41 -0
  402. data/test/workos/test_platform_teams_model_round_trip.rb +41 -0
  403. data/test/workos/test_shared_model_round_trip.rb +1263 -0
  404. data/test/workos/test_sso.rb +108 -2
  405. data/test/workos/test_sso_model_round_trip.rb +681 -0
  406. data/test/workos/test_user_management.rb +78 -6
  407. data/test/workos/test_user_management_model_round_trip.rb +1604 -27
  408. data/test/workos/test_vault_model_round_trip.rb +571 -0
  409. data/test/workos/test_widgets.rb +2 -2
  410. data/test/workos/test_widgets_model_round_trip.rb +30 -0
  411. metadata +287 -19
  412. data/lib/workos/admin_portal/intent_options.rb +0 -22
  413. data/lib/workos/admin_portal/sso_intent_options.rb +0 -22
  414. data/rbi/workos/intent_options.rbi +0 -30
  415. 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,1225 @@ 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
+ "id" => "stub",
180
+ "email" => "stub",
181
+ "state" => "stub",
182
+ "approved_at" => nil,
183
+ "additional_fields" => {},
184
+ "waitlist_id" => nil,
185
+ "created_at" => "stub",
186
+ "updated_at" => "stub",
187
+ "object" => "waitlist_user"
188
+ }
189
+ model = WorkOS::WaitlistUser.new(fixture.to_json)
190
+ json = model.to_h
191
+ assert_kind_of Hash, json
192
+ assert_equal fixture["id"], json[:id]
193
+ assert_equal fixture["email"], json[:email]
194
+ assert_nil json[:approved_at]
195
+ assert_equal fixture["created_at"], json[:created_at]
196
+ assert_equal fixture["updated_at"], json[:updated_at]
197
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
198
+ end
199
+
200
+ def test_event_schema_round_trip
201
+ fixture = {
202
+ "object" => "event",
203
+ "id" => "stub",
204
+ "event" => "stub",
205
+ "data" => {},
206
+ "created_at" => "stub",
207
+ "context" => {}
208
+ }
209
+ model = WorkOS::EventSchema.new(fixture.to_json)
210
+ json = model.to_h
211
+ assert_kind_of Hash, json
212
+ assert_equal fixture["id"], json[:id]
213
+ assert_equal fixture["event"], json[:event]
214
+ assert_equal fixture["created_at"], json[:created_at]
215
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
216
+ end
217
+
218
+ def test_agent_blueprint_created_round_trip
219
+ fixture = {
220
+ "object" => "event",
221
+ "id" => "stub",
222
+ "event" => "agent.blueprint.created",
223
+ "data" => {},
224
+ "created_at" => "stub",
225
+ "context" => {}
226
+ }
227
+ model = WorkOS::AgentBlueprintCreated.new(fixture.to_json)
228
+ json = model.to_h
229
+ assert_kind_of Hash, json
230
+ assert_equal fixture["id"], json[:id]
231
+ assert_equal fixture["created_at"], json[:created_at]
232
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
233
+ end
234
+
235
+ def test_agent_blueprint_created_data_round_trip
236
+ fixture = {
237
+ "object" => "agent_blueprint",
238
+ "id" => "stub",
239
+ "name" => "stub",
240
+ "description" => nil,
241
+ "permissions" => [],
242
+ "invocable_by" => {},
243
+ "session_settings" => {},
244
+ "created_at" => "stub",
245
+ "updated_at" => "stub"
246
+ }
247
+ model = WorkOS::AgentBlueprintCreatedData.new(fixture.to_json)
248
+ json = model.to_h
249
+ assert_kind_of Hash, json
250
+ assert_equal fixture["id"], json[:id]
251
+ assert_equal fixture["name"], json[:name]
252
+ assert_nil json[:description]
253
+ assert_equal fixture["created_at"], json[:created_at]
254
+ assert_equal fixture["updated_at"], json[:updated_at]
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_blueprint_created_data_invocable_by_round_trip
259
+ fixture = {
260
+ "role_slugs" => [],
261
+ "organization_ids" => []
262
+ }
263
+ model = WorkOS::AgentBlueprintCreatedDataInvocableBy.new(fixture.to_json)
264
+ json = model.to_h
265
+ assert_kind_of Hash, json
266
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
267
+ end
268
+
269
+ def test_agent_blueprint_created_data_session_setting_round_trip
270
+ fixture = {
271
+ "max_age_seconds" => 1.0,
272
+ "access_token_ttl_seconds" => 1.0,
273
+ "refresh_token_ttl_seconds" => 1.0
274
+ }
275
+ model = WorkOS::AgentBlueprintCreatedDataSessionSetting.new(fixture.to_json)
276
+ json = model.to_h
277
+ assert_kind_of Hash, json
278
+ assert_equal fixture["max_age_seconds"], json[:max_age_seconds]
279
+ assert_equal fixture["access_token_ttl_seconds"], json[:access_token_ttl_seconds]
280
+ assert_equal fixture["refresh_token_ttl_seconds"], json[:refresh_token_ttl_seconds]
281
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
282
+ end
283
+
284
+ def test_agent_blueprint_deleted_round_trip
285
+ fixture = {
286
+ "object" => "event",
287
+ "id" => "stub",
288
+ "event" => "agent.blueprint.deleted",
289
+ "data" => {},
290
+ "created_at" => "stub",
291
+ "context" => {}
292
+ }
293
+ model = WorkOS::AgentBlueprintDeleted.new(fixture.to_json)
294
+ json = model.to_h
295
+ assert_kind_of Hash, json
296
+ assert_equal fixture["id"], json[:id]
297
+ assert_equal fixture["created_at"], json[:created_at]
298
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
299
+ end
300
+
301
+ def test_agent_blueprint_deleted_data_round_trip
302
+ fixture = {
303
+ "object" => "agent_blueprint",
304
+ "id" => "stub",
305
+ "name" => "stub",
306
+ "created_at" => "stub",
307
+ "updated_at" => "stub"
308
+ }
309
+ model = WorkOS::AgentBlueprintDeletedData.new(fixture.to_json)
310
+ json = model.to_h
311
+ assert_kind_of Hash, json
312
+ assert_equal fixture["id"], json[:id]
313
+ assert_equal fixture["name"], json[:name]
314
+ assert_equal fixture["created_at"], json[:created_at]
315
+ assert_equal fixture["updated_at"], json[:updated_at]
316
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
317
+ end
318
+
319
+ def test_agent_blueprint_updated_round_trip
320
+ fixture = {
321
+ "object" => "event",
322
+ "id" => "stub",
323
+ "event" => "agent.blueprint.updated",
324
+ "data" => {},
325
+ "created_at" => "stub",
326
+ "context" => {}
327
+ }
328
+ model = WorkOS::AgentBlueprintUpdated.new(fixture.to_json)
329
+ json = model.to_h
330
+ assert_kind_of Hash, json
331
+ assert_equal fixture["id"], json[:id]
332
+ assert_equal fixture["created_at"], json[:created_at]
333
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
334
+ end
335
+
336
+ def test_agent_blueprint_updated_data_round_trip
337
+ fixture = {
338
+ "object" => "agent_blueprint",
339
+ "id" => "stub",
340
+ "name" => "stub",
341
+ "description" => nil,
342
+ "permissions" => [],
343
+ "invocable_by" => {},
344
+ "session_settings" => {},
345
+ "created_at" => "stub",
346
+ "updated_at" => "stub"
347
+ }
348
+ model = WorkOS::AgentBlueprintUpdatedData.new(fixture.to_json)
349
+ json = model.to_h
350
+ assert_kind_of Hash, json
351
+ assert_equal fixture["id"], json[:id]
352
+ assert_equal fixture["name"], json[:name]
353
+ assert_nil json[:description]
354
+ assert_equal fixture["created_at"], json[:created_at]
355
+ assert_equal fixture["updated_at"], json[:updated_at]
356
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
357
+ end
358
+
359
+ def test_agent_blueprint_updated_data_invocable_by_round_trip
360
+ fixture = {
361
+ "role_slugs" => [],
362
+ "organization_ids" => []
363
+ }
364
+ model = WorkOS::AgentBlueprintUpdatedDataInvocableBy.new(fixture.to_json)
365
+ json = model.to_h
366
+ assert_kind_of Hash, json
367
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
368
+ end
369
+
370
+ def test_agent_blueprint_updated_data_session_setting_round_trip
371
+ fixture = {
372
+ "max_age_seconds" => 1.0,
373
+ "access_token_ttl_seconds" => 1.0,
374
+ "refresh_token_ttl_seconds" => 1.0
375
+ }
376
+ model = WorkOS::AgentBlueprintUpdatedDataSessionSetting.new(fixture.to_json)
377
+ json = model.to_h
378
+ assert_kind_of Hash, json
379
+ assert_equal fixture["max_age_seconds"], json[:max_age_seconds]
380
+ assert_equal fixture["access_token_ttl_seconds"], json[:access_token_ttl_seconds]
381
+ assert_equal fixture["refresh_token_ttl_seconds"], json[:refresh_token_ttl_seconds]
382
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
383
+ end
384
+
385
+ def test_agent_instance_created_round_trip
386
+ fixture = {
387
+ "object" => "event",
388
+ "id" => "stub",
389
+ "event" => "agent.instance.created",
390
+ "data" => {},
391
+ "created_at" => "stub",
392
+ "context" => {}
393
+ }
394
+ model = WorkOS::AgentInstanceCreated.new(fixture.to_json)
395
+ json = model.to_h
396
+ assert_kind_of Hash, json
397
+ assert_equal fixture["id"], json[:id]
398
+ assert_equal fixture["created_at"], json[:created_at]
399
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
400
+ end
401
+
402
+ def test_agent_instance_created_data_round_trip
403
+ fixture = {
404
+ "object" => "agent_instance",
405
+ "id" => "stub",
406
+ "agent_blueprint_id" => "stub",
407
+ "organization_id" => "stub",
408
+ "organization_membership_id" => nil,
409
+ "type" => "stub",
410
+ "created_at" => "stub",
411
+ "updated_at" => "stub"
412
+ }
413
+ model = WorkOS::AgentInstanceCreatedData.new(fixture.to_json)
414
+ json = model.to_h
415
+ assert_kind_of Hash, json
416
+ assert_equal fixture["id"], json[:id]
417
+ assert_equal fixture["agent_blueprint_id"], json[:agent_blueprint_id]
418
+ assert_equal fixture["organization_id"], json[:organization_id]
419
+ assert_nil json[:organization_membership_id]
420
+ assert_equal fixture["created_at"], json[:created_at]
421
+ assert_equal fixture["updated_at"], json[:updated_at]
422
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
423
+ end
424
+
425
+ def test_agent_instance_deleted_round_trip
426
+ fixture = {
427
+ "object" => "event",
428
+ "id" => "stub",
429
+ "event" => "agent.instance.deleted",
430
+ "data" => {},
431
+ "created_at" => "stub",
432
+ "context" => {}
433
+ }
434
+ model = WorkOS::AgentInstanceDeleted.new(fixture.to_json)
435
+ json = model.to_h
436
+ assert_kind_of Hash, json
437
+ assert_equal fixture["id"], json[:id]
438
+ assert_equal fixture["created_at"], json[:created_at]
439
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
440
+ end
441
+
442
+ def test_agent_instance_deleted_data_round_trip
443
+ fixture = {
444
+ "object" => "agent_instance",
445
+ "id" => "stub",
446
+ "agent_blueprint_id" => "stub",
447
+ "organization_id" => "stub",
448
+ "organization_membership_id" => nil,
449
+ "type" => "stub",
450
+ "created_at" => "stub",
451
+ "updated_at" => "stub"
452
+ }
453
+ model = WorkOS::AgentInstanceDeletedData.new(fixture.to_json)
454
+ json = model.to_h
455
+ assert_kind_of Hash, json
456
+ assert_equal fixture["id"], json[:id]
457
+ assert_equal fixture["agent_blueprint_id"], json[:agent_blueprint_id]
458
+ assert_equal fixture["organization_id"], json[:organization_id]
459
+ assert_nil json[:organization_membership_id]
460
+ assert_equal fixture["created_at"], json[:created_at]
461
+ assert_equal fixture["updated_at"], json[:updated_at]
462
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
463
+ end
464
+
465
+ def test_agent_instance_session_created_round_trip
466
+ fixture = {
467
+ "object" => "event",
468
+ "id" => "stub",
469
+ "event" => "agent.instance.session.created",
470
+ "data" => {},
471
+ "created_at" => "stub",
472
+ "context" => {}
473
+ }
474
+ model = WorkOS::AgentInstanceSessionCreated.new(fixture.to_json)
475
+ json = model.to_h
476
+ assert_kind_of Hash, json
477
+ assert_equal fixture["id"], json[:id]
478
+ assert_equal fixture["created_at"], json[:created_at]
479
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
480
+ end
481
+
482
+ def test_agent_instance_session_created_data_round_trip
483
+ fixture = {
484
+ "object" => "agent_instance_session",
485
+ "id" => "stub",
486
+ "agent_instance_id" => "stub",
487
+ "organization_id" => "stub",
488
+ "expires_at" => "stub",
489
+ "revoked_at" => nil,
490
+ "created_at" => "stub",
491
+ "updated_at" => "stub",
492
+ "permission_slugs" => []
493
+ }
494
+ model = WorkOS::AgentInstanceSessionCreatedData.new(fixture.to_json)
495
+ json = model.to_h
496
+ assert_kind_of Hash, json
497
+ assert_equal fixture["id"], json[:id]
498
+ assert_equal fixture["agent_instance_id"], json[:agent_instance_id]
499
+ assert_equal fixture["organization_id"], json[:organization_id]
500
+ assert_equal fixture["expires_at"], json[:expires_at]
501
+ assert_nil json[:revoked_at]
502
+ assert_equal fixture["created_at"], json[:created_at]
503
+ assert_equal fixture["updated_at"], json[:updated_at]
504
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
505
+ end
506
+
507
+ def test_agent_instance_session_revoked_round_trip
508
+ fixture = {
509
+ "object" => "event",
510
+ "id" => "stub",
511
+ "event" => "agent.instance.session.revoked",
512
+ "data" => {},
513
+ "created_at" => "stub",
514
+ "context" => {}
515
+ }
516
+ model = WorkOS::AgentInstanceSessionRevoked.new(fixture.to_json)
517
+ json = model.to_h
518
+ assert_kind_of Hash, json
519
+ assert_equal fixture["id"], json[:id]
520
+ assert_equal fixture["created_at"], json[:created_at]
521
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
522
+ end
523
+
524
+ def test_agent_instance_session_revoked_data_round_trip
525
+ fixture = {
526
+ "object" => "agent_instance_session",
527
+ "id" => "stub",
528
+ "agent_instance_id" => "stub",
529
+ "organization_id" => "stub",
530
+ "expires_at" => "stub",
531
+ "revoked_at" => nil,
532
+ "created_at" => "stub",
533
+ "updated_at" => "stub"
534
+ }
535
+ model = WorkOS::AgentInstanceSessionRevokedData.new(fixture.to_json)
536
+ json = model.to_h
537
+ assert_kind_of Hash, json
538
+ assert_equal fixture["id"], json[:id]
539
+ assert_equal fixture["agent_instance_id"], json[:agent_instance_id]
540
+ assert_equal fixture["organization_id"], json[:organization_id]
541
+ assert_equal fixture["expires_at"], json[:expires_at]
542
+ assert_nil json[:revoked_at]
543
+ assert_equal fixture["created_at"], json[:created_at]
544
+ assert_equal fixture["updated_at"], json[:updated_at]
545
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
546
+ end
547
+
548
+ def test_agent_registration_claim_attempt_created_round_trip
549
+ fixture = {
550
+ "object" => "event",
551
+ "id" => "stub",
552
+ "event" => "agent.registration.claim.attempt.created",
553
+ "data" => {},
554
+ "created_at" => "stub",
555
+ "context" => {}
556
+ }
557
+ model = WorkOS::AgentRegistrationClaimAttemptCreated.new(fixture.to_json)
558
+ json = model.to_h
559
+ assert_kind_of Hash, json
560
+ assert_equal fixture["id"], json[:id]
561
+ assert_equal fixture["created_at"], json[:created_at]
562
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
563
+ end
564
+
565
+ def test_agent_registration_claim_attempt_created_data_round_trip
566
+ fixture = {
567
+ "object" => "agent_registration_claim_attempt",
568
+ "id" => "stub",
569
+ "agent_registration_id" => "stub",
570
+ "agent_registration_claim_id" => "stub",
571
+ "login_hint" => "stub",
572
+ "expires_at" => "stub",
573
+ "created_at" => "stub",
574
+ "updated_at" => "stub"
575
+ }
576
+ model = WorkOS::AgentRegistrationClaimAttemptCreatedData.new(fixture.to_json)
577
+ json = model.to_h
578
+ assert_kind_of Hash, json
579
+ assert_equal fixture["id"], json[:id]
580
+ assert_equal fixture["agent_registration_id"], json[:agent_registration_id]
581
+ assert_equal fixture["agent_registration_claim_id"], json[:agent_registration_claim_id]
582
+ assert_equal fixture["login_hint"], json[:login_hint]
583
+ assert_equal fixture["expires_at"], json[:expires_at]
584
+ assert_equal fixture["created_at"], json[:created_at]
585
+ assert_equal fixture["updated_at"], json[:updated_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_agent_registration_claim_completed_round_trip
590
+ fixture = {
591
+ "object" => "event",
592
+ "id" => "stub",
593
+ "event" => "agent.registration.claim.completed",
594
+ "data" => {},
595
+ "created_at" => "stub",
596
+ "context" => {}
597
+ }
598
+ model = WorkOS::AgentRegistrationClaimCompleted.new(fixture.to_json)
599
+ json = model.to_h
600
+ assert_kind_of Hash, json
601
+ assert_equal fixture["id"], json[:id]
602
+ assert_equal fixture["created_at"], json[:created_at]
603
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
604
+ end
605
+
606
+ def test_agent_registration_claim_completed_data_round_trip
607
+ fixture = {
608
+ "object" => "agent_registration_claim",
609
+ "id" => "stub",
610
+ "agent_registration_id" => "stub",
611
+ "completed_by_attempt_id" => "stub",
612
+ "claimed_by" => {},
613
+ "completed_at" => "stub",
614
+ "created_at" => "stub",
615
+ "updated_at" => "stub"
616
+ }
617
+ model = WorkOS::AgentRegistrationClaimCompletedData.new(fixture.to_json)
618
+ json = model.to_h
619
+ assert_kind_of Hash, json
620
+ assert_equal fixture["id"], json[:id]
621
+ assert_equal fixture["agent_registration_id"], json[:agent_registration_id]
622
+ assert_equal fixture["completed_by_attempt_id"], json[:completed_by_attempt_id]
623
+ assert_equal fixture["completed_at"], json[:completed_at]
624
+ assert_equal fixture["created_at"], json[:created_at]
625
+ assert_equal fixture["updated_at"], json[:updated_at]
626
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
627
+ end
628
+
629
+ def test_agent_registration_claim_completed_data_claimed_by_round_trip
630
+ fixture = {
631
+ "user_id" => "stub",
632
+ "organization_id" => "stub"
633
+ }
634
+ model = WorkOS::AgentRegistrationClaimCompletedDataClaimedBy.new(fixture.to_json)
635
+ json = model.to_h
636
+ assert_kind_of Hash, json
637
+ assert_equal fixture["user_id"], json[:user_id]
638
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
639
+ end
640
+
641
+ def test_agent_registration_created_round_trip
642
+ fixture = {
643
+ "object" => "event",
644
+ "id" => "stub",
645
+ "event" => "agent.registration.created",
646
+ "data" => {},
647
+ "created_at" => "stub",
648
+ "context" => {}
649
+ }
650
+ model = WorkOS::AgentRegistrationCreated.new(fixture.to_json)
651
+ json = model.to_h
652
+ assert_kind_of Hash, json
653
+ assert_equal fixture["id"], json[:id]
654
+ assert_equal fixture["created_at"], json[:created_at]
655
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
656
+ end
657
+
658
+ def test_agent_registration_created_data_round_trip
659
+ fixture = {
660
+ "object" => "agent_registration",
661
+ "id" => "stub",
662
+ "agent_identity" => {},
663
+ "organization_id" => "stub",
664
+ "status" => "stub",
665
+ "kind" => "stub",
666
+ "method" => "stub",
667
+ "created_at" => "stub",
668
+ "updated_at" => "stub"
669
+ }
670
+ model = WorkOS::AgentRegistrationCreatedData.new(fixture.to_json)
671
+ json = model.to_h
672
+ assert_kind_of Hash, json
673
+ assert_equal fixture["id"], json[:id]
674
+ assert_equal fixture["organization_id"], json[:organization_id]
675
+ assert_equal fixture["created_at"], json[:created_at]
676
+ assert_equal fixture["updated_at"], json[:updated_at]
677
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
678
+ end
679
+
680
+ def test_agent_registration_created_data_agent_identity_round_trip
681
+ fixture = {
682
+ "object" => "agent_identity",
683
+ "id" => "stub",
684
+ "userland_user_id" => "stub"
685
+ }
686
+ model = WorkOS::AgentRegistrationCreatedDataAgentIdentity.new(fixture.to_json)
687
+ json = model.to_h
688
+ assert_kind_of Hash, json
689
+ assert_equal fixture["id"], json[:id]
690
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
691
+ end
692
+
693
+ def test_agent_registration_credential_issued_round_trip
694
+ fixture = {
695
+ "object" => "event",
696
+ "id" => "stub",
697
+ "event" => "agent.registration.credential.issued",
698
+ "data" => {},
699
+ "created_at" => "stub",
700
+ "context" => {}
701
+ }
702
+ model = WorkOS::AgentRegistrationCredentialIssued.new(fixture.to_json)
703
+ json = model.to_h
704
+ assert_kind_of Hash, json
705
+ assert_equal fixture["id"], json[:id]
706
+ assert_equal fixture["created_at"], json[:created_at]
707
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
708
+ end
709
+
710
+ def test_agent_registration_credential_issued_data_round_trip
711
+ fixture = {
712
+ "object" => "agent_registration_credential",
713
+ "id" => "stub",
714
+ "agent_registration_id" => "stub",
715
+ "detail" => {},
716
+ "created_at" => "stub",
717
+ "updated_at" => "stub"
718
+ }
719
+ model = WorkOS::AgentRegistrationCredentialIssuedData.new(fixture.to_json)
720
+ json = model.to_h
721
+ assert_kind_of Hash, json
722
+ assert_equal fixture["id"], json[:id]
723
+ assert_equal fixture["agent_registration_id"], json[:agent_registration_id]
724
+ assert_equal fixture["created_at"], json[:created_at]
725
+ assert_equal fixture["updated_at"], json[:updated_at]
726
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
727
+ end
728
+
729
+ def test_agent_registration_credential_issued_data_detail_round_trip
730
+ fixture = {
731
+ "kind" => "api_key",
732
+ "api_key_id" => "stub"
733
+ }
734
+ model = WorkOS::AgentRegistrationCredentialIssuedDataDetail.new(fixture.to_json)
735
+ json = model.to_h
736
+ assert_kind_of Hash, json
737
+ assert_equal fixture["api_key_id"], json[:api_key_id]
738
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
739
+ end
740
+
741
+ def test_access_token_agent_registration_credential_issued_data_detail_round_trip
742
+ fixture = {
743
+ "kind" => "access_token",
744
+ "jti" => "stub",
745
+ "expires_at" => "stub"
746
+ }
747
+ model = WorkOS::AccessTokenAgentRegistrationCredentialIssuedDataDetail.new(fixture.to_json)
748
+ json = model.to_h
749
+ assert_kind_of Hash, json
750
+ assert_equal fixture["jti"], json[:jti]
751
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
752
+ end
753
+
754
+ def test_agent_registration_deleted_round_trip
755
+ fixture = {
756
+ "object" => "event",
757
+ "id" => "stub",
758
+ "event" => "agent.registration.deleted",
759
+ "data" => {},
760
+ "created_at" => "stub",
761
+ "context" => {}
762
+ }
763
+ model = WorkOS::AgentRegistrationDeleted.new(fixture.to_json)
764
+ json = model.to_h
765
+ assert_kind_of Hash, json
766
+ assert_equal fixture["id"], json[:id]
767
+ assert_equal fixture["created_at"], json[:created_at]
768
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
769
+ end
770
+
771
+ def test_agent_registration_deleted_data_round_trip
772
+ fixture = {
773
+ "agent_registration_id" => "stub"
774
+ }
775
+ model = WorkOS::AgentRegistrationDeletedData.new(fixture.to_json)
776
+ json = model.to_h
777
+ assert_kind_of Hash, json
778
+ assert_equal fixture["agent_registration_id"], json[:agent_registration_id]
779
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
780
+ end
781
+
782
+ def test_agent_registration_expired_round_trip
783
+ fixture = {
784
+ "object" => "event",
785
+ "id" => "stub",
786
+ "event" => "agent.registration.expired",
787
+ "data" => {},
788
+ "created_at" => "stub",
789
+ "context" => {}
790
+ }
791
+ model = WorkOS::AgentRegistrationExpired.new(fixture.to_json)
792
+ json = model.to_h
793
+ assert_kind_of Hash, json
794
+ assert_equal fixture["id"], json[:id]
795
+ assert_equal fixture["created_at"], json[:created_at]
796
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
797
+ end
798
+
799
+ def test_agent_registration_expired_data_round_trip
800
+ fixture = {
801
+ "agent_registration_id" => "stub"
802
+ }
803
+ model = WorkOS::AgentRegistrationExpiredData.new(fixture.to_json)
804
+ json = model.to_h
805
+ assert_kind_of Hash, json
806
+ assert_equal fixture["agent_registration_id"], json[:agent_registration_id]
807
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
808
+ end
809
+
810
+ def test_agent_registration_organization_switched_round_trip
811
+ fixture = {
812
+ "object" => "event",
813
+ "id" => "stub",
814
+ "event" => "agent.registration.organization.switched",
815
+ "data" => {},
816
+ "created_at" => "stub",
817
+ "context" => {}
818
+ }
819
+ model = WorkOS::AgentRegistrationOrganizationSwitched.new(fixture.to_json)
820
+ json = model.to_h
821
+ assert_kind_of Hash, json
822
+ assert_equal fixture["id"], json[:id]
823
+ assert_equal fixture["created_at"], json[:created_at]
824
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
825
+ end
826
+
827
+ def test_agent_registration_organization_switched_data_round_trip
828
+ fixture = {
829
+ "agent_registration_id" => "stub",
830
+ "from_organization_id" => "stub",
831
+ "to_organization_id" => "stub"
832
+ }
833
+ model = WorkOS::AgentRegistrationOrganizationSwitchedData.new(fixture.to_json)
834
+ json = model.to_h
835
+ assert_kind_of Hash, json
836
+ assert_equal fixture["agent_registration_id"], json[:agent_registration_id]
837
+ assert_equal fixture["from_organization_id"], json[:from_organization_id]
838
+ assert_equal fixture["to_organization_id"], json[:to_organization_id]
839
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
840
+ end
841
+
842
+ def test_agent_registration_refreshed_round_trip
843
+ fixture = {
844
+ "object" => "event",
845
+ "id" => "stub",
846
+ "event" => "agent.registration.refreshed",
847
+ "data" => {},
848
+ "created_at" => "stub",
849
+ "context" => {}
850
+ }
851
+ model = WorkOS::AgentRegistrationRefreshed.new(fixture.to_json)
852
+ json = model.to_h
853
+ assert_kind_of Hash, json
854
+ assert_equal fixture["id"], json[:id]
855
+ assert_equal fixture["created_at"], json[:created_at]
856
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
857
+ end
858
+
859
+ def test_agent_registration_refreshed_data_round_trip
860
+ fixture = {
861
+ "agent_registration_id" => "stub"
862
+ }
863
+ model = WorkOS::AgentRegistrationRefreshedData.new(fixture.to_json)
864
+ json = model.to_h
865
+ assert_kind_of Hash, json
866
+ assert_equal fixture["agent_registration_id"], json[:agent_registration_id]
867
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
868
+ end
869
+
870
+ def test_agent_registration_revoked_round_trip
871
+ fixture = {
872
+ "object" => "event",
873
+ "id" => "stub",
874
+ "event" => "agent.registration.revoked",
875
+ "data" => {},
876
+ "created_at" => "stub",
877
+ "context" => {}
878
+ }
879
+ model = WorkOS::AgentRegistrationRevoked.new(fixture.to_json)
880
+ json = model.to_h
881
+ assert_kind_of Hash, json
882
+ assert_equal fixture["id"], json[:id]
883
+ assert_equal fixture["created_at"], json[:created_at]
884
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
885
+ end
886
+
887
+ def test_agent_registration_revoked_data_round_trip
888
+ fixture = {
889
+ "agent_registration_id" => "stub"
890
+ }
891
+ model = WorkOS::AgentRegistrationRevokedData.new(fixture.to_json)
892
+ json = model.to_h
893
+ assert_kind_of Hash, json
894
+ assert_equal fixture["agent_registration_id"], json[:agent_registration_id]
895
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
896
+ end
897
+
898
+ def test_group_created_round_trip
899
+ fixture = {
900
+ "object" => "event",
901
+ "id" => "stub",
902
+ "event" => "group.created",
903
+ "data" => {},
904
+ "created_at" => "stub",
905
+ "context" => {}
906
+ }
907
+ model = WorkOS::GroupCreated.new(fixture.to_json)
908
+ json = model.to_h
909
+ assert_kind_of Hash, json
910
+ assert_equal fixture["id"], json[:id]
911
+ assert_equal fixture["created_at"], json[:created_at]
912
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
913
+ end
914
+
915
+ def test_group_deleted_round_trip
916
+ fixture = {
917
+ "object" => "event",
918
+ "id" => "stub",
919
+ "event" => "group.deleted",
920
+ "data" => {},
921
+ "created_at" => "stub",
922
+ "context" => {}
923
+ }
924
+ model = WorkOS::GroupDeleted.new(fixture.to_json)
925
+ json = model.to_h
926
+ assert_kind_of Hash, json
927
+ assert_equal fixture["id"], json[:id]
928
+ assert_equal fixture["created_at"], json[:created_at]
929
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
930
+ end
931
+
932
+ def test_group_member_added_round_trip
933
+ fixture = {
934
+ "object" => "event",
935
+ "id" => "stub",
936
+ "event" => "group.member_added",
937
+ "data" => {},
938
+ "created_at" => "stub",
939
+ "context" => {}
940
+ }
941
+ model = WorkOS::GroupMemberAdded.new(fixture.to_json)
942
+ json = model.to_h
943
+ assert_kind_of Hash, json
944
+ assert_equal fixture["id"], json[:id]
945
+ assert_equal fixture["created_at"], json[:created_at]
946
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
947
+ end
948
+
949
+ def test_group_member_added_data_round_trip
950
+ fixture = {
951
+ "group_id" => "stub",
952
+ "organization_membership_id" => "stub"
953
+ }
954
+ model = WorkOS::GroupMemberAddedData.new(fixture.to_json)
955
+ json = model.to_h
956
+ assert_kind_of Hash, json
957
+ assert_equal fixture["group_id"], json[:group_id]
958
+ assert_equal fixture["organization_membership_id"], json[:organization_membership_id]
959
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
960
+ end
961
+
962
+ def test_group_member_removed_round_trip
963
+ fixture = {
964
+ "object" => "event",
965
+ "id" => "stub",
966
+ "event" => "group.member_removed",
967
+ "data" => {},
968
+ "created_at" => "stub",
969
+ "context" => {}
970
+ }
971
+ model = WorkOS::GroupMemberRemoved.new(fixture.to_json)
972
+ json = model.to_h
973
+ assert_kind_of Hash, json
974
+ assert_equal fixture["id"], json[:id]
975
+ assert_equal fixture["created_at"], json[:created_at]
976
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
977
+ end
978
+
979
+ def test_group_member_removed_data_round_trip
980
+ fixture = {
981
+ "group_id" => "stub",
982
+ "organization_membership_id" => "stub"
983
+ }
984
+ model = WorkOS::GroupMemberRemovedData.new(fixture.to_json)
985
+ json = model.to_h
986
+ assert_kind_of Hash, json
987
+ assert_equal fixture["group_id"], json[:group_id]
988
+ assert_equal fixture["organization_membership_id"], json[:organization_membership_id]
989
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
990
+ end
991
+
992
+ def test_group_updated_round_trip
993
+ fixture = {
994
+ "object" => "event",
995
+ "id" => "stub",
996
+ "event" => "group.updated",
997
+ "data" => {},
998
+ "created_at" => "stub",
999
+ "context" => {}
1000
+ }
1001
+ model = WorkOS::GroupUpdated.new(fixture.to_json)
1002
+ json = model.to_h
1003
+ assert_kind_of Hash, json
1004
+ assert_equal fixture["id"], json[:id]
1005
+ assert_equal fixture["created_at"], json[:created_at]
1006
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
1007
+ end
1008
+
1009
+ def test_pipes_connected_account_connected_round_trip
1010
+ fixture = {
1011
+ "object" => "event",
1012
+ "id" => "stub",
1013
+ "event" => "pipes.connected_account.connected",
1014
+ "data" => {},
1015
+ "created_at" => "stub",
1016
+ "context" => {}
1017
+ }
1018
+ model = WorkOS::PipesConnectedAccountConnected.new(fixture.to_json)
1019
+ json = model.to_h
1020
+ assert_kind_of Hash, json
1021
+ assert_equal fixture["id"], json[:id]
1022
+ assert_equal fixture["created_at"], json[:created_at]
1023
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
1024
+ end
1025
+
1026
+ def test_pipes_connected_account_connection_failed_round_trip
1027
+ fixture = {
1028
+ "object" => "event",
1029
+ "id" => "stub",
1030
+ "event" => "pipes.connected_account.connection_failed",
1031
+ "data" => {},
1032
+ "created_at" => "stub",
1033
+ "context" => {}
1034
+ }
1035
+ model = WorkOS::PipesConnectedAccountConnectionFailed.new(fixture.to_json)
1036
+ json = model.to_h
1037
+ assert_kind_of Hash, json
1038
+ assert_equal fixture["id"], json[:id]
1039
+ assert_equal fixture["created_at"], json[:created_at]
1040
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
1041
+ end
1042
+
1043
+ def test_pipes_connected_account_connection_failed_data_round_trip
1044
+ fixture = {
1045
+ "object" => "connection_failed",
1046
+ "data_integration_id" => "stub",
1047
+ "provider_slug" => "stub",
1048
+ "user_id" => nil,
1049
+ "organization_id" => nil,
1050
+ "error_code" => "stub",
1051
+ "error_reason" => nil,
1052
+ "provider_error" => nil,
1053
+ "provider_error_description" => nil,
1054
+ "created_at" => "stub"
1055
+ }
1056
+ model = WorkOS::PipesConnectedAccountConnectionFailedData.new(fixture.to_json)
1057
+ json = model.to_h
1058
+ assert_kind_of Hash, json
1059
+ assert_equal fixture["data_integration_id"], json[:data_integration_id]
1060
+ assert_equal fixture["provider_slug"], json[:provider_slug]
1061
+ assert_nil json[:user_id]
1062
+ assert_nil json[:organization_id]
1063
+ assert_equal fixture["error_code"], json[:error_code]
1064
+ assert_nil json[:error_reason]
1065
+ assert_nil json[:provider_error]
1066
+ assert_nil json[:provider_error_description]
1067
+ assert_equal fixture["created_at"], json[:created_at]
1068
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
1069
+ end
1070
+
1071
+ def test_pipes_connected_account_disconnected_round_trip
1072
+ fixture = {
1073
+ "object" => "event",
1074
+ "id" => "stub",
1075
+ "event" => "pipes.connected_account.disconnected",
1076
+ "data" => {},
1077
+ "created_at" => "stub",
1078
+ "context" => {}
1079
+ }
1080
+ model = WorkOS::PipesConnectedAccountDisconnected.new(fixture.to_json)
1081
+ json = model.to_h
1082
+ assert_kind_of Hash, json
1083
+ assert_equal fixture["id"], json[:id]
1084
+ assert_equal fixture["created_at"], json[:created_at]
1085
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
1086
+ end
1087
+
1088
+ def test_pipes_connected_account_reauthorization_needed_round_trip
1089
+ fixture = {
1090
+ "object" => "event",
1091
+ "id" => "stub",
1092
+ "event" => "pipes.connected_account.reauthorization_needed",
1093
+ "data" => {},
1094
+ "created_at" => "stub",
1095
+ "context" => {}
1096
+ }
1097
+ model = WorkOS::PipesConnectedAccountReauthorizationNeeded.new(fixture.to_json)
1098
+ json = model.to_h
1099
+ assert_kind_of Hash, json
1100
+ assert_equal fixture["id"], json[:id]
1101
+ assert_equal fixture["created_at"], json[:created_at]
1102
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
1103
+ end
1104
+
1105
+ def test_radar_challenge_created_round_trip
1106
+ fixture = {
1107
+ "object" => "event",
1108
+ "id" => "stub",
1109
+ "event" => "radar.challenge_created",
1110
+ "data" => {},
1111
+ "created_at" => "stub",
1112
+ "context" => {}
1113
+ }
1114
+ model = WorkOS::RadarChallengeCreated.new(fixture.to_json)
1115
+ json = model.to_h
1116
+ assert_kind_of Hash, json
1117
+ assert_equal fixture["id"], json[:id]
1118
+ assert_equal fixture["created_at"], json[:created_at]
1119
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
1120
+ end
1121
+
1122
+ def test_radar_challenge_created_data_round_trip
1123
+ fixture = {
1124
+ "type" => "email",
1125
+ "radar_challenge_id" => "stub",
1126
+ "user_id" => "stub",
1127
+ "email" => "stub"
1128
+ }
1129
+ model = WorkOS::RadarChallengeCreatedData.new(fixture.to_json)
1130
+ json = model.to_h
1131
+ assert_kind_of Hash, json
1132
+ assert_equal fixture["radar_challenge_id"], json[:radar_challenge_id]
1133
+ assert_equal fixture["user_id"], json[:user_id]
1134
+ assert_equal fixture["email"], json[:email]
1135
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
1136
+ end
1137
+
1138
+ def test_resource_export_completed_round_trip
1139
+ fixture = {
1140
+ "object" => "event",
1141
+ "id" => "stub",
1142
+ "event" => "resource_export.completed",
1143
+ "data" => {},
1144
+ "created_at" => "stub",
1145
+ "context" => {}
1146
+ }
1147
+ model = WorkOS::ResourceExportCompleted.new(fixture.to_json)
1148
+ json = model.to_h
1149
+ assert_kind_of Hash, json
1150
+ assert_equal fixture["id"], json[:id]
1151
+ assert_equal fixture["created_at"], json[:created_at]
1152
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
1153
+ end
1154
+
1155
+ def test_resource_export_completed_data_round_trip
1156
+ fixture = {
1157
+ "id" => "stub",
1158
+ "resource_type" => "stub"
1159
+ }
1160
+ model = WorkOS::ResourceExportCompletedData.new(fixture.to_json)
1161
+ json = model.to_h
1162
+ assert_kind_of Hash, json
1163
+ assert_equal fixture["id"], json[:id]
1164
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
1165
+ end
1166
+
1167
+ def test_resource_export_created_round_trip
1168
+ fixture = {
1169
+ "object" => "event",
1170
+ "id" => "stub",
1171
+ "event" => "resource_export.created",
1172
+ "data" => {},
1173
+ "created_at" => "stub",
1174
+ "context" => {}
1175
+ }
1176
+ model = WorkOS::ResourceExportCreated.new(fixture.to_json)
1177
+ json = model.to_h
1178
+ assert_kind_of Hash, json
1179
+ assert_equal fixture["id"], json[:id]
1180
+ assert_equal fixture["created_at"], json[:created_at]
1181
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
1182
+ end
1183
+
1184
+ def test_resource_export_created_data_round_trip
1185
+ fixture = {
1186
+ "id" => "stub",
1187
+ "resource_type" => "stub"
1188
+ }
1189
+ model = WorkOS::ResourceExportCreatedData.new(fixture.to_json)
1190
+ json = model.to_h
1191
+ assert_kind_of Hash, json
1192
+ assert_equal fixture["id"], json[:id]
1193
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
1194
+ end
1195
+
1196
+ def test_resource_export_downloaded_round_trip
1197
+ fixture = {
1198
+ "object" => "event",
1199
+ "id" => "stub",
1200
+ "event" => "resource_export.downloaded",
1201
+ "data" => {},
1202
+ "created_at" => "stub",
1203
+ "context" => {}
1204
+ }
1205
+ model = WorkOS::ResourceExportDownloaded.new(fixture.to_json)
1206
+ json = model.to_h
1207
+ assert_kind_of Hash, json
1208
+ assert_equal fixture["id"], json[:id]
1209
+ assert_equal fixture["created_at"], json[:created_at]
1210
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
1211
+ end
1212
+
1213
+ def test_resource_export_downloaded_data_round_trip
1214
+ fixture = {
1215
+ "id" => "stub",
1216
+ "resource_type" => "stub"
1217
+ }
1218
+ model = WorkOS::ResourceExportDownloadedData.new(fixture.to_json)
1219
+ json = model.to_h
1220
+ assert_kind_of Hash, json
1221
+ assert_equal fixture["id"], json[:id]
1222
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
1223
+ end
1224
+
1225
+ def test_resource_export_failed_round_trip
1226
+ fixture = {
1227
+ "object" => "event",
1228
+ "id" => "stub",
1229
+ "event" => "resource_export.failed",
1230
+ "data" => {},
1231
+ "created_at" => "stub",
1232
+ "context" => {}
1233
+ }
1234
+ model = WorkOS::ResourceExportFailed.new(fixture.to_json)
1235
+ json = model.to_h
1236
+ assert_kind_of Hash, json
1237
+ assert_equal fixture["id"], json[:id]
1238
+ assert_equal fixture["created_at"], json[:created_at]
1239
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
1240
+ end
1241
+
1242
+ def test_resource_export_failed_data_round_trip
1243
+ fixture = {
1244
+ "id" => "stub",
1245
+ "resource_type" => "stub"
1246
+ }
1247
+ model = WorkOS::ResourceExportFailedData.new(fixture.to_json)
1248
+ json = model.to_h
1249
+ assert_kind_of Hash, json
1250
+ assert_equal fixture["id"], json[:id]
1251
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
1252
+ end
1253
+
1254
+ def test_waitlist_user_approved_round_trip
1255
+ fixture = {
1256
+ "object" => "event",
1257
+ "id" => "stub",
1258
+ "event" => "waitlist_user.approved",
1259
+ "data" => {},
1260
+ "created_at" => "stub",
1261
+ "context" => {}
1262
+ }
1263
+ model = WorkOS::WaitlistUserApproved.new(fixture.to_json)
1264
+ json = model.to_h
1265
+ assert_kind_of Hash, json
1266
+ assert_equal fixture["id"], json[:id]
1267
+ assert_equal fixture["created_at"], json[:created_at]
1268
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
1269
+ end
1270
+
1271
+ def test_waitlist_user_created_round_trip
1272
+ fixture = {
1273
+ "object" => "event",
1274
+ "id" => "stub",
1275
+ "event" => "waitlist_user.created",
1276
+ "data" => {},
1277
+ "created_at" => "stub",
1278
+ "context" => {}
1279
+ }
1280
+ model = WorkOS::WaitlistUserCreated.new(fixture.to_json)
1281
+ json = model.to_h
1282
+ assert_kind_of Hash, json
1283
+ assert_equal fixture["id"], json[:id]
1284
+ assert_equal fixture["created_at"], json[:created_at]
1285
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
1286
+ end
1287
+
1288
+ def test_waitlist_user_denied_round_trip
1289
+ fixture = {
1290
+ "object" => "event",
1291
+ "id" => "stub",
1292
+ "event" => "waitlist_user.denied",
1293
+ "data" => {},
1294
+ "created_at" => "stub",
1295
+ "context" => {}
1296
+ }
1297
+ model = WorkOS::WaitlistUserDenied.new(fixture.to_json)
1298
+ json = model.to_h
1299
+ assert_kind_of Hash, json
1300
+ assert_equal fixture["id"], json[:id]
1301
+ assert_equal fixture["created_at"], json[:created_at]
1302
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
1303
+ end
1304
+
1305
+ def test_auth_method_mismatch_error_round_trip
1306
+ fixture = {
1307
+ "code" => "auth_method_mismatch",
1308
+ "message" => "stub"
1309
+ }
1310
+ model = WorkOS::AuthMethodMismatchError.new(fixture.to_json)
1311
+ json = model.to_h
1312
+ assert_kind_of Hash, json
1313
+ assert_equal fixture["message"], json[:message]
1314
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
1315
+ end
1316
+
1317
+ def test_event_list_list_metadata_round_trip
1318
+ fixture = {
1319
+ "after" => nil
1320
+ }
1321
+ model = WorkOS::EventListListMetadata.new(fixture.to_json)
1322
+ json = model.to_h
1323
+ assert_kind_of Hash, json
1324
+ assert_nil json[:after]
1325
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
1326
+ end
1327
+
1328
+ def test_event_context_google_analytics_session_round_trip
1329
+ fixture = {
1330
+ "containerId" => "stub",
1331
+ "sessionId" => "stub",
1332
+ "sessionNumber" => "stub"
1333
+ }
1334
+ model = WorkOS::EventContextGoogleAnalyticsSession.new(fixture.to_json)
1335
+ json = model.to_h
1336
+ assert_kind_of Hash, json
1337
+ assert_equal fixture["containerId"], json[:containerId]
1338
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
1339
+ end
1340
+
78
1341
  def test_authorized_connect_application_list_data_round_trip
79
1342
  fixture = {
80
1343
  "object" => "authorized_connect_application",