workos 10.5.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 (502) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/release-please.yml +3 -3
  3. data/.last-synced-sha +1 -1
  4. data/.oagen-manifest.json +387 -25
  5. data/.release-please-manifest.json +1 -1
  6. data/CHANGELOG.md +112 -0
  7. data/Gemfile.lock +2 -2
  8. data/README.md +2 -2
  9. data/lib/workos/agents/list_metadata.rb +22 -0
  10. data/lib/workos/api_keys/api_key_data_integration_vended_credential.rb +28 -0
  11. data/lib/workos/authorization/patch_group_role_assignments.rb +22 -0
  12. data/lib/workos/authorization.rb +26 -0
  13. data/lib/workos/base_client.rb +3 -0
  14. data/lib/workos/connect/connect_application.rb +3 -0
  15. data/lib/workos/connect/create_oauth_application.rb +3 -0
  16. data/lib/workos/connect/update_oauth_application.rb +5 -2
  17. data/lib/workos/connect.rb +6 -0
  18. data/lib/workos/events.rb +3 -11
  19. data/lib/workos/feature_flags/flag_created_data.rb +1 -46
  20. data/lib/workos/feature_flags/flag_deleted_data.rb +1 -1
  21. data/lib/workos/feature_flags/flag_rule.rb +49 -0
  22. data/lib/workos/feature_flags/flag_rule_updated_data.rb +1 -1
  23. data/lib/workos/feature_flags/flag_target.rb +52 -0
  24. data/lib/workos/feature_flags/flag_target_with_rule_id.rb +46 -0
  25. data/lib/workos/feature_flags/flag_target_with_value_type.rb +49 -0
  26. data/lib/workos/feature_flags/flag_updated_context_previous_attribute.rb +1 -12
  27. data/lib/workos/feature_flags/flag_updated_context_previous_attribute_data.rb +1 -28
  28. data/lib/workos/feature_flags/flag_updated_data.rb +1 -1
  29. data/lib/workos/groups/patch_group_memberships.rb +22 -0
  30. data/lib/workos/groups.rb +28 -0
  31. data/lib/workos/inflections.rb +30 -0
  32. data/lib/workos/organizations/it_contact_list_list_metadata.rb +22 -0
  33. data/lib/workos/organizations/organization_authentication_methods_required_oauth_error_body.rb +22 -0
  34. data/lib/workos/organizations/organization_connected_account_import_error_body.rb +22 -0
  35. data/lib/workos/organizations/organization_membership_not_found_oauth_error_body.rb +22 -0
  36. data/lib/workos/organizations/organization_not_found_oauth_error_body.rb +22 -0
  37. data/lib/workos/organizations/organization_selection_required_error_body.rb +22 -0
  38. data/lib/workos/organizations/organization_selection_required_error_body_with_organization.rb +7 -0
  39. data/lib/workos/organizations/organization_selection_required_error_body_with_organizations.rb +25 -0
  40. data/lib/workos/pipes/connected_account.rb +5 -2
  41. data/lib/workos/pipes/{connected_account_write_response_warning.rb → connected_account_warning.rb} +1 -1
  42. data/lib/workos/pipes/data_integration_authorize_url_response.rb +9 -2
  43. data/lib/workos/pipes/data_integration_finish_connection_response.rb +18 -0
  44. data/lib/workos/pipes/data_integration_vended_credential.rb +5 -5
  45. data/lib/workos/pipes/data_integrations_finish_connection_request.rb +25 -0
  46. data/lib/workos/pipes/data_integrations_get_data_integration_authorize_url_request.rb +14 -2
  47. data/lib/workos/pipes/data_integrations_list_response_data_connected_account.rb +4 -1
  48. data/lib/workos/pipes/data_integrations_list_response_data_connected_account_warning.rb +7 -0
  49. data/lib/workos/pipes/data_integrations_upsert_api_key_request.rb +8 -2
  50. data/lib/workos/pipes/data_integrations_upsert_client_credentials_request.rb +8 -2
  51. data/lib/workos/pipes.rb +62 -27
  52. data/lib/workos/shared/access_denied_oauth_error_body.rb +22 -0
  53. data/lib/workos/shared/account_selection_required_error_body.rb +7 -0
  54. data/lib/workos/shared/already_claimed_error_body.rb +22 -0
  55. data/lib/workos/shared/application_consent_required_error_body.rb +22 -0
  56. data/lib/workos/shared/auth_method_mismatch_error_body.rb +7 -0
  57. data/lib/workos/shared/authorization_pending_oauth_error_body.rb +22 -0
  58. data/lib/workos/shared/authorization_url_not_found_error_body.rb +22 -0
  59. data/lib/workos/shared/authorization_url_request_error_body.rb +22 -0
  60. data/lib/workos/shared/client_credentials_data_integration_vended_credential.rb +40 -0
  61. data/lib/workos/shared/code_challenge_not_found_error_body.rb +22 -0
  62. data/lib/workos/shared/connect_application_oauth.rb +3 -0
  63. data/lib/workos/shared/connected_account_limit_reached_error_body.rb +22 -0
  64. data/lib/workos/shared/daily_quota_exceeded_error_body.rb +22 -0
  65. data/lib/workos/shared/data_integration_access_token_response_with_access_token.rb +22 -0
  66. data/lib/workos/shared/data_integration_access_token_response_with_access_token_access_token.rb +7 -0
  67. data/lib/workos/shared/data_integration_access_token_response_with_error.rb +22 -0
  68. data/lib/workos/shared/data_integration_credentials_response_with_credential.rb +22 -0
  69. data/lib/workos/shared/data_integration_credentials_response_with_error.rb +22 -0
  70. data/lib/workos/shared/entity_not_found_error_body.rb +22 -0
  71. data/lib/workos/shared/error_body.rb +7 -0
  72. data/lib/workos/shared/error_body_with_code.rb +7 -0
  73. data/lib/workos/shared/error_body_with_code_errors.rb +25 -0
  74. data/lib/workos/shared/error_body_with_code_field_error.rb +22 -0
  75. data/lib/workos/shared/error_body_with_code_field_errors.rb +22 -0
  76. data/lib/workos/shared/error_body_with_code_instance_path_error.rb +18 -0
  77. data/lib/workos/shared/error_body_with_code_instance_path_errors.rb +25 -0
  78. data/lib/workos/shared/error_body_with_code_status_code.rb +25 -0
  79. data/lib/workos/shared/error_body_with_constraints_property_error.rb +22 -0
  80. data/lib/workos/shared/error_body_with_constraints_property_errors.rb +22 -0
  81. data/lib/workos/shared/error_body_with_error.rb +22 -0
  82. data/lib/workos/shared/error_body_with_error_message_list.rb +22 -0
  83. data/lib/workos/shared/error_body_with_message_or_message_list.rb +18 -0
  84. data/lib/workos/shared/expired_token_oauth_error_body.rb +22 -0
  85. data/lib/workos/shared/external_auth_session_already_completed_error_body.rb +22 -0
  86. data/lib/workos/shared/external_id_already_used_error_body.rb +22 -0
  87. data/lib/workos/shared/extra_attributes_required_oauth_error_body.rb +22 -0
  88. data/lib/workos/shared/feature_flags_flag_created.rb +34 -0
  89. data/lib/workos/shared/feature_flags_flag_created_context.rb +22 -0
  90. data/lib/workos/shared/feature_flags_flag_created_context_actor.rb +25 -0
  91. data/lib/workos/shared/feature_flags_flag_created_data.rb +52 -0
  92. data/lib/workos/shared/feature_flags_flag_created_data_owner.rb +7 -0
  93. data/lib/workos/shared/feature_flags_flag_deleted.rb +34 -0
  94. data/lib/workos/shared/feature_flags_flag_deleted_context.rb +22 -0
  95. data/lib/workos/shared/feature_flags_flag_deleted_context_actor.rb +25 -0
  96. data/lib/workos/shared/feature_flags_flag_deleted_data.rb +7 -0
  97. data/lib/workos/shared/feature_flags_flag_deleted_data_owner.rb +7 -0
  98. data/lib/workos/shared/feature_flags_flag_rule_created.rb +34 -0
  99. data/lib/workos/shared/feature_flags_flag_rule_created_context.rb +22 -0
  100. data/lib/workos/shared/feature_flags_flag_rule_created_context_actor.rb +25 -0
  101. data/lib/workos/shared/feature_flags_flag_rule_deleted.rb +34 -0
  102. data/lib/workos/shared/feature_flags_flag_rule_deleted_context.rb +22 -0
  103. data/lib/workos/shared/feature_flags_flag_rule_deleted_context_actor.rb +25 -0
  104. data/lib/workos/shared/feature_flags_flag_rule_updated.rb +34 -0
  105. data/lib/workos/shared/feature_flags_flag_rule_updated_context.rb +25 -0
  106. data/lib/workos/shared/feature_flags_flag_rule_updated_context_actor.rb +25 -0
  107. data/lib/workos/shared/feature_flags_flag_rule_updated_context_previous_attribute.rb +18 -0
  108. data/lib/workos/shared/feature_flags_flag_rule_updated_context_previous_attribute_data.rb +18 -0
  109. data/lib/workos/shared/feature_flags_flag_target_created.rb +34 -0
  110. data/lib/workos/shared/feature_flags_flag_target_created_context.rb +22 -0
  111. data/lib/workos/shared/feature_flags_flag_target_created_context_actor.rb +25 -0
  112. data/lib/workos/shared/feature_flags_flag_target_deleted.rb +34 -0
  113. data/lib/workos/shared/feature_flags_flag_target_deleted_context.rb +22 -0
  114. data/lib/workos/shared/feature_flags_flag_target_deleted_context_actor.rb +25 -0
  115. data/lib/workos/shared/feature_flags_flag_updated.rb +34 -0
  116. data/lib/workos/shared/feature_flags_flag_updated_context.rb +25 -0
  117. data/lib/workos/shared/feature_flags_flag_updated_context_actor.rb +25 -0
  118. data/lib/workos/shared/feature_flags_flag_updated_context_previous_attribute.rb +18 -0
  119. data/lib/workos/shared/feature_flags_flag_updated_context_previous_attribute_data.rb +34 -0
  120. data/lib/workos/shared/feature_flags_flag_updated_context_previous_attribute_data_owner.rb +7 -0
  121. data/lib/workos/shared/feature_flags_flag_updated_data.rb +7 -0
  122. data/lib/workos/shared/feature_flags_flag_updated_data_owner.rb +7 -0
  123. data/lib/workos/shared/idp_metadata_fetch_failed_error_body.rb +22 -0
  124. data/lib/workos/shared/invalid_client_oauth_error_body.rb +22 -0
  125. data/lib/workos/shared/invalid_connection_oauth_error_body.rb +22 -0
  126. data/lib/workos/shared/invalid_credentials_error_body.rb +22 -0
  127. data/lib/workos/shared/invalid_email_error_body.rb +22 -0
  128. data/lib/workos/shared/invalid_grant_oauth_error_body.rb +22 -0
  129. data/lib/workos/shared/invalid_idp_sso_url_error_body.rb +22 -0
  130. data/lib/workos/shared/invalid_link_authorization_code_oauth_error_body.rb +22 -0
  131. data/lib/workos/shared/invalid_locale_error_body.rb +22 -0
  132. data/lib/workos/shared/invalid_metadata_error_body.rb +22 -0
  133. data/lib/workos/shared/invalid_one_time_code_error_body.rb +22 -0
  134. data/lib/workos/shared/invalid_organization_id_error_body.rb +22 -0
  135. data/lib/workos/shared/invalid_password_hash_error_body.rb +22 -0
  136. data/lib/workos/shared/invalid_pending_authentication_token_error_body.rb +22 -0
  137. data/lib/workos/shared/invalid_profile_oauth_error_body.rb +22 -0
  138. data/lib/workos/shared/invalid_refresh_token_error_body.rb +22 -0
  139. data/lib/workos/shared/invalid_request_oauth_error_body.rb +22 -0
  140. data/lib/workos/shared/invalid_request_parameters_error_body.rb +22 -0
  141. data/lib/workos/shared/invalid_request_parameters_error_body_with_errors.rb +25 -0
  142. data/lib/workos/shared/invalid_role_error_body.rb +22 -0
  143. data/lib/workos/shared/invalid_url_error_body.rb +22 -0
  144. data/lib/workos/shared/mfa_challenge_error_body.rb +22 -0
  145. data/lib/workos/shared/mfa_enrollment_error_body.rb +22 -0
  146. data/lib/workos/shared/mfa_enrollment_oauth_error_body.rb +22 -0
  147. data/lib/workos/shared/multiple_roles_not_enabled_error_body.rb +22 -0
  148. data/lib/workos/shared/must_use_sso_for_selected_organization_message_error_body.rb +18 -0
  149. data/lib/workos/shared/oauth_data_integration_vended_credential.rb +40 -0
  150. data/lib/workos/shared/oauth_error_body.rb +22 -0
  151. data/lib/workos/shared/one_time_code_expired_error_body.rb +22 -0
  152. data/lib/workos/shared/one_time_code_previously_used_error_body.rb +22 -0
  153. data/lib/workos/shared/one_time_code_too_many_attempts_error_body.rb +22 -0
  154. data/lib/workos/shared/passkey_progressive_enrollment_error_body.rb +22 -0
  155. data/lib/workos/shared/phone_number_required_error_body.rb +22 -0
  156. data/lib/workos/shared/pkce_not_supported_oauth_error_body.rb +22 -0
  157. data/lib/workos/shared/policy_denied_error_body.rb +22 -0
  158. data/lib/workos/shared/radar_challenge_error_body.rb +22 -0
  159. data/lib/workos/shared/radar_sign_up_challenge_error_body.rb +22 -0
  160. data/lib/workos/shared/radar_sms_sign_in_challenge_error_body.rb +22 -0
  161. data/lib/workos/shared/rate_limit_exceeded_error_body_with_retry_after.rb +25 -0
  162. data/lib/workos/shared/sign_up_not_allowed_oauth_error_body.rb +22 -0
  163. data/lib/workos/shared/slow_down_oauth_error_body.rb +22 -0
  164. data/lib/workos/shared/sms_challenge_quota_reached_error_body.rb +22 -0
  165. data/lib/workos/shared/sms_challenge_rate_limited_error_body.rb +22 -0
  166. data/lib/workos/shared/sso_required_oauth_error_body_with_connection_ids_list_email_pending_authentication_token.rb +31 -0
  167. data/lib/workos/shared/sub_resource_scoped_role_not_allowed_error_body_with_role_slug.rb +25 -0
  168. data/lib/workos/shared/token_too_big_oauth_error_body.rb +22 -0
  169. data/lib/workos/shared/too_many_failed_verification_attempts_error_body_with_retry_after.rb +25 -0
  170. data/lib/workos/shared/too_many_requests_oauth_error_body.rb +22 -0
  171. data/lib/workos/shared/unauthorized_client_oauth_error_body.rb +22 -0
  172. data/lib/workos/shared/unauthorized_error_body.rb +18 -0
  173. data/lib/workos/shared/update_audit_logs_retention_with_retention_period.rb +18 -0
  174. data/lib/workos/shared/update_audit_logs_retention_with_retention_period_in_days.rb +26 -0
  175. data/lib/workos/shared/update_user_organization_membership_with_role_slug.rb +18 -0
  176. data/lib/workos/shared/update_user_organization_membership_with_role_slugs.rb +18 -0
  177. data/lib/workos/shared/verification_id_required_error_body.rb +22 -0
  178. data/lib/workos/sso/connection_could_not_be_verified_error_body.rb +22 -0
  179. data/lib/workos/sso/connection_creation_conflict_error_body.rb +22 -0
  180. data/lib/workos/sso/connection_creation_not_found_error_body.rb +22 -0
  181. data/lib/workos/sso/connection_finish_error_body.rb +22 -0
  182. data/lib/workos/sso/connection_type_not_updatable_error_body.rb +22 -0
  183. data/lib/workos/types/authorization_url_not_found_error_body_code.rb +14 -0
  184. data/lib/workos/types/authorization_url_request_error_body_code.rb +14 -0
  185. data/lib/workos/types/connection_creation_conflict_error_body_code.rb +13 -0
  186. data/lib/workos/types/connection_creation_not_found_error_body_code.rb +13 -0
  187. data/lib/workos/types/connection_finish_error_body_code.rb +29 -0
  188. data/lib/workos/types/create_data_integration_ownership.rb +5 -1
  189. data/lib/workos/types/create_magic_code_and_return_locale.rb +101 -0
  190. data/lib/workos/types/{connected_account_write_response_auth_method.rb → create_password_reset_token_locale.rb} +1 -1
  191. data/lib/workos/types/create_user_invite_options_locale.rb +1 -93
  192. data/lib/workos/types/create_webhook_endpoint_events.rb +9 -1
  193. data/lib/workos/types/data_integration_access_token_response_with_error_error.rb +9 -0
  194. data/lib/workos/types/data_integration_credentials_response_with_error_error.rb +9 -0
  195. data/lib/workos/types/data_integration_ownership.rb +1 -1
  196. data/lib/workos/types/data_integrations_create_api_key_connection_request_connection_owner.rb +1 -1
  197. data/lib/workos/types/data_integrations_create_client_credentials_connection_request_connection_owner.rb +1 -1
  198. data/lib/workos/types/data_integrations_get_data_integration_authorize_url_request_connection_intent.rb +13 -0
  199. data/lib/workos/types/data_integrations_get_data_integration_authorize_url_request_connection_owner.rb +1 -1
  200. data/lib/workos/types/data_integrations_get_user_token_request_connection_owner.rb +1 -1
  201. data/lib/workos/types/data_integrations_list_response_data_connection_owner.rb +1 -1
  202. data/lib/workos/types/data_integrations_upsert_api_key_request_connection_owner.rb +1 -1
  203. data/lib/workos/types/data_integrations_upsert_client_credentials_request_connection_owner.rb +1 -1
  204. data/lib/workos/types/data_integrations_vend_credentials_request_connection_owner.rb +1 -1
  205. data/lib/workos/types/error_body_code.rb +183 -0
  206. data/lib/workos/types/{connected_account_write_response_connection_role.rb → feature_flags_flag_created_context_actor_source.rb} +1 -1
  207. data/lib/workos/types/feature_flags_flag_deleted_context_actor_source.rb +9 -0
  208. data/lib/workos/types/feature_flags_flag_rule_created_context_actor_source.rb +9 -0
  209. data/lib/workos/types/feature_flags_flag_rule_deleted_context_actor_source.rb +9 -0
  210. data/lib/workos/types/feature_flags_flag_rule_updated_context_actor_source.rb +9 -0
  211. data/lib/workos/types/feature_flags_flag_target_created_context_actor_source.rb +9 -0
  212. data/lib/workos/types/feature_flags_flag_target_deleted_context_actor_source.rb +9 -0
  213. data/lib/workos/types/feature_flags_flag_updated_context_actor_source.rb +9 -0
  214. data/lib/workos/types/organization_connected_account_import_error_body_code.rb +14 -0
  215. data/lib/workos/types/pipes_ownership.rb +1 -1
  216. data/lib/workos/types/resend_user_invite_options_locale.rb +1 -1
  217. data/lib/workos/types/resource_export_completed_data_resource_type.rb +3 -1
  218. data/lib/workos/types/{connected_account_write_response_state.rb → send_email_change_locale.rb} +1 -1
  219. data/lib/workos/types/send_verification_email_locale.rb +9 -0
  220. data/lib/workos/types/update_audit_logs_retention_with_retention_period_retention_period.rb +9 -0
  221. data/lib/workos/types/user_connected_account_import_error_body_code.rb +15 -0
  222. data/lib/workos/types/widget_session_token_scopes.rb +3 -1
  223. data/lib/workos/user_management/action_denied_error_body.rb +22 -0
  224. data/lib/workos/user_management/authentication_method_not_allowed_error_body.rb +22 -0
  225. data/lib/workos/user_management/authentication_method_not_allowed_oauth_error_body.rb +22 -0
  226. data/lib/workos/user_management/create_magic_code_and_return.rb +5 -2
  227. data/lib/workos/user_management/create_password_reset_token.rb +16 -1
  228. data/lib/workos/user_management/email_already_in_use_error_body.rb +22 -0
  229. data/lib/workos/user_management/email_already_verified_error_body.rb +22 -0
  230. data/lib/workos/user_management/email_change_not_allowed_error_body.rb +22 -0
  231. data/lib/workos/user_management/email_completion_required_error_body_with_email_completion_token.rb +25 -0
  232. data/lib/workos/user_management/email_domain_not_deliverable_error_body.rb +22 -0
  233. data/lib/workos/user_management/email_not_available_error_body.rb +22 -0
  234. data/lib/workos/user_management/email_password_auth_disabled_error_body.rb +22 -0
  235. data/lib/workos/user_management/email_verification_required_error_body.rb +22 -0
  236. data/lib/workos/user_management/invitation_cannot_be_used_for_email_oauth_error_body.rb +22 -0
  237. data/lib/workos/user_management/invitation_invalid_oauth_error_body.rb +22 -0
  238. data/lib/workos/user_management/password_and_password_hash_provided_error_body.rb +22 -0
  239. data/lib/workos/user_management/password_and_password_hash_type_provided_error_body.rb +22 -0
  240. data/lib/workos/user_management/password_salt_position_requires_password_hash_error_body.rb +22 -0
  241. data/lib/workos/user_management/password_strength_error_error_body_with_errors.rb +25 -0
  242. data/lib/workos/user_management/send_email_change.rb +6 -2
  243. data/lib/workos/user_management/send_verification_email.rb +18 -0
  244. data/lib/workos/user_management/user_connected_account_import_error_body.rb +22 -0
  245. data/lib/workos/user_management/user_consent_options_not_supported_error_body.rb +22 -0
  246. data/lib/workos/user_management/user_creation_error_error_body_with_errors.rb +25 -0
  247. data/lib/workos/user_management/user_mismatch_error_body.rb +22 -0
  248. data/lib/workos/user_management/waitlist_list_response.rb +25 -0
  249. data/lib/workos/user_management/waitlist_list_response_list_metadata.rb +7 -0
  250. data/lib/workos/user_management.rb +25 -10
  251. data/lib/workos/version.rb +1 -1
  252. data/rbi/workos/access_denied_oauth_error_body.rbi +30 -0
  253. data/rbi/workos/{connected_account_write_response_warning.rbi → account_selection_required_error_body.rbi} +1 -1
  254. data/rbi/workos/action_denied_error_body.rbi +30 -0
  255. data/rbi/workos/admin_portal.rbi +2 -2
  256. data/rbi/workos/agents.rbi +20 -20
  257. data/rbi/workos/already_claimed_error_body.rbi +30 -0
  258. data/rbi/workos/api_key_data_integration_vended_credential.rbi +42 -0
  259. data/rbi/workos/api_keys.rbi +5 -5
  260. data/rbi/workos/application_consent_required_error_body.rbi +30 -0
  261. data/rbi/workos/audit_logs.rbi +10 -10
  262. data/rbi/workos/auth_method_mismatch_error_body.rbi +30 -0
  263. data/rbi/workos/authentication_method_not_allowed_error_body.rbi +30 -0
  264. data/rbi/workos/authentication_method_not_allowed_oauth_error_body.rbi +30 -0
  265. data/rbi/workos/authorization.rbi +55 -45
  266. data/rbi/workos/authorization_pending_oauth_error_body.rbi +30 -0
  267. data/rbi/workos/authorization_url_not_found_error_body.rbi +30 -0
  268. data/rbi/workos/authorization_url_request_error_body.rbi +30 -0
  269. data/rbi/workos/client_api.rbi +1 -1
  270. data/rbi/workos/client_credentials_data_integration_vended_credential.rbi +66 -0
  271. data/rbi/workos/code_challenge_not_found_error_body.rbi +30 -0
  272. data/rbi/workos/connect.rbi +12 -10
  273. data/rbi/workos/connect_application_oauth.rbi +6 -0
  274. data/rbi/workos/connected_account.rbi +6 -0
  275. data/rbi/workos/connected_account_limit_reached_error_body.rbi +30 -0
  276. data/rbi/workos/connected_account_warning.rbi +30 -0
  277. data/rbi/workos/connection_could_not_be_verified_error_body.rbi +30 -0
  278. data/rbi/workos/connection_creation_conflict_error_body.rbi +30 -0
  279. data/rbi/workos/connection_creation_not_found_error_body.rbi +30 -0
  280. data/rbi/workos/connection_finish_error_body.rbi +30 -0
  281. data/rbi/workos/connection_type_not_updatable_error_body.rbi +30 -0
  282. data/rbi/workos/create_magic_code_and_return.rbi +6 -0
  283. data/rbi/workos/create_oauth_application.rbi +6 -0
  284. data/rbi/workos/create_password_reset_token.rbi +6 -0
  285. data/rbi/workos/daily_quota_exceeded_error_body.rbi +30 -0
  286. data/rbi/workos/data_integration_access_token_response_with_access_token.rbi +30 -0
  287. data/rbi/workos/data_integration_access_token_response_with_access_token_access_token.rbi +48 -0
  288. data/rbi/workos/data_integration_access_token_response_with_error.rbi +30 -0
  289. data/rbi/workos/data_integration_authorize_url_response.rbi +12 -0
  290. data/rbi/workos/data_integration_credentials_response_with_credential.rbi +30 -0
  291. data/rbi/workos/data_integration_credentials_response_with_error.rbi +30 -0
  292. data/rbi/workos/data_integration_finish_connection_response.rbi +24 -0
  293. data/rbi/workos/data_integration_vended_credential.rbi +6 -6
  294. data/rbi/workos/data_integrations_finish_connection_request.rbi +36 -0
  295. data/rbi/workos/data_integrations_get_data_integration_authorize_url_request.rbi +24 -0
  296. data/rbi/workos/data_integrations_list_response_data_connected_account.rbi +6 -0
  297. data/rbi/workos/data_integrations_list_response_data_connected_account_warning.rbi +30 -0
  298. data/rbi/workos/data_integrations_upsert_api_key_request.rbi +12 -0
  299. data/rbi/workos/data_integrations_upsert_client_credentials_request.rbi +12 -0
  300. data/rbi/workos/directory_sync.rbi +8 -8
  301. data/rbi/workos/email_already_in_use_error_body.rbi +30 -0
  302. data/rbi/workos/email_already_verified_error_body.rbi +30 -0
  303. data/rbi/workos/email_change_not_allowed_error_body.rbi +30 -0
  304. data/rbi/workos/email_completion_required_error_body_with_email_completion_token.rbi +36 -0
  305. data/rbi/workos/email_domain_not_deliverable_error_body.rbi +30 -0
  306. data/rbi/workos/email_not_available_error_body.rbi +30 -0
  307. data/rbi/workos/email_password_auth_disabled_error_body.rbi +30 -0
  308. data/rbi/workos/email_verification_required_error_body.rbi +30 -0
  309. data/rbi/workos/entity_not_found_error_body.rbi +30 -0
  310. data/rbi/workos/error_body.rbi +24 -0
  311. data/rbi/workos/error_body_with_code.rbi +30 -0
  312. data/rbi/workos/error_body_with_code_errors.rbi +36 -0
  313. data/rbi/workos/error_body_with_code_field_error.rbi +30 -0
  314. data/rbi/workos/error_body_with_code_field_errors.rbi +30 -0
  315. data/rbi/workos/error_body_with_code_instance_path_error.rbi +24 -0
  316. data/rbi/workos/error_body_with_code_instance_path_errors.rbi +36 -0
  317. data/rbi/workos/error_body_with_code_status_code.rbi +36 -0
  318. data/rbi/workos/error_body_with_constraints_property_error.rbi +30 -0
  319. data/rbi/workos/error_body_with_constraints_property_errors.rbi +30 -0
  320. data/rbi/workos/error_body_with_error.rbi +30 -0
  321. data/rbi/workos/error_body_with_error_message_list.rbi +30 -0
  322. data/rbi/workos/error_body_with_message_or_message_list.rbi +24 -0
  323. data/rbi/workos/events.rbi +1 -3
  324. data/rbi/workos/expired_token_oauth_error_body.rbi +30 -0
  325. data/rbi/workos/external_auth_session_already_completed_error_body.rbi +30 -0
  326. data/rbi/workos/external_id_already_used_error_body.rbi +30 -0
  327. data/rbi/workos/extra_attributes_required_oauth_error_body.rbi +30 -0
  328. data/rbi/workos/feature_flags.rbi +8 -8
  329. data/rbi/workos/feature_flags_flag_created.rbi +54 -0
  330. data/rbi/workos/feature_flags_flag_created_context.rbi +30 -0
  331. data/rbi/workos/feature_flags_flag_created_context_actor.rbi +36 -0
  332. data/rbi/workos/feature_flags_flag_created_data.rbi +90 -0
  333. data/rbi/workos/feature_flags_flag_created_data_owner.rbi +36 -0
  334. data/rbi/workos/feature_flags_flag_deleted.rbi +54 -0
  335. data/rbi/workos/feature_flags_flag_deleted_context.rbi +30 -0
  336. data/rbi/workos/feature_flags_flag_deleted_context_actor.rbi +36 -0
  337. data/rbi/workos/feature_flags_flag_deleted_data.rbi +90 -0
  338. data/rbi/workos/feature_flags_flag_deleted_data_owner.rbi +36 -0
  339. data/rbi/workos/feature_flags_flag_rule_created.rbi +54 -0
  340. data/rbi/workos/feature_flags_flag_rule_created_context.rbi +30 -0
  341. data/rbi/workos/feature_flags_flag_rule_created_context_actor.rbi +36 -0
  342. data/rbi/workos/feature_flags_flag_rule_deleted.rbi +54 -0
  343. data/rbi/workos/feature_flags_flag_rule_deleted_context.rbi +30 -0
  344. data/rbi/workos/feature_flags_flag_rule_deleted_context_actor.rbi +36 -0
  345. data/rbi/workos/feature_flags_flag_rule_updated.rbi +54 -0
  346. data/rbi/workos/feature_flags_flag_rule_updated_context.rbi +36 -0
  347. data/rbi/workos/feature_flags_flag_rule_updated_context_actor.rbi +36 -0
  348. data/rbi/workos/feature_flags_flag_rule_updated_context_previous_attribute.rbi +24 -0
  349. data/rbi/workos/feature_flags_flag_rule_updated_context_previous_attribute_data.rbi +24 -0
  350. data/rbi/workos/feature_flags_flag_target_created.rbi +54 -0
  351. data/rbi/workos/feature_flags_flag_target_created_context.rbi +30 -0
  352. data/rbi/workos/feature_flags_flag_target_created_context_actor.rbi +36 -0
  353. data/rbi/workos/feature_flags_flag_target_deleted.rbi +54 -0
  354. data/rbi/workos/feature_flags_flag_target_deleted_context.rbi +30 -0
  355. data/rbi/workos/feature_flags_flag_target_deleted_context_actor.rbi +36 -0
  356. data/rbi/workos/feature_flags_flag_updated.rbi +54 -0
  357. data/rbi/workos/feature_flags_flag_updated_context.rbi +36 -0
  358. data/rbi/workos/feature_flags_flag_updated_context_actor.rbi +36 -0
  359. data/rbi/workos/feature_flags_flag_updated_context_previous_attribute.rbi +24 -0
  360. data/rbi/workos/feature_flags_flag_updated_context_previous_attribute_data.rbi +54 -0
  361. data/rbi/workos/feature_flags_flag_updated_context_previous_attribute_data_owner.rbi +36 -0
  362. data/rbi/workos/feature_flags_flag_updated_data.rbi +90 -0
  363. data/rbi/workos/feature_flags_flag_updated_data_owner.rbi +36 -0
  364. data/rbi/workos/flag_rule.rbi +84 -0
  365. data/rbi/workos/flag_target.rbi +90 -0
  366. data/rbi/workos/flag_target_with_rule_id.rbi +78 -0
  367. data/rbi/workos/flag_target_with_value_type.rbi +84 -0
  368. data/rbi/workos/group_role_assignment_list.rbi +36 -0
  369. data/rbi/workos/groups.rbi +19 -8
  370. data/rbi/workos/idp_metadata_fetch_failed_error_body.rbi +30 -0
  371. data/rbi/workos/invalid_client_oauth_error_body.rbi +30 -0
  372. data/rbi/workos/invalid_connection_oauth_error_body.rbi +30 -0
  373. data/rbi/workos/invalid_credentials_error_body.rbi +30 -0
  374. data/rbi/workos/invalid_email_error_body.rbi +30 -0
  375. data/rbi/workos/invalid_grant_oauth_error_body.rbi +30 -0
  376. data/rbi/workos/invalid_idp_sso_url_error_body.rbi +30 -0
  377. data/rbi/workos/invalid_link_authorization_code_oauth_error_body.rbi +30 -0
  378. data/rbi/workos/invalid_locale_error_body.rbi +30 -0
  379. data/rbi/workos/invalid_metadata_error_body.rbi +30 -0
  380. data/rbi/workos/invalid_one_time_code_error_body.rbi +30 -0
  381. data/rbi/workos/invalid_organization_id_error_body.rbi +30 -0
  382. data/rbi/workos/invalid_password_hash_error_body.rbi +30 -0
  383. data/rbi/workos/invalid_pending_authentication_token_error_body.rbi +30 -0
  384. data/rbi/workos/invalid_profile_oauth_error_body.rbi +30 -0
  385. data/rbi/workos/invalid_refresh_token_error_body.rbi +30 -0
  386. data/rbi/workos/invalid_request_oauth_error_body.rbi +30 -0
  387. data/rbi/workos/invalid_request_parameters_error_body.rbi +30 -0
  388. data/rbi/workos/invalid_request_parameters_error_body_with_errors.rbi +36 -0
  389. data/rbi/workos/invalid_role_error_body.rbi +30 -0
  390. data/rbi/workos/invalid_url_error_body.rbi +30 -0
  391. data/rbi/workos/invitation_cannot_be_used_for_email_oauth_error_body.rbi +30 -0
  392. data/rbi/workos/invitation_invalid_oauth_error_body.rbi +30 -0
  393. data/rbi/workos/it_contact_list.rbi +36 -0
  394. data/rbi/workos/it_contact_list_list_metadata.rbi +30 -0
  395. data/rbi/workos/list_metadata.rbi +30 -0
  396. data/rbi/workos/mfa_challenge_error_body.rbi +30 -0
  397. data/rbi/workos/mfa_enrollment_error_body.rbi +30 -0
  398. data/rbi/workos/mfa_enrollment_oauth_error_body.rbi +30 -0
  399. data/rbi/workos/multi_factor_auth.rbi +7 -7
  400. data/rbi/workos/multiple_roles_not_enabled_error_body.rbi +30 -0
  401. data/rbi/workos/must_use_sso_for_selected_organization_message_error_body.rbi +24 -0
  402. data/rbi/workos/oauth_data_integration_vended_credential.rbi +66 -0
  403. data/rbi/workos/oauth_error_body.rbi +30 -0
  404. data/rbi/workos/one_time_code_expired_error_body.rbi +30 -0
  405. data/rbi/workos/one_time_code_previously_used_error_body.rbi +30 -0
  406. data/rbi/workos/one_time_code_too_many_attempts_error_body.rbi +30 -0
  407. data/rbi/workos/organization_authentication_methods_required_oauth_error_body.rbi +30 -0
  408. data/rbi/workos/organization_connected_account_import_error_body.rbi +30 -0
  409. data/rbi/workos/organization_domains.rbi +4 -4
  410. data/rbi/workos/organization_membership_not_found_oauth_error_body.rbi +30 -0
  411. data/rbi/workos/organization_membership_service.rbi +8 -8
  412. data/rbi/workos/organization_not_found_oauth_error_body.rbi +30 -0
  413. data/rbi/workos/organization_selection_required_error_body.rbi +30 -0
  414. data/rbi/workos/organization_selection_required_error_body_with_organization.rbi +30 -0
  415. data/rbi/workos/organization_selection_required_error_body_with_organizations.rbi +36 -0
  416. data/rbi/workos/organizations.rbi +13 -13
  417. data/rbi/workos/passkey_progressive_enrollment_error_body.rbi +30 -0
  418. data/rbi/workos/password_and_password_hash_provided_error_body.rbi +30 -0
  419. data/rbi/workos/password_and_password_hash_type_provided_error_body.rbi +30 -0
  420. data/rbi/workos/password_salt_position_requires_password_hash_error_body.rbi +30 -0
  421. data/rbi/workos/password_strength_error_error_body_with_errors.rbi +36 -0
  422. data/rbi/workos/patch_group_memberships.rbi +30 -0
  423. data/rbi/workos/patch_group_role_assignments.rbi +30 -0
  424. data/rbi/workos/phone_number_required_error_body.rbi +30 -0
  425. data/rbi/workos/pipes.rbi +51 -33
  426. data/rbi/workos/pipes_provider.rbi +2 -2
  427. data/rbi/workos/pkce_not_supported_oauth_error_body.rbi +30 -0
  428. data/rbi/workos/platform_teams.rbi +2 -2
  429. data/rbi/workos/policy_denied_error_body.rbi +30 -0
  430. data/rbi/workos/radar.rbi +4 -4
  431. data/rbi/workos/radar_challenge_error_body.rbi +30 -0
  432. data/rbi/workos/radar_sign_up_challenge_error_body.rbi +30 -0
  433. data/rbi/workos/radar_sms_sign_in_challenge_error_body.rbi +30 -0
  434. data/rbi/workos/rate_limit_exceeded_error_body_with_retry_after.rbi +36 -0
  435. data/rbi/workos/send_email_change.rbi +6 -0
  436. data/rbi/workos/send_verification_email.rbi +24 -0
  437. data/rbi/workos/sign_up_not_allowed_oauth_error_body.rbi +30 -0
  438. data/rbi/workos/slow_down_oauth_error_body.rbi +30 -0
  439. data/rbi/workos/sms_challenge_quota_reached_error_body.rbi +30 -0
  440. data/rbi/workos/sms_challenge_rate_limited_error_body.rbi +30 -0
  441. data/rbi/workos/sso.rbi +18 -18
  442. data/rbi/workos/sso_required_oauth_error_body_with_connection_ids_list_email_pending_authentication_token.rbi +48 -0
  443. data/rbi/workos/sub_resource_scoped_role_not_allowed_error_body_with_role_slug.rbi +36 -0
  444. data/rbi/workos/token_too_big_oauth_error_body.rbi +30 -0
  445. data/rbi/workos/too_many_failed_verification_attempts_error_body_with_retry_after.rbi +36 -0
  446. data/rbi/workos/too_many_requests_oauth_error_body.rbi +30 -0
  447. data/rbi/workos/unauthorized_client_oauth_error_body.rbi +30 -0
  448. data/rbi/workos/unauthorized_error_body.rbi +24 -0
  449. data/rbi/workos/update_audit_logs_retention_with_retention_period.rbi +24 -0
  450. data/rbi/workos/update_audit_logs_retention_with_retention_period_in_days.rbi +24 -0
  451. data/rbi/workos/update_oauth_application.rbi +6 -0
  452. data/rbi/workos/update_user_organization_membership_with_role_slug.rbi +24 -0
  453. data/rbi/workos/update_user_organization_membership_with_role_slugs.rbi +24 -0
  454. data/rbi/workos/user_connected_account_import_error_body.rbi +30 -0
  455. data/rbi/workos/user_consent_options_not_supported_error_body.rbi +30 -0
  456. data/rbi/workos/user_creation_error_error_body_with_errors.rbi +36 -0
  457. data/rbi/workos/user_management.rbi +77 -61
  458. data/rbi/workos/user_mismatch_error_body.rbi +30 -0
  459. data/rbi/workos/vault.rbi +11 -11
  460. data/rbi/workos/verification_id_required_error_body.rbi +30 -0
  461. data/rbi/workos/version_list_response.rbi +30 -0
  462. data/rbi/workos/waitlist_list_response.rbi +36 -0
  463. data/rbi/workos/waitlist_list_response_list_metadata.rbi +30 -0
  464. data/rbi/workos/webhooks.rbi +4 -4
  465. data/rbi/workos/widgets.rbi +1 -1
  466. data/test/workos/test_agents_model_round_trip.rb +11 -0
  467. data/test/workos/test_api_keys_model_round_trip.rb +14 -0
  468. data/test/workos/test_authorization.rb +8 -0
  469. data/test/workos/test_authorization_model_round_trip.rb +23 -0
  470. data/test/workos/test_base_client.rb +4 -3
  471. data/test/workos/test_connect_model_round_trip.rb +3 -1
  472. data/test/workos/test_feature_flags_model_round_trip.rb +107 -0
  473. data/test/workos/test_groups.rb +8 -0
  474. data/test/workos/test_groups_model_round_trip.rb +11 -0
  475. data/test/workos/test_organizations_model_round_trip.rb +111 -0
  476. data/test/workos/test_pipes.rb +8 -0
  477. data/test/workos/test_pipes_model_round_trip.rb +94 -200
  478. data/test/workos/test_shared_model_round_trip.rb +2051 -432
  479. data/test/workos/test_sso_model_round_trip.rb +60 -0
  480. data/test/workos/test_user_management_model_round_trip.rb +297 -3
  481. data/test/workos/test_vault_model_round_trip.rb +30 -0
  482. metadata +376 -26
  483. data/lib/workos/pipes/add_data_integrations_get_data_integration_authorize_url_request.rb +0 -37
  484. data/lib/workos/pipes/connected_account_write_response.rb +0 -73
  485. data/lib/workos/pipes/data_integrations_upsert_api_key_request_2.rb +0 -37
  486. data/lib/workos/pipes/data_integrations_upsert_client_credentials_request_2.rb +0 -43
  487. data/lib/workos/pipes/reauthorize_data_integrations_get_data_integration_authorize_url_request.rb +0 -40
  488. data/lib/workos/pipes/reauthorize_data_integrations_upsert_api_key_request.rb +0 -40
  489. data/lib/workos/pipes/reauthorize_data_integrations_upsert_client_credentials_request.rb +0 -46
  490. data/lib/workos/types/add_data_integrations_get_data_integration_authorize_url_request_connection_owner.rb +0 -13
  491. data/lib/workos/types/data_integrations_upsert_api_key_request_2_connection_owner.rb +0 -9
  492. data/lib/workos/types/data_integrations_upsert_client_credentials_request_2_connection_owner.rb +0 -9
  493. data/lib/workos/types/reauthorize_data_integrations_get_data_integration_authorize_url_request_connection_owner.rb +0 -9
  494. data/lib/workos/types/reauthorize_data_integrations_upsert_api_key_request_connection_owner.rb +0 -9
  495. data/lib/workos/types/reauthorize_data_integrations_upsert_client_credentials_request_connection_owner.rb +0 -9
  496. data/rbi/workos/add_data_integrations_get_data_integration_authorize_url_request.rbi +0 -60
  497. data/rbi/workos/connected_account_write_response.rbi +0 -132
  498. data/rbi/workos/data_integrations_upsert_api_key_request_2.rbi +0 -60
  499. data/rbi/workos/data_integrations_upsert_client_credentials_request_2.rbi +0 -72
  500. data/rbi/workos/reauthorize_data_integrations_get_data_integration_authorize_url_request.rbi +0 -66
  501. data/rbi/workos/reauthorize_data_integrations_upsert_api_key_request.rbi +0 -66
  502. data/rbi/workos/reauthorize_data_integrations_upsert_client_credentials_request.rbi +0 -78
@@ -5,310 +5,1871 @@
5
5
  require "test_helper"
6
6
 
7
7
  class SharedModelRoundTripTest < Minitest::Test
8
- def test_error_response_round_trip
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
9
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" => [],
10
140
  "error" => "stub"
11
141
  }
12
- model = WorkOS::ErrorResponse.new(fixture.to_json)
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
+
990
+ def test_error_response_round_trip
991
+ fixture = {
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)
13
1529
  json = model.to_h
14
1530
  assert_kind_of Hash, json
15
- assert_equal fixture["error"], json[:error]
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]
16
1538
  fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
17
1539
  end
18
1540
 
19
- def test_object_summary_round_trip
1541
+ def test_agent_registration_claim_attempt_created_round_trip
20
1542
  fixture = {
1543
+ "object" => "event",
21
1544
  "id" => "stub",
22
- "name" => "stub",
23
- "updated_at" => nil
1545
+ "event" => "agent.registration.claim.attempt.created",
1546
+ "data" => {},
1547
+ "created_at" => "stub",
1548
+ "context" => {}
24
1549
  }
25
- model = WorkOS::ObjectSummary.new(fixture.to_json)
1550
+ model = WorkOS::AgentRegistrationClaimAttemptCreated.new(fixture.to_json)
26
1551
  json = model.to_h
27
1552
  assert_kind_of Hash, json
28
1553
  assert_equal fixture["id"], json[:id]
29
- assert_equal fixture["name"], json[:name]
1554
+ assert_equal fixture["created_at"], json[:created_at]
30
1555
  fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
31
1556
  end
32
1557
 
33
- def test_object_version_round_trip
1558
+ def test_agent_registration_claim_attempt_created_data_round_trip
34
1559
  fixture = {
35
- "created_at" => "stub",
36
- "current_version" => true,
37
- "etag" => "stub",
1560
+ "object" => "agent_registration_claim_attempt",
38
1561
  "id" => "stub",
39
- "size" => 1
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"
40
1568
  }
41
- model = WorkOS::ObjectVersion.new(fixture.to_json)
1569
+ model = WorkOS::AgentRegistrationClaimAttemptCreatedData.new(fixture.to_json)
42
1570
  json = model.to_h
43
1571
  assert_kind_of Hash, json
1572
+ assert_equal fixture["id"], json[:id]
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]
44
1577
  assert_equal fixture["created_at"], json[:created_at]
45
- assert_equal fixture["current_version"], json[:current_version]
46
- assert_equal fixture["etag"], json[:etag]
1578
+ assert_equal fixture["updated_at"], json[:updated_at]
1579
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
1580
+ end
1581
+
1582
+ def test_agent_registration_claim_completed_round_trip
1583
+ fixture = {
1584
+ "object" => "event",
1585
+ "id" => "stub",
1586
+ "event" => "agent.registration.claim.completed",
1587
+ "data" => {},
1588
+ "created_at" => "stub",
1589
+ "context" => {}
1590
+ }
1591
+ model = WorkOS::AgentRegistrationClaimCompleted.new(fixture.to_json)
1592
+ json = model.to_h
1593
+ assert_kind_of Hash, json
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]
118
- assert_equal fixture["organization_id"], json[:organization_id]
119
1648
  fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
120
1649
  end
121
1650
 
122
- def test_event_context_actor_round_trip
1651
+ def test_agent_registration_created_data_round_trip
123
1652
  fixture = {
1653
+ "object" => "agent_registration",
124
1654
  "id" => "stub",
125
- "source" => "stub",
126
- "name" => nil
1655
+ "agent_identity" => {},
1656
+ "organization_id" => "stub",
1657
+ "status" => "stub",
1658
+ "kind" => "stub",
1659
+ "method" => "stub",
1660
+ "created_at" => "stub",
1661
+ "updated_at" => "stub"
127
1662
  }
128
- model = WorkOS::EventContextActor.new(fixture.to_json)
1663
+ model = WorkOS::AgentRegistrationCreatedData.new(fixture.to_json)
129
1664
  json = model.to_h
130
1665
  assert_kind_of Hash, json
131
1666
  assert_equal fixture["id"], json[:id]
132
- assert_nil json[:name]
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]
133
1670
  fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
134
1671
  end
135
1672
 
136
- def test_event_context_round_trip
1673
+ def test_agent_registration_created_data_agent_identity_round_trip
137
1674
  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" => {}
1675
+ "object" => "agent_identity",
1676
+ "id" => "stub",
1677
+ "userland_user_id" => "stub"
144
1678
  }
145
- model = WorkOS::EventContext.new(fixture.to_json)
1679
+ model = WorkOS::AgentRegistrationCreatedDataAgentIdentity.new(fixture.to_json)
146
1680
  json = model.to_h
147
1681
  assert_kind_of Hash, json
1682
+ assert_equal fixture["id"], json[:id]
148
1683
  fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
149
1684
  end
150
1685
 
151
- def test_pipe_connected_account_round_trip
1686
+ def test_agent_registration_credential_issued_round_trip
152
1687
  fixture = {
153
- "object" => "connected_account",
1688
+ "object" => "event",
154
1689
  "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",
166
- "established_by_user_id" => nil,
167
- "state_reason" => nil,
1690
+ "event" => "agent.registration.credential.issued",
1691
+ "data" => {},
168
1692
  "created_at" => "stub",
169
- "updated_at" => "stub"
1693
+ "context" => {}
170
1694
  }
171
- model = WorkOS::PipeConnectedAccount.new(fixture.to_json)
1695
+ model = WorkOS::AgentRegistrationCredentialIssued.new(fixture.to_json)
172
1696
  json = model.to_h
173
1697
  assert_kind_of Hash, json
174
1698
  assert_equal fixture["id"], json[:id]
175
- assert_equal fixture["data_integration_id"], json[:data_integration_id]
176
- assert_equal fixture["provider_slug"], json[:provider_slug]
177
- assert_nil json[:user_id]
178
- assert_nil json[:organization_id]
179
1699
  assert_equal fixture["created_at"], json[:created_at]
180
- assert_equal fixture["updated_at"], json[:updated_at]
181
1700
  fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
182
1701
  end
183
1702
 
184
- def test_waitlist_user_round_trip
1703
+ def test_agent_registration_credential_issued_data_round_trip
185
1704
  fixture = {
1705
+ "object" => "agent_registration_credential",
186
1706
  "id" => "stub",
187
- "email" => "stub",
188
- "state" => "stub",
189
- "approved_at" => nil,
190
- "additional_fields" => {},
191
- "waitlist_id" => nil,
1707
+ "agent_registration_id" => "stub",
1708
+ "detail" => {},
192
1709
  "created_at" => "stub",
193
- "updated_at" => "stub",
194
- "object" => "waitlist_user"
1710
+ "updated_at" => "stub"
195
1711
  }
196
- model = WorkOS::WaitlistUser.new(fixture.to_json)
1712
+ model = WorkOS::AgentRegistrationCredentialIssuedData.new(fixture.to_json)
197
1713
  json = model.to_h
198
1714
  assert_kind_of Hash, json
199
1715
  assert_equal fixture["id"], json[:id]
200
- assert_equal fixture["email"], json[:email]
201
- assert_nil json[:approved_at]
1716
+ assert_equal fixture["agent_registration_id"], json[:agent_registration_id]
202
1717
  assert_equal fixture["created_at"], json[:created_at]
203
1718
  assert_equal fixture["updated_at"], json[:updated_at]
204
1719
  fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
205
1720
  end
206
1721
 
207
- def test_event_schema_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
208
1748
  fixture = {
209
1749
  "object" => "event",
210
1750
  "id" => "stub",
211
- "event" => "stub",
1751
+ "event" => "agent.registration.deleted",
212
1752
  "data" => {},
213
1753
  "created_at" => "stub",
214
1754
  "context" => {}
215
1755
  }
216
- model = WorkOS::EventSchema.new(fixture.to_json)
1756
+ model = WorkOS::AgentRegistrationDeleted.new(fixture.to_json)
217
1757
  json = model.to_h
218
1758
  assert_kind_of Hash, json
219
1759
  assert_equal fixture["id"], json[:id]
220
- assert_equal fixture["event"], json[:event]
221
1760
  assert_equal fixture["created_at"], json[:created_at]
222
1761
  fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
223
1762
  end
224
1763
 
225
- def test_agent_blueprint_created_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
226
1776
  fixture = {
227
1777
  "object" => "event",
228
1778
  "id" => "stub",
229
- "event" => "agent.blueprint.created",
1779
+ "event" => "agent.registration.expired",
230
1780
  "data" => {},
231
1781
  "created_at" => "stub",
232
1782
  "context" => {}
233
1783
  }
234
- model = WorkOS::AgentBlueprintCreated.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)
235
1797
  json = model.to_h
236
1798
  assert_kind_of Hash, json
237
- assert_equal fixture["id"], json[:id]
238
- assert_equal fixture["created_at"], json[:created_at]
1799
+ assert_equal fixture["agent_registration_id"], json[:agent_registration_id]
239
1800
  fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
240
1801
  end
241
1802
 
242
- def test_agent_blueprint_created_data_round_trip
1803
+ def test_agent_registration_organization_switched_round_trip
243
1804
  fixture = {
244
- "object" => "agent_blueprint",
1805
+ "object" => "event",
245
1806
  "id" => "stub",
246
- "name" => "stub",
247
- "description" => nil,
248
- "permissions" => [],
249
- "invocable_by" => {},
250
- "invocable_as" => {},
251
- "session_settings" => {},
1807
+ "event" => "agent.registration.organization.switched",
1808
+ "data" => {},
252
1809
  "created_at" => "stub",
253
- "updated_at" => "stub"
1810
+ "context" => {}
254
1811
  }
255
- model = WorkOS::AgentBlueprintCreatedData.new(fixture.to_json)
1812
+ model = WorkOS::AgentRegistrationOrganizationSwitched.new(fixture.to_json)
256
1813
  json = model.to_h
257
1814
  assert_kind_of Hash, json
258
1815
  assert_equal fixture["id"], json[:id]
259
- assert_equal fixture["name"], json[:name]
260
- assert_nil json[:description]
261
1816
  assert_equal fixture["created_at"], json[:created_at]
262
- assert_equal fixture["updated_at"], json[:updated_at]
263
1817
  fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
264
1818
  end
265
1819
 
266
- def test_agent_blueprint_created_data_invocable_by_round_trip
1820
+ def test_agent_registration_organization_switched_data_round_trip
267
1821
  fixture = {
268
- "role_slugs" => [],
269
- "organization_ids" => []
1822
+ "agent_registration_id" => "stub",
1823
+ "from_organization_id" => "stub",
1824
+ "to_organization_id" => "stub"
270
1825
  }
271
- model = WorkOS::AgentBlueprintCreatedDataInvocableBy.new(fixture.to_json)
1826
+ model = WorkOS::AgentRegistrationOrganizationSwitchedData.new(fixture.to_json)
272
1827
  json = model.to_h
273
1828
  assert_kind_of Hash, json
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]
274
1832
  fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
275
1833
  end
276
1834
 
277
- def test_agent_blueprint_created_data_invocable_as_round_trip
1835
+ def test_agent_registration_refreshed_round_trip
278
1836
  fixture = {
279
- "instance_types" => []
1837
+ "object" => "event",
1838
+ "id" => "stub",
1839
+ "event" => "agent.registration.refreshed",
1840
+ "data" => {},
1841
+ "created_at" => "stub",
1842
+ "context" => {}
280
1843
  }
281
- model = WorkOS::AgentBlueprintCreatedDataInvocableAs.new(fixture.to_json)
1844
+ model = WorkOS::AgentRegistrationRefreshed.new(fixture.to_json)
282
1845
  json = model.to_h
283
1846
  assert_kind_of Hash, json
1847
+ assert_equal fixture["id"], json[:id]
1848
+ assert_equal fixture["created_at"], json[:created_at]
284
1849
  fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
285
1850
  end
286
1851
 
287
- def test_agent_blueprint_created_data_session_setting_round_trip
1852
+ def test_agent_registration_refreshed_data_round_trip
288
1853
  fixture = {
289
- "max_age_seconds" => 1.0,
290
- "access_token_ttl_seconds" => 1.0,
291
- "refresh_token_ttl_seconds" => 1.0
1854
+ "agent_registration_id" => "stub"
292
1855
  }
293
- model = WorkOS::AgentBlueprintCreatedDataSessionSetting.new(fixture.to_json)
1856
+ model = WorkOS::AgentRegistrationRefreshedData.new(fixture.to_json)
294
1857
  json = model.to_h
295
1858
  assert_kind_of Hash, json
296
- assert_equal fixture["max_age_seconds"], json[:max_age_seconds]
297
- assert_equal fixture["access_token_ttl_seconds"], json[:access_token_ttl_seconds]
298
- assert_equal fixture["refresh_token_ttl_seconds"], json[:refresh_token_ttl_seconds]
1859
+ assert_equal fixture["agent_registration_id"], json[:agent_registration_id]
299
1860
  fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
300
1861
  end
301
1862
 
302
- def test_agent_blueprint_deleted_round_trip
1863
+ def test_agent_registration_revoked_round_trip
303
1864
  fixture = {
304
1865
  "object" => "event",
305
1866
  "id" => "stub",
306
- "event" => "agent.blueprint.deleted",
1867
+ "event" => "agent.registration.revoked",
307
1868
  "data" => {},
308
1869
  "created_at" => "stub",
309
1870
  "context" => {}
310
1871
  }
311
- model = WorkOS::AgentBlueprintDeleted.new(fixture.to_json)
1872
+ model = WorkOS::AgentRegistrationRevoked.new(fixture.to_json)
312
1873
  json = model.to_h
313
1874
  assert_kind_of Hash, json
314
1875
  assert_equal fixture["id"], json[:id]
@@ -316,34 +1877,27 @@ class SharedModelRoundTripTest < Minitest::Test
316
1877
  fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
317
1878
  end
318
1879
 
319
- def test_agent_blueprint_deleted_data_round_trip
1880
+ def test_agent_registration_revoked_data_round_trip
320
1881
  fixture = {
321
- "object" => "agent_blueprint",
322
- "id" => "stub",
323
- "name" => "stub",
324
- "created_at" => "stub",
325
- "updated_at" => "stub"
1882
+ "agent_registration_id" => "stub"
326
1883
  }
327
- model = WorkOS::AgentBlueprintDeletedData.new(fixture.to_json)
1884
+ model = WorkOS::AgentRegistrationRevokedData.new(fixture.to_json)
328
1885
  json = model.to_h
329
1886
  assert_kind_of Hash, json
330
- assert_equal fixture["id"], json[:id]
331
- assert_equal fixture["name"], json[:name]
332
- assert_equal fixture["created_at"], json[:created_at]
333
- assert_equal fixture["updated_at"], json[:updated_at]
1887
+ assert_equal fixture["agent_registration_id"], json[:agent_registration_id]
334
1888
  fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
335
1889
  end
336
1890
 
337
- def test_agent_blueprint_updated_round_trip
1891
+ def test_feature_flags_flag_created_round_trip
338
1892
  fixture = {
339
1893
  "object" => "event",
340
1894
  "id" => "stub",
341
- "event" => "agent.blueprint.updated",
1895
+ "event" => "feature_flags.flag.created",
342
1896
  "data" => {},
343
1897
  "created_at" => "stub",
344
1898
  "context" => {}
345
1899
  }
346
- model = WorkOS::AgentBlueprintUpdated.new(fixture.to_json)
1900
+ model = WorkOS::FeatureFlagsFlagCreated.new(fixture.to_json)
347
1901
  json = model.to_h
348
1902
  assert_kind_of Hash, json
349
1903
  assert_equal fixture["id"], json[:id]
@@ -351,76 +1905,87 @@ class SharedModelRoundTripTest < Minitest::Test
351
1905
  fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
352
1906
  end
353
1907
 
354
- def test_agent_blueprint_updated_data_round_trip
1908
+ def test_feature_flags_flag_created_data_round_trip
355
1909
  fixture = {
356
- "object" => "agent_blueprint",
1910
+ "object" => "feature_flag",
357
1911
  "id" => "stub",
1912
+ "environment_id" => "stub",
1913
+ "slug" => "stub",
358
1914
  "name" => "stub",
359
1915
  "description" => nil,
360
- "permissions" => [],
361
- "invocable_by" => {},
362
- "invocable_as" => {},
363
- "session_settings" => {},
1916
+ "owner" => nil,
1917
+ "tags" => [],
1918
+ "enabled" => true,
1919
+ "default_value" => true,
364
1920
  "created_at" => "stub",
365
1921
  "updated_at" => "stub"
366
1922
  }
367
- model = WorkOS::AgentBlueprintUpdatedData.new(fixture.to_json)
1923
+ model = WorkOS::FeatureFlagsFlagCreatedData.new(fixture.to_json)
368
1924
  json = model.to_h
369
1925
  assert_kind_of Hash, json
370
1926
  assert_equal fixture["id"], json[:id]
1927
+ assert_equal fixture["environment_id"], json[:environment_id]
1928
+ assert_equal fixture["slug"], json[:slug]
371
1929
  assert_equal fixture["name"], json[:name]
372
1930
  assert_nil json[:description]
1931
+ assert_equal fixture["enabled"], json[:enabled]
1932
+ assert_equal fixture["default_value"], json[:default_value]
373
1933
  assert_equal fixture["created_at"], json[:created_at]
374
1934
  assert_equal fixture["updated_at"], json[:updated_at]
375
1935
  fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
376
1936
  end
377
1937
 
378
- def test_agent_blueprint_updated_data_invocable_by_round_trip
1938
+ def test_feature_flags_flag_created_data_owner_round_trip
379
1939
  fixture = {
380
- "role_slugs" => [],
381
- "organization_ids" => []
1940
+ "email" => "stub",
1941
+ "first_name" => nil,
1942
+ "last_name" => nil
382
1943
  }
383
- model = WorkOS::AgentBlueprintUpdatedDataInvocableBy.new(fixture.to_json)
1944
+ model = WorkOS::FeatureFlagsFlagCreatedDataOwner.new(fixture.to_json)
384
1945
  json = model.to_h
385
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]
386
1950
  fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
387
1951
  end
388
1952
 
389
- def test_agent_blueprint_updated_data_invocable_as_round_trip
1953
+ def test_feature_flags_flag_created_context_round_trip
390
1954
  fixture = {
391
- "instance_types" => []
1955
+ "client_id" => "stub",
1956
+ "actor" => {}
392
1957
  }
393
- model = WorkOS::AgentBlueprintUpdatedDataInvocableAs.new(fixture.to_json)
1958
+ model = WorkOS::FeatureFlagsFlagCreatedContext.new(fixture.to_json)
394
1959
  json = model.to_h
395
1960
  assert_kind_of Hash, json
1961
+ assert_equal fixture["client_id"], json[:client_id]
396
1962
  fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
397
1963
  end
398
1964
 
399
- def test_agent_blueprint_updated_data_session_setting_round_trip
1965
+ def test_feature_flags_flag_created_context_actor_round_trip
400
1966
  fixture = {
401
- "max_age_seconds" => 1.0,
402
- "access_token_ttl_seconds" => 1.0,
403
- "refresh_token_ttl_seconds" => 1.0
1967
+ "id" => "stub",
1968
+ "source" => "stub",
1969
+ "name" => nil
404
1970
  }
405
- model = WorkOS::AgentBlueprintUpdatedDataSessionSetting.new(fixture.to_json)
1971
+ model = WorkOS::FeatureFlagsFlagCreatedContextActor.new(fixture.to_json)
406
1972
  json = model.to_h
407
1973
  assert_kind_of Hash, json
408
- assert_equal fixture["max_age_seconds"], json[:max_age_seconds]
409
- assert_equal fixture["access_token_ttl_seconds"], json[:access_token_ttl_seconds]
410
- assert_equal fixture["refresh_token_ttl_seconds"], json[:refresh_token_ttl_seconds]
1974
+ assert_equal fixture["id"], json[:id]
1975
+ assert_nil json[:name]
411
1976
  fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
412
1977
  end
413
1978
 
414
- def test_agent_instance_created_round_trip
1979
+ def test_feature_flags_flag_deleted_round_trip
415
1980
  fixture = {
416
1981
  "object" => "event",
417
1982
  "id" => "stub",
418
- "event" => "agent.instance.created",
1983
+ "event" => "feature_flags.flag.deleted",
419
1984
  "data" => {},
420
1985
  "created_at" => "stub",
421
1986
  "context" => {}
422
1987
  }
423
- model = WorkOS::AgentInstanceCreated.new(fixture.to_json)
1988
+ model = WorkOS::FeatureFlagsFlagDeleted.new(fixture.to_json)
424
1989
  json = model.to_h
425
1990
  assert_kind_of Hash, json
426
1991
  assert_equal fixture["id"], json[:id]
@@ -428,203 +1993,130 @@ class SharedModelRoundTripTest < Minitest::Test
428
1993
  fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
429
1994
  end
430
1995
 
431
- def test_agent_instance_created_data_round_trip
1996
+ def test_feature_flags_flag_deleted_data_round_trip
432
1997
  fixture = {
433
- "object" => "agent_instance",
1998
+ "object" => "feature_flag",
434
1999
  "id" => "stub",
435
- "agent_blueprint_id" => "stub",
436
- "organization_id" => "stub",
437
- "organization_membership_id" => nil,
438
- "type" => "stub",
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,
439
2008
  "created_at" => "stub",
440
2009
  "updated_at" => "stub"
441
2010
  }
442
- model = WorkOS::AgentInstanceCreatedData.new(fixture.to_json)
2011
+ model = WorkOS::FeatureFlagsFlagDeletedData.new(fixture.to_json)
443
2012
  json = model.to_h
444
2013
  assert_kind_of Hash, json
445
2014
  assert_equal fixture["id"], json[:id]
446
- assert_equal fixture["agent_blueprint_id"], json[:agent_blueprint_id]
447
- assert_equal fixture["organization_id"], json[:organization_id]
448
- assert_nil json[:organization_membership_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]
449
2021
  assert_equal fixture["created_at"], json[:created_at]
450
2022
  assert_equal fixture["updated_at"], json[:updated_at]
451
2023
  fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
452
2024
  end
453
2025
 
454
- def test_agent_instance_deleted_round_trip
455
- fixture = {
456
- "object" => "event",
457
- "id" => "stub",
458
- "event" => "agent.instance.deleted",
459
- "data" => {},
460
- "created_at" => "stub",
461
- "context" => {}
462
- }
463
- model = WorkOS::AgentInstanceDeleted.new(fixture.to_json)
464
- json = model.to_h
465
- assert_kind_of Hash, json
466
- assert_equal fixture["id"], json[:id]
467
- assert_equal fixture["created_at"], json[:created_at]
468
- fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
469
- end
470
-
471
- def test_agent_instance_deleted_data_round_trip
2026
+ def test_feature_flags_flag_deleted_data_owner_round_trip
472
2027
  fixture = {
473
- "object" => "agent_instance",
474
- "id" => "stub",
475
- "agent_blueprint_id" => "stub",
476
- "organization_id" => "stub",
477
- "organization_membership_id" => nil,
478
- "type" => "stub",
479
- "created_at" => "stub",
480
- "updated_at" => "stub"
2028
+ "email" => "stub",
2029
+ "first_name" => nil,
2030
+ "last_name" => nil
481
2031
  }
482
- model = WorkOS::AgentInstanceDeletedData.new(fixture.to_json)
2032
+ model = WorkOS::FeatureFlagsFlagDeletedDataOwner.new(fixture.to_json)
483
2033
  json = model.to_h
484
2034
  assert_kind_of Hash, json
485
- assert_equal fixture["id"], json[:id]
486
- assert_equal fixture["agent_blueprint_id"], json[:agent_blueprint_id]
487
- assert_equal fixture["organization_id"], json[:organization_id]
488
- assert_nil json[:organization_membership_id]
489
- assert_equal fixture["created_at"], json[:created_at]
490
- 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]
491
2038
  fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
492
2039
  end
493
2040
 
494
- def test_agent_instance_session_created_round_trip
2041
+ def test_feature_flags_flag_deleted_context_round_trip
495
2042
  fixture = {
496
- "object" => "event",
497
- "id" => "stub",
498
- "event" => "agent.instance.session.created",
499
- "data" => {},
500
- "created_at" => "stub",
501
- "context" => {}
2043
+ "client_id" => "stub",
2044
+ "actor" => {}
502
2045
  }
503
- model = WorkOS::AgentInstanceSessionCreated.new(fixture.to_json)
2046
+ model = WorkOS::FeatureFlagsFlagDeletedContext.new(fixture.to_json)
504
2047
  json = model.to_h
505
2048
  assert_kind_of Hash, json
506
- assert_equal fixture["id"], json[:id]
507
- assert_equal fixture["created_at"], json[:created_at]
2049
+ assert_equal fixture["client_id"], json[:client_id]
508
2050
  fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
509
2051
  end
510
2052
 
511
- def test_agent_instance_session_created_data_round_trip
2053
+ def test_feature_flags_flag_deleted_context_actor_round_trip
512
2054
  fixture = {
513
- "object" => "agent_instance_session",
514
2055
  "id" => "stub",
515
- "agent_instance_id" => "stub",
516
- "organization_id" => "stub",
517
- "expires_at" => "stub",
518
- "revoked_at" => nil,
519
- "created_at" => "stub",
520
- "updated_at" => "stub",
521
- "permission_slugs" => []
2056
+ "source" => "stub",
2057
+ "name" => nil
522
2058
  }
523
- model = WorkOS::AgentInstanceSessionCreatedData.new(fixture.to_json)
2059
+ model = WorkOS::FeatureFlagsFlagDeletedContextActor.new(fixture.to_json)
524
2060
  json = model.to_h
525
2061
  assert_kind_of Hash, json
526
2062
  assert_equal fixture["id"], json[:id]
527
- assert_equal fixture["agent_instance_id"], json[:agent_instance_id]
528
- assert_equal fixture["organization_id"], json[:organization_id]
529
- assert_equal fixture["expires_at"], json[:expires_at]
530
- assert_nil json[:revoked_at]
531
- assert_equal fixture["created_at"], json[:created_at]
532
- assert_equal fixture["updated_at"], json[:updated_at]
2063
+ assert_nil json[:name]
533
2064
  fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
534
2065
  end
535
2066
 
536
- def test_agent_instance_session_revoked_round_trip
2067
+ def test_feature_flags_flag_rule_created_round_trip
537
2068
  fixture = {
538
2069
  "object" => "event",
539
2070
  "id" => "stub",
540
- "event" => "agent.instance.session.revoked",
2071
+ "event" => "feature_flags.flag_rule.created",
541
2072
  "data" => {},
542
2073
  "created_at" => "stub",
543
2074
  "context" => {}
544
2075
  }
545
- model = WorkOS::AgentInstanceSessionRevoked.new(fixture.to_json)
546
- json = model.to_h
547
- assert_kind_of Hash, json
548
- assert_equal fixture["id"], json[:id]
549
- assert_equal fixture["created_at"], json[:created_at]
550
- fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
551
- end
552
-
553
- def test_agent_instance_session_revoked_data_round_trip
554
- fixture = {
555
- "object" => "agent_instance_session",
556
- "id" => "stub",
557
- "agent_instance_id" => "stub",
558
- "organization_id" => "stub",
559
- "expires_at" => "stub",
560
- "revoked_at" => nil,
561
- "created_at" => "stub",
562
- "updated_at" => "stub"
563
- }
564
- model = WorkOS::AgentInstanceSessionRevokedData.new(fixture.to_json)
2076
+ model = WorkOS::FeatureFlagsFlagRuleCreated.new(fixture.to_json)
565
2077
  json = model.to_h
566
2078
  assert_kind_of Hash, json
567
2079
  assert_equal fixture["id"], json[:id]
568
- assert_equal fixture["agent_instance_id"], json[:agent_instance_id]
569
- assert_equal fixture["organization_id"], json[:organization_id]
570
- assert_equal fixture["expires_at"], json[:expires_at]
571
- assert_nil json[:revoked_at]
572
2080
  assert_equal fixture["created_at"], json[:created_at]
573
- assert_equal fixture["updated_at"], json[:updated_at]
574
2081
  fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
575
2082
  end
576
2083
 
577
- def test_agent_registration_claim_attempt_created_round_trip
2084
+ def test_feature_flags_flag_rule_created_context_round_trip
578
2085
  fixture = {
579
- "object" => "event",
580
- "id" => "stub",
581
- "event" => "agent.registration.claim.attempt.created",
582
- "data" => {},
583
- "created_at" => "stub",
584
- "context" => {}
2086
+ "client_id" => "stub",
2087
+ "actor" => {}
585
2088
  }
586
- model = WorkOS::AgentRegistrationClaimAttemptCreated.new(fixture.to_json)
2089
+ model = WorkOS::FeatureFlagsFlagRuleCreatedContext.new(fixture.to_json)
587
2090
  json = model.to_h
588
2091
  assert_kind_of Hash, json
589
- assert_equal fixture["id"], json[:id]
590
- assert_equal fixture["created_at"], json[:created_at]
2092
+ assert_equal fixture["client_id"], json[:client_id]
591
2093
  fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
592
2094
  end
593
2095
 
594
- def test_agent_registration_claim_attempt_created_data_round_trip
2096
+ def test_feature_flags_flag_rule_created_context_actor_round_trip
595
2097
  fixture = {
596
- "object" => "agent_registration_claim_attempt",
597
2098
  "id" => "stub",
598
- "agent_registration_id" => "stub",
599
- "agent_registration_claim_id" => "stub",
600
- "login_hint" => "stub",
601
- "expires_at" => "stub",
602
- "created_at" => "stub",
603
- "updated_at" => "stub"
2099
+ "source" => "stub",
2100
+ "name" => nil
604
2101
  }
605
- model = WorkOS::AgentRegistrationClaimAttemptCreatedData.new(fixture.to_json)
2102
+ model = WorkOS::FeatureFlagsFlagRuleCreatedContextActor.new(fixture.to_json)
606
2103
  json = model.to_h
607
2104
  assert_kind_of Hash, json
608
2105
  assert_equal fixture["id"], json[:id]
609
- assert_equal fixture["agent_registration_id"], json[:agent_registration_id]
610
- assert_equal fixture["agent_registration_claim_id"], json[:agent_registration_claim_id]
611
- assert_equal fixture["login_hint"], json[:login_hint]
612
- assert_equal fixture["expires_at"], json[:expires_at]
613
- assert_equal fixture["created_at"], json[:created_at]
614
- assert_equal fixture["updated_at"], json[:updated_at]
2106
+ assert_nil json[:name]
615
2107
  fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
616
2108
  end
617
2109
 
618
- def test_agent_registration_claim_completed_round_trip
2110
+ def test_feature_flags_flag_rule_deleted_round_trip
619
2111
  fixture = {
620
2112
  "object" => "event",
621
2113
  "id" => "stub",
622
- "event" => "agent.registration.claim.completed",
2114
+ "event" => "feature_flags.flag_rule.deleted",
623
2115
  "data" => {},
624
2116
  "created_at" => "stub",
625
2117
  "context" => {}
626
2118
  }
627
- model = WorkOS::AgentRegistrationClaimCompleted.new(fixture.to_json)
2119
+ model = WorkOS::FeatureFlagsFlagRuleDeleted.new(fixture.to_json)
628
2120
  json = model.to_h
629
2121
  assert_kind_of Hash, json
630
2122
  assert_equal fixture["id"], json[:id]
@@ -632,51 +2124,42 @@ class SharedModelRoundTripTest < Minitest::Test
632
2124
  fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
633
2125
  end
634
2126
 
635
- def test_agent_registration_claim_completed_data_round_trip
2127
+ def test_feature_flags_flag_rule_deleted_context_round_trip
636
2128
  fixture = {
637
- "object" => "agent_registration_claim",
638
- "id" => "stub",
639
- "agent_registration_id" => "stub",
640
- "completed_by_attempt_id" => "stub",
641
- "claimed_by" => {},
642
- "completed_at" => "stub",
643
- "created_at" => "stub",
644
- "updated_at" => "stub"
2129
+ "client_id" => "stub",
2130
+ "actor" => {}
645
2131
  }
646
- model = WorkOS::AgentRegistrationClaimCompletedData.new(fixture.to_json)
2132
+ model = WorkOS::FeatureFlagsFlagRuleDeletedContext.new(fixture.to_json)
647
2133
  json = model.to_h
648
2134
  assert_kind_of Hash, json
649
- assert_equal fixture["id"], json[:id]
650
- assert_equal fixture["agent_registration_id"], json[:agent_registration_id]
651
- assert_equal fixture["completed_by_attempt_id"], json[:completed_by_attempt_id]
652
- assert_equal fixture["completed_at"], json[:completed_at]
653
- assert_equal fixture["created_at"], json[:created_at]
654
- assert_equal fixture["updated_at"], json[:updated_at]
2135
+ assert_equal fixture["client_id"], json[:client_id]
655
2136
  fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
656
2137
  end
657
2138
 
658
- def test_agent_registration_claim_completed_data_claimed_by_round_trip
2139
+ def test_feature_flags_flag_rule_deleted_context_actor_round_trip
659
2140
  fixture = {
660
- "user_id" => "stub",
661
- "organization_id" => "stub"
2141
+ "id" => "stub",
2142
+ "source" => "stub",
2143
+ "name" => nil
662
2144
  }
663
- model = WorkOS::AgentRegistrationClaimCompletedDataClaimedBy.new(fixture.to_json)
2145
+ model = WorkOS::FeatureFlagsFlagRuleDeletedContextActor.new(fixture.to_json)
664
2146
  json = model.to_h
665
2147
  assert_kind_of Hash, json
666
- assert_equal fixture["user_id"], json[:user_id]
2148
+ assert_equal fixture["id"], json[:id]
2149
+ assert_nil json[:name]
667
2150
  fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
668
2151
  end
669
2152
 
670
- def test_agent_registration_created_round_trip
2153
+ def test_feature_flags_flag_rule_updated_round_trip
671
2154
  fixture = {
672
2155
  "object" => "event",
673
2156
  "id" => "stub",
674
- "event" => "agent.registration.created",
2157
+ "event" => "feature_flags.flag_rule.updated",
675
2158
  "data" => {},
676
2159
  "created_at" => "stub",
677
2160
  "context" => {}
678
2161
  }
679
- model = WorkOS::AgentRegistrationCreated.new(fixture.to_json)
2162
+ model = WorkOS::FeatureFlagsFlagRuleUpdated.new(fixture.to_json)
680
2163
  json = model.to_h
681
2164
  assert_kind_of Hash, json
682
2165
  assert_equal fixture["id"], json[:id]
@@ -684,51 +2167,63 @@ class SharedModelRoundTripTest < Minitest::Test
684
2167
  fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
685
2168
  end
686
2169
 
687
- def test_agent_registration_created_data_round_trip
2170
+ def test_feature_flags_flag_rule_updated_context_round_trip
688
2171
  fixture = {
689
- "object" => "agent_registration",
690
- "id" => "stub",
691
- "agent_identity" => {},
692
- "organization_id" => "stub",
693
- "status" => "stub",
694
- "kind" => "stub",
695
- "method" => "stub",
696
- "created_at" => "stub",
697
- "updated_at" => "stub"
2172
+ "client_id" => "stub",
2173
+ "actor" => {},
2174
+ "previous_attributes" => {}
698
2175
  }
699
- model = WorkOS::AgentRegistrationCreatedData.new(fixture.to_json)
2176
+ model = WorkOS::FeatureFlagsFlagRuleUpdatedContext.new(fixture.to_json)
700
2177
  json = model.to_h
701
2178
  assert_kind_of Hash, json
702
- assert_equal fixture["id"], json[:id]
703
- assert_equal fixture["organization_id"], json[:organization_id]
704
- assert_equal fixture["created_at"], json[:created_at]
705
- assert_equal fixture["updated_at"], json[:updated_at]
2179
+ assert_equal fixture["client_id"], json[:client_id]
706
2180
  fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
707
2181
  end
708
2182
 
709
- def test_agent_registration_created_data_agent_identity_round_trip
2183
+ def test_feature_flags_flag_rule_updated_context_actor_round_trip
710
2184
  fixture = {
711
- "object" => "agent_identity",
712
2185
  "id" => "stub",
713
- "userland_user_id" => "stub"
2186
+ "source" => "stub",
2187
+ "name" => nil
714
2188
  }
715
- model = WorkOS::AgentRegistrationCreatedDataAgentIdentity.new(fixture.to_json)
2189
+ model = WorkOS::FeatureFlagsFlagRuleUpdatedContextActor.new(fixture.to_json)
716
2190
  json = model.to_h
717
2191
  assert_kind_of Hash, json
718
2192
  assert_equal fixture["id"], json[:id]
2193
+ assert_nil json[:name]
719
2194
  fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
720
2195
  end
721
2196
 
722
- def test_agent_registration_credential_issued_round_trip
2197
+ def test_feature_flags_flag_rule_updated_context_previous_attribute_round_trip
2198
+ fixture = {
2199
+ "data" => {}
2200
+ }
2201
+ model = WorkOS::FeatureFlagsFlagRuleUpdatedContextPreviousAttribute.new(fixture.to_json)
2202
+ json = model.to_h
2203
+ assert_kind_of Hash, json
2204
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
2205
+ end
2206
+
2207
+ def test_feature_flags_flag_rule_updated_context_previous_attribute_data_round_trip
2208
+ fixture = {
2209
+ "value" => true
2210
+ }
2211
+ model = WorkOS::FeatureFlagsFlagRuleUpdatedContextPreviousAttributeData.new(fixture.to_json)
2212
+ json = model.to_h
2213
+ assert_kind_of Hash, json
2214
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
2215
+ end
2216
+
2217
+ def test_feature_flags_flag_updated_round_trip
723
2218
  fixture = {
724
2219
  "object" => "event",
725
2220
  "id" => "stub",
726
- "event" => "agent.registration.credential.issued",
2221
+ "event" => "feature_flags.flag.updated",
727
2222
  "data" => {},
728
2223
  "created_at" => "stub",
729
2224
  "context" => {}
730
2225
  }
731
- model = WorkOS::AgentRegistrationCredentialIssued.new(fixture.to_json)
2226
+ model = WorkOS::FeatureFlagsFlagUpdated.new(fixture.to_json)
732
2227
  json = model.to_h
733
2228
  assert_kind_of Hash, json
734
2229
  assert_equal fixture["id"], json[:id]
@@ -736,116 +2231,128 @@ class SharedModelRoundTripTest < Minitest::Test
736
2231
  fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
737
2232
  end
738
2233
 
739
- def test_agent_registration_credential_issued_data_round_trip
2234
+ def test_feature_flags_flag_updated_data_round_trip
740
2235
  fixture = {
741
- "object" => "agent_registration_credential",
2236
+ "object" => "feature_flag",
742
2237
  "id" => "stub",
743
- "agent_registration_id" => "stub",
744
- "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,
745
2246
  "created_at" => "stub",
746
2247
  "updated_at" => "stub"
747
2248
  }
748
- model = WorkOS::AgentRegistrationCredentialIssuedData.new(fixture.to_json)
2249
+ model = WorkOS::FeatureFlagsFlagUpdatedData.new(fixture.to_json)
749
2250
  json = model.to_h
750
2251
  assert_kind_of Hash, json
751
2252
  assert_equal fixture["id"], json[:id]
752
- 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]
753
2259
  assert_equal fixture["created_at"], json[:created_at]
754
2260
  assert_equal fixture["updated_at"], json[:updated_at]
755
2261
  fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
756
2262
  end
757
2263
 
758
- def test_agent_registration_credential_issued_data_detail_round_trip
2264
+ def test_feature_flags_flag_updated_data_owner_round_trip
759
2265
  fixture = {
760
- "kind" => "api_key",
761
- "api_key_id" => "stub"
2266
+ "email" => "stub",
2267
+ "first_name" => nil,
2268
+ "last_name" => nil
762
2269
  }
763
- model = WorkOS::AgentRegistrationCredentialIssuedDataDetail.new(fixture.to_json)
2270
+ model = WorkOS::FeatureFlagsFlagUpdatedDataOwner.new(fixture.to_json)
764
2271
  json = model.to_h
765
2272
  assert_kind_of Hash, json
766
- 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]
767
2276
  fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
768
2277
  end
769
2278
 
770
- def test_access_token_agent_registration_credential_issued_data_detail_round_trip
2279
+ def test_feature_flags_flag_updated_context_round_trip
771
2280
  fixture = {
772
- "kind" => "access_token",
773
- "jti" => "stub",
774
- "expires_at" => "stub"
2281
+ "client_id" => "stub",
2282
+ "actor" => {},
2283
+ "previous_attributes" => {}
775
2284
  }
776
- model = WorkOS::AccessTokenAgentRegistrationCredentialIssuedDataDetail.new(fixture.to_json)
2285
+ model = WorkOS::FeatureFlagsFlagUpdatedContext.new(fixture.to_json)
777
2286
  json = model.to_h
778
2287
  assert_kind_of Hash, json
779
- assert_equal fixture["jti"], json[:jti]
2288
+ assert_equal fixture["client_id"], json[:client_id]
780
2289
  fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
781
2290
  end
782
2291
 
783
- def test_agent_registration_deleted_round_trip
2292
+ def test_feature_flags_flag_updated_context_actor_round_trip
784
2293
  fixture = {
785
- "object" => "event",
786
2294
  "id" => "stub",
787
- "event" => "agent.registration.deleted",
788
- "data" => {},
789
- "created_at" => "stub",
790
- "context" => {}
2295
+ "source" => "stub",
2296
+ "name" => nil
791
2297
  }
792
- model = WorkOS::AgentRegistrationDeleted.new(fixture.to_json)
2298
+ model = WorkOS::FeatureFlagsFlagUpdatedContextActor.new(fixture.to_json)
793
2299
  json = model.to_h
794
2300
  assert_kind_of Hash, json
795
2301
  assert_equal fixture["id"], json[:id]
796
- assert_equal fixture["created_at"], json[:created_at]
2302
+ assert_nil json[:name]
797
2303
  fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
798
2304
  end
799
2305
 
800
- def test_agent_registration_deleted_data_round_trip
2306
+ def test_feature_flags_flag_updated_context_previous_attribute_round_trip
801
2307
  fixture = {
802
- "agent_registration_id" => "stub"
2308
+ "data" => {}
803
2309
  }
804
- model = WorkOS::AgentRegistrationDeletedData.new(fixture.to_json)
2310
+ model = WorkOS::FeatureFlagsFlagUpdatedContextPreviousAttribute.new(fixture.to_json)
805
2311
  json = model.to_h
806
2312
  assert_kind_of Hash, json
807
- assert_equal fixture["agent_registration_id"], json[:agent_registration_id]
808
2313
  fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
809
2314
  end
810
2315
 
811
- def test_agent_registration_expired_round_trip
2316
+ def test_feature_flags_flag_updated_context_previous_attribute_data_round_trip
812
2317
  fixture = {
813
- "object" => "event",
814
- "id" => "stub",
815
- "event" => "agent.registration.expired",
816
- "data" => {},
817
- "created_at" => "stub",
818
- "context" => {}
2318
+ "name" => "stub",
2319
+ "description" => nil,
2320
+ "tags" => [],
2321
+ "owner" => nil,
2322
+ "enabled" => true,
2323
+ "default_value" => true
819
2324
  }
820
- model = WorkOS::AgentRegistrationExpired.new(fixture.to_json)
2325
+ model = WorkOS::FeatureFlagsFlagUpdatedContextPreviousAttributeData.new(fixture.to_json)
821
2326
  json = model.to_h
822
2327
  assert_kind_of Hash, json
823
- assert_equal fixture["id"], json[:id]
824
- assert_equal fixture["created_at"], json[:created_at]
825
2328
  fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
826
2329
  end
827
2330
 
828
- def test_agent_registration_expired_data_round_trip
2331
+ def test_feature_flags_flag_updated_context_previous_attribute_data_owner_round_trip
829
2332
  fixture = {
830
- "agent_registration_id" => "stub"
2333
+ "email" => "stub",
2334
+ "first_name" => nil,
2335
+ "last_name" => nil
831
2336
  }
832
- model = WorkOS::AgentRegistrationExpiredData.new(fixture.to_json)
2337
+ model = WorkOS::FeatureFlagsFlagUpdatedContextPreviousAttributeDataOwner.new(fixture.to_json)
833
2338
  json = model.to_h
834
2339
  assert_kind_of Hash, json
835
- 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]
836
2343
  fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
837
2344
  end
838
2345
 
839
- def test_agent_registration_organization_switched_round_trip
2346
+ def test_feature_flags_flag_target_created_round_trip
840
2347
  fixture = {
841
2348
  "object" => "event",
842
2349
  "id" => "stub",
843
- "event" => "agent.registration.organization.switched",
2350
+ "event" => "feature_flags.flag_target.created",
844
2351
  "data" => {},
845
2352
  "created_at" => "stub",
846
2353
  "context" => {}
847
2354
  }
848
- model = WorkOS::AgentRegistrationOrganizationSwitched.new(fixture.to_json)
2355
+ model = WorkOS::FeatureFlagsFlagTargetCreated.new(fixture.to_json)
849
2356
  json = model.to_h
850
2357
  assert_kind_of Hash, json
851
2358
  assert_equal fixture["id"], json[:id]
@@ -853,59 +2360,42 @@ class SharedModelRoundTripTest < Minitest::Test
853
2360
  fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
854
2361
  end
855
2362
 
856
- def test_agent_registration_organization_switched_data_round_trip
2363
+ def test_feature_flags_flag_target_created_context_round_trip
857
2364
  fixture = {
858
- "agent_registration_id" => "stub",
859
- "from_organization_id" => "stub",
860
- "to_organization_id" => "stub"
2365
+ "client_id" => "stub",
2366
+ "actor" => {}
861
2367
  }
862
- model = WorkOS::AgentRegistrationOrganizationSwitchedData.new(fixture.to_json)
2368
+ model = WorkOS::FeatureFlagsFlagTargetCreatedContext.new(fixture.to_json)
863
2369
  json = model.to_h
864
2370
  assert_kind_of Hash, json
865
- assert_equal fixture["agent_registration_id"], json[:agent_registration_id]
866
- assert_equal fixture["from_organization_id"], json[:from_organization_id]
867
- assert_equal fixture["to_organization_id"], json[:to_organization_id]
2371
+ assert_equal fixture["client_id"], json[:client_id]
868
2372
  fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
869
2373
  end
870
2374
 
871
- def test_agent_registration_refreshed_round_trip
2375
+ def test_feature_flags_flag_target_created_context_actor_round_trip
872
2376
  fixture = {
873
- "object" => "event",
874
2377
  "id" => "stub",
875
- "event" => "agent.registration.refreshed",
876
- "data" => {},
877
- "created_at" => "stub",
878
- "context" => {}
2378
+ "source" => "stub",
2379
+ "name" => nil
879
2380
  }
880
- model = WorkOS::AgentRegistrationRefreshed.new(fixture.to_json)
2381
+ model = WorkOS::FeatureFlagsFlagTargetCreatedContextActor.new(fixture.to_json)
881
2382
  json = model.to_h
882
2383
  assert_kind_of Hash, json
883
2384
  assert_equal fixture["id"], json[:id]
884
- assert_equal fixture["created_at"], json[:created_at]
885
- fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
886
- end
887
-
888
- def test_agent_registration_refreshed_data_round_trip
889
- fixture = {
890
- "agent_registration_id" => "stub"
891
- }
892
- model = WorkOS::AgentRegistrationRefreshedData.new(fixture.to_json)
893
- json = model.to_h
894
- assert_kind_of Hash, json
895
- assert_equal fixture["agent_registration_id"], json[:agent_registration_id]
2385
+ assert_nil json[:name]
896
2386
  fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
897
2387
  end
898
2388
 
899
- def test_agent_registration_revoked_round_trip
2389
+ def test_feature_flags_flag_target_deleted_round_trip
900
2390
  fixture = {
901
2391
  "object" => "event",
902
2392
  "id" => "stub",
903
- "event" => "agent.registration.revoked",
2393
+ "event" => "feature_flags.flag_target.deleted",
904
2394
  "data" => {},
905
2395
  "created_at" => "stub",
906
2396
  "context" => {}
907
2397
  }
908
- model = WorkOS::AgentRegistrationRevoked.new(fixture.to_json)
2398
+ model = WorkOS::FeatureFlagsFlagTargetDeleted.new(fixture.to_json)
909
2399
  json = model.to_h
910
2400
  assert_kind_of Hash, json
911
2401
  assert_equal fixture["id"], json[:id]
@@ -913,14 +2403,29 @@ class SharedModelRoundTripTest < Minitest::Test
913
2403
  fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
914
2404
  end
915
2405
 
916
- def test_agent_registration_revoked_data_round_trip
2406
+ def test_feature_flags_flag_target_deleted_context_round_trip
917
2407
  fixture = {
918
- "agent_registration_id" => "stub"
2408
+ "client_id" => "stub",
2409
+ "actor" => {}
919
2410
  }
920
- model = WorkOS::AgentRegistrationRevokedData.new(fixture.to_json)
2411
+ model = WorkOS::FeatureFlagsFlagTargetDeletedContext.new(fixture.to_json)
921
2412
  json = model.to_h
922
2413
  assert_kind_of Hash, json
923
- 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]
924
2429
  fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
925
2430
  end
926
2431
 
@@ -1487,6 +2992,44 @@ class SharedModelRoundTripTest < Minitest::Test
1487
2992
  fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
1488
2993
  end
1489
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
+
1490
3033
  def test_account_selection_required_error_round_trip
1491
3034
  fixture = {
1492
3035
  "code" => "account_selection_required",
@@ -1499,6 +3042,66 @@ class SharedModelRoundTripTest < Minitest::Test
1499
3042
  fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
1500
3043
  end
1501
3044
 
3045
+ def test_oauth_data_integration_vended_credential_round_trip
3046
+ fixture = {
3047
+ "object" => "credential",
3048
+ "auth_method" => "oauth",
3049
+ "value" => "stub",
3050
+ "expires_at" => nil,
3051
+ "scopes" => [],
3052
+ "missing_scopes" => [],
3053
+ "metadata" => {},
3054
+ "config" => {}
3055
+ }
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)
3100
+ json = model.to_h
3101
+ assert_kind_of Hash, json
3102
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
3103
+ end
3104
+
1502
3105
  def test_event_list_list_metadata_round_trip
1503
3106
  fixture = {
1504
3107
  "after" => nil
@@ -1537,4 +3140,20 @@ class SharedModelRoundTripTest < Minitest::Test
1537
3140
  assert_equal fixture["id"], json[:id]
1538
3141
  fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
1539
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
1540
3159
  end