workos 10.4.0 → 10.6.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 (558) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/ci.yml +1 -1
  3. data/.github/workflows/docs.yml +2 -2
  4. data/.github/workflows/lint.yml +1 -1
  5. data/.github/workflows/release-please.yml +4 -4
  6. data/.github/workflows/release.yml +1 -1
  7. data/.last-synced-sha +1 -1
  8. data/.oagen-manifest.json +454 -2
  9. data/.release-please-manifest.json +1 -1
  10. data/.ruby-version +1 -1
  11. data/CHANGELOG.md +326 -0
  12. data/Gemfile.lock +2 -2
  13. data/README.md +2 -2
  14. data/lib/workos/admin_portal/generate_link.rb +3 -0
  15. data/lib/workos/admin_portal/revoke_link.rb +22 -0
  16. data/lib/workos/admin_portal.rb +27 -0
  17. data/lib/workos/agents/agent_blueprint.rb +3 -0
  18. data/lib/workos/agents/agent_blueprint_invocable_as.rb +18 -0
  19. data/lib/workos/agents/agent_blueprints_create_request.rb +3 -0
  20. data/lib/workos/agents/agent_blueprints_create_request_invocable_as.rb +18 -0
  21. data/lib/workos/agents/agent_blueprints_update_request.rb +3 -0
  22. data/lib/workos/agents/agent_blueprints_update_request_invocable_as.rb +18 -0
  23. data/lib/workos/agents/agent_registration.rb +3 -0
  24. data/lib/workos/agents/list_metadata.rb +22 -0
  25. data/lib/workos/agents.rb +25 -0
  26. data/lib/workos/api_keys/api_key_data_integration_vended_credential.rb +28 -0
  27. data/lib/workos/authorization/patch_group_role_assignments.rb +22 -0
  28. data/lib/workos/authorization/user_role_assignment_source.rb +5 -2
  29. data/lib/workos/authorization/user_role_assignment_source_group.rb +7 -0
  30. data/lib/workos/authorization.rb +26 -0
  31. data/lib/workos/base_client.rb +3 -0
  32. data/lib/workos/connect/connect_application.rb +3 -0
  33. data/lib/workos/connect/create_oauth_application.rb +3 -0
  34. data/lib/workos/connect/update_oauth_application.rb +5 -2
  35. data/lib/workos/connect.rb +6 -0
  36. data/lib/workos/directory_sync/directory_sync_rate_limit_error.rb +25 -0
  37. data/lib/workos/directory_sync/directory_sync_response.rb +18 -0
  38. data/lib/workos/directory_sync.rb +19 -0
  39. data/lib/workos/events.rb +3 -11
  40. data/lib/workos/feature_flags/flag_created_data.rb +1 -46
  41. data/lib/workos/feature_flags/flag_deleted_data.rb +1 -1
  42. data/lib/workos/feature_flags/flag_rule.rb +49 -0
  43. data/lib/workos/feature_flags/flag_rule_updated_data.rb +1 -1
  44. data/lib/workos/feature_flags/flag_target.rb +52 -0
  45. data/lib/workos/feature_flags/flag_target_with_rule_id.rb +46 -0
  46. data/lib/workos/feature_flags/flag_target_with_value_type.rb +49 -0
  47. data/lib/workos/feature_flags/flag_updated_context_previous_attribute.rb +1 -12
  48. data/lib/workos/feature_flags/flag_updated_context_previous_attribute_data.rb +1 -25
  49. data/lib/workos/feature_flags/flag_updated_context_previous_attribute_data_owner.rb +7 -0
  50. data/lib/workos/feature_flags/flag_updated_data.rb +1 -1
  51. data/lib/workos/groups/patch_group_memberships.rb +22 -0
  52. data/lib/workos/groups.rb +28 -0
  53. data/lib/workos/inflections.rb +30 -0
  54. data/lib/workos/organizations/it_contact_list_list_metadata.rb +22 -0
  55. data/lib/workos/organizations/organization_authentication_methods_required_oauth_error_body.rb +22 -0
  56. data/lib/workos/organizations/organization_connected_account_import_error_body.rb +22 -0
  57. data/lib/workos/organizations/organization_membership_not_found_oauth_error_body.rb +22 -0
  58. data/lib/workos/organizations/organization_not_found_oauth_error_body.rb +22 -0
  59. data/lib/workos/organizations/organization_selection_required_error_body.rb +22 -0
  60. data/lib/workos/organizations/organization_selection_required_error_body_with_organization.rb +7 -0
  61. data/lib/workos/organizations/organization_selection_required_error_body_with_organizations.rb +25 -0
  62. data/lib/workos/pipes/connected_account.rb +11 -2
  63. data/lib/workos/pipes/connected_account_input.rb +6 -0
  64. data/lib/workos/pipes/connected_account_warning.rb +22 -0
  65. data/lib/workos/pipes/create_connected_account.rb +40 -0
  66. data/lib/workos/pipes/create_organization_connected_account.rb +43 -0
  67. data/lib/workos/pipes/data_integration_authorize_url_response.rb +9 -2
  68. data/lib/workos/pipes/data_integration_credentials_response.rb +1 -1
  69. data/lib/workos/pipes/data_integration_finish_connection_response.rb +18 -0
  70. data/lib/workos/pipes/{data_integration_credentials_response_credential.rb → data_integration_vended_credential.rb} +9 -3
  71. data/lib/workos/pipes/data_integrations_create_api_key_connection_request.rb +37 -0
  72. data/lib/workos/pipes/data_integrations_create_client_credentials_connection_request.rb +43 -0
  73. data/lib/workos/pipes/data_integrations_finish_connection_request.rb +25 -0
  74. data/lib/workos/pipes/data_integrations_get_data_integration_authorize_url_request.rb +17 -2
  75. data/lib/workos/pipes/data_integrations_list_response_data_connected_account.rb +10 -1
  76. data/lib/workos/pipes/data_integrations_list_response_data_connected_account_warning.rb +7 -0
  77. data/lib/workos/pipes/data_integrations_upsert_api_key_request.rb +14 -5
  78. data/lib/workos/pipes/data_integrations_upsert_client_credentials_request.rb +14 -5
  79. data/lib/workos/pipes/organization_connected_account.rb +40 -0
  80. data/lib/workos/pipes.rb +216 -20
  81. data/lib/workos/shared/access_denied_oauth_error_body.rb +22 -0
  82. data/lib/workos/shared/account_selection_required_error_body.rb +7 -0
  83. data/lib/workos/shared/agent_blueprint_created_data.rb +3 -0
  84. data/lib/workos/shared/agent_blueprint_created_data_invocable_as.rb +18 -0
  85. data/lib/workos/shared/agent_blueprint_updated_data.rb +40 -1
  86. data/lib/workos/shared/agent_blueprint_updated_data_invocable_as.rb +18 -0
  87. data/lib/workos/shared/already_claimed_error_body.rb +22 -0
  88. data/lib/workos/shared/application_consent_required_error_body.rb +22 -0
  89. data/lib/workos/shared/auth_method_mismatch_error_body.rb +7 -0
  90. data/lib/workos/shared/authorization_pending_oauth_error_body.rb +22 -0
  91. data/lib/workos/shared/authorization_url_not_found_error_body.rb +22 -0
  92. data/lib/workos/shared/authorization_url_request_error_body.rb +22 -0
  93. data/lib/workos/shared/client_credentials_data_integration_vended_credential.rb +40 -0
  94. data/lib/workos/shared/code_challenge_not_found_error_body.rb +22 -0
  95. data/lib/workos/shared/connect_application_oauth.rb +3 -0
  96. data/lib/workos/shared/connected_account_limit_reached_error_body.rb +22 -0
  97. data/lib/workos/shared/daily_quota_exceeded_error_body.rb +22 -0
  98. data/lib/workos/shared/data_integration_access_token_response_with_access_token.rb +22 -0
  99. data/lib/workos/shared/data_integration_access_token_response_with_access_token_access_token.rb +7 -0
  100. data/lib/workos/shared/data_integration_access_token_response_with_error.rb +22 -0
  101. data/lib/workos/shared/data_integration_credentials_response_with_credential.rb +22 -0
  102. data/lib/workos/shared/data_integration_credentials_response_with_error.rb +22 -0
  103. data/lib/workos/shared/entity_not_found_error_body.rb +22 -0
  104. data/lib/workos/shared/error_body.rb +7 -0
  105. data/lib/workos/shared/error_body_with_code.rb +7 -0
  106. data/lib/workos/shared/error_body_with_code_errors.rb +25 -0
  107. data/lib/workos/shared/error_body_with_code_field_error.rb +22 -0
  108. data/lib/workos/shared/error_body_with_code_field_errors.rb +22 -0
  109. data/lib/workos/shared/error_body_with_code_instance_path_error.rb +18 -0
  110. data/lib/workos/shared/error_body_with_code_instance_path_errors.rb +25 -0
  111. data/lib/workos/shared/error_body_with_code_status_code.rb +25 -0
  112. data/lib/workos/shared/error_body_with_constraints_property_error.rb +22 -0
  113. data/lib/workos/shared/error_body_with_constraints_property_errors.rb +22 -0
  114. data/lib/workos/shared/error_body_with_error.rb +22 -0
  115. data/lib/workos/shared/error_body_with_error_message_list.rb +22 -0
  116. data/lib/workos/shared/error_body_with_message_or_message_list.rb +18 -0
  117. data/lib/workos/shared/expired_token_oauth_error_body.rb +22 -0
  118. data/lib/workos/shared/external_auth_session_already_completed_error_body.rb +22 -0
  119. data/lib/workos/shared/external_id_already_used_error_body.rb +22 -0
  120. data/lib/workos/shared/extra_attributes_required_oauth_error_body.rb +22 -0
  121. data/lib/workos/shared/feature_flags_flag_created.rb +34 -0
  122. data/lib/workos/shared/feature_flags_flag_created_context.rb +22 -0
  123. data/lib/workos/shared/feature_flags_flag_created_context_actor.rb +25 -0
  124. data/lib/workos/shared/feature_flags_flag_created_data.rb +52 -0
  125. data/lib/workos/shared/feature_flags_flag_created_data_owner.rb +7 -0
  126. data/lib/workos/shared/feature_flags_flag_deleted.rb +34 -0
  127. data/lib/workos/shared/feature_flags_flag_deleted_context.rb +22 -0
  128. data/lib/workos/shared/feature_flags_flag_deleted_context_actor.rb +25 -0
  129. data/lib/workos/shared/feature_flags_flag_deleted_data.rb +7 -0
  130. data/lib/workos/shared/feature_flags_flag_deleted_data_owner.rb +7 -0
  131. data/lib/workos/shared/feature_flags_flag_rule_created.rb +34 -0
  132. data/lib/workos/shared/feature_flags_flag_rule_created_context.rb +22 -0
  133. data/lib/workos/shared/feature_flags_flag_rule_created_context_actor.rb +25 -0
  134. data/lib/workos/shared/feature_flags_flag_rule_deleted.rb +34 -0
  135. data/lib/workos/shared/feature_flags_flag_rule_deleted_context.rb +22 -0
  136. data/lib/workos/shared/feature_flags_flag_rule_deleted_context_actor.rb +25 -0
  137. data/lib/workos/shared/feature_flags_flag_rule_updated.rb +34 -0
  138. data/lib/workos/shared/feature_flags_flag_rule_updated_context.rb +25 -0
  139. data/lib/workos/shared/feature_flags_flag_rule_updated_context_actor.rb +25 -0
  140. data/lib/workos/shared/feature_flags_flag_rule_updated_context_previous_attribute.rb +18 -0
  141. data/lib/workos/shared/feature_flags_flag_rule_updated_context_previous_attribute_data.rb +18 -0
  142. data/lib/workos/shared/feature_flags_flag_target_created.rb +34 -0
  143. data/lib/workos/shared/feature_flags_flag_target_created_context.rb +22 -0
  144. data/lib/workos/shared/feature_flags_flag_target_created_context_actor.rb +25 -0
  145. data/lib/workos/shared/feature_flags_flag_target_deleted.rb +34 -0
  146. data/lib/workos/shared/feature_flags_flag_target_deleted_context.rb +22 -0
  147. data/lib/workos/shared/feature_flags_flag_target_deleted_context_actor.rb +25 -0
  148. data/lib/workos/shared/feature_flags_flag_updated.rb +34 -0
  149. data/lib/workos/shared/feature_flags_flag_updated_context.rb +25 -0
  150. data/lib/workos/shared/feature_flags_flag_updated_context_actor.rb +25 -0
  151. data/lib/workos/shared/feature_flags_flag_updated_context_previous_attribute.rb +18 -0
  152. data/lib/workos/shared/feature_flags_flag_updated_context_previous_attribute_data.rb +34 -0
  153. data/lib/workos/shared/feature_flags_flag_updated_context_previous_attribute_data_owner.rb +7 -0
  154. data/lib/workos/shared/feature_flags_flag_updated_data.rb +7 -0
  155. data/lib/workos/shared/feature_flags_flag_updated_data_owner.rb +7 -0
  156. data/lib/workos/shared/idp_metadata_fetch_failed_error_body.rb +22 -0
  157. data/lib/workos/shared/invalid_client_oauth_error_body.rb +22 -0
  158. data/lib/workos/shared/invalid_connection_oauth_error_body.rb +22 -0
  159. data/lib/workos/shared/invalid_credentials_error_body.rb +22 -0
  160. data/lib/workos/shared/invalid_email_error_body.rb +22 -0
  161. data/lib/workos/shared/invalid_grant_oauth_error_body.rb +22 -0
  162. data/lib/workos/shared/invalid_idp_sso_url_error_body.rb +22 -0
  163. data/lib/workos/shared/invalid_link_authorization_code_oauth_error_body.rb +22 -0
  164. data/lib/workos/shared/invalid_locale_error_body.rb +22 -0
  165. data/lib/workos/shared/invalid_metadata_error_body.rb +22 -0
  166. data/lib/workos/shared/invalid_one_time_code_error_body.rb +22 -0
  167. data/lib/workos/shared/invalid_organization_id_error_body.rb +22 -0
  168. data/lib/workos/shared/invalid_password_hash_error_body.rb +22 -0
  169. data/lib/workos/shared/invalid_pending_authentication_token_error_body.rb +22 -0
  170. data/lib/workos/shared/invalid_profile_oauth_error_body.rb +22 -0
  171. data/lib/workos/shared/invalid_refresh_token_error_body.rb +22 -0
  172. data/lib/workos/shared/invalid_request_oauth_error_body.rb +22 -0
  173. data/lib/workos/shared/invalid_request_parameters_error_body.rb +22 -0
  174. data/lib/workos/shared/invalid_request_parameters_error_body_with_errors.rb +25 -0
  175. data/lib/workos/shared/invalid_role_error_body.rb +22 -0
  176. data/lib/workos/shared/invalid_url_error_body.rb +22 -0
  177. data/lib/workos/shared/mfa_challenge_error_body.rb +22 -0
  178. data/lib/workos/shared/mfa_enrollment_error_body.rb +22 -0
  179. data/lib/workos/shared/mfa_enrollment_oauth_error_body.rb +22 -0
  180. data/lib/workos/shared/multiple_roles_not_enabled_error_body.rb +22 -0
  181. data/lib/workos/shared/must_use_sso_for_selected_organization_message_error_body.rb +18 -0
  182. data/lib/workos/shared/oauth_data_integration_vended_credential.rb +40 -0
  183. data/lib/workos/shared/oauth_error_body.rb +22 -0
  184. data/lib/workos/shared/one_time_code_expired_error_body.rb +22 -0
  185. data/lib/workos/shared/one_time_code_previously_used_error_body.rb +22 -0
  186. data/lib/workos/shared/one_time_code_too_many_attempts_error_body.rb +22 -0
  187. data/lib/workos/shared/passkey_progressive_enrollment_error_body.rb +22 -0
  188. data/lib/workos/shared/phone_number_required_error_body.rb +22 -0
  189. data/lib/workos/shared/pipe_connected_account.rb +6 -0
  190. data/lib/workos/shared/pkce_not_supported_oauth_error_body.rb +22 -0
  191. data/lib/workos/shared/policy_denied_error_body.rb +22 -0
  192. data/lib/workos/shared/radar_challenge_error_body.rb +22 -0
  193. data/lib/workos/shared/radar_sign_up_challenge_error_body.rb +22 -0
  194. data/lib/workos/shared/radar_sms_sign_in_challenge_error_body.rb +22 -0
  195. data/lib/workos/shared/rate_limit_exceeded_error_body_with_retry_after.rb +25 -0
  196. data/lib/workos/shared/sign_up_not_allowed_oauth_error_body.rb +22 -0
  197. data/lib/workos/shared/slow_down_oauth_error_body.rb +22 -0
  198. data/lib/workos/shared/sms_challenge_quota_reached_error_body.rb +22 -0
  199. data/lib/workos/shared/sms_challenge_rate_limited_error_body.rb +22 -0
  200. data/lib/workos/shared/sso_required_oauth_error_body_with_connection_ids_list_email_pending_authentication_token.rb +31 -0
  201. data/lib/workos/shared/sub_resource_scoped_role_not_allowed_error_body_with_role_slug.rb +25 -0
  202. data/lib/workos/shared/token_too_big_oauth_error_body.rb +22 -0
  203. data/lib/workos/shared/too_many_failed_verification_attempts_error_body_with_retry_after.rb +25 -0
  204. data/lib/workos/shared/too_many_requests_oauth_error_body.rb +22 -0
  205. data/lib/workos/shared/unauthorized_client_oauth_error_body.rb +22 -0
  206. data/lib/workos/shared/unauthorized_error_body.rb +18 -0
  207. data/lib/workos/shared/update_audit_logs_retention_with_retention_period.rb +18 -0
  208. data/lib/workos/shared/update_audit_logs_retention_with_retention_period_in_days.rb +26 -0
  209. data/lib/workos/shared/update_user_organization_membership_with_role_slug.rb +18 -0
  210. data/lib/workos/shared/update_user_organization_membership_with_role_slugs.rb +18 -0
  211. data/lib/workos/shared/verification_id_required_error_body.rb +22 -0
  212. data/lib/workos/sso/connection_could_not_be_verified_error_body.rb +22 -0
  213. data/lib/workos/sso/connection_creation_conflict_error_body.rb +22 -0
  214. data/lib/workos/sso/connection_creation_not_found_error_body.rb +22 -0
  215. data/lib/workos/sso/connection_finish_error_body.rb +22 -0
  216. data/lib/workos/sso/connection_type_not_updatable_error_body.rb +22 -0
  217. data/lib/workos/sso/token_query.rb +3 -0
  218. data/lib/workos/sso.rb +3 -0
  219. data/lib/workos/types/agent_blueprint_created_data_invocable_as_instance_types.rb +13 -0
  220. data/lib/workos/types/agent_blueprint_invocable_as_instance_types.rb +9 -0
  221. data/lib/workos/types/agent_blueprint_updated_data_invocable_as_instance_types.rb +9 -0
  222. data/lib/workos/types/agent_blueprints_create_request_invocable_as_instance_types.rb +9 -0
  223. data/lib/workos/types/agent_blueprints_update_request_invocable_as_instance_types.rb +9 -0
  224. data/lib/workos/types/agent_instance_created_data_type.rb +1 -5
  225. data/lib/workos/types/agent_instance_deleted_data_type.rb +1 -1
  226. data/lib/workos/types/agent_instance_type.rb +1 -1
  227. data/lib/workos/types/authorization_url_not_found_error_body_code.rb +14 -0
  228. data/lib/workos/types/authorization_url_request_error_body_code.rb +14 -0
  229. data/lib/workos/types/connection_creation_conflict_error_body_code.rb +13 -0
  230. data/lib/workos/types/connection_creation_not_found_error_body_code.rb +13 -0
  231. data/lib/workos/types/connection_finish_error_body_code.rb +29 -0
  232. data/lib/workos/types/create_connected_account_state.rb +9 -0
  233. data/lib/workos/types/create_magic_code_and_return_locale.rb +101 -0
  234. data/lib/workos/types/create_organization_connected_account_state.rb +9 -0
  235. data/lib/workos/types/create_password_reset_token_locale.rb +9 -0
  236. data/lib/workos/types/create_user_invite_options_locale.rb +1 -93
  237. data/lib/workos/types/create_webhook_endpoint_events.rb +9 -1
  238. data/lib/workos/types/data_integration_access_token_response_with_error_error.rb +9 -0
  239. data/lib/workos/types/data_integration_credentials_response_with_error_error.rb +9 -0
  240. data/lib/workos/types/data_integrations_create_api_key_connection_request_connection_owner.rb +9 -0
  241. data/lib/workos/types/data_integrations_create_client_credentials_connection_request_connection_owner.rb +9 -0
  242. data/lib/workos/types/data_integrations_get_data_integration_authorize_url_request_connection_intent.rb +13 -0
  243. data/lib/workos/types/error_body_code.rb +183 -0
  244. data/lib/workos/types/feature_flags_flag_created_context_actor_source.rb +9 -0
  245. data/lib/workos/types/feature_flags_flag_deleted_context_actor_source.rb +9 -0
  246. data/lib/workos/types/feature_flags_flag_rule_created_context_actor_source.rb +9 -0
  247. data/lib/workos/types/feature_flags_flag_rule_deleted_context_actor_source.rb +9 -0
  248. data/lib/workos/types/feature_flags_flag_rule_updated_context_actor_source.rb +9 -0
  249. data/lib/workos/types/feature_flags_flag_target_created_context_actor_source.rb +9 -0
  250. data/lib/workos/types/feature_flags_flag_target_deleted_context_actor_source.rb +9 -0
  251. data/lib/workos/types/feature_flags_flag_updated_context_actor_source.rb +9 -0
  252. data/lib/workos/types/organization_connected_account_import_error_body_code.rb +14 -0
  253. data/lib/workos/types/organization_connected_account_state.rb +9 -0
  254. data/lib/workos/types/resend_user_invite_options_locale.rb +1 -1
  255. data/lib/workos/types/resource_export_completed_data_resource_type.rb +4 -1
  256. data/lib/workos/types/send_email_change_locale.rb +9 -0
  257. data/lib/workos/types/send_verification_email_locale.rb +9 -0
  258. data/lib/workos/types/update_audit_logs_retention_with_retention_period_retention_period.rb +9 -0
  259. data/lib/workos/types/user_connected_account_import_error_body_code.rb +15 -0
  260. data/lib/workos/types/vault_dek_rekeyed_data_actor_source.rb +9 -0
  261. data/lib/workos/types/widget_session_token_scopes.rb +3 -1
  262. data/lib/workos/user_management/action_denied_error_body.rb +22 -0
  263. data/lib/workos/user_management/authentication_method_not_allowed_error_body.rb +22 -0
  264. data/lib/workos/user_management/authentication_method_not_allowed_oauth_error_body.rb +22 -0
  265. data/lib/workos/user_management/create_magic_code_and_return.rb +5 -2
  266. data/lib/workos/user_management/create_password_reset_token.rb +16 -1
  267. data/lib/workos/user_management/email_already_in_use_error_body.rb +22 -0
  268. data/lib/workos/user_management/email_already_verified_error_body.rb +22 -0
  269. data/lib/workos/user_management/email_change_not_allowed_error_body.rb +22 -0
  270. data/lib/workos/user_management/email_completion_required_error_body_with_email_completion_token.rb +25 -0
  271. data/lib/workos/user_management/email_domain_not_deliverable_error_body.rb +22 -0
  272. data/lib/workos/user_management/email_not_available_error_body.rb +22 -0
  273. data/lib/workos/user_management/email_password_auth_disabled_error_body.rb +22 -0
  274. data/lib/workos/user_management/email_verification_required_error_body.rb +22 -0
  275. data/lib/workos/user_management/invitation_cannot_be_used_for_email_oauth_error_body.rb +22 -0
  276. data/lib/workos/user_management/invitation_invalid_oauth_error_body.rb +22 -0
  277. data/lib/workos/user_management/password_and_password_hash_provided_error_body.rb +22 -0
  278. data/lib/workos/user_management/password_and_password_hash_type_provided_error_body.rb +22 -0
  279. data/lib/workos/user_management/password_salt_position_requires_password_hash_error_body.rb +22 -0
  280. data/lib/workos/user_management/password_strength_error_error_body_with_errors.rb +25 -0
  281. data/lib/workos/user_management/send_email_change.rb +6 -2
  282. data/lib/workos/user_management/send_verification_email.rb +18 -0
  283. data/lib/workos/user_management/user_connected_account_import_error_body.rb +22 -0
  284. data/lib/workos/user_management/user_consent_options_not_supported_error_body.rb +22 -0
  285. data/lib/workos/user_management/user_creation_error_error_body_with_errors.rb +25 -0
  286. data/lib/workos/user_management/user_mismatch_error_body.rb +22 -0
  287. data/lib/workos/user_management/waitlist_list_response.rb +25 -0
  288. data/lib/workos/user_management/waitlist_list_response_list_metadata.rb +7 -0
  289. data/lib/workos/user_management.rb +26 -11
  290. data/lib/workos/vault/vault_dek_rekeyed.rb +34 -0
  291. data/lib/workos/vault/vault_dek_rekeyed_data.rb +31 -0
  292. data/lib/workos/version.rb +1 -1
  293. data/rbi/workos/access_denied_oauth_error_body.rbi +30 -0
  294. data/rbi/workos/account_selection_required_error_body.rbi +30 -0
  295. data/rbi/workos/action_denied_error_body.rbi +30 -0
  296. data/rbi/workos/admin_portal.rbi +11 -1
  297. data/rbi/workos/agent_blueprint.rbi +6 -0
  298. data/rbi/workos/agent_blueprint_created_data.rbi +6 -0
  299. data/rbi/workos/agent_blueprint_created_data_invocable_as.rbi +24 -0
  300. data/rbi/workos/agent_blueprint_invocable_as.rbi +24 -0
  301. data/rbi/workos/agent_blueprint_updated_data.rbi +6 -0
  302. data/rbi/workos/agent_blueprint_updated_data_invocable_as.rbi +24 -0
  303. data/rbi/workos/agent_blueprints_create_request.rbi +6 -0
  304. data/rbi/workos/agent_blueprints_create_request_invocable_as.rbi +24 -0
  305. data/rbi/workos/agent_blueprints_update_request.rbi +6 -0
  306. data/rbi/workos/agent_blueprints_update_request_invocable_as.rbi +24 -0
  307. data/rbi/workos/agent_registration.rbi +6 -0
  308. data/rbi/workos/agents.rbi +29 -19
  309. data/rbi/workos/already_claimed_error_body.rbi +30 -0
  310. data/rbi/workos/api_key_data_integration_vended_credential.rbi +42 -0
  311. data/rbi/workos/api_keys.rbi +5 -5
  312. data/rbi/workos/application_consent_required_error_body.rbi +30 -0
  313. data/rbi/workos/audit_logs.rbi +10 -10
  314. data/rbi/workos/auth_method_mismatch_error_body.rbi +30 -0
  315. data/rbi/workos/authentication_method_not_allowed_error_body.rbi +30 -0
  316. data/rbi/workos/authentication_method_not_allowed_oauth_error_body.rbi +30 -0
  317. data/rbi/workos/authorization.rbi +55 -45
  318. data/rbi/workos/authorization_pending_oauth_error_body.rbi +30 -0
  319. data/rbi/workos/authorization_url_not_found_error_body.rbi +30 -0
  320. data/rbi/workos/authorization_url_request_error_body.rbi +30 -0
  321. data/rbi/workos/client_api.rbi +1 -1
  322. data/rbi/workos/client_credentials_data_integration_vended_credential.rbi +66 -0
  323. data/rbi/workos/code_challenge_not_found_error_body.rbi +30 -0
  324. data/rbi/workos/connect.rbi +12 -10
  325. data/rbi/workos/connect_application_oauth.rbi +6 -0
  326. data/rbi/workos/connected_account.rbi +18 -0
  327. data/rbi/workos/connected_account_input.rbi +12 -0
  328. data/rbi/workos/connected_account_limit_reached_error_body.rbi +30 -0
  329. data/rbi/workos/connected_account_warning.rbi +30 -0
  330. data/rbi/workos/connection_could_not_be_verified_error_body.rbi +30 -0
  331. data/rbi/workos/connection_creation_conflict_error_body.rbi +30 -0
  332. data/rbi/workos/connection_creation_not_found_error_body.rbi +30 -0
  333. data/rbi/workos/connection_finish_error_body.rbi +30 -0
  334. data/rbi/workos/connection_type_not_updatable_error_body.rbi +30 -0
  335. data/rbi/workos/create_connected_account.rbi +66 -0
  336. data/rbi/workos/create_magic_code_and_return.rbi +6 -0
  337. data/rbi/workos/create_oauth_application.rbi +6 -0
  338. data/rbi/workos/create_organization_connected_account.rbi +72 -0
  339. data/rbi/workos/create_password_reset_token.rbi +6 -0
  340. data/rbi/workos/daily_quota_exceeded_error_body.rbi +30 -0
  341. data/rbi/workos/data_integration_access_token_response_with_access_token.rbi +30 -0
  342. data/rbi/workos/{data_integration_credentials_response_credential.rbi → data_integration_access_token_response_with_access_token_access_token.rbi} +3 -9
  343. data/rbi/workos/data_integration_access_token_response_with_error.rbi +30 -0
  344. data/rbi/workos/data_integration_authorize_url_response.rbi +12 -0
  345. data/rbi/workos/data_integration_credentials_response.rbi +2 -2
  346. data/rbi/workos/data_integration_credentials_response_with_credential.rbi +30 -0
  347. data/rbi/workos/data_integration_credentials_response_with_error.rbi +30 -0
  348. data/rbi/workos/data_integration_finish_connection_response.rbi +24 -0
  349. data/rbi/workos/data_integration_vended_credential.rbi +66 -0
  350. data/rbi/workos/data_integrations_create_api_key_connection_request.rbi +60 -0
  351. data/rbi/workos/data_integrations_create_client_credentials_connection_request.rbi +72 -0
  352. data/rbi/workos/data_integrations_finish_connection_request.rbi +36 -0
  353. data/rbi/workos/data_integrations_get_data_integration_authorize_url_request.rbi +30 -0
  354. data/rbi/workos/data_integrations_list_response_data_connected_account.rbi +18 -0
  355. data/rbi/workos/data_integrations_list_response_data_connected_account_warning.rbi +30 -0
  356. data/rbi/workos/data_integrations_upsert_api_key_request.rbi +24 -6
  357. data/rbi/workos/data_integrations_upsert_client_credentials_request.rbi +24 -6
  358. data/rbi/workos/directory_sync.rbi +15 -7
  359. data/rbi/workos/directory_sync_rate_limit_error.rbi +36 -0
  360. data/rbi/workos/directory_sync_response.rbi +24 -0
  361. data/rbi/workos/email_already_in_use_error_body.rbi +30 -0
  362. data/rbi/workos/email_already_verified_error_body.rbi +30 -0
  363. data/rbi/workos/email_change_not_allowed_error_body.rbi +30 -0
  364. data/rbi/workos/email_completion_required_error_body_with_email_completion_token.rbi +36 -0
  365. data/rbi/workos/email_domain_not_deliverable_error_body.rbi +30 -0
  366. data/rbi/workos/email_not_available_error_body.rbi +30 -0
  367. data/rbi/workos/email_password_auth_disabled_error_body.rbi +30 -0
  368. data/rbi/workos/email_verification_required_error_body.rbi +30 -0
  369. data/rbi/workos/entity_not_found_error_body.rbi +30 -0
  370. data/rbi/workos/error_body.rbi +24 -0
  371. data/rbi/workos/error_body_with_code.rbi +30 -0
  372. data/rbi/workos/error_body_with_code_errors.rbi +36 -0
  373. data/rbi/workos/error_body_with_code_field_error.rbi +30 -0
  374. data/rbi/workos/error_body_with_code_field_errors.rbi +30 -0
  375. data/rbi/workos/error_body_with_code_instance_path_error.rbi +24 -0
  376. data/rbi/workos/error_body_with_code_instance_path_errors.rbi +36 -0
  377. data/rbi/workos/error_body_with_code_status_code.rbi +36 -0
  378. data/rbi/workos/error_body_with_constraints_property_error.rbi +30 -0
  379. data/rbi/workos/error_body_with_constraints_property_errors.rbi +30 -0
  380. data/rbi/workos/error_body_with_error.rbi +30 -0
  381. data/rbi/workos/error_body_with_error_message_list.rbi +30 -0
  382. data/rbi/workos/error_body_with_message_or_message_list.rbi +24 -0
  383. data/rbi/workos/events.rbi +1 -3
  384. data/rbi/workos/expired_token_oauth_error_body.rbi +30 -0
  385. data/rbi/workos/external_auth_session_already_completed_error_body.rbi +30 -0
  386. data/rbi/workos/external_id_already_used_error_body.rbi +30 -0
  387. data/rbi/workos/extra_attributes_required_oauth_error_body.rbi +30 -0
  388. data/rbi/workos/feature_flags.rbi +8 -8
  389. data/rbi/workos/feature_flags_flag_created.rbi +54 -0
  390. data/rbi/workos/feature_flags_flag_created_context.rbi +30 -0
  391. data/rbi/workos/feature_flags_flag_created_context_actor.rbi +36 -0
  392. data/rbi/workos/feature_flags_flag_created_data.rbi +90 -0
  393. data/rbi/workos/feature_flags_flag_created_data_owner.rbi +36 -0
  394. data/rbi/workos/feature_flags_flag_deleted.rbi +54 -0
  395. data/rbi/workos/feature_flags_flag_deleted_context.rbi +30 -0
  396. data/rbi/workos/feature_flags_flag_deleted_context_actor.rbi +36 -0
  397. data/rbi/workos/feature_flags_flag_deleted_data.rbi +90 -0
  398. data/rbi/workos/feature_flags_flag_deleted_data_owner.rbi +36 -0
  399. data/rbi/workos/feature_flags_flag_rule_created.rbi +54 -0
  400. data/rbi/workos/feature_flags_flag_rule_created_context.rbi +30 -0
  401. data/rbi/workos/feature_flags_flag_rule_created_context_actor.rbi +36 -0
  402. data/rbi/workos/feature_flags_flag_rule_deleted.rbi +54 -0
  403. data/rbi/workos/feature_flags_flag_rule_deleted_context.rbi +30 -0
  404. data/rbi/workos/feature_flags_flag_rule_deleted_context_actor.rbi +36 -0
  405. data/rbi/workos/feature_flags_flag_rule_updated.rbi +54 -0
  406. data/rbi/workos/feature_flags_flag_rule_updated_context.rbi +36 -0
  407. data/rbi/workos/feature_flags_flag_rule_updated_context_actor.rbi +36 -0
  408. data/rbi/workos/feature_flags_flag_rule_updated_context_previous_attribute.rbi +24 -0
  409. data/rbi/workos/feature_flags_flag_rule_updated_context_previous_attribute_data.rbi +24 -0
  410. data/rbi/workos/feature_flags_flag_target_created.rbi +54 -0
  411. data/rbi/workos/feature_flags_flag_target_created_context.rbi +30 -0
  412. data/rbi/workos/feature_flags_flag_target_created_context_actor.rbi +36 -0
  413. data/rbi/workos/feature_flags_flag_target_deleted.rbi +54 -0
  414. data/rbi/workos/feature_flags_flag_target_deleted_context.rbi +30 -0
  415. data/rbi/workos/feature_flags_flag_target_deleted_context_actor.rbi +36 -0
  416. data/rbi/workos/feature_flags_flag_updated.rbi +54 -0
  417. data/rbi/workos/feature_flags_flag_updated_context.rbi +36 -0
  418. data/rbi/workos/feature_flags_flag_updated_context_actor.rbi +36 -0
  419. data/rbi/workos/feature_flags_flag_updated_context_previous_attribute.rbi +24 -0
  420. data/rbi/workos/feature_flags_flag_updated_context_previous_attribute_data.rbi +54 -0
  421. data/rbi/workos/feature_flags_flag_updated_context_previous_attribute_data_owner.rbi +36 -0
  422. data/rbi/workos/feature_flags_flag_updated_data.rbi +90 -0
  423. data/rbi/workos/feature_flags_flag_updated_data_owner.rbi +36 -0
  424. data/rbi/workos/flag_rule.rbi +84 -0
  425. data/rbi/workos/flag_target.rbi +90 -0
  426. data/rbi/workos/flag_target_with_rule_id.rbi +78 -0
  427. data/rbi/workos/flag_target_with_value_type.rbi +84 -0
  428. data/rbi/workos/flag_updated_context_previous_attribute_data.rbi +6 -0
  429. data/rbi/workos/flag_updated_context_previous_attribute_data_owner.rbi +36 -0
  430. data/rbi/workos/generate_link.rbi +6 -0
  431. data/rbi/workos/group_role_assignment_list.rbi +36 -0
  432. data/rbi/workos/groups.rbi +19 -8
  433. data/rbi/workos/idp_metadata_fetch_failed_error_body.rbi +30 -0
  434. data/rbi/workos/invalid_client_oauth_error_body.rbi +30 -0
  435. data/rbi/workos/invalid_connection_oauth_error_body.rbi +30 -0
  436. data/rbi/workos/invalid_credentials_error_body.rbi +30 -0
  437. data/rbi/workos/invalid_email_error_body.rbi +30 -0
  438. data/rbi/workos/invalid_grant_oauth_error_body.rbi +30 -0
  439. data/rbi/workos/invalid_idp_sso_url_error_body.rbi +30 -0
  440. data/rbi/workos/invalid_link_authorization_code_oauth_error_body.rbi +30 -0
  441. data/rbi/workos/invalid_locale_error_body.rbi +30 -0
  442. data/rbi/workos/invalid_metadata_error_body.rbi +30 -0
  443. data/rbi/workos/invalid_one_time_code_error_body.rbi +30 -0
  444. data/rbi/workos/invalid_organization_id_error_body.rbi +30 -0
  445. data/rbi/workos/invalid_password_hash_error_body.rbi +30 -0
  446. data/rbi/workos/invalid_pending_authentication_token_error_body.rbi +30 -0
  447. data/rbi/workos/invalid_profile_oauth_error_body.rbi +30 -0
  448. data/rbi/workos/invalid_refresh_token_error_body.rbi +30 -0
  449. data/rbi/workos/invalid_request_oauth_error_body.rbi +30 -0
  450. data/rbi/workos/invalid_request_parameters_error_body.rbi +30 -0
  451. data/rbi/workos/invalid_request_parameters_error_body_with_errors.rbi +36 -0
  452. data/rbi/workos/invalid_role_error_body.rbi +30 -0
  453. data/rbi/workos/invalid_url_error_body.rbi +30 -0
  454. data/rbi/workos/invitation_cannot_be_used_for_email_oauth_error_body.rbi +30 -0
  455. data/rbi/workos/invitation_invalid_oauth_error_body.rbi +30 -0
  456. data/rbi/workos/it_contact_list.rbi +36 -0
  457. data/rbi/workos/it_contact_list_list_metadata.rbi +30 -0
  458. data/rbi/workos/list_metadata.rbi +30 -0
  459. data/rbi/workos/mfa_challenge_error_body.rbi +30 -0
  460. data/rbi/workos/mfa_enrollment_error_body.rbi +30 -0
  461. data/rbi/workos/mfa_enrollment_oauth_error_body.rbi +30 -0
  462. data/rbi/workos/multi_factor_auth.rbi +7 -7
  463. data/rbi/workos/multiple_roles_not_enabled_error_body.rbi +30 -0
  464. data/rbi/workos/must_use_sso_for_selected_organization_message_error_body.rbi +24 -0
  465. data/rbi/workos/oauth_data_integration_vended_credential.rbi +66 -0
  466. data/rbi/workos/oauth_error_body.rbi +30 -0
  467. data/rbi/workos/one_time_code_expired_error_body.rbi +30 -0
  468. data/rbi/workos/one_time_code_previously_used_error_body.rbi +30 -0
  469. data/rbi/workos/one_time_code_too_many_attempts_error_body.rbi +30 -0
  470. data/rbi/workos/organization_authentication_methods_required_oauth_error_body.rbi +30 -0
  471. data/rbi/workos/organization_connected_account.rbi +66 -0
  472. data/rbi/workos/organization_connected_account_import_error_body.rbi +30 -0
  473. data/rbi/workos/organization_domains.rbi +4 -4
  474. data/rbi/workos/organization_membership_not_found_oauth_error_body.rbi +30 -0
  475. data/rbi/workos/organization_membership_service.rbi +8 -8
  476. data/rbi/workos/organization_not_found_oauth_error_body.rbi +30 -0
  477. data/rbi/workos/organization_selection_required_error_body.rbi +30 -0
  478. data/rbi/workos/organization_selection_required_error_body_with_organization.rbi +30 -0
  479. data/rbi/workos/organization_selection_required_error_body_with_organizations.rbi +36 -0
  480. data/rbi/workos/organizations.rbi +13 -13
  481. data/rbi/workos/passkey_progressive_enrollment_error_body.rbi +30 -0
  482. data/rbi/workos/password_and_password_hash_provided_error_body.rbi +30 -0
  483. data/rbi/workos/password_and_password_hash_type_provided_error_body.rbi +30 -0
  484. data/rbi/workos/password_salt_position_requires_password_hash_error_body.rbi +30 -0
  485. data/rbi/workos/password_strength_error_error_body_with_errors.rbi +36 -0
  486. data/rbi/workos/patch_group_memberships.rbi +30 -0
  487. data/rbi/workos/patch_group_role_assignments.rbi +30 -0
  488. data/rbi/workos/phone_number_required_error_body.rbi +30 -0
  489. data/rbi/workos/pipe_connected_account.rbi +12 -0
  490. data/rbi/workos/pipes.rbi +92 -25
  491. data/rbi/workos/pipes_provider.rbi +2 -2
  492. data/rbi/workos/pkce_not_supported_oauth_error_body.rbi +30 -0
  493. data/rbi/workos/platform_teams.rbi +2 -2
  494. data/rbi/workos/policy_denied_error_body.rbi +30 -0
  495. data/rbi/workos/radar.rbi +4 -4
  496. data/rbi/workos/radar_challenge_error_body.rbi +30 -0
  497. data/rbi/workos/radar_sign_up_challenge_error_body.rbi +30 -0
  498. data/rbi/workos/radar_sms_sign_in_challenge_error_body.rbi +30 -0
  499. data/rbi/workos/rate_limit_exceeded_error_body_with_retry_after.rbi +36 -0
  500. data/rbi/workos/revoke_link.rbi +30 -0
  501. data/rbi/workos/send_email_change.rbi +6 -0
  502. data/rbi/workos/send_verification_email.rbi +24 -0
  503. data/rbi/workos/sign_up_not_allowed_oauth_error_body.rbi +30 -0
  504. data/rbi/workos/slow_down_oauth_error_body.rbi +30 -0
  505. data/rbi/workos/sms_challenge_quota_reached_error_body.rbi +30 -0
  506. data/rbi/workos/sms_challenge_rate_limited_error_body.rbi +30 -0
  507. data/rbi/workos/sso.rbi +19 -18
  508. data/rbi/workos/sso_required_oauth_error_body_with_connection_ids_list_email_pending_authentication_token.rbi +48 -0
  509. data/rbi/workos/sub_resource_scoped_role_not_allowed_error_body_with_role_slug.rbi +36 -0
  510. data/rbi/workos/token_query.rbi +6 -0
  511. data/rbi/workos/token_too_big_oauth_error_body.rbi +30 -0
  512. data/rbi/workos/too_many_failed_verification_attempts_error_body_with_retry_after.rbi +36 -0
  513. data/rbi/workos/too_many_requests_oauth_error_body.rbi +30 -0
  514. data/rbi/workos/unauthorized_client_oauth_error_body.rbi +30 -0
  515. data/rbi/workos/unauthorized_error_body.rbi +24 -0
  516. data/rbi/workos/update_audit_logs_retention_with_retention_period.rbi +24 -0
  517. data/rbi/workos/update_audit_logs_retention_with_retention_period_in_days.rbi +24 -0
  518. data/rbi/workos/update_oauth_application.rbi +6 -0
  519. data/rbi/workos/update_user_organization_membership_with_role_slug.rbi +24 -0
  520. data/rbi/workos/update_user_organization_membership_with_role_slugs.rbi +24 -0
  521. data/rbi/workos/user_connected_account_import_error_body.rbi +30 -0
  522. data/rbi/workos/user_consent_options_not_supported_error_body.rbi +30 -0
  523. data/rbi/workos/user_creation_error_error_body_with_errors.rbi +36 -0
  524. data/rbi/workos/user_management.rbi +77 -61
  525. data/rbi/workos/user_mismatch_error_body.rbi +30 -0
  526. data/rbi/workos/user_role_assignment_source.rbi +6 -0
  527. data/rbi/workos/user_role_assignment_source_group.rbi +30 -0
  528. data/rbi/workos/vault.rbi +11 -11
  529. data/rbi/workos/vault_dek_rekeyed.rbi +54 -0
  530. data/rbi/workos/vault_dek_rekeyed_data.rbi +48 -0
  531. data/rbi/workos/verification_id_required_error_body.rbi +30 -0
  532. data/rbi/workos/version_list_response.rbi +30 -0
  533. data/rbi/workos/waitlist_list_response.rbi +36 -0
  534. data/rbi/workos/waitlist_list_response_list_metadata.rbi +30 -0
  535. data/rbi/workos/webhooks.rbi +4 -4
  536. data/rbi/workos/widgets.rbi +1 -1
  537. data/test/workos/test_admin_portal.rb +9 -1
  538. data/test/workos/test_admin_portal_model_round_trip.rb +14 -0
  539. data/test/workos/test_agents.rb +8 -0
  540. data/test/workos/test_agents_model_round_trip.rb +46 -0
  541. data/test/workos/test_api_keys_model_round_trip.rb +14 -0
  542. data/test/workos/test_authorization.rb +8 -0
  543. data/test/workos/test_authorization_model_round_trip.rb +38 -1
  544. data/test/workos/test_base_client.rb +4 -3
  545. data/test/workos/test_connect_model_round_trip.rb +3 -1
  546. data/test/workos/test_directory_sync.rb +8 -0
  547. data/test/workos/test_directory_sync_model_round_trip.rb +24 -0
  548. data/test/workos/test_feature_flags_model_round_trip.rb +123 -0
  549. data/test/workos/test_groups.rb +8 -0
  550. data/test/workos/test_groups_model_round_trip.rb +11 -0
  551. data/test/workos/test_organizations_model_round_trip.rb +111 -0
  552. data/test/workos/test_pipes.rb +28 -4
  553. data/test/workos/test_pipes_model_round_trip.rb +214 -51
  554. data/test/workos/test_shared_model_round_trip.rb +2066 -423
  555. data/test/workos/test_sso_model_round_trip.rb +61 -0
  556. data/test/workos/test_user_management_model_round_trip.rb +297 -3
  557. data/test/workos/test_vault_model_round_trip.rb +63 -0
  558. metadata +423 -3
@@ -5,231 +5,1811 @@
5
5
  require "test_helper"
6
6
 
7
7
  class SharedModelRoundTripTest < Minitest::Test
8
+ def test_update_audit_logs_retention_with_retention_period_round_trip
9
+ fixture = {
10
+ "retention_period" => "stub"
11
+ }
12
+ model = WorkOS::UpdateAuditLogsRetentionWithRetentionPeriod.new(fixture.to_json)
13
+ json = model.to_h
14
+ assert_kind_of Hash, json
15
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
16
+ end
17
+
18
+ def test_update_audit_logs_retention_with_retention_period_in_days_round_trip
19
+ fixture = {
20
+ "retention_period_in_days" => 1
21
+ }
22
+ model = WorkOS::UpdateAuditLogsRetentionWithRetentionPeriodInDays.new(fixture.to_json)
23
+ json = model.to_h
24
+ assert_kind_of Hash, json
25
+ assert_equal fixture["retention_period_in_days"], json[:retention_period_in_days]
26
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
27
+ end
28
+
29
+ def test_update_user_organization_membership_with_role_slug_round_trip
30
+ fixture = {
31
+ "role_slug" => "stub"
32
+ }
33
+ model = WorkOS::UpdateUserOrganizationMembershipWithRoleSlug.new(fixture.to_json)
34
+ json = model.to_h
35
+ assert_kind_of Hash, json
36
+ assert_equal fixture["role_slug"], json[:role_slug]
37
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
38
+ end
39
+
40
+ def test_update_user_organization_membership_with_role_slugs_round_trip
41
+ fixture = {
42
+ "role_slugs" => []
43
+ }
44
+ model = WorkOS::UpdateUserOrganizationMembershipWithRoleSlugs.new(fixture.to_json)
45
+ json = model.to_h
46
+ assert_kind_of Hash, json
47
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
48
+ end
49
+
50
+ def test_error_body_with_code_round_trip
51
+ fixture = {
52
+ "code" => "stub",
53
+ "message" => "stub"
54
+ }
55
+ model = WorkOS::ErrorBodyWithCode.new(fixture.to_json)
56
+ json = model.to_h
57
+ assert_kind_of Hash, json
58
+ assert_equal fixture["code"], json[:code]
59
+ assert_equal fixture["message"], json[:message]
60
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
61
+ end
62
+
63
+ def test_error_body_with_error_round_trip
64
+ fixture = {
65
+ "error" => "stub",
66
+ "message" => "stub"
67
+ }
68
+ model = WorkOS::ErrorBodyWithError.new(fixture.to_json)
69
+ json = model.to_h
70
+ assert_kind_of Hash, json
71
+ assert_equal fixture["error"], json[:error]
72
+ assert_equal fixture["message"], json[:message]
73
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
74
+ end
75
+
76
+ def test_error_body_round_trip
77
+ fixture = {
78
+ "message" => "stub"
79
+ }
80
+ model = WorkOS::ErrorBody.new(fixture.to_json)
81
+ json = model.to_h
82
+ assert_kind_of Hash, json
83
+ assert_equal fixture["message"], json[:message]
84
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
85
+ end
86
+
87
+ def test_error_body_with_code_field_errors_round_trip
88
+ fixture = {
89
+ "message" => "stub",
90
+ "errors" => []
91
+ }
92
+ model = WorkOS::ErrorBodyWithCodeFieldErrors.new(fixture.to_json)
93
+ json = model.to_h
94
+ assert_kind_of Hash, json
95
+ assert_equal fixture["message"], json[:message]
96
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
97
+ end
98
+
99
+ def test_error_body_with_code_field_error_round_trip
100
+ fixture = {
101
+ "code" => "stub",
102
+ "field" => "stub"
103
+ }
104
+ model = WorkOS::ErrorBodyWithCodeFieldError.new(fixture.to_json)
105
+ json = model.to_h
106
+ assert_kind_of Hash, json
107
+ assert_equal fixture["code"], json[:code]
108
+ assert_equal fixture["field"], json[:field]
109
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
110
+ end
111
+
112
+ def test_error_body_with_code_instance_path_errors_round_trip
113
+ fixture = {
114
+ "errors" => [],
115
+ "message" => "stub",
116
+ "code" => "stub"
117
+ }
118
+ model = WorkOS::ErrorBodyWithCodeInstancePathErrors.new(fixture.to_json)
119
+ json = model.to_h
120
+ assert_kind_of Hash, json
121
+ assert_equal fixture["message"], json[:message]
122
+ assert_equal fixture["code"], json[:code]
123
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
124
+ end
125
+
126
+ def test_error_body_with_code_instance_path_error_round_trip
127
+ fixture = {
128
+ "instancePath" => "stub"
129
+ }
130
+ model = WorkOS::ErrorBodyWithCodeInstancePathError.new(fixture.to_json)
131
+ json = model.to_h
132
+ assert_kind_of Hash, json
133
+ assert_equal fixture["instancePath"], json[:instancePath]
134
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
135
+ end
136
+
137
+ def test_error_body_with_error_message_list_round_trip
138
+ fixture = {
139
+ "message" => [],
140
+ "error" => "stub"
141
+ }
142
+ model = WorkOS::ErrorBodyWithErrorMessageList.new(fixture.to_json)
143
+ json = model.to_h
144
+ assert_kind_of Hash, json
145
+ assert_equal fixture["error"], json[:error]
146
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
147
+ end
148
+
149
+ def test_too_many_failed_verification_attempts_error_body_with_retry_after_round_trip
150
+ fixture = {
151
+ "code" => "too_many_failed_verification_attempts",
152
+ "message" => "stub",
153
+ "retry_after" => 1
154
+ }
155
+ model = WorkOS::TooManyFailedVerificationAttemptsErrorBodyWithRetryAfter.new(fixture.to_json)
156
+ json = model.to_h
157
+ assert_kind_of Hash, json
158
+ assert_equal fixture["message"], json[:message]
159
+ assert_equal fixture["retry_after"], json[:retry_after]
160
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
161
+ end
162
+
163
+ def test_rate_limit_exceeded_error_body_with_retry_after_round_trip
164
+ fixture = {
165
+ "code" => "rate_limit_exceeded",
166
+ "message" => "stub",
167
+ "retry_after" => 1.0
168
+ }
169
+ model = WorkOS::RateLimitExceededErrorBodyWithRetryAfter.new(fixture.to_json)
170
+ json = model.to_h
171
+ assert_kind_of Hash, json
172
+ assert_equal fixture["message"], json[:message]
173
+ assert_equal fixture["retry_after"], json[:retry_after]
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_error_body_with_constraints_property_errors_round_trip
178
+ fixture = {
179
+ "message" => "stub",
180
+ "errors" => []
181
+ }
182
+ model = WorkOS::ErrorBodyWithConstraintsPropertyErrors.new(fixture.to_json)
183
+ json = model.to_h
184
+ assert_kind_of Hash, json
185
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
186
+ end
187
+
188
+ def test_error_body_with_constraints_property_error_round_trip
189
+ fixture = {
190
+ "property" => "stub",
191
+ "constraints" => {}
192
+ }
193
+ model = WorkOS::ErrorBodyWithConstraintsPropertyError.new(fixture.to_json)
194
+ json = model.to_h
195
+ assert_kind_of Hash, json
196
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
197
+ end
198
+
199
+ def test_error_body_with_code_status_code_round_trip
200
+ fixture = {
201
+ "message" => "stub",
202
+ "code" => "stub",
203
+ "statusCode" => 1.0
204
+ }
205
+ model = WorkOS::ErrorBodyWithCodeStatusCode.new(fixture.to_json)
206
+ json = model.to_h
207
+ assert_kind_of Hash, json
208
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
209
+ end
210
+
211
+ def test_error_body_with_message_or_message_list_round_trip
212
+ fixture = {
213
+ "message" => "stub"
214
+ }
215
+ model = WorkOS::ErrorBodyWithMessageOrMessageList.new(fixture.to_json)
216
+ json = model.to_h
217
+ assert_kind_of Hash, json
218
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
219
+ end
220
+
221
+ def test_authorization_url_request_error_body_round_trip
222
+ fixture = {
223
+ "code" => "stub",
224
+ "message" => "stub"
225
+ }
226
+ model = WorkOS::AuthorizationUrlRequestErrorBody.new(fixture.to_json)
227
+ json = model.to_h
228
+ assert_kind_of Hash, json
229
+ assert_equal fixture["message"], json[:message]
230
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
231
+ end
232
+
233
+ def test_authorization_url_not_found_error_body_round_trip
234
+ fixture = {
235
+ "code" => "stub",
236
+ "message" => "stub"
237
+ }
238
+ model = WorkOS::AuthorizationUrlNotFoundErrorBody.new(fixture.to_json)
239
+ json = model.to_h
240
+ assert_kind_of Hash, json
241
+ assert_equal fixture["message"], json[:message]
242
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
243
+ end
244
+
245
+ def test_auth_method_mismatch_error_body_round_trip
246
+ fixture = {
247
+ "code" => "auth_method_mismatch",
248
+ "message" => "stub"
249
+ }
250
+ model = WorkOS::AuthMethodMismatchErrorBody.new(fixture.to_json)
251
+ json = model.to_h
252
+ assert_kind_of Hash, json
253
+ assert_equal fixture["message"], json[:message]
254
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
255
+ end
256
+
257
+ def test_account_selection_required_error_body_round_trip
258
+ fixture = {
259
+ "code" => "account_selection_required",
260
+ "message" => "stub"
261
+ }
262
+ model = WorkOS::AccountSelectionRequiredErrorBody.new(fixture.to_json)
263
+ json = model.to_h
264
+ assert_kind_of Hash, json
265
+ assert_equal fixture["message"], json[:message]
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_error_body_with_code_errors_round_trip
270
+ fixture = {
271
+ "code" => "stub",
272
+ "message" => "stub",
273
+ "errors" => []
274
+ }
275
+ model = WorkOS::ErrorBodyWithCodeErrors.new(fixture.to_json)
276
+ json = model.to_h
277
+ assert_kind_of Hash, json
278
+ assert_equal fixture["message"], json[:message]
279
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
280
+ end
281
+
282
+ def test_oauth_error_body_round_trip
283
+ fixture = {
284
+ "error" => "stub",
285
+ "error_description" => "stub"
286
+ }
287
+ model = WorkOS::OAuthErrorBody.new(fixture.to_json)
288
+ json = model.to_h
289
+ assert_kind_of Hash, json
290
+ assert_equal fixture["error"], json[:error]
291
+ assert_equal fixture["error_description"], json[:error_description]
292
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
293
+ end
294
+
295
+ def test_sub_resource_scoped_role_not_allowed_error_body_with_role_slug_round_trip
296
+ fixture = {
297
+ "message" => "stub",
298
+ "code" => "sub_resource_scoped_role_not_allowed",
299
+ "role_slug" => "stub"
300
+ }
301
+ model = WorkOS::SubResourceScopedRoleNotAllowedErrorBodyWithRoleSlug.new(fixture.to_json)
302
+ json = model.to_h
303
+ assert_kind_of Hash, json
304
+ assert_equal fixture["message"], json[:message]
305
+ assert_equal fixture["role_slug"], json[:role_slug]
306
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
307
+ end
308
+
309
+ def test_unauthorized_error_body_round_trip
310
+ fixture = {
311
+ "error" => "Unauthorized"
312
+ }
313
+ model = WorkOS::UnauthorizedErrorBody.new(fixture.to_json)
314
+ json = model.to_h
315
+ assert_kind_of Hash, json
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_external_auth_session_already_completed_error_body_round_trip
320
+ fixture = {
321
+ "code" => "external_auth_session_already_completed",
322
+ "message" => "stub"
323
+ }
324
+ model = WorkOS::ExternalAuthSessionAlreadyCompletedErrorBody.new(fixture.to_json)
325
+ json = model.to_h
326
+ assert_kind_of Hash, json
327
+ assert_equal fixture["message"], json[:message]
328
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
329
+ end
330
+
331
+ def test_invalid_email_error_body_round_trip
332
+ fixture = {
333
+ "code" => "invalid_email",
334
+ "message" => "stub"
335
+ }
336
+ model = WorkOS::InvalidEmailErrorBody.new(fixture.to_json)
337
+ json = model.to_h
338
+ assert_kind_of Hash, json
339
+ assert_equal fixture["message"], json[:message]
340
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
341
+ end
342
+
343
+ def test_already_claimed_error_body_round_trip
344
+ fixture = {
345
+ "code" => "already_claimed",
346
+ "message" => "stub"
347
+ }
348
+ model = WorkOS::AlreadyClaimedErrorBody.new(fixture.to_json)
349
+ json = model.to_h
350
+ assert_kind_of Hash, json
351
+ assert_equal fixture["message"], json[:message]
352
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
353
+ end
354
+
355
+ def test_sms_challenge_rate_limited_error_body_round_trip
356
+ fixture = {
357
+ "code" => "sms_challenge_rate_limited",
358
+ "message" => "stub"
359
+ }
360
+ model = WorkOS::SmsChallengeRateLimitedErrorBody.new(fixture.to_json)
361
+ json = model.to_h
362
+ assert_kind_of Hash, json
363
+ assert_equal fixture["message"], json[:message]
364
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
365
+ end
366
+
367
+ def test_sms_challenge_quota_reached_error_body_round_trip
368
+ fixture = {
369
+ "code" => "sms_challenge_quota_reached",
370
+ "message" => "stub"
371
+ }
372
+ model = WorkOS::SmsChallengeQuotaReachedErrorBody.new(fixture.to_json)
373
+ json = model.to_h
374
+ assert_kind_of Hash, json
375
+ assert_equal fixture["message"], json[:message]
376
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
377
+ end
378
+
379
+ def test_idp_metadata_fetch_failed_error_body_round_trip
380
+ fixture = {
381
+ "code" => "idp_metadata_fetch_failed",
382
+ "message" => "stub"
383
+ }
384
+ model = WorkOS::IdpMetadataFetchFailedErrorBody.new(fixture.to_json)
385
+ json = model.to_h
386
+ assert_kind_of Hash, json
387
+ assert_equal fixture["message"], json[:message]
388
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
389
+ end
390
+
391
+ def test_invalid_idp_sso_url_error_body_round_trip
392
+ fixture = {
393
+ "code" => "invalid_idp_sso_url",
394
+ "message" => "stub"
395
+ }
396
+ model = WorkOS::InvalidIdpSSOUrlErrorBody.new(fixture.to_json)
397
+ json = model.to_h
398
+ assert_kind_of Hash, json
399
+ assert_equal fixture["message"], json[:message]
400
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
401
+ end
402
+
403
+ def test_connected_account_limit_reached_error_body_round_trip
404
+ fixture = {
405
+ "code" => "connected_account_limit_reached",
406
+ "message" => "stub"
407
+ }
408
+ model = WorkOS::ConnectedAccountLimitReachedErrorBody.new(fixture.to_json)
409
+ json = model.to_h
410
+ assert_kind_of Hash, json
411
+ assert_equal fixture["message"], json[:message]
412
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
413
+ end
414
+
415
+ def test_entity_not_found_error_body_round_trip
416
+ fixture = {
417
+ "code" => "entity_not_found",
418
+ "message" => "stub"
419
+ }
420
+ model = WorkOS::EntityNotFoundErrorBody.new(fixture.to_json)
421
+ json = model.to_h
422
+ assert_kind_of Hash, json
423
+ assert_equal fixture["message"], json[:message]
424
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
425
+ end
426
+
427
+ def test_invalid_request_parameters_error_body_with_errors_round_trip
428
+ fixture = {
429
+ "code" => "invalid_request_parameters",
430
+ "message" => "stub",
431
+ "errors" => []
432
+ }
433
+ model = WorkOS::InvalidRequestParametersErrorBodyWithErrors.new(fixture.to_json)
434
+ json = model.to_h
435
+ assert_kind_of Hash, json
436
+ assert_equal fixture["message"], json[:message]
437
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
438
+ end
439
+
440
+ def test_invalid_refresh_token_error_body_round_trip
441
+ fixture = {
442
+ "code" => "invalid_refresh_token",
443
+ "message" => "stub"
444
+ }
445
+ model = WorkOS::InvalidRefreshTokenErrorBody.new(fixture.to_json)
446
+ json = model.to_h
447
+ assert_kind_of Hash, json
448
+ assert_equal fixture["message"], json[:message]
449
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
450
+ end
451
+
452
+ def test_sign_up_not_allowed_oauth_error_body_round_trip
453
+ fixture = {
454
+ "error" => "sign_up_not_allowed",
455
+ "error_description" => "stub"
456
+ }
457
+ model = WorkOS::SignUpNotAllowedOAuthErrorBody.new(fixture.to_json)
458
+ json = model.to_h
459
+ assert_kind_of Hash, json
460
+ assert_equal fixture["error_description"], json[:error_description]
461
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
462
+ end
463
+
464
+ def test_invalid_request_parameters_error_body_round_trip
465
+ fixture = {
466
+ "code" => "invalid_request_parameters",
467
+ "message" => "stub"
468
+ }
469
+ model = WorkOS::InvalidRequestParametersErrorBody.new(fixture.to_json)
470
+ json = model.to_h
471
+ assert_kind_of Hash, json
472
+ assert_equal fixture["message"], json[:message]
473
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
474
+ end
475
+
476
+ def test_invalid_role_error_body_round_trip
477
+ fixture = {
478
+ "code" => "invalid_role",
479
+ "message" => "stub"
480
+ }
481
+ model = WorkOS::InvalidRoleErrorBody.new(fixture.to_json)
482
+ json = model.to_h
483
+ assert_kind_of Hash, json
484
+ assert_equal fixture["message"], json[:message]
485
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
486
+ end
487
+
488
+ def test_multiple_roles_not_enabled_error_body_round_trip
489
+ fixture = {
490
+ "code" => "multiple_roles_not_enabled",
491
+ "message" => "stub"
492
+ }
493
+ model = WorkOS::MultipleRolesNotEnabledErrorBody.new(fixture.to_json)
494
+ json = model.to_h
495
+ assert_kind_of Hash, json
496
+ assert_equal fixture["message"], json[:message]
497
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
498
+ end
499
+
500
+ def test_invalid_password_hash_error_body_round_trip
501
+ fixture = {
502
+ "code" => "invalid_password_hash",
503
+ "message" => "stub"
504
+ }
505
+ model = WorkOS::InvalidPasswordHashErrorBody.new(fixture.to_json)
506
+ json = model.to_h
507
+ assert_kind_of Hash, json
508
+ assert_equal fixture["message"], json[:message]
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_invalid_metadata_error_body_round_trip
513
+ fixture = {
514
+ "code" => "invalid_metadata",
515
+ "message" => "stub"
516
+ }
517
+ model = WorkOS::InvalidMetadataErrorBody.new(fixture.to_json)
518
+ json = model.to_h
519
+ assert_kind_of Hash, json
520
+ assert_equal fixture["message"], json[:message]
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_external_id_already_used_error_body_round_trip
525
+ fixture = {
526
+ "code" => "external_id_already_used",
527
+ "message" => "stub"
528
+ }
529
+ model = WorkOS::ExternalIdAlreadyUsedErrorBody.new(fixture.to_json)
530
+ json = model.to_h
531
+ assert_kind_of Hash, json
532
+ assert_equal fixture["message"], json[:message]
533
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
534
+ end
535
+
536
+ def test_invalid_locale_error_body_round_trip
537
+ fixture = {
538
+ "code" => "invalid_locale",
539
+ "message" => "stub"
540
+ }
541
+ model = WorkOS::InvalidLocaleErrorBody.new(fixture.to_json)
542
+ json = model.to_h
543
+ assert_kind_of Hash, json
544
+ assert_equal fixture["message"], json[:message]
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_invalid_organization_id_error_body_round_trip
549
+ fixture = {
550
+ "code" => "invalid_organization_id",
551
+ "message" => "stub"
552
+ }
553
+ model = WorkOS::InvalidOrganizationIdErrorBody.new(fixture.to_json)
554
+ json = model.to_h
555
+ assert_kind_of Hash, json
556
+ assert_equal fixture["message"], json[:message]
557
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
558
+ end
559
+
560
+ def test_code_challenge_not_found_error_body_round_trip
561
+ fixture = {
562
+ "code" => "code_challenge_not_found",
563
+ "message" => "stub"
564
+ }
565
+ model = WorkOS::CodeChallengeNotFoundErrorBody.new(fixture.to_json)
566
+ json = model.to_h
567
+ assert_kind_of Hash, json
568
+ assert_equal fixture["message"], json[:message]
569
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
570
+ end
571
+
572
+ def test_invalid_credentials_error_body_round_trip
573
+ fixture = {
574
+ "code" => "invalid_credentials",
575
+ "message" => "stub"
576
+ }
577
+ model = WorkOS::InvalidCredentialsErrorBody.new(fixture.to_json)
578
+ json = model.to_h
579
+ assert_kind_of Hash, json
580
+ assert_equal fixture["message"], json[:message]
581
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
582
+ end
583
+
584
+ def test_invalid_one_time_code_error_body_round_trip
585
+ fixture = {
586
+ "code" => "invalid_one_time_code",
587
+ "message" => "stub"
588
+ }
589
+ model = WorkOS::InvalidOneTimeCodeErrorBody.new(fixture.to_json)
590
+ json = model.to_h
591
+ assert_kind_of Hash, json
592
+ assert_equal fixture["message"], json[:message]
593
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
594
+ end
595
+
596
+ def test_one_time_code_previously_used_error_body_round_trip
597
+ fixture = {
598
+ "code" => "one_time_code_previously_used",
599
+ "message" => "stub"
600
+ }
601
+ model = WorkOS::OneTimeCodePreviouslyUsedErrorBody.new(fixture.to_json)
602
+ json = model.to_h
603
+ assert_kind_of Hash, json
604
+ assert_equal fixture["message"], json[:message]
605
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
606
+ end
607
+
608
+ def test_one_time_code_expired_error_body_round_trip
609
+ fixture = {
610
+ "code" => "one_time_code_expired",
611
+ "message" => "stub"
612
+ }
613
+ model = WorkOS::OneTimeCodeExpiredErrorBody.new(fixture.to_json)
614
+ json = model.to_h
615
+ assert_kind_of Hash, json
616
+ assert_equal fixture["message"], json[:message]
617
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
618
+ end
619
+
620
+ def test_one_time_code_too_many_attempts_error_body_round_trip
621
+ fixture = {
622
+ "code" => "one_time_code_too_many_attempts",
623
+ "message" => "stub"
624
+ }
625
+ model = WorkOS::OneTimeCodeTooManyAttemptsErrorBody.new(fixture.to_json)
626
+ json = model.to_h
627
+ assert_kind_of Hash, json
628
+ assert_equal fixture["message"], json[:message]
629
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
630
+ end
631
+
632
+ def test_invalid_pending_authentication_token_error_body_round_trip
633
+ fixture = {
634
+ "code" => "invalid_pending_authentication_token",
635
+ "message" => "stub"
636
+ }
637
+ model = WorkOS::InvalidPendingAuthenticationTokenErrorBody.new(fixture.to_json)
638
+ json = model.to_h
639
+ assert_kind_of Hash, json
640
+ assert_equal fixture["message"], json[:message]
641
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
642
+ end
643
+
644
+ def test_phone_number_required_error_body_round_trip
645
+ fixture = {
646
+ "code" => "phone_number_required",
647
+ "message" => "stub"
648
+ }
649
+ model = WorkOS::PhoneNumberRequiredErrorBody.new(fixture.to_json)
650
+ json = model.to_h
651
+ assert_kind_of Hash, json
652
+ assert_equal fixture["message"], json[:message]
653
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
654
+ end
655
+
656
+ def test_verification_id_required_error_body_round_trip
657
+ fixture = {
658
+ "code" => "verification_id_required",
659
+ "message" => "stub"
660
+ }
661
+ model = WorkOS::VerificationIdRequiredErrorBody.new(fixture.to_json)
662
+ json = model.to_h
663
+ assert_kind_of Hash, json
664
+ assert_equal fixture["message"], json[:message]
665
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
666
+ end
667
+
668
+ def test_invalid_client_oauth_error_body_round_trip
669
+ fixture = {
670
+ "error" => "invalid_client",
671
+ "error_description" => "stub"
672
+ }
673
+ model = WorkOS::InvalidClientOAuthErrorBody.new(fixture.to_json)
674
+ json = model.to_h
675
+ assert_kind_of Hash, json
676
+ assert_equal fixture["error_description"], json[:error_description]
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_unauthorized_client_oauth_error_body_round_trip
681
+ fixture = {
682
+ "error" => "unauthorized_client",
683
+ "error_description" => "stub"
684
+ }
685
+ model = WorkOS::UnauthorizedClientOAuthErrorBody.new(fixture.to_json)
686
+ json = model.to_h
687
+ assert_kind_of Hash, json
688
+ assert_equal fixture["error_description"], json[:error_description]
689
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
690
+ end
691
+
692
+ def test_invalid_profile_oauth_error_body_round_trip
693
+ fixture = {
694
+ "error" => "invalid_profile",
695
+ "error_description" => "stub"
696
+ }
697
+ model = WorkOS::InvalidProfileOAuthErrorBody.new(fixture.to_json)
698
+ json = model.to_h
699
+ assert_kind_of Hash, json
700
+ assert_equal fixture["error_description"], json[:error_description]
701
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
702
+ end
703
+
704
+ def test_invalid_connection_oauth_error_body_round_trip
705
+ fixture = {
706
+ "error" => "invalid_connection",
707
+ "error_description" => "stub"
708
+ }
709
+ model = WorkOS::InvalidConnectionOAuthErrorBody.new(fixture.to_json)
710
+ json = model.to_h
711
+ assert_kind_of Hash, json
712
+ assert_equal fixture["error_description"], json[:error_description]
713
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
714
+ end
715
+
716
+ def test_invalid_link_authorization_code_oauth_error_body_round_trip
717
+ fixture = {
718
+ "error" => "invalid_link_authorization_code",
719
+ "error_description" => "stub"
720
+ }
721
+ model = WorkOS::InvalidLinkAuthorizationCodeOAuthErrorBody.new(fixture.to_json)
722
+ json = model.to_h
723
+ assert_kind_of Hash, json
724
+ assert_equal fixture["error_description"], json[:error_description]
725
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
726
+ end
727
+
728
+ def test_extra_attributes_required_oauth_error_body_round_trip
729
+ fixture = {
730
+ "error" => "extra_attributes_required",
731
+ "error_description" => "stub"
732
+ }
733
+ model = WorkOS::ExtraAttributesRequiredOAuthErrorBody.new(fixture.to_json)
734
+ json = model.to_h
735
+ assert_kind_of Hash, json
736
+ assert_equal fixture["error_description"], json[:error_description]
737
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
738
+ end
739
+
740
+ def test_pkce_not_supported_oauth_error_body_round_trip
741
+ fixture = {
742
+ "error" => "pkce_not_supported",
743
+ "error_description" => "stub"
744
+ }
745
+ model = WorkOS::PkceNotSupportedOAuthErrorBody.new(fixture.to_json)
746
+ json = model.to_h
747
+ assert_kind_of Hash, json
748
+ assert_equal fixture["error_description"], json[:error_description]
749
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
750
+ end
751
+
752
+ def test_expired_token_oauth_error_body_round_trip
753
+ fixture = {
754
+ "error" => "expired_token",
755
+ "error_description" => "stub"
756
+ }
757
+ model = WorkOS::ExpiredTokenOAuthErrorBody.new(fixture.to_json)
758
+ json = model.to_h
759
+ assert_kind_of Hash, json
760
+ assert_equal fixture["error_description"], json[:error_description]
761
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
762
+ end
763
+
764
+ def test_authorization_pending_oauth_error_body_round_trip
765
+ fixture = {
766
+ "error" => "authorization_pending",
767
+ "error_description" => "stub"
768
+ }
769
+ model = WorkOS::AuthorizationPendingOAuthErrorBody.new(fixture.to_json)
770
+ json = model.to_h
771
+ assert_kind_of Hash, json
772
+ assert_equal fixture["error_description"], json[:error_description]
773
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
774
+ end
775
+
776
+ def test_access_denied_oauth_error_body_round_trip
777
+ fixture = {
778
+ "error" => "access_denied",
779
+ "error_description" => "stub"
780
+ }
781
+ model = WorkOS::AccessDeniedOAuthErrorBody.new(fixture.to_json)
782
+ json = model.to_h
783
+ assert_kind_of Hash, json
784
+ assert_equal fixture["error_description"], json[:error_description]
785
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
786
+ end
787
+
788
+ def test_slow_down_oauth_error_body_round_trip
789
+ fixture = {
790
+ "error" => "slow_down",
791
+ "error_description" => "stub"
792
+ }
793
+ model = WorkOS::SlowDownOAuthErrorBody.new(fixture.to_json)
794
+ json = model.to_h
795
+ assert_kind_of Hash, json
796
+ assert_equal fixture["error_description"], json[:error_description]
797
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
798
+ end
799
+
800
+ def test_must_use_sso_for_selected_organization_message_error_body_round_trip
801
+ fixture = {
802
+ "message" => "Must use SSO for selected organization"
803
+ }
804
+ model = WorkOS::MustUseSSOForSelectedOrganizationMessageErrorBody.new(fixture.to_json)
805
+ json = model.to_h
806
+ assert_kind_of Hash, json
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_invalid_grant_oauth_error_body_round_trip
811
+ fixture = {
812
+ "error" => "invalid_grant",
813
+ "error_description" => "stub"
814
+ }
815
+ model = WorkOS::InvalidGrantOAuthErrorBody.new(fixture.to_json)
816
+ json = model.to_h
817
+ assert_kind_of Hash, json
818
+ assert_equal fixture["error_description"], json[:error_description]
819
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
820
+ end
821
+
822
+ def test_invalid_request_oauth_error_body_round_trip
823
+ fixture = {
824
+ "error" => "invalid_request",
825
+ "error_description" => "stub"
826
+ }
827
+ model = WorkOS::InvalidRequestOAuthErrorBody.new(fixture.to_json)
828
+ json = model.to_h
829
+ assert_kind_of Hash, json
830
+ assert_equal fixture["error_description"], json[:error_description]
831
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
832
+ end
833
+
834
+ def test_mfa_enrollment_oauth_error_body_round_trip
835
+ fixture = {
836
+ "error" => "mfa_enrollment",
837
+ "error_description" => "stub"
838
+ }
839
+ model = WorkOS::MFAEnrollmentOAuthErrorBody.new(fixture.to_json)
840
+ json = model.to_h
841
+ assert_kind_of Hash, json
842
+ assert_equal fixture["error_description"], json[:error_description]
843
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
844
+ end
845
+
846
+ def test_token_too_big_oauth_error_body_round_trip
847
+ fixture = {
848
+ "error" => "token_too_big",
849
+ "error_description" => "stub"
850
+ }
851
+ model = WorkOS::TokenTooBigOAuthErrorBody.new(fixture.to_json)
852
+ json = model.to_h
853
+ assert_kind_of Hash, json
854
+ assert_equal fixture["error_description"], json[:error_description]
855
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
856
+ end
857
+
858
+ def test_mfa_enrollment_error_body_round_trip
859
+ fixture = {
860
+ "code" => "mfa_enrollment",
861
+ "message" => "stub"
862
+ }
863
+ model = WorkOS::MFAEnrollmentErrorBody.new(fixture.to_json)
864
+ json = model.to_h
865
+ assert_kind_of Hash, json
866
+ assert_equal fixture["message"], json[:message]
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_mfa_challenge_error_body_round_trip
871
+ fixture = {
872
+ "code" => "mfa_challenge",
873
+ "message" => "stub"
874
+ }
875
+ model = WorkOS::MFAChallengeErrorBody.new(fixture.to_json)
876
+ json = model.to_h
877
+ assert_kind_of Hash, json
878
+ assert_equal fixture["message"], json[:message]
879
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
880
+ end
881
+
882
+ def test_passkey_progressive_enrollment_error_body_round_trip
883
+ fixture = {
884
+ "code" => "passkey_progressive_enrollment",
885
+ "message" => "stub"
886
+ }
887
+ model = WorkOS::PasskeyProgressiveEnrollmentErrorBody.new(fixture.to_json)
888
+ json = model.to_h
889
+ assert_kind_of Hash, json
890
+ assert_equal fixture["message"], json[:message]
891
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
892
+ end
893
+
894
+ def test_radar_challenge_error_body_round_trip
895
+ fixture = {
896
+ "code" => "radar_challenge",
897
+ "message" => "stub"
898
+ }
899
+ model = WorkOS::RadarChallengeErrorBody.new(fixture.to_json)
900
+ json = model.to_h
901
+ assert_kind_of Hash, json
902
+ assert_equal fixture["message"], json[:message]
903
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
904
+ end
905
+
906
+ def test_radar_sign_up_challenge_error_body_round_trip
907
+ fixture = {
908
+ "code" => "radar_sign_up_challenge",
909
+ "message" => "stub"
910
+ }
911
+ model = WorkOS::RadarSignUpChallengeErrorBody.new(fixture.to_json)
912
+ json = model.to_h
913
+ assert_kind_of Hash, json
914
+ assert_equal fixture["message"], json[:message]
915
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
916
+ end
917
+
918
+ def test_radar_sms_sign_in_challenge_error_body_round_trip
919
+ fixture = {
920
+ "code" => "radar_sms_sign_in_challenge",
921
+ "message" => "stub"
922
+ }
923
+ model = WorkOS::RadarSmsSignInChallengeErrorBody.new(fixture.to_json)
924
+ json = model.to_h
925
+ assert_kind_of Hash, json
926
+ assert_equal fixture["message"], json[:message]
927
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
928
+ end
929
+
930
+ def test_application_consent_required_error_body_round_trip
931
+ fixture = {
932
+ "code" => "application_consent_required",
933
+ "message" => "stub"
934
+ }
935
+ model = WorkOS::ApplicationConsentRequiredErrorBody.new(fixture.to_json)
936
+ json = model.to_h
937
+ assert_kind_of Hash, json
938
+ assert_equal fixture["message"], json[:message]
939
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
940
+ end
941
+
942
+ def test_policy_denied_error_body_round_trip
943
+ fixture = {
944
+ "code" => "policy_denied",
945
+ "message" => "stub"
946
+ }
947
+ model = WorkOS::PolicyDeniedErrorBody.new(fixture.to_json)
948
+ json = model.to_h
949
+ assert_kind_of Hash, json
950
+ assert_equal fixture["message"], json[:message]
951
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
952
+ end
953
+
954
+ def test_daily_quota_exceeded_error_body_round_trip
955
+ fixture = {
956
+ "code" => "daily_quota_exceeded",
957
+ "message" => "stub"
958
+ }
959
+ model = WorkOS::DailyQuotaExceededErrorBody.new(fixture.to_json)
960
+ json = model.to_h
961
+ assert_kind_of Hash, json
962
+ assert_equal fixture["message"], json[:message]
963
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
964
+ end
965
+
966
+ def test_too_many_requests_oauth_error_body_round_trip
967
+ fixture = {
968
+ "error" => "too_many_requests",
969
+ "error_description" => "stub"
970
+ }
971
+ model = WorkOS::TooManyRequestsOAuthErrorBody.new(fixture.to_json)
972
+ json = model.to_h
973
+ assert_kind_of Hash, json
974
+ assert_equal fixture["error_description"], json[:error_description]
975
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
976
+ end
977
+
978
+ def test_invalid_url_error_body_round_trip
979
+ fixture = {
980
+ "code" => "invalid_url",
981
+ "message" => "stub"
982
+ }
983
+ model = WorkOS::InvalidUrlErrorBody.new(fixture.to_json)
984
+ json = model.to_h
985
+ assert_kind_of Hash, json
986
+ assert_equal fixture["message"], json[:message]
987
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
988
+ end
989
+
8
990
  def test_error_response_round_trip
9
991
  fixture = {
10
- "error" => "stub"
992
+ "error" => "stub"
993
+ }
994
+ model = WorkOS::ErrorResponse.new(fixture.to_json)
995
+ json = model.to_h
996
+ assert_kind_of Hash, json
997
+ assert_equal fixture["error"], json[:error]
998
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
999
+ end
1000
+
1001
+ def test_object_summary_round_trip
1002
+ fixture = {
1003
+ "id" => "stub",
1004
+ "name" => "stub",
1005
+ "updated_at" => nil
1006
+ }
1007
+ model = WorkOS::ObjectSummary.new(fixture.to_json)
1008
+ json = model.to_h
1009
+ assert_kind_of Hash, json
1010
+ assert_equal fixture["id"], json[:id]
1011
+ assert_equal fixture["name"], json[:name]
1012
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
1013
+ end
1014
+
1015
+ def test_connect_application_oauth_round_trip
1016
+ fixture = {
1017
+ "object" => "connect_application",
1018
+ "id" => "stub",
1019
+ "client_id" => "stub",
1020
+ "description" => nil,
1021
+ "name" => "stub",
1022
+ "scopes" => [],
1023
+ "created_at" => "stub",
1024
+ "updated_at" => "stub",
1025
+ "application_type" => "oauth",
1026
+ "redirect_uris" => [],
1027
+ "cors_origins" => [],
1028
+ "uses_pkce" => true,
1029
+ "is_first_party" => true,
1030
+ "was_dynamically_registered" => true,
1031
+ "organization_id" => "stub"
1032
+ }
1033
+ model = WorkOS::ConnectApplicationOAuth.new(fixture.to_json)
1034
+ json = model.to_h
1035
+ assert_kind_of Hash, json
1036
+ assert_equal fixture["id"], json[:id]
1037
+ assert_equal fixture["client_id"], json[:client_id]
1038
+ assert_nil json[:description]
1039
+ assert_equal fixture["name"], json[:name]
1040
+ assert_equal fixture["created_at"], json[:created_at]
1041
+ assert_equal fixture["updated_at"], json[:updated_at]
1042
+ assert_equal fixture["uses_pkce"], json[:uses_pkce]
1043
+ assert_equal fixture["is_first_party"], json[:is_first_party]
1044
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
1045
+ end
1046
+
1047
+ def test_connect_application_oauth_redirect_uris_round_trip
1048
+ fixture = {
1049
+ "uri" => "stub",
1050
+ "default" => true
1051
+ }
1052
+ model = WorkOS::ConnectApplicationOAuthRedirectUris.new(fixture.to_json)
1053
+ json = model.to_h
1054
+ assert_kind_of Hash, json
1055
+ assert_equal fixture["uri"], json[:uri]
1056
+ assert_equal fixture["default"], json[:default]
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_connect_application_m2m_round_trip
1061
+ fixture = {
1062
+ "object" => "connect_application",
1063
+ "id" => "stub",
1064
+ "client_id" => "stub",
1065
+ "description" => nil,
1066
+ "name" => "stub",
1067
+ "scopes" => [],
1068
+ "created_at" => "stub",
1069
+ "updated_at" => "stub",
1070
+ "application_type" => "m2m",
1071
+ "organization_id" => "stub"
1072
+ }
1073
+ model = WorkOS::ConnectApplicationM2M.new(fixture.to_json)
1074
+ json = model.to_h
1075
+ assert_kind_of Hash, json
1076
+ assert_equal fixture["id"], json[:id]
1077
+ assert_equal fixture["client_id"], json[:client_id]
1078
+ assert_nil json[:description]
1079
+ assert_equal fixture["name"], json[:name]
1080
+ assert_equal fixture["created_at"], json[:created_at]
1081
+ assert_equal fixture["updated_at"], json[:updated_at]
1082
+ assert_equal fixture["organization_id"], json[:organization_id]
1083
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
1084
+ end
1085
+
1086
+ def test_event_context_actor_round_trip
1087
+ fixture = {
1088
+ "id" => "stub",
1089
+ "source" => "stub",
1090
+ "name" => nil
1091
+ }
1092
+ model = WorkOS::EventContextActor.new(fixture.to_json)
1093
+ json = model.to_h
1094
+ assert_kind_of Hash, json
1095
+ assert_equal fixture["id"], json[:id]
1096
+ assert_nil json[:name]
1097
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
1098
+ end
1099
+
1100
+ def test_event_context_round_trip
1101
+ fixture = {
1102
+ "google_analytics_client_id" => "stub",
1103
+ "google_analytics_sessions" => [],
1104
+ "ajs_anonymous_id" => "stub",
1105
+ "client_id" => "stub",
1106
+ "actor" => {},
1107
+ "previous_attributes" => {}
1108
+ }
1109
+ model = WorkOS::EventContext.new(fixture.to_json)
1110
+ json = model.to_h
1111
+ assert_kind_of Hash, json
1112
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
1113
+ end
1114
+
1115
+ def test_pipe_connected_account_round_trip
1116
+ fixture = {
1117
+ "object" => "connected_account",
1118
+ "id" => "stub",
1119
+ "connection_role" => "stub",
1120
+ "account_identifier" => nil,
1121
+ "account_display_name" => nil,
1122
+ "data_integration_id" => "stub",
1123
+ "provider_slug" => "stub",
1124
+ "user_id" => nil,
1125
+ "organization_id" => nil,
1126
+ "scopes" => [],
1127
+ "auth_method" => "stub",
1128
+ "api_key_last_4" => nil,
1129
+ "state" => "stub",
1130
+ "established_by_user_id" => nil,
1131
+ "state_reason" => nil,
1132
+ "created_at" => "stub",
1133
+ "updated_at" => "stub"
1134
+ }
1135
+ model = WorkOS::PipeConnectedAccount.new(fixture.to_json)
1136
+ json = model.to_h
1137
+ assert_kind_of Hash, json
1138
+ assert_equal fixture["id"], json[:id]
1139
+ assert_equal fixture["data_integration_id"], json[:data_integration_id]
1140
+ assert_equal fixture["provider_slug"], json[:provider_slug]
1141
+ assert_nil json[:user_id]
1142
+ assert_nil json[:organization_id]
1143
+ assert_equal fixture["created_at"], json[:created_at]
1144
+ assert_equal fixture["updated_at"], json[:updated_at]
1145
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
1146
+ end
1147
+
1148
+ def test_waitlist_user_round_trip
1149
+ fixture = {
1150
+ "id" => "stub",
1151
+ "email" => "stub",
1152
+ "state" => "stub",
1153
+ "approved_at" => nil,
1154
+ "additional_fields" => {},
1155
+ "waitlist_id" => nil,
1156
+ "created_at" => "stub",
1157
+ "updated_at" => "stub",
1158
+ "object" => "waitlist_user"
1159
+ }
1160
+ model = WorkOS::WaitlistUser.new(fixture.to_json)
1161
+ json = model.to_h
1162
+ assert_kind_of Hash, json
1163
+ assert_equal fixture["id"], json[:id]
1164
+ assert_equal fixture["email"], json[:email]
1165
+ assert_nil json[:approved_at]
1166
+ assert_equal fixture["created_at"], json[:created_at]
1167
+ assert_equal fixture["updated_at"], json[:updated_at]
1168
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
1169
+ end
1170
+
1171
+ def test_event_schema_round_trip
1172
+ fixture = {
1173
+ "object" => "event",
1174
+ "id" => "stub",
1175
+ "event" => "stub",
1176
+ "data" => {},
1177
+ "created_at" => "stub",
1178
+ "context" => {}
1179
+ }
1180
+ model = WorkOS::EventSchema.new(fixture.to_json)
1181
+ json = model.to_h
1182
+ assert_kind_of Hash, json
1183
+ assert_equal fixture["id"], json[:id]
1184
+ assert_equal fixture["event"], json[:event]
1185
+ assert_equal fixture["created_at"], json[:created_at]
1186
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
1187
+ end
1188
+
1189
+ def test_agent_blueprint_created_round_trip
1190
+ fixture = {
1191
+ "object" => "event",
1192
+ "id" => "stub",
1193
+ "event" => "agent.blueprint.created",
1194
+ "data" => {},
1195
+ "created_at" => "stub",
1196
+ "context" => {}
1197
+ }
1198
+ model = WorkOS::AgentBlueprintCreated.new(fixture.to_json)
1199
+ json = model.to_h
1200
+ assert_kind_of Hash, json
1201
+ assert_equal fixture["id"], json[:id]
1202
+ assert_equal fixture["created_at"], json[:created_at]
1203
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
1204
+ end
1205
+
1206
+ def test_agent_blueprint_created_data_round_trip
1207
+ fixture = {
1208
+ "object" => "agent_blueprint",
1209
+ "id" => "stub",
1210
+ "name" => "stub",
1211
+ "description" => nil,
1212
+ "permissions" => [],
1213
+ "invocable_by" => {},
1214
+ "invocable_as" => {},
1215
+ "session_settings" => {},
1216
+ "created_at" => "stub",
1217
+ "updated_at" => "stub"
1218
+ }
1219
+ model = WorkOS::AgentBlueprintCreatedData.new(fixture.to_json)
1220
+ json = model.to_h
1221
+ assert_kind_of Hash, json
1222
+ assert_equal fixture["id"], json[:id]
1223
+ assert_equal fixture["name"], json[:name]
1224
+ assert_nil json[:description]
1225
+ assert_equal fixture["created_at"], json[:created_at]
1226
+ assert_equal fixture["updated_at"], json[:updated_at]
1227
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
1228
+ end
1229
+
1230
+ def test_agent_blueprint_created_data_invocable_by_round_trip
1231
+ fixture = {
1232
+ "role_slugs" => [],
1233
+ "organization_ids" => []
1234
+ }
1235
+ model = WorkOS::AgentBlueprintCreatedDataInvocableBy.new(fixture.to_json)
1236
+ json = model.to_h
1237
+ assert_kind_of Hash, json
1238
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
1239
+ end
1240
+
1241
+ def test_agent_blueprint_created_data_invocable_as_round_trip
1242
+ fixture = {
1243
+ "instance_types" => []
1244
+ }
1245
+ model = WorkOS::AgentBlueprintCreatedDataInvocableAs.new(fixture.to_json)
1246
+ json = model.to_h
1247
+ assert_kind_of Hash, json
1248
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
1249
+ end
1250
+
1251
+ def test_agent_blueprint_created_data_session_setting_round_trip
1252
+ fixture = {
1253
+ "max_age_seconds" => 1.0,
1254
+ "access_token_ttl_seconds" => 1.0,
1255
+ "refresh_token_ttl_seconds" => 1.0
1256
+ }
1257
+ model = WorkOS::AgentBlueprintCreatedDataSessionSetting.new(fixture.to_json)
1258
+ json = model.to_h
1259
+ assert_kind_of Hash, json
1260
+ assert_equal fixture["max_age_seconds"], json[:max_age_seconds]
1261
+ assert_equal fixture["access_token_ttl_seconds"], json[:access_token_ttl_seconds]
1262
+ assert_equal fixture["refresh_token_ttl_seconds"], json[:refresh_token_ttl_seconds]
1263
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
1264
+ end
1265
+
1266
+ def test_agent_blueprint_deleted_round_trip
1267
+ fixture = {
1268
+ "object" => "event",
1269
+ "id" => "stub",
1270
+ "event" => "agent.blueprint.deleted",
1271
+ "data" => {},
1272
+ "created_at" => "stub",
1273
+ "context" => {}
1274
+ }
1275
+ model = WorkOS::AgentBlueprintDeleted.new(fixture.to_json)
1276
+ json = model.to_h
1277
+ assert_kind_of Hash, json
1278
+ assert_equal fixture["id"], json[:id]
1279
+ assert_equal fixture["created_at"], json[:created_at]
1280
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
1281
+ end
1282
+
1283
+ def test_agent_blueprint_deleted_data_round_trip
1284
+ fixture = {
1285
+ "object" => "agent_blueprint",
1286
+ "id" => "stub",
1287
+ "name" => "stub",
1288
+ "created_at" => "stub",
1289
+ "updated_at" => "stub"
1290
+ }
1291
+ model = WorkOS::AgentBlueprintDeletedData.new(fixture.to_json)
1292
+ json = model.to_h
1293
+ assert_kind_of Hash, json
1294
+ assert_equal fixture["id"], json[:id]
1295
+ assert_equal fixture["name"], json[:name]
1296
+ assert_equal fixture["created_at"], json[:created_at]
1297
+ assert_equal fixture["updated_at"], json[:updated_at]
1298
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
1299
+ end
1300
+
1301
+ def test_agent_blueprint_updated_round_trip
1302
+ fixture = {
1303
+ "object" => "event",
1304
+ "id" => "stub",
1305
+ "event" => "agent.blueprint.updated",
1306
+ "data" => {},
1307
+ "created_at" => "stub",
1308
+ "context" => {}
1309
+ }
1310
+ model = WorkOS::AgentBlueprintUpdated.new(fixture.to_json)
1311
+ json = model.to_h
1312
+ assert_kind_of Hash, json
1313
+ assert_equal fixture["id"], json[:id]
1314
+ assert_equal fixture["created_at"], json[:created_at]
1315
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
1316
+ end
1317
+
1318
+ def test_agent_blueprint_updated_data_round_trip
1319
+ fixture = {
1320
+ "object" => "agent_blueprint",
1321
+ "id" => "stub",
1322
+ "name" => "stub",
1323
+ "description" => nil,
1324
+ "permissions" => [],
1325
+ "invocable_by" => {},
1326
+ "invocable_as" => {},
1327
+ "session_settings" => {},
1328
+ "created_at" => "stub",
1329
+ "updated_at" => "stub"
1330
+ }
1331
+ model = WorkOS::AgentBlueprintUpdatedData.new(fixture.to_json)
1332
+ json = model.to_h
1333
+ assert_kind_of Hash, json
1334
+ assert_equal fixture["id"], json[:id]
1335
+ assert_equal fixture["name"], json[:name]
1336
+ assert_nil json[:description]
1337
+ assert_equal fixture["created_at"], json[:created_at]
1338
+ assert_equal fixture["updated_at"], json[:updated_at]
1339
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
1340
+ end
1341
+
1342
+ def test_agent_blueprint_updated_data_invocable_by_round_trip
1343
+ fixture = {
1344
+ "role_slugs" => [],
1345
+ "organization_ids" => []
1346
+ }
1347
+ model = WorkOS::AgentBlueprintUpdatedDataInvocableBy.new(fixture.to_json)
1348
+ json = model.to_h
1349
+ assert_kind_of Hash, json
1350
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
1351
+ end
1352
+
1353
+ def test_agent_blueprint_updated_data_invocable_as_round_trip
1354
+ fixture = {
1355
+ "instance_types" => []
1356
+ }
1357
+ model = WorkOS::AgentBlueprintUpdatedDataInvocableAs.new(fixture.to_json)
1358
+ json = model.to_h
1359
+ assert_kind_of Hash, json
1360
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
1361
+ end
1362
+
1363
+ def test_agent_blueprint_updated_data_session_setting_round_trip
1364
+ fixture = {
1365
+ "max_age_seconds" => 1.0,
1366
+ "access_token_ttl_seconds" => 1.0,
1367
+ "refresh_token_ttl_seconds" => 1.0
1368
+ }
1369
+ model = WorkOS::AgentBlueprintUpdatedDataSessionSetting.new(fixture.to_json)
1370
+ json = model.to_h
1371
+ assert_kind_of Hash, json
1372
+ assert_equal fixture["max_age_seconds"], json[:max_age_seconds]
1373
+ assert_equal fixture["access_token_ttl_seconds"], json[:access_token_ttl_seconds]
1374
+ assert_equal fixture["refresh_token_ttl_seconds"], json[:refresh_token_ttl_seconds]
1375
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
1376
+ end
1377
+
1378
+ def test_agent_instance_created_round_trip
1379
+ fixture = {
1380
+ "object" => "event",
1381
+ "id" => "stub",
1382
+ "event" => "agent.instance.created",
1383
+ "data" => {},
1384
+ "created_at" => "stub",
1385
+ "context" => {}
1386
+ }
1387
+ model = WorkOS::AgentInstanceCreated.new(fixture.to_json)
1388
+ json = model.to_h
1389
+ assert_kind_of Hash, json
1390
+ assert_equal fixture["id"], json[:id]
1391
+ assert_equal fixture["created_at"], json[:created_at]
1392
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
1393
+ end
1394
+
1395
+ def test_agent_instance_created_data_round_trip
1396
+ fixture = {
1397
+ "object" => "agent_instance",
1398
+ "id" => "stub",
1399
+ "agent_blueprint_id" => "stub",
1400
+ "organization_id" => "stub",
1401
+ "organization_membership_id" => nil,
1402
+ "type" => "stub",
1403
+ "created_at" => "stub",
1404
+ "updated_at" => "stub"
1405
+ }
1406
+ model = WorkOS::AgentInstanceCreatedData.new(fixture.to_json)
1407
+ json = model.to_h
1408
+ assert_kind_of Hash, json
1409
+ assert_equal fixture["id"], json[:id]
1410
+ assert_equal fixture["agent_blueprint_id"], json[:agent_blueprint_id]
1411
+ assert_equal fixture["organization_id"], json[:organization_id]
1412
+ assert_nil json[:organization_membership_id]
1413
+ assert_equal fixture["created_at"], json[:created_at]
1414
+ assert_equal fixture["updated_at"], json[:updated_at]
1415
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
1416
+ end
1417
+
1418
+ def test_agent_instance_deleted_round_trip
1419
+ fixture = {
1420
+ "object" => "event",
1421
+ "id" => "stub",
1422
+ "event" => "agent.instance.deleted",
1423
+ "data" => {},
1424
+ "created_at" => "stub",
1425
+ "context" => {}
1426
+ }
1427
+ model = WorkOS::AgentInstanceDeleted.new(fixture.to_json)
1428
+ json = model.to_h
1429
+ assert_kind_of Hash, json
1430
+ assert_equal fixture["id"], json[:id]
1431
+ assert_equal fixture["created_at"], json[:created_at]
1432
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
1433
+ end
1434
+
1435
+ def test_agent_instance_deleted_data_round_trip
1436
+ fixture = {
1437
+ "object" => "agent_instance",
1438
+ "id" => "stub",
1439
+ "agent_blueprint_id" => "stub",
1440
+ "organization_id" => "stub",
1441
+ "organization_membership_id" => nil,
1442
+ "type" => "stub",
1443
+ "created_at" => "stub",
1444
+ "updated_at" => "stub"
1445
+ }
1446
+ model = WorkOS::AgentInstanceDeletedData.new(fixture.to_json)
1447
+ json = model.to_h
1448
+ assert_kind_of Hash, json
1449
+ assert_equal fixture["id"], json[:id]
1450
+ assert_equal fixture["agent_blueprint_id"], json[:agent_blueprint_id]
1451
+ assert_equal fixture["organization_id"], json[:organization_id]
1452
+ assert_nil json[:organization_membership_id]
1453
+ assert_equal fixture["created_at"], json[:created_at]
1454
+ assert_equal fixture["updated_at"], json[:updated_at]
1455
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
1456
+ end
1457
+
1458
+ def test_agent_instance_session_created_round_trip
1459
+ fixture = {
1460
+ "object" => "event",
1461
+ "id" => "stub",
1462
+ "event" => "agent.instance.session.created",
1463
+ "data" => {},
1464
+ "created_at" => "stub",
1465
+ "context" => {}
1466
+ }
1467
+ model = WorkOS::AgentInstanceSessionCreated.new(fixture.to_json)
1468
+ json = model.to_h
1469
+ assert_kind_of Hash, json
1470
+ assert_equal fixture["id"], json[:id]
1471
+ assert_equal fixture["created_at"], json[:created_at]
1472
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
1473
+ end
1474
+
1475
+ def test_agent_instance_session_created_data_round_trip
1476
+ fixture = {
1477
+ "object" => "agent_instance_session",
1478
+ "id" => "stub",
1479
+ "agent_instance_id" => "stub",
1480
+ "organization_id" => "stub",
1481
+ "expires_at" => "stub",
1482
+ "revoked_at" => nil,
1483
+ "created_at" => "stub",
1484
+ "updated_at" => "stub",
1485
+ "permission_slugs" => []
1486
+ }
1487
+ model = WorkOS::AgentInstanceSessionCreatedData.new(fixture.to_json)
1488
+ json = model.to_h
1489
+ assert_kind_of Hash, json
1490
+ assert_equal fixture["id"], json[:id]
1491
+ assert_equal fixture["agent_instance_id"], json[:agent_instance_id]
1492
+ assert_equal fixture["organization_id"], json[:organization_id]
1493
+ assert_equal fixture["expires_at"], json[:expires_at]
1494
+ assert_nil json[:revoked_at]
1495
+ assert_equal fixture["created_at"], json[:created_at]
1496
+ assert_equal fixture["updated_at"], json[:updated_at]
1497
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
1498
+ end
1499
+
1500
+ def test_agent_instance_session_revoked_round_trip
1501
+ fixture = {
1502
+ "object" => "event",
1503
+ "id" => "stub",
1504
+ "event" => "agent.instance.session.revoked",
1505
+ "data" => {},
1506
+ "created_at" => "stub",
1507
+ "context" => {}
1508
+ }
1509
+ model = WorkOS::AgentInstanceSessionRevoked.new(fixture.to_json)
1510
+ json = model.to_h
1511
+ assert_kind_of Hash, json
1512
+ assert_equal fixture["id"], json[:id]
1513
+ assert_equal fixture["created_at"], json[:created_at]
1514
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
1515
+ end
1516
+
1517
+ def test_agent_instance_session_revoked_data_round_trip
1518
+ fixture = {
1519
+ "object" => "agent_instance_session",
1520
+ "id" => "stub",
1521
+ "agent_instance_id" => "stub",
1522
+ "organization_id" => "stub",
1523
+ "expires_at" => "stub",
1524
+ "revoked_at" => nil,
1525
+ "created_at" => "stub",
1526
+ "updated_at" => "stub"
1527
+ }
1528
+ model = WorkOS::AgentInstanceSessionRevokedData.new(fixture.to_json)
1529
+ json = model.to_h
1530
+ assert_kind_of Hash, json
1531
+ assert_equal fixture["id"], json[:id]
1532
+ assert_equal fixture["agent_instance_id"], json[:agent_instance_id]
1533
+ assert_equal fixture["organization_id"], json[:organization_id]
1534
+ assert_equal fixture["expires_at"], json[:expires_at]
1535
+ assert_nil json[:revoked_at]
1536
+ assert_equal fixture["created_at"], json[:created_at]
1537
+ assert_equal fixture["updated_at"], json[:updated_at]
1538
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
1539
+ end
1540
+
1541
+ def test_agent_registration_claim_attempt_created_round_trip
1542
+ fixture = {
1543
+ "object" => "event",
1544
+ "id" => "stub",
1545
+ "event" => "agent.registration.claim.attempt.created",
1546
+ "data" => {},
1547
+ "created_at" => "stub",
1548
+ "context" => {}
11
1549
  }
12
- model = WorkOS::ErrorResponse.new(fixture.to_json)
1550
+ model = WorkOS::AgentRegistrationClaimAttemptCreated.new(fixture.to_json)
13
1551
  json = model.to_h
14
1552
  assert_kind_of Hash, json
15
- assert_equal fixture["error"], json[:error]
1553
+ assert_equal fixture["id"], json[:id]
1554
+ assert_equal fixture["created_at"], json[:created_at]
16
1555
  fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
17
1556
  end
18
1557
 
19
- def test_object_summary_round_trip
1558
+ def test_agent_registration_claim_attempt_created_data_round_trip
20
1559
  fixture = {
1560
+ "object" => "agent_registration_claim_attempt",
21
1561
  "id" => "stub",
22
- "name" => "stub",
23
- "updated_at" => nil
1562
+ "agent_registration_id" => "stub",
1563
+ "agent_registration_claim_id" => "stub",
1564
+ "login_hint" => "stub",
1565
+ "expires_at" => "stub",
1566
+ "created_at" => "stub",
1567
+ "updated_at" => "stub"
24
1568
  }
25
- model = WorkOS::ObjectSummary.new(fixture.to_json)
1569
+ model = WorkOS::AgentRegistrationClaimAttemptCreatedData.new(fixture.to_json)
26
1570
  json = model.to_h
27
1571
  assert_kind_of Hash, json
28
1572
  assert_equal fixture["id"], json[:id]
29
- assert_equal fixture["name"], json[:name]
1573
+ assert_equal fixture["agent_registration_id"], json[:agent_registration_id]
1574
+ assert_equal fixture["agent_registration_claim_id"], json[:agent_registration_claim_id]
1575
+ assert_equal fixture["login_hint"], json[:login_hint]
1576
+ assert_equal fixture["expires_at"], json[:expires_at]
1577
+ assert_equal fixture["created_at"], json[:created_at]
1578
+ assert_equal fixture["updated_at"], json[:updated_at]
30
1579
  fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
31
1580
  end
32
1581
 
33
- def test_object_version_round_trip
1582
+ def test_agent_registration_claim_completed_round_trip
34
1583
  fixture = {
35
- "created_at" => "stub",
36
- "current_version" => true,
37
- "etag" => "stub",
1584
+ "object" => "event",
38
1585
  "id" => "stub",
39
- "size" => 1
1586
+ "event" => "agent.registration.claim.completed",
1587
+ "data" => {},
1588
+ "created_at" => "stub",
1589
+ "context" => {}
40
1590
  }
41
- model = WorkOS::ObjectVersion.new(fixture.to_json)
1591
+ model = WorkOS::AgentRegistrationClaimCompleted.new(fixture.to_json)
42
1592
  json = model.to_h
43
1593
  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
1594
  assert_equal fixture["id"], json[:id]
48
- assert_equal fixture["size"], json[:size]
1595
+ assert_equal fixture["created_at"], json[:created_at]
49
1596
  fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
50
1597
  end
51
1598
 
52
- def test_connect_application_oauth_round_trip
1599
+ def test_agent_registration_claim_completed_data_round_trip
53
1600
  fixture = {
54
- "object" => "connect_application",
1601
+ "object" => "agent_registration_claim",
55
1602
  "id" => "stub",
56
- "client_id" => "stub",
57
- "description" => nil,
58
- "name" => "stub",
59
- "scopes" => [],
1603
+ "agent_registration_id" => "stub",
1604
+ "completed_by_attempt_id" => "stub",
1605
+ "claimed_by" => {},
1606
+ "completed_at" => "stub",
60
1607
  "created_at" => "stub",
61
- "updated_at" => "stub",
62
- "application_type" => "oauth",
63
- "redirect_uris" => [],
64
- "uses_pkce" => true,
65
- "is_first_party" => true,
66
- "was_dynamically_registered" => true,
67
- "organization_id" => "stub"
1608
+ "updated_at" => "stub"
68
1609
  }
69
- model = WorkOS::ConnectApplicationOAuth.new(fixture.to_json)
1610
+ model = WorkOS::AgentRegistrationClaimCompletedData.new(fixture.to_json)
70
1611
  json = model.to_h
71
1612
  assert_kind_of Hash, json
72
1613
  assert_equal fixture["id"], json[:id]
73
- assert_equal fixture["client_id"], json[:client_id]
74
- assert_nil json[:description]
75
- assert_equal fixture["name"], json[:name]
1614
+ assert_equal fixture["agent_registration_id"], json[:agent_registration_id]
1615
+ assert_equal fixture["completed_by_attempt_id"], json[:completed_by_attempt_id]
1616
+ assert_equal fixture["completed_at"], json[:completed_at]
76
1617
  assert_equal fixture["created_at"], json[:created_at]
77
1618
  assert_equal fixture["updated_at"], json[:updated_at]
78
- assert_equal fixture["uses_pkce"], json[:uses_pkce]
79
- assert_equal fixture["is_first_party"], json[:is_first_party]
80
1619
  fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
81
1620
  end
82
1621
 
83
- def test_connect_application_oauth_redirect_uris_round_trip
1622
+ def test_agent_registration_claim_completed_data_claimed_by_round_trip
84
1623
  fixture = {
85
- "uri" => "stub",
86
- "default" => true
1624
+ "user_id" => "stub",
1625
+ "organization_id" => "stub"
87
1626
  }
88
- model = WorkOS::ConnectApplicationOAuthRedirectUris.new(fixture.to_json)
1627
+ model = WorkOS::AgentRegistrationClaimCompletedDataClaimedBy.new(fixture.to_json)
89
1628
  json = model.to_h
90
1629
  assert_kind_of Hash, json
91
- assert_equal fixture["uri"], json[:uri]
92
- assert_equal fixture["default"], json[:default]
1630
+ assert_equal fixture["user_id"], json[:user_id]
93
1631
  fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
94
1632
  end
95
1633
 
96
- def test_connect_application_m2m_round_trip
1634
+ def test_agent_registration_created_round_trip
97
1635
  fixture = {
98
- "object" => "connect_application",
1636
+ "object" => "event",
99
1637
  "id" => "stub",
100
- "client_id" => "stub",
101
- "description" => nil,
102
- "name" => "stub",
103
- "scopes" => [],
1638
+ "event" => "agent.registration.created",
1639
+ "data" => {},
104
1640
  "created_at" => "stub",
105
- "updated_at" => "stub",
106
- "application_type" => "m2m",
107
- "organization_id" => "stub"
1641
+ "context" => {}
108
1642
  }
109
- model = WorkOS::ConnectApplicationM2M.new(fixture.to_json)
1643
+ model = WorkOS::AgentRegistrationCreated.new(fixture.to_json)
110
1644
  json = model.to_h
111
1645
  assert_kind_of Hash, json
112
1646
  assert_equal fixture["id"], json[:id]
113
- assert_equal fixture["client_id"], json[:client_id]
114
- assert_nil json[:description]
115
- assert_equal fixture["name"], json[:name]
116
1647
  assert_equal fixture["created_at"], json[:created_at]
117
- assert_equal fixture["updated_at"], json[:updated_at]
1648
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
1649
+ end
1650
+
1651
+ def test_agent_registration_created_data_round_trip
1652
+ fixture = {
1653
+ "object" => "agent_registration",
1654
+ "id" => "stub",
1655
+ "agent_identity" => {},
1656
+ "organization_id" => "stub",
1657
+ "status" => "stub",
1658
+ "kind" => "stub",
1659
+ "method" => "stub",
1660
+ "created_at" => "stub",
1661
+ "updated_at" => "stub"
1662
+ }
1663
+ model = WorkOS::AgentRegistrationCreatedData.new(fixture.to_json)
1664
+ json = model.to_h
1665
+ assert_kind_of Hash, json
1666
+ assert_equal fixture["id"], json[:id]
118
1667
  assert_equal fixture["organization_id"], json[:organization_id]
1668
+ assert_equal fixture["created_at"], json[:created_at]
1669
+ assert_equal fixture["updated_at"], json[:updated_at]
119
1670
  fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
120
1671
  end
121
1672
 
122
- def test_event_context_actor_round_trip
1673
+ def test_agent_registration_created_data_agent_identity_round_trip
123
1674
  fixture = {
1675
+ "object" => "agent_identity",
124
1676
  "id" => "stub",
125
- "source" => "stub",
126
- "name" => nil
1677
+ "userland_user_id" => "stub"
127
1678
  }
128
- model = WorkOS::EventContextActor.new(fixture.to_json)
1679
+ model = WorkOS::AgentRegistrationCreatedDataAgentIdentity.new(fixture.to_json)
129
1680
  json = model.to_h
130
1681
  assert_kind_of Hash, json
131
1682
  assert_equal fixture["id"], json[:id]
132
- assert_nil json[:name]
133
1683
  fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
134
1684
  end
135
1685
 
136
- def test_event_context_round_trip
1686
+ def test_agent_registration_credential_issued_round_trip
137
1687
  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" => {}
1688
+ "object" => "event",
1689
+ "id" => "stub",
1690
+ "event" => "agent.registration.credential.issued",
1691
+ "data" => {},
1692
+ "created_at" => "stub",
1693
+ "context" => {}
144
1694
  }
145
- model = WorkOS::EventContext.new(fixture.to_json)
1695
+ model = WorkOS::AgentRegistrationCredentialIssued.new(fixture.to_json)
146
1696
  json = model.to_h
147
1697
  assert_kind_of Hash, json
1698
+ assert_equal fixture["id"], json[:id]
1699
+ assert_equal fixture["created_at"], json[:created_at]
148
1700
  fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
149
1701
  end
150
1702
 
151
- def test_pipe_connected_account_round_trip
1703
+ def test_agent_registration_credential_issued_data_round_trip
152
1704
  fixture = {
153
- "object" => "connected_account",
1705
+ "object" => "agent_registration_credential",
154
1706
  "id" => "stub",
155
- "connection_role" => "stub",
156
- "account_identifier" => nil,
157
- "account_display_name" => nil,
158
- "data_integration_id" => "stub",
159
- "provider_slug" => "stub",
160
- "user_id" => nil,
161
- "organization_id" => nil,
162
- "scopes" => [],
163
- "auth_method" => "stub",
164
- "api_key_last_4" => nil,
165
- "state" => "stub",
1707
+ "agent_registration_id" => "stub",
1708
+ "detail" => {},
166
1709
  "created_at" => "stub",
167
1710
  "updated_at" => "stub"
168
1711
  }
169
- model = WorkOS::PipeConnectedAccount.new(fixture.to_json)
1712
+ model = WorkOS::AgentRegistrationCredentialIssuedData.new(fixture.to_json)
170
1713
  json = model.to_h
171
1714
  assert_kind_of Hash, json
172
1715
  assert_equal fixture["id"], json[:id]
173
- assert_equal fixture["data_integration_id"], json[:data_integration_id]
174
- assert_equal fixture["provider_slug"], json[:provider_slug]
175
- assert_nil json[:user_id]
176
- assert_nil json[:organization_id]
1716
+ assert_equal fixture["agent_registration_id"], json[:agent_registration_id]
177
1717
  assert_equal fixture["created_at"], json[:created_at]
178
1718
  assert_equal fixture["updated_at"], json[:updated_at]
179
1719
  fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
180
1720
  end
181
1721
 
182
- def test_waitlist_user_round_trip
1722
+ def test_agent_registration_credential_issued_data_detail_round_trip
1723
+ fixture = {
1724
+ "kind" => "api_key",
1725
+ "api_key_id" => "stub"
1726
+ }
1727
+ model = WorkOS::AgentRegistrationCredentialIssuedDataDetail.new(fixture.to_json)
1728
+ json = model.to_h
1729
+ assert_kind_of Hash, json
1730
+ assert_equal fixture["api_key_id"], json[:api_key_id]
1731
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
1732
+ end
1733
+
1734
+ def test_access_token_agent_registration_credential_issued_data_detail_round_trip
1735
+ fixture = {
1736
+ "kind" => "access_token",
1737
+ "jti" => "stub",
1738
+ "expires_at" => "stub"
1739
+ }
1740
+ model = WorkOS::AccessTokenAgentRegistrationCredentialIssuedDataDetail.new(fixture.to_json)
1741
+ json = model.to_h
1742
+ assert_kind_of Hash, json
1743
+ assert_equal fixture["jti"], json[:jti]
1744
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
1745
+ end
1746
+
1747
+ def test_agent_registration_deleted_round_trip
183
1748
  fixture = {
1749
+ "object" => "event",
184
1750
  "id" => "stub",
185
- "email" => "stub",
186
- "state" => "stub",
187
- "approved_at" => nil,
188
- "additional_fields" => {},
189
- "waitlist_id" => nil,
1751
+ "event" => "agent.registration.deleted",
1752
+ "data" => {},
190
1753
  "created_at" => "stub",
191
- "updated_at" => "stub",
192
- "object" => "waitlist_user"
1754
+ "context" => {}
193
1755
  }
194
- model = WorkOS::WaitlistUser.new(fixture.to_json)
1756
+ model = WorkOS::AgentRegistrationDeleted.new(fixture.to_json)
195
1757
  json = model.to_h
196
1758
  assert_kind_of Hash, json
197
1759
  assert_equal fixture["id"], json[:id]
198
- assert_equal fixture["email"], json[:email]
199
- assert_nil json[:approved_at]
200
1760
  assert_equal fixture["created_at"], json[:created_at]
201
- assert_equal fixture["updated_at"], json[:updated_at]
202
1761
  fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
203
1762
  end
204
1763
 
205
- def test_event_schema_round_trip
1764
+ def test_agent_registration_deleted_data_round_trip
1765
+ fixture = {
1766
+ "agent_registration_id" => "stub"
1767
+ }
1768
+ model = WorkOS::AgentRegistrationDeletedData.new(fixture.to_json)
1769
+ json = model.to_h
1770
+ assert_kind_of Hash, json
1771
+ assert_equal fixture["agent_registration_id"], json[:agent_registration_id]
1772
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
1773
+ end
1774
+
1775
+ def test_agent_registration_expired_round_trip
206
1776
  fixture = {
207
1777
  "object" => "event",
208
1778
  "id" => "stub",
209
- "event" => "stub",
1779
+ "event" => "agent.registration.expired",
210
1780
  "data" => {},
211
1781
  "created_at" => "stub",
212
1782
  "context" => {}
213
1783
  }
214
- model = WorkOS::EventSchema.new(fixture.to_json)
1784
+ model = WorkOS::AgentRegistrationExpired.new(fixture.to_json)
1785
+ json = model.to_h
1786
+ assert_kind_of Hash, json
1787
+ assert_equal fixture["id"], json[:id]
1788
+ assert_equal fixture["created_at"], json[:created_at]
1789
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
1790
+ end
1791
+
1792
+ def test_agent_registration_expired_data_round_trip
1793
+ fixture = {
1794
+ "agent_registration_id" => "stub"
1795
+ }
1796
+ model = WorkOS::AgentRegistrationExpiredData.new(fixture.to_json)
215
1797
  json = model.to_h
216
1798
  assert_kind_of Hash, json
217
- assert_equal fixture["id"], json[:id]
218
- assert_equal fixture["event"], json[:event]
219
- assert_equal fixture["created_at"], json[:created_at]
1799
+ assert_equal fixture["agent_registration_id"], json[:agent_registration_id]
220
1800
  fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
221
1801
  end
222
1802
 
223
- def test_agent_blueprint_created_round_trip
1803
+ def test_agent_registration_organization_switched_round_trip
224
1804
  fixture = {
225
1805
  "object" => "event",
226
1806
  "id" => "stub",
227
- "event" => "agent.blueprint.created",
1807
+ "event" => "agent.registration.organization.switched",
228
1808
  "data" => {},
229
1809
  "created_at" => "stub",
230
1810
  "context" => {}
231
1811
  }
232
- model = WorkOS::AgentBlueprintCreated.new(fixture.to_json)
1812
+ model = WorkOS::AgentRegistrationOrganizationSwitched.new(fixture.to_json)
233
1813
  json = model.to_h
234
1814
  assert_kind_of Hash, json
235
1815
  assert_equal fixture["id"], json[:id]
@@ -237,65 +1817,59 @@ class SharedModelRoundTripTest < Minitest::Test
237
1817
  fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
238
1818
  end
239
1819
 
240
- def test_agent_blueprint_created_data_round_trip
1820
+ def test_agent_registration_organization_switched_data_round_trip
241
1821
  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"
1822
+ "agent_registration_id" => "stub",
1823
+ "from_organization_id" => "stub",
1824
+ "to_organization_id" => "stub"
251
1825
  }
252
- model = WorkOS::AgentBlueprintCreatedData.new(fixture.to_json)
1826
+ model = WorkOS::AgentRegistrationOrganizationSwitchedData.new(fixture.to_json)
253
1827
  json = model.to_h
254
1828
  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]
1829
+ assert_equal fixture["agent_registration_id"], json[:agent_registration_id]
1830
+ assert_equal fixture["from_organization_id"], json[:from_organization_id]
1831
+ assert_equal fixture["to_organization_id"], json[:to_organization_id]
260
1832
  fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
261
1833
  end
262
1834
 
263
- def test_agent_blueprint_created_data_invocable_by_round_trip
1835
+ def test_agent_registration_refreshed_round_trip
264
1836
  fixture = {
265
- "role_slugs" => [],
266
- "organization_ids" => []
1837
+ "object" => "event",
1838
+ "id" => "stub",
1839
+ "event" => "agent.registration.refreshed",
1840
+ "data" => {},
1841
+ "created_at" => "stub",
1842
+ "context" => {}
267
1843
  }
268
- model = WorkOS::AgentBlueprintCreatedDataInvocableBy.new(fixture.to_json)
1844
+ model = WorkOS::AgentRegistrationRefreshed.new(fixture.to_json)
269
1845
  json = model.to_h
270
1846
  assert_kind_of Hash, json
1847
+ assert_equal fixture["id"], json[:id]
1848
+ assert_equal fixture["created_at"], json[:created_at]
271
1849
  fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
272
1850
  end
273
1851
 
274
- def test_agent_blueprint_created_data_session_setting_round_trip
1852
+ def test_agent_registration_refreshed_data_round_trip
275
1853
  fixture = {
276
- "max_age_seconds" => 1.0,
277
- "access_token_ttl_seconds" => 1.0,
278
- "refresh_token_ttl_seconds" => 1.0
1854
+ "agent_registration_id" => "stub"
279
1855
  }
280
- model = WorkOS::AgentBlueprintCreatedDataSessionSetting.new(fixture.to_json)
1856
+ model = WorkOS::AgentRegistrationRefreshedData.new(fixture.to_json)
281
1857
  json = model.to_h
282
1858
  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]
1859
+ assert_equal fixture["agent_registration_id"], json[:agent_registration_id]
286
1860
  fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
287
1861
  end
288
1862
 
289
- def test_agent_blueprint_deleted_round_trip
1863
+ def test_agent_registration_revoked_round_trip
290
1864
  fixture = {
291
1865
  "object" => "event",
292
1866
  "id" => "stub",
293
- "event" => "agent.blueprint.deleted",
1867
+ "event" => "agent.registration.revoked",
294
1868
  "data" => {},
295
1869
  "created_at" => "stub",
296
1870
  "context" => {}
297
1871
  }
298
- model = WorkOS::AgentBlueprintDeleted.new(fixture.to_json)
1872
+ model = WorkOS::AgentRegistrationRevoked.new(fixture.to_json)
299
1873
  json = model.to_h
300
1874
  assert_kind_of Hash, json
301
1875
  assert_equal fixture["id"], json[:id]
@@ -303,34 +1877,27 @@ class SharedModelRoundTripTest < Minitest::Test
303
1877
  fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
304
1878
  end
305
1879
 
306
- def test_agent_blueprint_deleted_data_round_trip
1880
+ def test_agent_registration_revoked_data_round_trip
307
1881
  fixture = {
308
- "object" => "agent_blueprint",
309
- "id" => "stub",
310
- "name" => "stub",
311
- "created_at" => "stub",
312
- "updated_at" => "stub"
1882
+ "agent_registration_id" => "stub"
313
1883
  }
314
- model = WorkOS::AgentBlueprintDeletedData.new(fixture.to_json)
1884
+ model = WorkOS::AgentRegistrationRevokedData.new(fixture.to_json)
315
1885
  json = model.to_h
316
1886
  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]
1887
+ assert_equal fixture["agent_registration_id"], json[:agent_registration_id]
321
1888
  fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
322
1889
  end
323
1890
 
324
- def test_agent_blueprint_updated_round_trip
1891
+ def test_feature_flags_flag_created_round_trip
325
1892
  fixture = {
326
1893
  "object" => "event",
327
1894
  "id" => "stub",
328
- "event" => "agent.blueprint.updated",
1895
+ "event" => "feature_flags.flag.created",
329
1896
  "data" => {},
330
1897
  "created_at" => "stub",
331
1898
  "context" => {}
332
1899
  }
333
- model = WorkOS::AgentBlueprintUpdated.new(fixture.to_json)
1900
+ model = WorkOS::FeatureFlagsFlagCreated.new(fixture.to_json)
334
1901
  json = model.to_h
335
1902
  assert_kind_of Hash, json
336
1903
  assert_equal fixture["id"], json[:id]
@@ -338,187 +1905,175 @@ class SharedModelRoundTripTest < Minitest::Test
338
1905
  fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
339
1906
  end
340
1907
 
341
- def test_agent_blueprint_updated_data_round_trip
1908
+ def test_feature_flags_flag_created_data_round_trip
342
1909
  fixture = {
343
- "object" => "agent_blueprint",
1910
+ "object" => "feature_flag",
344
1911
  "id" => "stub",
1912
+ "environment_id" => "stub",
1913
+ "slug" => "stub",
345
1914
  "name" => "stub",
346
1915
  "description" => nil,
347
- "permissions" => [],
348
- "invocable_by" => {},
349
- "session_settings" => {},
1916
+ "owner" => nil,
1917
+ "tags" => [],
1918
+ "enabled" => true,
1919
+ "default_value" => true,
350
1920
  "created_at" => "stub",
351
1921
  "updated_at" => "stub"
352
1922
  }
353
- model = WorkOS::AgentBlueprintUpdatedData.new(fixture.to_json)
1923
+ model = WorkOS::FeatureFlagsFlagCreatedData.new(fixture.to_json)
354
1924
  json = model.to_h
355
1925
  assert_kind_of Hash, json
356
1926
  assert_equal fixture["id"], json[:id]
1927
+ assert_equal fixture["environment_id"], json[:environment_id]
1928
+ assert_equal fixture["slug"], json[:slug]
357
1929
  assert_equal fixture["name"], json[:name]
358
1930
  assert_nil json[:description]
1931
+ assert_equal fixture["enabled"], json[:enabled]
1932
+ assert_equal fixture["default_value"], json[:default_value]
359
1933
  assert_equal fixture["created_at"], json[:created_at]
360
1934
  assert_equal fixture["updated_at"], json[:updated_at]
361
1935
  fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
362
1936
  end
363
1937
 
364
- def test_agent_blueprint_updated_data_invocable_by_round_trip
1938
+ def test_feature_flags_flag_created_data_owner_round_trip
365
1939
  fixture = {
366
- "role_slugs" => [],
367
- "organization_ids" => []
1940
+ "email" => "stub",
1941
+ "first_name" => nil,
1942
+ "last_name" => nil
368
1943
  }
369
- model = WorkOS::AgentBlueprintUpdatedDataInvocableBy.new(fixture.to_json)
1944
+ model = WorkOS::FeatureFlagsFlagCreatedDataOwner.new(fixture.to_json)
370
1945
  json = model.to_h
371
1946
  assert_kind_of Hash, json
1947
+ assert_equal fixture["email"], json[:email]
1948
+ assert_nil json[:first_name]
1949
+ assert_nil json[:last_name]
372
1950
  fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
373
1951
  end
374
1952
 
375
- def test_agent_blueprint_updated_data_session_setting_round_trip
1953
+ def test_feature_flags_flag_created_context_round_trip
376
1954
  fixture = {
377
- "max_age_seconds" => 1.0,
378
- "access_token_ttl_seconds" => 1.0,
379
- "refresh_token_ttl_seconds" => 1.0
1955
+ "client_id" => "stub",
1956
+ "actor" => {}
380
1957
  }
381
- model = WorkOS::AgentBlueprintUpdatedDataSessionSetting.new(fixture.to_json)
1958
+ model = WorkOS::FeatureFlagsFlagCreatedContext.new(fixture.to_json)
382
1959
  json = model.to_h
383
1960
  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]
1961
+ assert_equal fixture["client_id"], json[:client_id]
387
1962
  fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
388
1963
  end
389
1964
 
390
- def test_agent_instance_created_round_trip
1965
+ def test_feature_flags_flag_created_context_actor_round_trip
391
1966
  fixture = {
392
- "object" => "event",
393
1967
  "id" => "stub",
394
- "event" => "agent.instance.created",
395
- "data" => {},
396
- "created_at" => "stub",
397
- "context" => {}
1968
+ "source" => "stub",
1969
+ "name" => nil
398
1970
  }
399
- model = WorkOS::AgentInstanceCreated.new(fixture.to_json)
1971
+ model = WorkOS::FeatureFlagsFlagCreatedContextActor.new(fixture.to_json)
400
1972
  json = model.to_h
401
1973
  assert_kind_of Hash, json
402
1974
  assert_equal fixture["id"], json[:id]
403
- assert_equal fixture["created_at"], json[:created_at]
1975
+ assert_nil json[:name]
404
1976
  fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
405
1977
  end
406
1978
 
407
- def test_agent_instance_created_data_round_trip
1979
+ def test_feature_flags_flag_deleted_round_trip
408
1980
  fixture = {
409
- "object" => "agent_instance",
1981
+ "object" => "event",
410
1982
  "id" => "stub",
411
- "agent_blueprint_id" => "stub",
412
- "organization_id" => "stub",
413
- "organization_membership_id" => nil,
414
- "type" => "stub",
1983
+ "event" => "feature_flags.flag.deleted",
1984
+ "data" => {},
415
1985
  "created_at" => "stub",
416
- "updated_at" => "stub"
1986
+ "context" => {}
417
1987
  }
418
- model = WorkOS::AgentInstanceCreatedData.new(fixture.to_json)
1988
+ model = WorkOS::FeatureFlagsFlagDeleted.new(fixture.to_json)
419
1989
  json = model.to_h
420
1990
  assert_kind_of Hash, json
421
1991
  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
1992
  assert_equal fixture["created_at"], json[:created_at]
426
- assert_equal fixture["updated_at"], json[:updated_at]
427
1993
  fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
428
1994
  end
429
1995
 
430
- def test_agent_instance_deleted_round_trip
1996
+ def test_feature_flags_flag_deleted_data_round_trip
431
1997
  fixture = {
432
- "object" => "event",
1998
+ "object" => "feature_flag",
433
1999
  "id" => "stub",
434
- "event" => "agent.instance.deleted",
435
- "data" => {},
2000
+ "environment_id" => "stub",
2001
+ "slug" => "stub",
2002
+ "name" => "stub",
2003
+ "description" => nil,
2004
+ "owner" => nil,
2005
+ "tags" => [],
2006
+ "enabled" => true,
2007
+ "default_value" => true,
436
2008
  "created_at" => "stub",
437
- "context" => {}
2009
+ "updated_at" => "stub"
438
2010
  }
439
- model = WorkOS::AgentInstanceDeleted.new(fixture.to_json)
2011
+ model = WorkOS::FeatureFlagsFlagDeletedData.new(fixture.to_json)
440
2012
  json = model.to_h
441
2013
  assert_kind_of Hash, json
442
2014
  assert_equal fixture["id"], json[:id]
2015
+ assert_equal fixture["environment_id"], json[:environment_id]
2016
+ assert_equal fixture["slug"], json[:slug]
2017
+ assert_equal fixture["name"], json[:name]
2018
+ assert_nil json[:description]
2019
+ assert_equal fixture["enabled"], json[:enabled]
2020
+ assert_equal fixture["default_value"], json[:default_value]
443
2021
  assert_equal fixture["created_at"], json[:created_at]
2022
+ assert_equal fixture["updated_at"], json[:updated_at]
444
2023
  fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
445
2024
  end
446
2025
 
447
- def test_agent_instance_deleted_data_round_trip
2026
+ def test_feature_flags_flag_deleted_data_owner_round_trip
448
2027
  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"
2028
+ "email" => "stub",
2029
+ "first_name" => nil,
2030
+ "last_name" => nil
457
2031
  }
458
- model = WorkOS::AgentInstanceDeletedData.new(fixture.to_json)
2032
+ model = WorkOS::FeatureFlagsFlagDeletedDataOwner.new(fixture.to_json)
459
2033
  json = model.to_h
460
2034
  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]
2035
+ assert_equal fixture["email"], json[:email]
2036
+ assert_nil json[:first_name]
2037
+ assert_nil json[:last_name]
467
2038
  fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
468
2039
  end
469
2040
 
470
- def test_agent_instance_session_created_round_trip
2041
+ def test_feature_flags_flag_deleted_context_round_trip
471
2042
  fixture = {
472
- "object" => "event",
473
- "id" => "stub",
474
- "event" => "agent.instance.session.created",
475
- "data" => {},
476
- "created_at" => "stub",
477
- "context" => {}
2043
+ "client_id" => "stub",
2044
+ "actor" => {}
478
2045
  }
479
- model = WorkOS::AgentInstanceSessionCreated.new(fixture.to_json)
2046
+ model = WorkOS::FeatureFlagsFlagDeletedContext.new(fixture.to_json)
480
2047
  json = model.to_h
481
2048
  assert_kind_of Hash, json
482
- assert_equal fixture["id"], json[:id]
483
- assert_equal fixture["created_at"], json[:created_at]
2049
+ assert_equal fixture["client_id"], json[:client_id]
484
2050
  fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
485
2051
  end
486
2052
 
487
- def test_agent_instance_session_created_data_round_trip
2053
+ def test_feature_flags_flag_deleted_context_actor_round_trip
488
2054
  fixture = {
489
- "object" => "agent_instance_session",
490
2055
  "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" => []
2056
+ "source" => "stub",
2057
+ "name" => nil
498
2058
  }
499
- model = WorkOS::AgentInstanceSessionCreatedData.new(fixture.to_json)
2059
+ model = WorkOS::FeatureFlagsFlagDeletedContextActor.new(fixture.to_json)
500
2060
  json = model.to_h
501
2061
  assert_kind_of Hash, json
502
2062
  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]
2063
+ assert_nil json[:name]
509
2064
  fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
510
2065
  end
511
2066
 
512
- def test_agent_instance_session_revoked_round_trip
2067
+ def test_feature_flags_flag_rule_created_round_trip
513
2068
  fixture = {
514
2069
  "object" => "event",
515
2070
  "id" => "stub",
516
- "event" => "agent.instance.session.revoked",
2071
+ "event" => "feature_flags.flag_rule.created",
517
2072
  "data" => {},
518
2073
  "created_at" => "stub",
519
2074
  "context" => {}
520
2075
  }
521
- model = WorkOS::AgentInstanceSessionRevoked.new(fixture.to_json)
2076
+ model = WorkOS::FeatureFlagsFlagRuleCreated.new(fixture.to_json)
522
2077
  json = model.to_h
523
2078
  assert_kind_of Hash, json
524
2079
  assert_equal fixture["id"], json[:id]
@@ -526,40 +2081,42 @@ class SharedModelRoundTripTest < Minitest::Test
526
2081
  fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
527
2082
  end
528
2083
 
529
- def test_agent_instance_session_revoked_data_round_trip
2084
+ def test_feature_flags_flag_rule_created_context_round_trip
2085
+ fixture = {
2086
+ "client_id" => "stub",
2087
+ "actor" => {}
2088
+ }
2089
+ model = WorkOS::FeatureFlagsFlagRuleCreatedContext.new(fixture.to_json)
2090
+ json = model.to_h
2091
+ assert_kind_of Hash, json
2092
+ assert_equal fixture["client_id"], json[:client_id]
2093
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
2094
+ end
2095
+
2096
+ def test_feature_flags_flag_rule_created_context_actor_round_trip
530
2097
  fixture = {
531
- "object" => "agent_instance_session",
532
2098
  "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"
2099
+ "source" => "stub",
2100
+ "name" => nil
539
2101
  }
540
- model = WorkOS::AgentInstanceSessionRevokedData.new(fixture.to_json)
2102
+ model = WorkOS::FeatureFlagsFlagRuleCreatedContextActor.new(fixture.to_json)
541
2103
  json = model.to_h
542
2104
  assert_kind_of Hash, json
543
2105
  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]
2106
+ assert_nil json[:name]
550
2107
  fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
551
2108
  end
552
2109
 
553
- def test_agent_registration_claim_attempt_created_round_trip
2110
+ def test_feature_flags_flag_rule_deleted_round_trip
554
2111
  fixture = {
555
2112
  "object" => "event",
556
2113
  "id" => "stub",
557
- "event" => "agent.registration.claim.attempt.created",
2114
+ "event" => "feature_flags.flag_rule.deleted",
558
2115
  "data" => {},
559
2116
  "created_at" => "stub",
560
2117
  "context" => {}
561
2118
  }
562
- model = WorkOS::AgentRegistrationClaimAttemptCreated.new(fixture.to_json)
2119
+ model = WorkOS::FeatureFlagsFlagRuleDeleted.new(fixture.to_json)
563
2120
  json = model.to_h
564
2121
  assert_kind_of Hash, json
565
2122
  assert_equal fixture["id"], json[:id]
@@ -567,144 +2124,106 @@ class SharedModelRoundTripTest < Minitest::Test
567
2124
  fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
568
2125
  end
569
2126
 
570
- def test_agent_registration_claim_attempt_created_data_round_trip
2127
+ def test_feature_flags_flag_rule_deleted_context_round_trip
571
2128
  fixture = {
572
- "object" => "agent_registration_claim_attempt",
573
- "id" => "stub",
574
- "agent_registration_id" => "stub",
575
- "agent_registration_claim_id" => "stub",
576
- "login_hint" => "stub",
577
- "expires_at" => "stub",
578
- "created_at" => "stub",
579
- "updated_at" => "stub"
2129
+ "client_id" => "stub",
2130
+ "actor" => {}
580
2131
  }
581
- model = WorkOS::AgentRegistrationClaimAttemptCreatedData.new(fixture.to_json)
2132
+ model = WorkOS::FeatureFlagsFlagRuleDeletedContext.new(fixture.to_json)
582
2133
  json = model.to_h
583
2134
  assert_kind_of Hash, json
584
- assert_equal fixture["id"], json[:id]
585
- assert_equal fixture["agent_registration_id"], json[:agent_registration_id]
586
- assert_equal fixture["agent_registration_claim_id"], json[:agent_registration_claim_id]
587
- assert_equal fixture["login_hint"], json[:login_hint]
588
- assert_equal fixture["expires_at"], json[:expires_at]
589
- assert_equal fixture["created_at"], json[:created_at]
590
- assert_equal fixture["updated_at"], json[:updated_at]
2135
+ assert_equal fixture["client_id"], json[:client_id]
591
2136
  fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
592
2137
  end
593
-
594
- def test_agent_registration_claim_completed_round_trip
595
- fixture = {
596
- "object" => "event",
597
- "id" => "stub",
598
- "event" => "agent.registration.claim.completed",
599
- "data" => {},
600
- "created_at" => "stub",
601
- "context" => {}
2138
+
2139
+ def test_feature_flags_flag_rule_deleted_context_actor_round_trip
2140
+ fixture = {
2141
+ "id" => "stub",
2142
+ "source" => "stub",
2143
+ "name" => nil
602
2144
  }
603
- model = WorkOS::AgentRegistrationClaimCompleted.new(fixture.to_json)
2145
+ model = WorkOS::FeatureFlagsFlagRuleDeletedContextActor.new(fixture.to_json)
604
2146
  json = model.to_h
605
2147
  assert_kind_of Hash, json
606
2148
  assert_equal fixture["id"], json[:id]
607
- assert_equal fixture["created_at"], json[:created_at]
2149
+ assert_nil json[:name]
608
2150
  fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
609
2151
  end
610
2152
 
611
- def test_agent_registration_claim_completed_data_round_trip
2153
+ def test_feature_flags_flag_rule_updated_round_trip
612
2154
  fixture = {
613
- "object" => "agent_registration_claim",
2155
+ "object" => "event",
614
2156
  "id" => "stub",
615
- "agent_registration_id" => "stub",
616
- "completed_by_attempt_id" => "stub",
617
- "claimed_by" => {},
618
- "completed_at" => "stub",
2157
+ "event" => "feature_flags.flag_rule.updated",
2158
+ "data" => {},
619
2159
  "created_at" => "stub",
620
- "updated_at" => "stub"
2160
+ "context" => {}
621
2161
  }
622
- model = WorkOS::AgentRegistrationClaimCompletedData.new(fixture.to_json)
2162
+ model = WorkOS::FeatureFlagsFlagRuleUpdated.new(fixture.to_json)
623
2163
  json = model.to_h
624
2164
  assert_kind_of Hash, json
625
2165
  assert_equal fixture["id"], json[:id]
626
- assert_equal fixture["agent_registration_id"], json[:agent_registration_id]
627
- assert_equal fixture["completed_by_attempt_id"], json[:completed_by_attempt_id]
628
- assert_equal fixture["completed_at"], json[:completed_at]
629
2166
  assert_equal fixture["created_at"], json[:created_at]
630
- assert_equal fixture["updated_at"], json[:updated_at]
631
2167
  fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
632
2168
  end
633
2169
 
634
- def test_agent_registration_claim_completed_data_claimed_by_round_trip
2170
+ def test_feature_flags_flag_rule_updated_context_round_trip
635
2171
  fixture = {
636
- "user_id" => "stub",
637
- "organization_id" => "stub"
2172
+ "client_id" => "stub",
2173
+ "actor" => {},
2174
+ "previous_attributes" => {}
638
2175
  }
639
- model = WorkOS::AgentRegistrationClaimCompletedDataClaimedBy.new(fixture.to_json)
2176
+ model = WorkOS::FeatureFlagsFlagRuleUpdatedContext.new(fixture.to_json)
640
2177
  json = model.to_h
641
2178
  assert_kind_of Hash, json
642
- assert_equal fixture["user_id"], json[:user_id]
2179
+ assert_equal fixture["client_id"], json[:client_id]
643
2180
  fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
644
2181
  end
645
2182
 
646
- def test_agent_registration_created_round_trip
2183
+ def test_feature_flags_flag_rule_updated_context_actor_round_trip
647
2184
  fixture = {
648
- "object" => "event",
649
2185
  "id" => "stub",
650
- "event" => "agent.registration.created",
651
- "data" => {},
652
- "created_at" => "stub",
653
- "context" => {}
2186
+ "source" => "stub",
2187
+ "name" => nil
654
2188
  }
655
- model = WorkOS::AgentRegistrationCreated.new(fixture.to_json)
2189
+ model = WorkOS::FeatureFlagsFlagRuleUpdatedContextActor.new(fixture.to_json)
656
2190
  json = model.to_h
657
2191
  assert_kind_of Hash, json
658
2192
  assert_equal fixture["id"], json[:id]
659
- assert_equal fixture["created_at"], json[:created_at]
2193
+ assert_nil json[:name]
660
2194
  fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
661
2195
  end
662
2196
 
663
- def test_agent_registration_created_data_round_trip
2197
+ def test_feature_flags_flag_rule_updated_context_previous_attribute_round_trip
664
2198
  fixture = {
665
- "object" => "agent_registration",
666
- "id" => "stub",
667
- "agent_identity" => {},
668
- "organization_id" => "stub",
669
- "status" => "stub",
670
- "kind" => "stub",
671
- "method" => "stub",
672
- "created_at" => "stub",
673
- "updated_at" => "stub"
2199
+ "data" => {}
674
2200
  }
675
- model = WorkOS::AgentRegistrationCreatedData.new(fixture.to_json)
2201
+ model = WorkOS::FeatureFlagsFlagRuleUpdatedContextPreviousAttribute.new(fixture.to_json)
676
2202
  json = model.to_h
677
2203
  assert_kind_of Hash, json
678
- assert_equal fixture["id"], json[:id]
679
- assert_equal fixture["organization_id"], json[:organization_id]
680
- assert_equal fixture["created_at"], json[:created_at]
681
- assert_equal fixture["updated_at"], json[:updated_at]
682
2204
  fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
683
2205
  end
684
2206
 
685
- def test_agent_registration_created_data_agent_identity_round_trip
2207
+ def test_feature_flags_flag_rule_updated_context_previous_attribute_data_round_trip
686
2208
  fixture = {
687
- "object" => "agent_identity",
688
- "id" => "stub",
689
- "userland_user_id" => "stub"
2209
+ "value" => true
690
2210
  }
691
- model = WorkOS::AgentRegistrationCreatedDataAgentIdentity.new(fixture.to_json)
2211
+ model = WorkOS::FeatureFlagsFlagRuleUpdatedContextPreviousAttributeData.new(fixture.to_json)
692
2212
  json = model.to_h
693
2213
  assert_kind_of Hash, json
694
- assert_equal fixture["id"], json[:id]
695
2214
  fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
696
2215
  end
697
2216
 
698
- def test_agent_registration_credential_issued_round_trip
2217
+ def test_feature_flags_flag_updated_round_trip
699
2218
  fixture = {
700
2219
  "object" => "event",
701
2220
  "id" => "stub",
702
- "event" => "agent.registration.credential.issued",
2221
+ "event" => "feature_flags.flag.updated",
703
2222
  "data" => {},
704
2223
  "created_at" => "stub",
705
2224
  "context" => {}
706
2225
  }
707
- model = WorkOS::AgentRegistrationCredentialIssued.new(fixture.to_json)
2226
+ model = WorkOS::FeatureFlagsFlagUpdated.new(fixture.to_json)
708
2227
  json = model.to_h
709
2228
  assert_kind_of Hash, json
710
2229
  assert_equal fixture["id"], json[:id]
@@ -712,116 +2231,128 @@ class SharedModelRoundTripTest < Minitest::Test
712
2231
  fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
713
2232
  end
714
2233
 
715
- def test_agent_registration_credential_issued_data_round_trip
2234
+ def test_feature_flags_flag_updated_data_round_trip
716
2235
  fixture = {
717
- "object" => "agent_registration_credential",
2236
+ "object" => "feature_flag",
718
2237
  "id" => "stub",
719
- "agent_registration_id" => "stub",
720
- "detail" => {},
2238
+ "environment_id" => "stub",
2239
+ "slug" => "stub",
2240
+ "name" => "stub",
2241
+ "description" => nil,
2242
+ "owner" => nil,
2243
+ "tags" => [],
2244
+ "enabled" => true,
2245
+ "default_value" => true,
721
2246
  "created_at" => "stub",
722
2247
  "updated_at" => "stub"
723
2248
  }
724
- model = WorkOS::AgentRegistrationCredentialIssuedData.new(fixture.to_json)
2249
+ model = WorkOS::FeatureFlagsFlagUpdatedData.new(fixture.to_json)
725
2250
  json = model.to_h
726
2251
  assert_kind_of Hash, json
727
2252
  assert_equal fixture["id"], json[:id]
728
- assert_equal fixture["agent_registration_id"], json[:agent_registration_id]
2253
+ assert_equal fixture["environment_id"], json[:environment_id]
2254
+ assert_equal fixture["slug"], json[:slug]
2255
+ assert_equal fixture["name"], json[:name]
2256
+ assert_nil json[:description]
2257
+ assert_equal fixture["enabled"], json[:enabled]
2258
+ assert_equal fixture["default_value"], json[:default_value]
729
2259
  assert_equal fixture["created_at"], json[:created_at]
730
2260
  assert_equal fixture["updated_at"], json[:updated_at]
731
2261
  fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
732
2262
  end
733
2263
 
734
- def test_agent_registration_credential_issued_data_detail_round_trip
2264
+ def test_feature_flags_flag_updated_data_owner_round_trip
735
2265
  fixture = {
736
- "kind" => "api_key",
737
- "api_key_id" => "stub"
2266
+ "email" => "stub",
2267
+ "first_name" => nil,
2268
+ "last_name" => nil
738
2269
  }
739
- model = WorkOS::AgentRegistrationCredentialIssuedDataDetail.new(fixture.to_json)
2270
+ model = WorkOS::FeatureFlagsFlagUpdatedDataOwner.new(fixture.to_json)
740
2271
  json = model.to_h
741
2272
  assert_kind_of Hash, json
742
- assert_equal fixture["api_key_id"], json[:api_key_id]
2273
+ assert_equal fixture["email"], json[:email]
2274
+ assert_nil json[:first_name]
2275
+ assert_nil json[:last_name]
743
2276
  fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
744
2277
  end
745
2278
 
746
- def test_access_token_agent_registration_credential_issued_data_detail_round_trip
2279
+ def test_feature_flags_flag_updated_context_round_trip
747
2280
  fixture = {
748
- "kind" => "access_token",
749
- "jti" => "stub",
750
- "expires_at" => "stub"
2281
+ "client_id" => "stub",
2282
+ "actor" => {},
2283
+ "previous_attributes" => {}
751
2284
  }
752
- model = WorkOS::AccessTokenAgentRegistrationCredentialIssuedDataDetail.new(fixture.to_json)
2285
+ model = WorkOS::FeatureFlagsFlagUpdatedContext.new(fixture.to_json)
753
2286
  json = model.to_h
754
2287
  assert_kind_of Hash, json
755
- assert_equal fixture["jti"], json[:jti]
2288
+ assert_equal fixture["client_id"], json[:client_id]
756
2289
  fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
757
2290
  end
758
2291
 
759
- def test_agent_registration_deleted_round_trip
2292
+ def test_feature_flags_flag_updated_context_actor_round_trip
760
2293
  fixture = {
761
- "object" => "event",
762
2294
  "id" => "stub",
763
- "event" => "agent.registration.deleted",
764
- "data" => {},
765
- "created_at" => "stub",
766
- "context" => {}
2295
+ "source" => "stub",
2296
+ "name" => nil
767
2297
  }
768
- model = WorkOS::AgentRegistrationDeleted.new(fixture.to_json)
2298
+ model = WorkOS::FeatureFlagsFlagUpdatedContextActor.new(fixture.to_json)
769
2299
  json = model.to_h
770
2300
  assert_kind_of Hash, json
771
2301
  assert_equal fixture["id"], json[:id]
772
- assert_equal fixture["created_at"], json[:created_at]
2302
+ assert_nil json[:name]
773
2303
  fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
774
2304
  end
775
2305
 
776
- def test_agent_registration_deleted_data_round_trip
2306
+ def test_feature_flags_flag_updated_context_previous_attribute_round_trip
777
2307
  fixture = {
778
- "agent_registration_id" => "stub"
2308
+ "data" => {}
779
2309
  }
780
- model = WorkOS::AgentRegistrationDeletedData.new(fixture.to_json)
2310
+ model = WorkOS::FeatureFlagsFlagUpdatedContextPreviousAttribute.new(fixture.to_json)
781
2311
  json = model.to_h
782
2312
  assert_kind_of Hash, json
783
- assert_equal fixture["agent_registration_id"], json[:agent_registration_id]
784
2313
  fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
785
2314
  end
786
2315
 
787
- def test_agent_registration_expired_round_trip
2316
+ def test_feature_flags_flag_updated_context_previous_attribute_data_round_trip
788
2317
  fixture = {
789
- "object" => "event",
790
- "id" => "stub",
791
- "event" => "agent.registration.expired",
792
- "data" => {},
793
- "created_at" => "stub",
794
- "context" => {}
2318
+ "name" => "stub",
2319
+ "description" => nil,
2320
+ "tags" => [],
2321
+ "owner" => nil,
2322
+ "enabled" => true,
2323
+ "default_value" => true
795
2324
  }
796
- model = WorkOS::AgentRegistrationExpired.new(fixture.to_json)
2325
+ model = WorkOS::FeatureFlagsFlagUpdatedContextPreviousAttributeData.new(fixture.to_json)
797
2326
  json = model.to_h
798
2327
  assert_kind_of Hash, json
799
- assert_equal fixture["id"], json[:id]
800
- assert_equal fixture["created_at"], json[:created_at]
801
2328
  fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
802
2329
  end
803
2330
 
804
- def test_agent_registration_expired_data_round_trip
2331
+ def test_feature_flags_flag_updated_context_previous_attribute_data_owner_round_trip
805
2332
  fixture = {
806
- "agent_registration_id" => "stub"
2333
+ "email" => "stub",
2334
+ "first_name" => nil,
2335
+ "last_name" => nil
807
2336
  }
808
- model = WorkOS::AgentRegistrationExpiredData.new(fixture.to_json)
2337
+ model = WorkOS::FeatureFlagsFlagUpdatedContextPreviousAttributeDataOwner.new(fixture.to_json)
809
2338
  json = model.to_h
810
2339
  assert_kind_of Hash, json
811
- assert_equal fixture["agent_registration_id"], json[:agent_registration_id]
2340
+ assert_equal fixture["email"], json[:email]
2341
+ assert_nil json[:first_name]
2342
+ assert_nil json[:last_name]
812
2343
  fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
813
2344
  end
814
2345
 
815
- def test_agent_registration_organization_switched_round_trip
2346
+ def test_feature_flags_flag_target_created_round_trip
816
2347
  fixture = {
817
2348
  "object" => "event",
818
2349
  "id" => "stub",
819
- "event" => "agent.registration.organization.switched",
2350
+ "event" => "feature_flags.flag_target.created",
820
2351
  "data" => {},
821
2352
  "created_at" => "stub",
822
2353
  "context" => {}
823
2354
  }
824
- model = WorkOS::AgentRegistrationOrganizationSwitched.new(fixture.to_json)
2355
+ model = WorkOS::FeatureFlagsFlagTargetCreated.new(fixture.to_json)
825
2356
  json = model.to_h
826
2357
  assert_kind_of Hash, json
827
2358
  assert_equal fixture["id"], json[:id]
@@ -829,59 +2360,42 @@ class SharedModelRoundTripTest < Minitest::Test
829
2360
  fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
830
2361
  end
831
2362
 
832
- def test_agent_registration_organization_switched_data_round_trip
2363
+ def test_feature_flags_flag_target_created_context_round_trip
833
2364
  fixture = {
834
- "agent_registration_id" => "stub",
835
- "from_organization_id" => "stub",
836
- "to_organization_id" => "stub"
2365
+ "client_id" => "stub",
2366
+ "actor" => {}
837
2367
  }
838
- model = WorkOS::AgentRegistrationOrganizationSwitchedData.new(fixture.to_json)
2368
+ model = WorkOS::FeatureFlagsFlagTargetCreatedContext.new(fixture.to_json)
839
2369
  json = model.to_h
840
2370
  assert_kind_of Hash, json
841
- assert_equal fixture["agent_registration_id"], json[:agent_registration_id]
842
- assert_equal fixture["from_organization_id"], json[:from_organization_id]
843
- assert_equal fixture["to_organization_id"], json[:to_organization_id]
2371
+ assert_equal fixture["client_id"], json[:client_id]
844
2372
  fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
845
2373
  end
846
2374
 
847
- def test_agent_registration_refreshed_round_trip
2375
+ def test_feature_flags_flag_target_created_context_actor_round_trip
848
2376
  fixture = {
849
- "object" => "event",
850
2377
  "id" => "stub",
851
- "event" => "agent.registration.refreshed",
852
- "data" => {},
853
- "created_at" => "stub",
854
- "context" => {}
2378
+ "source" => "stub",
2379
+ "name" => nil
855
2380
  }
856
- model = WorkOS::AgentRegistrationRefreshed.new(fixture.to_json)
2381
+ model = WorkOS::FeatureFlagsFlagTargetCreatedContextActor.new(fixture.to_json)
857
2382
  json = model.to_h
858
2383
  assert_kind_of Hash, json
859
2384
  assert_equal fixture["id"], json[:id]
860
- assert_equal fixture["created_at"], json[:created_at]
861
- fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
862
- end
863
-
864
- def test_agent_registration_refreshed_data_round_trip
865
- fixture = {
866
- "agent_registration_id" => "stub"
867
- }
868
- model = WorkOS::AgentRegistrationRefreshedData.new(fixture.to_json)
869
- json = model.to_h
870
- assert_kind_of Hash, json
871
- assert_equal fixture["agent_registration_id"], json[:agent_registration_id]
2385
+ assert_nil json[:name]
872
2386
  fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
873
2387
  end
874
2388
 
875
- def test_agent_registration_revoked_round_trip
2389
+ def test_feature_flags_flag_target_deleted_round_trip
876
2390
  fixture = {
877
2391
  "object" => "event",
878
2392
  "id" => "stub",
879
- "event" => "agent.registration.revoked",
2393
+ "event" => "feature_flags.flag_target.deleted",
880
2394
  "data" => {},
881
2395
  "created_at" => "stub",
882
2396
  "context" => {}
883
2397
  }
884
- model = WorkOS::AgentRegistrationRevoked.new(fixture.to_json)
2398
+ model = WorkOS::FeatureFlagsFlagTargetDeleted.new(fixture.to_json)
885
2399
  json = model.to_h
886
2400
  assert_kind_of Hash, json
887
2401
  assert_equal fixture["id"], json[:id]
@@ -889,14 +2403,29 @@ class SharedModelRoundTripTest < Minitest::Test
889
2403
  fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
890
2404
  end
891
2405
 
892
- def test_agent_registration_revoked_data_round_trip
2406
+ def test_feature_flags_flag_target_deleted_context_round_trip
893
2407
  fixture = {
894
- "agent_registration_id" => "stub"
2408
+ "client_id" => "stub",
2409
+ "actor" => {}
895
2410
  }
896
- model = WorkOS::AgentRegistrationRevokedData.new(fixture.to_json)
2411
+ model = WorkOS::FeatureFlagsFlagTargetDeletedContext.new(fixture.to_json)
897
2412
  json = model.to_h
898
2413
  assert_kind_of Hash, json
899
- assert_equal fixture["agent_registration_id"], json[:agent_registration_id]
2414
+ assert_equal fixture["client_id"], json[:client_id]
2415
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
2416
+ end
2417
+
2418
+ def test_feature_flags_flag_target_deleted_context_actor_round_trip
2419
+ fixture = {
2420
+ "id" => "stub",
2421
+ "source" => "stub",
2422
+ "name" => nil
2423
+ }
2424
+ model = WorkOS::FeatureFlagsFlagTargetDeletedContextActor.new(fixture.to_json)
2425
+ json = model.to_h
2426
+ assert_kind_of Hash, json
2427
+ assert_equal fixture["id"], json[:id]
2428
+ assert_nil json[:name]
900
2429
  fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
901
2430
  end
902
2431
 
@@ -1451,6 +2980,56 @@ class SharedModelRoundTripTest < Minitest::Test
1451
2980
  fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
1452
2981
  end
1453
2982
 
2983
+ def test_auth_method_mismatch_error_round_trip
2984
+ fixture = {
2985
+ "code" => "auth_method_mismatch",
2986
+ "message" => "stub"
2987
+ }
2988
+ model = WorkOS::AuthMethodMismatchError.new(fixture.to_json)
2989
+ json = model.to_h
2990
+ assert_kind_of Hash, json
2991
+ assert_equal fixture["message"], json[:message]
2992
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
2993
+ end
2994
+
2995
+ def test_data_integration_access_token_response_with_access_token_round_trip
2996
+ fixture = {
2997
+ "active" => true,
2998
+ "access_token" => {}
2999
+ }
3000
+ model = WorkOS::DataIntegrationAccessTokenResponseWithAccessToken.new(fixture.to_json)
3001
+ json = model.to_h
3002
+ assert_kind_of Hash, json
3003
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
3004
+ end
3005
+
3006
+ def test_data_integration_access_token_response_with_access_token_access_token_round_trip
3007
+ fixture = {
3008
+ "object" => "access_token",
3009
+ "access_token" => "stub",
3010
+ "expires_at" => nil,
3011
+ "scopes" => [],
3012
+ "missing_scopes" => []
3013
+ }
3014
+ model = WorkOS::DataIntegrationAccessTokenResponseWithAccessTokenAccessToken.new(fixture.to_json)
3015
+ json = model.to_h
3016
+ assert_kind_of Hash, json
3017
+ assert_equal fixture["access_token"], json[:access_token]
3018
+ assert_nil json[:expires_at]
3019
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
3020
+ end
3021
+
3022
+ def test_data_integration_access_token_response_with_error_round_trip
3023
+ fixture = {
3024
+ "active" => false,
3025
+ "error" => "stub"
3026
+ }
3027
+ model = WorkOS::DataIntegrationAccessTokenResponseWithError.new(fixture.to_json)
3028
+ json = model.to_h
3029
+ assert_kind_of Hash, json
3030
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
3031
+ end
3032
+
1454
3033
  def test_account_selection_required_error_round_trip
1455
3034
  fixture = {
1456
3035
  "code" => "account_selection_required",
@@ -1463,15 +3042,63 @@ class SharedModelRoundTripTest < Minitest::Test
1463
3042
  fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
1464
3043
  end
1465
3044
 
1466
- def test_auth_method_mismatch_error_round_trip
3045
+ def test_oauth_data_integration_vended_credential_round_trip
1467
3046
  fixture = {
1468
- "code" => "auth_method_mismatch",
1469
- "message" => "stub"
3047
+ "object" => "credential",
3048
+ "auth_method" => "oauth",
3049
+ "value" => "stub",
3050
+ "expires_at" => nil,
3051
+ "scopes" => [],
3052
+ "missing_scopes" => [],
3053
+ "metadata" => {},
3054
+ "config" => {}
1470
3055
  }
1471
- model = WorkOS::AuthMethodMismatchError.new(fixture.to_json)
3056
+ model = WorkOS::OAuthDataIntegrationVendedCredential.new(fixture.to_json)
3057
+ json = model.to_h
3058
+ assert_kind_of Hash, json
3059
+ assert_equal fixture["value"], json[:value]
3060
+ assert_nil json[:expires_at]
3061
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
3062
+ end
3063
+
3064
+ def test_client_credentials_data_integration_vended_credential_round_trip
3065
+ fixture = {
3066
+ "object" => "credential",
3067
+ "auth_method" => "client_credentials",
3068
+ "value" => "stub",
3069
+ "expires_at" => nil,
3070
+ "scopes" => [],
3071
+ "missing_scopes" => [],
3072
+ "metadata" => {},
3073
+ "config" => {}
3074
+ }
3075
+ model = WorkOS::ClientCredentialsDataIntegrationVendedCredential.new(fixture.to_json)
3076
+ json = model.to_h
3077
+ assert_kind_of Hash, json
3078
+ assert_equal fixture["value"], json[:value]
3079
+ assert_nil json[:expires_at]
3080
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
3081
+ end
3082
+
3083
+ def test_data_integration_credentials_response_with_credential_round_trip
3084
+ fixture = {
3085
+ "active" => true,
3086
+ "credential" => {}
3087
+ }
3088
+ model = WorkOS::DataIntegrationCredentialsResponseWithCredential.new(fixture.to_json)
3089
+ json = model.to_h
3090
+ assert_kind_of Hash, json
3091
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
3092
+ end
3093
+
3094
+ def test_data_integration_credentials_response_with_error_round_trip
3095
+ fixture = {
3096
+ "active" => false,
3097
+ "error" => "stub"
3098
+ }
3099
+ model = WorkOS::DataIntegrationCredentialsResponseWithError.new(fixture.to_json)
1472
3100
  json = model.to_h
1473
3101
  assert_kind_of Hash, json
1474
- assert_equal fixture["message"], json[:message]
1475
3102
  fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
1476
3103
  end
1477
3104
 
@@ -1513,4 +3140,20 @@ class SharedModelRoundTripTest < Minitest::Test
1513
3140
  assert_equal fixture["id"], json[:id]
1514
3141
  fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
1515
3142
  end
3143
+
3144
+ def test_sso_required_oauth_error_body_with_connection_ids_list_email_pending_authentication_token_round_trip
3145
+ fixture = {
3146
+ "error" => "sso_required",
3147
+ "error_description" => "stub",
3148
+ "connection_ids" => [],
3149
+ "email" => "stub",
3150
+ "pending_authentication_token" => "stub"
3151
+ }
3152
+ model = WorkOS::SSORequiredOAuthErrorBodyWithConnectionIdsListEmailPendingAuthenticationToken.new(fixture.to_json)
3153
+ json = model.to_h
3154
+ assert_kind_of Hash, json
3155
+ assert_equal fixture["error_description"], json[:error_description]
3156
+ assert_equal fixture["email"], json[:email]
3157
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
3158
+ end
1516
3159
  end