workos 7.1.2 → 9.5.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 (582) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/ci.yml +2 -2
  3. data/.github/workflows/docs.yml +49 -0
  4. data/.github/workflows/lint.yml +2 -2
  5. data/.github/workflows/release-please.yml +164 -10
  6. data/.github/workflows/release.yml +2 -2
  7. data/.gitignore +2 -0
  8. data/.last-synced-sha +1 -1
  9. data/.oagen-manifest.json +403 -84
  10. data/.release-please-manifest.json +1 -1
  11. data/.ruby-version +1 -1
  12. data/.yardopts +6 -0
  13. data/CHANGELOG.md +331 -0
  14. data/Gemfile +6 -0
  15. data/Gemfile.lock +35 -4
  16. data/README.md +19 -0
  17. data/docs/V7_MIGRATION_GUIDE.md +21 -0
  18. data/lib/workos/actions.rb +1 -1
  19. data/lib/workos/admin_portal/generate_link.rb +0 -3
  20. data/lib/workos/admin_portal.rb +0 -3
  21. data/lib/workos/api_keys/api_key.rb +4 -1
  22. data/lib/workos/api_keys/api_key_created.rb +5 -5
  23. data/lib/workos/api_keys/api_key_created_data.rb +4 -1
  24. data/lib/workos/api_keys/api_key_revoked.rb +5 -5
  25. data/lib/workos/{audit_logs/audit_log_export_json.rb → api_keys/api_key_updated.rb} +10 -10
  26. data/lib/workos/api_keys/api_key_updated_data.rb +49 -0
  27. data/lib/workos/{directory_sync/dsync_deactivated_data_domain.rb → api_keys/api_key_updated_data_owner.rb} +1 -1
  28. data/lib/workos/api_keys/api_key_updated_data_previous_attribute.rb +18 -0
  29. data/lib/workos/api_keys/create_organization_api_key.rb +5 -2
  30. data/lib/workos/api_keys/expire_api_key.rb +18 -0
  31. data/lib/workos/api_keys/organization_api_key.rb +46 -0
  32. data/lib/workos/{types/events_order.rb → api_keys/organization_api_key_owner.rb} +1 -3
  33. data/lib/workos/api_keys/organization_api_key_with_value.rb +49 -0
  34. data/lib/workos/{types/audit_logs_order.rb → api_keys/organization_api_key_with_value_owner.rb} +1 -3
  35. data/lib/workos/api_keys.rb +75 -47
  36. data/lib/workos/audit_logs/audit_log_action.rb +2 -7
  37. data/lib/workos/audit_logs/audit_log_export.rb +2 -7
  38. data/lib/workos/audit_logs/audit_log_schema.rb +11 -2
  39. data/lib/workos/audit_logs/audit_log_schema_actor_input.rb +7 -0
  40. data/lib/workos/audit_logs/audit_log_schema_input.rb +25 -0
  41. data/lib/workos/audit_logs/audit_log_schema_target.rb +16 -1
  42. data/lib/workos/audit_logs/audit_log_schema_target_input.rb +7 -0
  43. data/lib/workos/audit_logs.rb +20 -20
  44. data/lib/workos/{audit_logs/audit_log_schema_json_actor.rb → authorization/create_group_role_assignment.rb} +1 -1
  45. data/lib/workos/authorization/delete_group_role_assignments_by_criteria.rb +7 -0
  46. data/lib/workos/authorization/{role_assignment.rb → group_role_assignment.rb} +5 -2
  47. data/lib/workos/authorization/group_role_assignment_list.rb +25 -0
  48. data/lib/workos/authorization/{role_assignment_resource.rb → group_role_assignment_resource.rb} +1 -1
  49. data/lib/workos/authorization/permission_created.rb +5 -5
  50. data/lib/workos/authorization/permission_deleted.rb +5 -5
  51. data/lib/workos/authorization/permission_updated.rb +5 -5
  52. data/lib/workos/{api_keys/api_key_with_value_owner.rb → authorization/replace_group_role_assignment_entry.rb} +1 -1
  53. data/lib/workos/authorization/replace_group_role_assignments.rb +18 -0
  54. data/lib/workos/authorization/role_created.rb +5 -5
  55. data/lib/workos/authorization/role_deleted.rb +5 -5
  56. data/lib/workos/authorization/role_updated.rb +5 -5
  57. data/lib/workos/authorization/user_role_assignment.rb +40 -0
  58. data/lib/workos/authorization/user_role_assignment_resource.rb +7 -0
  59. data/lib/workos/{audit_logs/audit_log_schema_json_target.rb → authorization/user_role_assignment_source.rb} +4 -4
  60. data/lib/workos/authorization.rb +326 -30
  61. data/lib/workos/base_client.rb +90 -7
  62. data/lib/workos/client.rb +18 -10
  63. data/lib/workos/client_api/client_api_token.rb +22 -0
  64. data/lib/workos/client_api/client_api_token_response.rb +18 -0
  65. data/lib/workos/client_api.rb +39 -0
  66. data/lib/workos/connect/connect_application.rb +12 -0
  67. data/lib/workos/connect/connect_application_redirect_uri.rb +22 -0
  68. data/lib/workos/connect/user_object.rb +3 -0
  69. data/lib/workos/connect.rb +2 -2
  70. data/lib/workos/directory_sync/directory_user.rb +3 -0
  71. data/lib/workos/directory_sync/directory_user_with_groups.rb +4 -1
  72. data/lib/workos/directory_sync/dsync_activated.rb +5 -5
  73. data/lib/workos/directory_sync/dsync_deleted.rb +5 -5
  74. data/lib/workos/directory_sync/dsync_group_created.rb +5 -5
  75. data/lib/workos/directory_sync/dsync_group_deleted.rb +5 -5
  76. data/lib/workos/directory_sync/dsync_group_updated.rb +5 -5
  77. data/lib/workos/directory_sync/dsync_group_user_added.rb +5 -5
  78. data/lib/workos/directory_sync/dsync_group_user_removed.rb +5 -5
  79. data/lib/workos/directory_sync/dsync_token_created.rb +34 -0
  80. data/lib/workos/directory_sync/dsync_token_created_data.rb +34 -0
  81. data/lib/workos/directory_sync/dsync_token_revoked.rb +34 -0
  82. data/lib/workos/directory_sync/dsync_token_revoked_data.rb +7 -0
  83. data/lib/workos/directory_sync/dsync_user_created.rb +5 -5
  84. data/lib/workos/directory_sync/dsync_user_deleted.rb +5 -5
  85. data/lib/workos/directory_sync/dsync_user_updated.rb +5 -5
  86. data/lib/workos/directory_sync/dsync_user_updated_data.rb +3 -0
  87. data/lib/workos/directory_sync.rb +6 -6
  88. data/lib/workos/encryptors/aes_gcm.rb +19 -5
  89. data/lib/workos/events.rb +2 -2
  90. data/lib/workos/feature_flags/flag_created.rb +5 -5
  91. data/lib/workos/feature_flags/flag_deleted.rb +5 -5
  92. data/lib/workos/feature_flags/flag_rule_updated.rb +5 -5
  93. data/lib/workos/feature_flags/flag_rule_updated_context_configured_target_organization.rb +1 -16
  94. data/lib/workos/feature_flags/flag_rule_updated_context_previous_attribute_context_configured_target_organization.rb +1 -1
  95. data/lib/workos/feature_flags/flag_updated.rb +5 -5
  96. data/lib/workos/feature_flags.rb +6 -6
  97. data/lib/workos/{authorization → groups}/user_organization_membership_base_list_data.rb +5 -2
  98. data/lib/workos/groups.rb +4 -4
  99. data/lib/workos/inflections.rb +3 -1
  100. data/lib/workos/multi_factor_auth.rb +2 -2
  101. data/lib/workos/organization_domains/organization_domain_created.rb +5 -5
  102. data/lib/workos/organization_domains/organization_domain_deleted.rb +5 -5
  103. data/lib/workos/organization_domains/organization_domain_updated.rb +5 -5
  104. data/lib/workos/organization_domains/organization_domain_verification_failed.rb +5 -5
  105. data/lib/workos/organization_domains/organization_domain_verified.rb +5 -5
  106. data/lib/workos/{user_management → organization_membership}/organization_membership.rb +8 -2
  107. data/lib/workos/{user_management → organization_membership}/user_organization_membership.rb +8 -2
  108. data/lib/workos/organization_membership_service.rb +273 -0
  109. data/lib/workos/organizations/audit_logs_retention.rb +2 -7
  110. data/lib/workos/organizations/organization_created.rb +5 -5
  111. data/lib/workos/organizations/organization_deleted.rb +5 -5
  112. data/lib/workos/organizations/organization_membership_created.rb +5 -5
  113. data/lib/workos/organizations/organization_membership_deleted.rb +5 -5
  114. data/lib/workos/organizations/organization_membership_updated.rb +5 -5
  115. data/lib/workos/organizations/organization_role_created.rb +5 -5
  116. data/lib/workos/organizations/organization_role_deleted.rb +5 -5
  117. data/lib/workos/organizations/organization_role_updated.rb +5 -5
  118. data/lib/workos/organizations/organization_updated.rb +5 -5
  119. data/lib/workos/organizations.rb +2 -2
  120. data/lib/workos/pipes/connected_account.rb +6 -0
  121. data/lib/workos/pipes/connected_account_dto.rb +31 -0
  122. data/lib/workos/pipes/create_data_integration.rb +34 -0
  123. data/lib/workos/pipes/custom_provider_definition.rb +49 -0
  124. data/lib/workos/pipes/data_integration.rb +55 -0
  125. data/lib/workos/pipes/data_integration_credential.rb +25 -0
  126. data/lib/workos/pipes/data_integration_credentials_dto.rb +25 -0
  127. data/lib/workos/pipes/data_integration_credentials_response.rb +25 -0
  128. data/lib/workos/pipes/data_integration_credentials_response_credential.rb +34 -0
  129. data/lib/workos/pipes/data_integration_custom_provider.rb +49 -0
  130. data/lib/workos/pipes/data_integrations_list_response_data.rb +3 -0
  131. data/lib/workos/pipes/data_integrations_list_response_data_connected_account.rb +6 -0
  132. data/lib/workos/pipes/data_integrations_upsert_api_key_request.rb +25 -0
  133. data/lib/workos/pipes/data_integrations_vend_credentials_request.rb +22 -0
  134. data/lib/workos/pipes/update_custom_provider_definition.rb +49 -0
  135. data/lib/workos/pipes/update_data_integration.rb +31 -0
  136. data/lib/workos/pipes.rb +309 -5
  137. data/lib/workos/pipes_provider/configure_data_integration_body.rb +28 -0
  138. data/lib/workos/pipes_provider/data_integration_configuration_list_response.rb +22 -0
  139. data/lib/workos/{directory_sync/dsync_deactivated_data.rb → pipes_provider/data_integration_configuration_response.rb} +13 -13
  140. data/lib/workos/pipes_provider/data_integration_credentials.rb +31 -0
  141. data/lib/workos/pipes_provider.rb +68 -0
  142. data/lib/workos/radar/radar_standalone_assess_request.rb +3 -6
  143. data/lib/workos/radar.rb +7 -10
  144. data/lib/workos/session.rb +28 -7
  145. data/lib/workos/session_manager.rb +24 -1
  146. data/lib/workos/shared/auth_method_mismatch_error.rb +22 -0
  147. data/lib/workos/shared/connect_application_m2m.rb +46 -0
  148. data/lib/workos/shared/connect_application_oauth.rb +58 -0
  149. data/lib/workos/shared/connect_application_oauth_redirect_uris.rb +22 -0
  150. data/lib/workos/shared/error_response.rb +18 -0
  151. data/lib/workos/shared/group_created.rb +5 -5
  152. data/lib/workos/shared/group_deleted.rb +5 -5
  153. data/lib/workos/shared/group_member_added.rb +5 -5
  154. data/lib/workos/shared/group_member_removed.rb +5 -5
  155. data/lib/workos/shared/group_updated.rb +5 -5
  156. data/lib/workos/shared/pipe_connected_account.rb +46 -0
  157. data/lib/workos/{directory_sync/dsync_deactivated.rb → shared/pipes_connected_account_connected.rb} +7 -7
  158. data/lib/workos/shared/pipes_connected_account_disconnected.rb +34 -0
  159. data/lib/workos/shared/pipes_connected_account_reauthorization_needed.rb +34 -0
  160. data/lib/workos/shared/waitlist_user_approved.rb +5 -5
  161. data/lib/workos/shared/waitlist_user_created.rb +5 -5
  162. data/lib/workos/shared/waitlist_user_denied.rb +5 -5
  163. data/lib/workos/sso/connection_activated.rb +5 -5
  164. data/lib/workos/sso/connection_deactivated.rb +5 -5
  165. data/lib/workos/sso/connection_deleted.rb +5 -5
  166. data/lib/workos/sso/connection_saml_certificate_renewal_required.rb +5 -5
  167. data/lib/workos/sso/connection_saml_certificate_renewed.rb +5 -5
  168. data/lib/workos/sso/profile.rb +3 -0
  169. data/lib/workos/sso.rb +2 -2
  170. data/lib/workos/types/audit_log_configuration_log_stream_type.rb +2 -1
  171. data/lib/workos/types/audit_log_export_state.rb +2 -1
  172. data/lib/workos/types/connected_account_auth_method.rb +13 -0
  173. data/lib/workos/types/connected_account_state.rb +1 -2
  174. data/lib/workos/types/create_webhook_endpoint_events.rb +12 -1
  175. data/lib/workos/types/custom_provider_definition_authenticate_via.rb +13 -0
  176. data/lib/workos/types/data_integration_access_token_response_error.rb +2 -2
  177. data/lib/workos/types/data_integration_credential_type.rb +13 -0
  178. data/lib/workos/types/data_integration_credentials_credentials_type.rb +14 -0
  179. data/lib/workos/types/{directories_order.rb → data_integration_credentials_response_error.rb} +1 -1
  180. data/lib/workos/types/{authorization_order.rb → data_integration_credentials_type.rb} +1 -1
  181. data/lib/workos/types/data_integration_custom_provider_authenticate_via.rb +9 -0
  182. data/lib/workos/types/data_integration_state.rb +14 -0
  183. data/lib/workos/types/{connections_order.rb → data_integrations_list_response_data_auth_methods.rb} +1 -1
  184. data/lib/workos/types/data_integrations_list_response_data_connected_account_auth_method.rb +9 -0
  185. data/lib/workos/types/data_integrations_list_response_data_connected_account_state.rb +6 -1
  186. data/lib/workos/types/event_context_actor_source.rb +2 -1
  187. data/lib/workos/types/{applications_order.rb → pagination_order.rb} +1 -1
  188. data/lib/workos/types/pipe_connected_account_state.rb +13 -0
  189. data/lib/workos/types/{radar_action.rb → radar_list_action.rb} +1 -1
  190. data/lib/workos/types/radar_list_type.rb +18 -0
  191. data/lib/workos/types/radar_standalone_assess_request_action.rb +1 -7
  192. data/lib/workos/types/radar_standalone_response_blocklist_type.rb +1 -10
  193. data/lib/workos/types/radar_standalone_response_control.rb +1 -4
  194. data/lib/workos/types/update_custom_provider_definition_authenticate_via.rb +9 -0
  195. data/lib/workos/types/user_management_authentication_screen_hint.rb +1 -5
  196. data/lib/workos/types/user_role_assignment_source_type.rb +13 -0
  197. data/lib/workos/types/{vault_byok_key_verification_completed_data_key_provider.rb → vault_byok_key_provider.rb} +1 -1
  198. data/{rbi/workos/types/request_options.rbi → lib/workos/types/vault_order.rb} +4 -3
  199. data/lib/workos/types/webhook_endpoint_status.rb +1 -5
  200. data/lib/workos/types/widget_session_token_scopes.rb +2 -1
  201. data/lib/workos/user_management/action_authentication_denied.rb +6 -6
  202. data/lib/workos/user_management/action_user_registration_denied.rb +6 -6
  203. data/lib/workos/user_management/authentication_email_verification_failed.rb +5 -5
  204. data/lib/workos/user_management/authentication_email_verification_succeeded.rb +5 -5
  205. data/lib/workos/user_management/authentication_magic_auth_failed.rb +5 -5
  206. data/lib/workos/user_management/authentication_magic_auth_succeeded.rb +5 -5
  207. data/lib/workos/user_management/authentication_mfa_failed.rb +5 -5
  208. data/lib/workos/user_management/authentication_mfa_succeeded.rb +5 -5
  209. data/lib/workos/user_management/authentication_oauth_failed.rb +5 -5
  210. data/lib/workos/user_management/authentication_oauth_succeeded.rb +5 -5
  211. data/lib/workos/user_management/authentication_passkey_failed.rb +5 -5
  212. data/lib/workos/user_management/authentication_passkey_succeeded.rb +5 -5
  213. data/lib/workos/user_management/authentication_password_failed.rb +5 -5
  214. data/lib/workos/user_management/authentication_password_succeeded.rb +5 -5
  215. data/lib/workos/user_management/authentication_radar_risk_detected.rb +5 -5
  216. data/lib/workos/user_management/authentication_sso_failed.rb +5 -5
  217. data/lib/workos/user_management/authentication_sso_started.rb +5 -5
  218. data/lib/workos/user_management/authentication_sso_succeeded.rb +5 -5
  219. data/lib/workos/user_management/authentication_sso_timed_out.rb +5 -5
  220. data/lib/workos/user_management/authorization_code_session_authenticate_request.rb +5 -2
  221. data/lib/workos/user_management/create_magic_code_and_return.rb +14 -2
  222. data/lib/workos/user_management/create_user.rb +12 -0
  223. data/lib/workos/user_management/create_user_api_key.rb +28 -0
  224. data/lib/workos/user_management/email_change_confirmation_user.rb +3 -0
  225. data/lib/workos/user_management/email_verification_created.rb +5 -5
  226. data/lib/workos/user_management/invitation_accepted.rb +5 -5
  227. data/lib/workos/user_management/invitation_created.rb +5 -5
  228. data/lib/workos/user_management/invitation_resent.rb +5 -5
  229. data/lib/workos/user_management/invitation_revoked.rb +5 -5
  230. data/lib/workos/user_management/magic_auth_code_session_authenticate_request.rb +5 -2
  231. data/lib/workos/user_management/magic_auth_created.rb +5 -5
  232. data/lib/workos/user_management/magic_auth_send_magic_auth_code_and_return_response.rb +43 -0
  233. data/lib/workos/user_management/password_reset_created.rb +5 -5
  234. data/lib/workos/user_management/password_reset_succeeded.rb +5 -5
  235. data/lib/workos/user_management/password_session_authenticate_request.rb +8 -2
  236. data/lib/workos/user_management/radar_email_challenge_code_session_authenticate_request.rb +43 -0
  237. data/lib/workos/user_management/radar_sms_challenge_code_session_authenticate_request.rb +46 -0
  238. data/lib/workos/user_management/revoke_session.rb +2 -6
  239. data/lib/workos/user_management/send_radar_sms_challenge.rb +31 -0
  240. data/lib/workos/user_management/send_radar_sms_challenge_response.rb +22 -0
  241. data/lib/workos/user_management/session_created.rb +5 -5
  242. data/lib/workos/user_management/session_revoked.rb +5 -5
  243. data/lib/workos/user_management/update_user.rb +3 -0
  244. data/lib/workos/user_management/user_api_key.rb +46 -0
  245. data/lib/workos/user_management/user_api_key_created_data_owner.rb +25 -0
  246. data/lib/workos/user_management/user_api_key_owner.rb +7 -0
  247. data/lib/workos/user_management/user_api_key_revoked_data_owner.rb +7 -0
  248. data/lib/workos/user_management/user_api_key_updated_data_owner.rb +7 -0
  249. data/lib/workos/{api_keys/api_key_with_value.rb → user_management/user_api_key_with_value.rb} +5 -2
  250. data/lib/workos/user_management/user_api_key_with_value_owner.rb +7 -0
  251. data/lib/workos/user_management/user_create_response.rb +61 -0
  252. data/lib/workos/user_management/user_created.rb +5 -5
  253. data/lib/workos/user_management/user_deleted.rb +5 -5
  254. data/lib/workos/user_management/user_updated.rb +5 -5
  255. data/lib/workos/user_management.rb +351 -202
  256. data/lib/workos/vault/actor.rb +22 -0
  257. data/lib/workos/vault/create_data_key_request.rb +18 -0
  258. data/lib/workos/vault/create_data_key_response.rb +28 -0
  259. data/lib/workos/vault/create_object_request.rb +25 -0
  260. data/lib/workos/vault/decrypt_request.rb +18 -0
  261. data/lib/workos/vault/decrypt_response.rb +22 -0
  262. data/lib/workos/vault/delete_object_response.rb +22 -0
  263. data/lib/workos/vault/object_metadata.rb +37 -0
  264. data/lib/workos/{audit_logs/audit_log_action_json.rb → vault/object_summary.rb} +4 -10
  265. data/lib/workos/vault/object_version.rb +31 -0
  266. data/lib/workos/vault/object_without_value.rb +25 -0
  267. data/lib/workos/vault/rekey_request.rb +22 -0
  268. data/lib/workos/vault/update_object_request.rb +22 -0
  269. data/lib/workos/vault/vault_byok_key_deleted.rb +34 -0
  270. data/lib/workos/vault/vault_byok_key_deleted_data.rb +22 -0
  271. data/lib/workos/vault/vault_byok_key_verification_completed.rb +5 -5
  272. data/lib/workos/vault/vault_data_created.rb +5 -5
  273. data/lib/workos/vault/vault_data_deleted.rb +5 -5
  274. data/lib/workos/vault/vault_data_read.rb +5 -5
  275. data/lib/workos/vault/vault_data_updated.rb +5 -5
  276. data/lib/workos/vault/vault_dek_decrypted.rb +5 -5
  277. data/lib/workos/vault/vault_dek_read.rb +5 -5
  278. data/lib/workos/vault/vault_kek_created.rb +5 -5
  279. data/lib/workos/vault/vault_metadata_read.rb +5 -5
  280. data/lib/workos/vault/vault_names_listed.rb +5 -5
  281. data/lib/workos/vault/vault_object.rb +28 -0
  282. data/lib/workos/vault/version_list_response.rb +22 -0
  283. data/lib/workos/vault.rb +273 -139
  284. data/lib/workos/version.rb +1 -1
  285. data/lib/workos/webhooks/webhook_endpoint.rb +2 -7
  286. data/lib/workos/webhooks.rb +10 -11
  287. data/lib/workos/widgets/widget_session_token_response.rb +1 -12
  288. data/lib/workos.rb +3 -0
  289. data/rbi/workos/action_authentication_denied.rbi +10 -10
  290. data/rbi/workos/action_user_registration_denied.rbi +10 -10
  291. data/rbi/workos/actor.rbi +30 -0
  292. data/rbi/workos/admin_portal.rbi +1 -2
  293. data/rbi/workos/api_key.rbi +8 -2
  294. data/rbi/workos/api_key_created.rbi +6 -6
  295. data/rbi/workos/api_key_created_data.rbi +8 -2
  296. data/rbi/workos/api_key_revoked.rbi +6 -6
  297. data/rbi/workos/api_key_revoked_data.rbi +8 -2
  298. data/rbi/workos/{dsync_deactivated.rbi → api_key_updated.rbi} +9 -9
  299. data/rbi/workos/api_key_updated_data.rbi +84 -0
  300. data/rbi/workos/{api_key_with_value_owner.rbi → api_key_updated_data_owner.rbi} +1 -1
  301. data/rbi/workos/{audit_logs_retention_json.rbi → api_key_updated_data_previous_attribute.rbi} +5 -5
  302. data/rbi/workos/api_keys.rbi +27 -17
  303. data/rbi/workos/audit_log_action.rbi +1 -0
  304. data/rbi/workos/audit_log_export.rbi +1 -0
  305. data/rbi/workos/audit_log_schema.rbi +18 -0
  306. data/rbi/workos/{audit_log_schema_json_actor.rbi → audit_log_schema_actor_input.rbi} +1 -1
  307. data/rbi/workos/audit_log_schema_input.rbi +36 -0
  308. data/rbi/workos/{audit_log_schema_json_target.rbi → audit_log_schema_target_input.rbi} +1 -1
  309. data/rbi/workos/audit_logs.rbi +9 -9
  310. data/rbi/workos/audit_logs_retention.rbi +1 -0
  311. data/rbi/workos/auth_method_mismatch_error.rbi +30 -0
  312. data/rbi/workos/authentication_email_verification_failed.rbi +6 -6
  313. data/rbi/workos/authentication_email_verification_succeeded.rbi +6 -6
  314. data/rbi/workos/authentication_magic_auth_failed.rbi +6 -6
  315. data/rbi/workos/authentication_magic_auth_succeeded.rbi +6 -6
  316. data/rbi/workos/authentication_mfa_failed.rbi +6 -6
  317. data/rbi/workos/authentication_mfa_succeeded.rbi +6 -6
  318. data/rbi/workos/authentication_oauth_failed.rbi +6 -6
  319. data/rbi/workos/authentication_oauth_succeeded.rbi +6 -6
  320. data/rbi/workos/authentication_passkey_failed.rbi +6 -6
  321. data/rbi/workos/authentication_passkey_succeeded.rbi +6 -6
  322. data/rbi/workos/authentication_password_failed.rbi +6 -6
  323. data/rbi/workos/authentication_password_succeeded.rbi +6 -6
  324. data/rbi/workos/authentication_radar_risk_detected.rbi +6 -6
  325. data/rbi/workos/authentication_sso_failed.rbi +6 -6
  326. data/rbi/workos/authentication_sso_started.rbi +6 -6
  327. data/rbi/workos/authentication_sso_succeeded.rbi +6 -6
  328. data/rbi/workos/authentication_sso_timed_out.rbi +6 -6
  329. data/rbi/workos/authorization.rbi +97 -4
  330. data/rbi/workos/authorization_code_session_authenticate_request.rbi +8 -2
  331. data/rbi/workos/client.rbi +15 -6
  332. data/rbi/workos/client_api.rbi +22 -0
  333. data/rbi/workos/client_api_token.rbi +30 -0
  334. data/rbi/workos/client_api_token_response.rbi +24 -0
  335. data/rbi/workos/configure_data_integration_body.rbi +42 -0
  336. data/rbi/workos/connect_application.rbi +0 -12
  337. data/rbi/workos/{dsync_deactivated_data.rbi → connect_application_m2m.rbi} +19 -19
  338. data/rbi/workos/connect_application_oauth.rbi +102 -0
  339. data/rbi/workos/connect_application_oauth_redirect_uris.rbi +30 -0
  340. data/rbi/workos/connected_account.rbi +12 -0
  341. data/rbi/workos/connected_account_dto.rbi +48 -0
  342. data/rbi/workos/connection_activated.rbi +6 -6
  343. data/rbi/workos/connection_deactivated.rbi +6 -6
  344. data/rbi/workos/connection_deleted.rbi +6 -6
  345. data/rbi/workos/connection_saml_certificate_renewal_required.rbi +6 -6
  346. data/rbi/workos/connection_saml_certificate_renewed.rbi +6 -6
  347. data/rbi/workos/create_data_integration.rbi +54 -0
  348. data/rbi/workos/create_data_key_request.rbi +24 -0
  349. data/rbi/workos/create_data_key_response.rbi +42 -0
  350. data/rbi/workos/create_group_role_assignment.rbi +42 -0
  351. data/rbi/workos/create_magic_code_and_return.rbi +24 -0
  352. data/rbi/workos/create_object_request.rbi +36 -0
  353. data/rbi/workos/create_organization_api_key.rbi +6 -0
  354. data/rbi/workos/create_user.rbi +24 -0
  355. data/rbi/workos/create_user_api_key.rbi +42 -0
  356. data/rbi/workos/custom_provider_definition.rbi +84 -0
  357. data/rbi/workos/data_integration.rbi +96 -0
  358. data/rbi/workos/data_integration_configuration_list_response.rbi +30 -0
  359. data/rbi/workos/data_integration_configuration_response.rbi +78 -0
  360. data/rbi/workos/data_integration_credential.rbi +36 -0
  361. data/rbi/workos/data_integration_credentials.rbi +48 -0
  362. data/rbi/workos/data_integration_credentials_dto.rbi +36 -0
  363. data/rbi/workos/data_integration_credentials_response.rbi +36 -0
  364. data/rbi/workos/data_integration_credentials_response_credential.rbi +54 -0
  365. data/rbi/workos/data_integration_custom_provider.rbi +84 -0
  366. data/rbi/workos/data_integrations_list_response_data.rbi +6 -0
  367. data/rbi/workos/data_integrations_list_response_data_connected_account.rbi +12 -0
  368. data/rbi/workos/data_integrations_upsert_api_key_request.rbi +36 -0
  369. data/rbi/workos/data_integrations_vend_credentials_request.rbi +30 -0
  370. data/rbi/workos/decrypt_request.rbi +24 -0
  371. data/rbi/workos/decrypt_response.rbi +30 -0
  372. data/rbi/workos/delete_group_role_assignments_by_criteria.rbi +42 -0
  373. data/rbi/workos/delete_object_response.rbi +30 -0
  374. data/rbi/workos/directory_user.rbi +6 -0
  375. data/rbi/workos/directory_user_with_groups.rbi +6 -0
  376. data/rbi/workos/dsync_activated.rbi +6 -6
  377. data/rbi/workos/dsync_deleted.rbi +6 -6
  378. data/rbi/workos/dsync_group_created.rbi +6 -6
  379. data/rbi/workos/dsync_group_deleted.rbi +6 -6
  380. data/rbi/workos/dsync_group_updated.rbi +6 -6
  381. data/rbi/workos/dsync_group_user_added.rbi +6 -6
  382. data/rbi/workos/dsync_group_user_removed.rbi +6 -6
  383. data/rbi/workos/dsync_token_created.rbi +54 -0
  384. data/rbi/workos/{audit_log_export_json.rbi → dsync_token_created_data.rbi} +9 -9
  385. data/rbi/workos/dsync_token_revoked.rbi +54 -0
  386. data/rbi/workos/{audit_log_action_json.rbi → dsync_token_revoked_data.rbi} +17 -11
  387. data/rbi/workos/dsync_user_created.rbi +6 -6
  388. data/rbi/workos/dsync_user_deleted.rbi +6 -6
  389. data/rbi/workos/dsync_user_updated.rbi +6 -6
  390. data/rbi/workos/dsync_user_updated_data.rbi +6 -0
  391. data/rbi/workos/email_change_confirmation_user.rbi +6 -0
  392. data/rbi/workos/email_verification_created.rbi +6 -6
  393. data/rbi/workos/error_response.rbi +24 -0
  394. data/rbi/workos/expire_api_key.rbi +24 -0
  395. data/rbi/workos/flag_created.rbi +6 -6
  396. data/rbi/workos/flag_deleted.rbi +6 -6
  397. data/rbi/workos/flag_rule_updated.rbi +6 -6
  398. data/rbi/workos/flag_updated.rbi +6 -6
  399. data/rbi/workos/generate_link.rbi +0 -6
  400. data/rbi/workos/group_created.rbi +6 -6
  401. data/rbi/workos/group_deleted.rbi +6 -6
  402. data/rbi/workos/group_member_added.rbi +6 -6
  403. data/rbi/workos/group_member_removed.rbi +6 -6
  404. data/rbi/workos/{role_assignment.rbi → group_role_assignment.rbi} +9 -3
  405. data/rbi/workos/group_role_assignment_resource.rbi +36 -0
  406. data/rbi/workos/group_updated.rbi +6 -6
  407. data/rbi/workos/invitation_accepted.rbi +6 -6
  408. data/rbi/workos/invitation_created.rbi +6 -6
  409. data/rbi/workos/invitation_resent.rbi +6 -6
  410. data/rbi/workos/invitation_revoked.rbi +6 -6
  411. data/rbi/workos/magic_auth_code_session_authenticate_request.rbi +6 -0
  412. data/rbi/workos/magic_auth_created.rbi +6 -6
  413. data/rbi/workos/{webhook_endpoint_json.rbi → magic_auth_send_magic_auth_code_and_return_response.rbi} +19 -13
  414. data/rbi/workos/object_metadata.rbi +60 -0
  415. data/rbi/workos/object_summary.rbi +36 -0
  416. data/rbi/workos/object_version.rbi +48 -0
  417. data/rbi/workos/object_without_value.rbi +36 -0
  418. data/rbi/workos/organization_api_key.rbi +78 -0
  419. data/rbi/workos/organization_api_key_owner.rbi +30 -0
  420. data/rbi/workos/organization_api_key_with_value.rbi +84 -0
  421. data/rbi/workos/organization_api_key_with_value_owner.rbi +30 -0
  422. data/rbi/workos/organization_created.rbi +6 -6
  423. data/rbi/workos/organization_deleted.rbi +6 -6
  424. data/rbi/workos/organization_domain_created.rbi +6 -6
  425. data/rbi/workos/organization_domain_deleted.rbi +6 -6
  426. data/rbi/workos/organization_domain_updated.rbi +6 -6
  427. data/rbi/workos/organization_domain_verification_failed.rbi +6 -6
  428. data/rbi/workos/organization_domain_verified.rbi +6 -6
  429. data/rbi/workos/organization_membership.rbi +12 -0
  430. data/rbi/workos/organization_membership_created.rbi +6 -6
  431. data/rbi/workos/organization_membership_deleted.rbi +6 -6
  432. data/rbi/workos/organization_membership_service.rbi +114 -0
  433. data/rbi/workos/organization_membership_updated.rbi +6 -6
  434. data/rbi/workos/organization_role_created.rbi +6 -6
  435. data/rbi/workos/organization_role_deleted.rbi +6 -6
  436. data/rbi/workos/organization_role_updated.rbi +6 -6
  437. data/rbi/workos/organization_updated.rbi +6 -6
  438. data/rbi/workos/password_reset_created.rbi +6 -6
  439. data/rbi/workos/password_reset_succeeded.rbi +6 -6
  440. data/rbi/workos/password_session_authenticate_request.rbi +12 -0
  441. data/rbi/workos/permission_created.rbi +6 -6
  442. data/rbi/workos/permission_deleted.rbi +6 -6
  443. data/rbi/workos/permission_updated.rbi +6 -6
  444. data/rbi/workos/pipe_connected_account.rbi +78 -0
  445. data/rbi/workos/pipes.rbi +105 -1
  446. data/rbi/workos/pipes_connected_account_connected.rbi +54 -0
  447. data/rbi/workos/pipes_connected_account_disconnected.rbi +54 -0
  448. data/rbi/workos/pipes_connected_account_reauthorization_needed.rbi +54 -0
  449. data/rbi/workos/pipes_provider.rbi +34 -0
  450. data/rbi/workos/profile.rbi +6 -0
  451. data/rbi/workos/radar.rbi +2 -3
  452. data/rbi/workos/radar_email_challenge_code_session_authenticate_request.rbi +72 -0
  453. data/rbi/workos/radar_sms_challenge_code_session_authenticate_request.rbi +78 -0
  454. data/rbi/workos/radar_standalone_assess_request.rbi +2 -8
  455. data/rbi/workos/refresh_token_session_authenticate_request.rbi +2 -2
  456. data/rbi/workos/rekey_request.rbi +30 -0
  457. data/rbi/workos/replace_group_role_assignment_entry.rbi +42 -0
  458. data/rbi/workos/replace_group_role_assignments.rbi +24 -0
  459. data/rbi/workos/revoke_session.rbi +0 -6
  460. data/rbi/workos/role_created.rbi +6 -6
  461. data/rbi/workos/role_deleted.rbi +6 -6
  462. data/rbi/workos/role_updated.rbi +6 -6
  463. data/rbi/workos/send_radar_sms_challenge.rbi +48 -0
  464. data/rbi/workos/send_radar_sms_challenge_response.rbi +30 -0
  465. data/rbi/workos/session_created.rbi +6 -6
  466. data/rbi/workos/session_manager.rbi +1 -1
  467. data/rbi/workos/session_revoked.rbi +6 -6
  468. data/rbi/workos/update_custom_provider_definition.rbi +84 -0
  469. data/rbi/workos/update_data_integration.rbi +48 -0
  470. data/rbi/workos/update_object_request.rbi +30 -0
  471. data/rbi/workos/update_user.rbi +6 -0
  472. data/rbi/workos/user.rbi +6 -0
  473. data/rbi/workos/{api_key_with_value.rbi → user_api_key.rbi} +9 -9
  474. data/rbi/workos/user_api_key_created_data_owner.rbi +36 -0
  475. data/rbi/workos/{dsync_deactivated_data_domain.rbi → user_api_key_owner.rbi} +5 -5
  476. data/rbi/workos/user_api_key_revoked_data_owner.rbi +36 -0
  477. data/rbi/workos/user_api_key_updated_data_owner.rbi +36 -0
  478. data/rbi/workos/user_api_key_with_value.rbi +84 -0
  479. data/rbi/workos/user_api_key_with_value_owner.rbi +36 -0
  480. data/rbi/workos/user_create_response.rbi +108 -0
  481. data/rbi/workos/user_created.rbi +6 -6
  482. data/rbi/workos/user_deleted.rbi +6 -6
  483. data/rbi/workos/user_management.rbi +72 -86
  484. data/rbi/workos/user_object.rbi +6 -0
  485. data/rbi/workos/user_organization_membership.rbi +12 -0
  486. data/rbi/workos/user_organization_membership_base_list_data.rbi +6 -0
  487. data/rbi/workos/user_role_assignment.rbi +66 -0
  488. data/rbi/workos/{role_assignment_resource.rbi → user_role_assignment_resource.rbi} +1 -1
  489. data/rbi/workos/user_role_assignment_source.rbi +30 -0
  490. data/rbi/workos/user_updated.rbi +6 -6
  491. data/rbi/workos/vault.rbi +70 -95
  492. data/rbi/workos/vault_byok_key_deleted.rbi +54 -0
  493. data/rbi/workos/vault_byok_key_deleted_data.rbi +30 -0
  494. data/rbi/workos/vault_byok_key_verification_completed.rbi +6 -6
  495. data/rbi/workos/vault_data_created.rbi +6 -6
  496. data/rbi/workos/vault_data_deleted.rbi +6 -6
  497. data/rbi/workos/vault_data_read.rbi +6 -6
  498. data/rbi/workos/vault_data_updated.rbi +6 -6
  499. data/rbi/workos/vault_dek_decrypted.rbi +6 -6
  500. data/rbi/workos/vault_dek_read.rbi +6 -6
  501. data/rbi/workos/vault_kek_created.rbi +6 -6
  502. data/rbi/workos/vault_metadata_read.rbi +6 -6
  503. data/rbi/workos/vault_names_listed.rbi +6 -6
  504. data/rbi/workos/vault_object.rbi +42 -0
  505. data/rbi/workos/waitlist_user_approved.rbi +6 -6
  506. data/rbi/workos/waitlist_user_created.rbi +6 -6
  507. data/rbi/workos/waitlist_user_denied.rbi +6 -6
  508. data/rbi/workos/webhook_endpoint.rbi +1 -0
  509. data/rbi/workos/webhooks.rbi +2 -2
  510. data/renovate.json +1 -61
  511. data/script/docs +16 -0
  512. data/script/docs-serve +12 -0
  513. data/script/llms-txt +37 -0
  514. data/test/workos/test_actions.rb +9 -0
  515. data/test/workos/test_admin_portal_model_round_trip.rb +33 -0
  516. data/test/workos/test_api_keys.rb +20 -12
  517. data/test/workos/test_audit_logs_model_round_trip.rb +218 -0
  518. data/test/workos/test_authorization.rb +64 -0
  519. data/test/workos/test_authorization_model_round_trip.rb +456 -0
  520. data/test/workos/test_base_client.rb +108 -0
  521. data/test/workos/test_client_api.rb +33 -0
  522. data/test/workos/test_connect_model_round_trip.rb +30 -0
  523. data/test/workos/test_encryptors_aes_gcm.rb +16 -1
  524. data/test/workos/test_groups_model_round_trip.rb +33 -0
  525. data/test/workos/test_model_round_trip.rb +2 -7138
  526. data/test/workos/test_organization_membership_service.rb +107 -0
  527. data/test/workos/test_organizations_model_round_trip.rb +29 -0
  528. data/test/workos/test_pipes.rb +75 -3
  529. data/test/workos/test_pipes_model_round_trip.rb +389 -0
  530. data/test/workos/test_pipes_provider.rb +41 -0
  531. data/test/workos/test_radar_model_round_trip.rb +85 -0
  532. data/test/workos/test_session.rb +43 -4
  533. data/test/workos/test_shared_model_round_trip.rb +92 -0
  534. data/test/workos/test_user_management.rb +77 -73
  535. data/test/workos/test_user_management_model_round_trip.rb +1087 -0
  536. data/test/workos/test_vault.rb +91 -88
  537. data/test/workos/test_webhook_verify.rb +11 -0
  538. data/test/workos/test_webhooks_model_round_trip.rb +53 -0
  539. metadata +220 -85
  540. data/lib/workos/audit_logs/audit_log_schema_json.rb +0 -34
  541. data/lib/workos/organizations/audit_logs_retention_json.rb +0 -18
  542. data/lib/workos/types/audit_log_export_json_state.rb +0 -14
  543. data/lib/workos/types/directory_groups_order.rb +0 -9
  544. data/lib/workos/types/directory_users_order.rb +0 -9
  545. data/lib/workos/types/dsync_deactivated_data_state.rb +0 -9
  546. data/lib/workos/types/dsync_deactivated_data_type.rb +0 -9
  547. data/lib/workos/types/feature_flags_order.rb +0 -9
  548. data/lib/workos/types/groups_order.rb +0 -9
  549. data/lib/workos/types/organizations_api_keys_order.rb +0 -9
  550. data/lib/workos/types/organizations_feature_flags_order.rb +0 -9
  551. data/lib/workos/types/organizations_order.rb +0 -9
  552. data/lib/workos/types/permissions_order.rb +0 -9
  553. data/lib/workos/types/radar_type.rb +0 -9
  554. data/lib/workos/types/user_management_invitations_order.rb +0 -9
  555. data/lib/workos/types/user_management_multi_factor_authentication_order.rb +0 -9
  556. data/lib/workos/types/user_management_organization_membership_groups_order.rb +0 -9
  557. data/lib/workos/types/user_management_organization_membership_order.rb +0 -9
  558. data/lib/workos/types/user_management_users_authorized_applications_order.rb +0 -9
  559. data/lib/workos/types/user_management_users_feature_flags_order.rb +0 -9
  560. data/lib/workos/types/user_management_users_order.rb +0 -9
  561. data/lib/workos/types/webhook_endpoint_json_status.rb +0 -9
  562. data/lib/workos/types/webhooks_order.rb +0 -9
  563. data/lib/workos/user_management_organization_membership_groups.rb +0 -60
  564. data/lib/workos/webhooks/webhook_endpoint_json.rb +0 -40
  565. data/rbi/workos/actions.rbi +0 -48
  566. data/rbi/workos/audit_log_schema_json.rbi +0 -54
  567. data/rbi/workos/base_client.rbi +0 -132
  568. data/rbi/workos/configuration.rbi +0 -68
  569. data/rbi/workos/encryptors/aes_gcm.rbi +0 -19
  570. data/rbi/workos/errors.rbi +0 -43
  571. data/rbi/workos/hash_provider.rbi +0 -18
  572. data/rbi/workos/passwordless.rbi +0 -47
  573. data/rbi/workos/public_client.rbi +0 -12
  574. data/rbi/workos/session.rbi +0 -43
  575. data/rbi/workos/types/api_response.rbi +0 -29
  576. data/rbi/workos/types/base_model.rbi +0 -22
  577. data/rbi/workos/types/list_struct.rbi +0 -89
  578. data/rbi/workos/user_management_organization_membership_groups.rbi +0 -25
  579. data/rbi/workos/util.rbi +0 -12
  580. data/test/workos/test_user_management_organization_membership_groups.rb +0 -33
  581. /data/lib/workos/{user_management → organization_membership}/create_user_organization_membership.rb +0 -0
  582. /data/lib/workos/{user_management → organization_membership}/update_user_organization_membership.rb +0 -0
@@ -52,6 +52,186 @@ module WorkOS
52
52
  @client = client
53
53
  end
54
54
 
55
+ # List role assignments for a group
56
+ # @param group_id [String] The ID of the group.
57
+ # @param before [String, nil] An object ID that defines your place in the list. When the ID is not present, you are at the end of the list. For example, if you make a list request and receive 100 objects, ending with `"obj_123"`, your subsequent call can include `before="obj_123"` to fetch a new batch of objects before `"obj_123"`.
58
+ # @param after [String, nil] An object ID that defines your place in the list. When the ID is not present, you are at the end of the list. For example, if you make a list request and receive 100 objects, ending with `"obj_123"`, your subsequent call can include `after="obj_123"` to fetch a new batch of objects after `"obj_123"`.
59
+ # @param limit [Integer, nil] Upper limit on the number of objects to return, between `1` and `100`.
60
+ # @param order [WorkOS::Types::PaginationOrder, nil] Order the results by the creation time. Supported values are `"asc"` (ascending), `"desc"` (descending), and `"normal"` (descending with reversed cursor semantics where `before` fetches older records and `after` fetches newer records).
61
+ # @param request_options [Hash] (see WorkOS::Types::RequestOptions)
62
+ # @return [WorkOS::Types::ListStruct<WorkOS::GroupRoleAssignment>]
63
+ def list_group_role_assignments(
64
+ group_id:,
65
+ before: nil,
66
+ after: nil,
67
+ limit: 10,
68
+ order: "desc",
69
+ request_options: {}
70
+ )
71
+ params = {
72
+ "before" => before,
73
+ "after" => after,
74
+ "limit" => limit,
75
+ "order" => order
76
+ }.compact
77
+ response = @client.request(
78
+ method: :get,
79
+ path: "/authorization/groups/#{WorkOS::Util.encode_path(group_id)}/role_assignments",
80
+ auth: true,
81
+ params: params,
82
+ request_options: request_options
83
+ )
84
+ fetch_next = ->(cursor) {
85
+ list_group_role_assignments(
86
+ group_id: group_id,
87
+ before: before,
88
+ after: cursor,
89
+ limit: limit,
90
+ order: order,
91
+ request_options: request_options
92
+ )
93
+ }
94
+ WorkOS::Types::ListStruct.from_response(
95
+ response,
96
+ model: WorkOS::GroupRoleAssignment,
97
+ filters: {group_id: group_id, before: before, limit: limit, order: order},
98
+ fetch_next: fetch_next
99
+ )
100
+ end
101
+
102
+ # Assign a role to a group
103
+ # @param group_id [String] The ID of the group.
104
+ # @param role_slug [String] The slug of the role to assign to the group.
105
+ # @param resource_id [String, nil] The ID of the resource. Omit along with the external-id fields to target the organization itself.
106
+ # @param resource_external_id [String, nil] The external ID of the resource.
107
+ # @param resource_type_slug [String, nil] The resource type slug.
108
+ # @param request_options [Hash] (see WorkOS::Types::RequestOptions)
109
+ # @return [WorkOS::GroupRoleAssignment]
110
+ def create_group_role_assignment(
111
+ group_id:,
112
+ role_slug:,
113
+ resource_id: nil,
114
+ resource_external_id: nil,
115
+ resource_type_slug: nil,
116
+ request_options: {}
117
+ )
118
+ body = {
119
+ "role_slug" => role_slug,
120
+ "resource_id" => resource_id,
121
+ "resource_external_id" => resource_external_id,
122
+ "resource_type_slug" => resource_type_slug
123
+ }.compact
124
+ response = @client.request(
125
+ method: :post,
126
+ path: "/authorization/groups/#{WorkOS::Util.encode_path(group_id)}/role_assignments",
127
+ auth: true,
128
+ body: body,
129
+ request_options: request_options
130
+ )
131
+ result = WorkOS::GroupRoleAssignment.new(response.body)
132
+ result.last_response = WorkOS::Types::ApiResponse.new(http_status: response.code.to_i, http_headers: response.each_header.to_h, request_id: response["x-request-id"])
133
+ result
134
+ end
135
+
136
+ # Replace all role assignments for a group
137
+ # @param group_id [String] The ID of the group.
138
+ # @param role_assignments [Array<WorkOS::ReplaceGroupRoleAssignmentEntry>] The list of role assignments that should exist for the group. All existing assignments will be replaced.
139
+ # @param request_options [Hash] (see WorkOS::Types::RequestOptions)
140
+ # @return [WorkOS::Types::ListStruct<WorkOS::GroupRoleAssignment>]
141
+ def update_group_role_assignments(
142
+ group_id:,
143
+ role_assignments:,
144
+ request_options: {}
145
+ )
146
+ body = {
147
+ "role_assignments" => role_assignments
148
+ }
149
+ response = @client.request(
150
+ method: :put,
151
+ path: "/authorization/groups/#{WorkOS::Util.encode_path(group_id)}/role_assignments",
152
+ auth: true,
153
+ body: body,
154
+ request_options: request_options
155
+ )
156
+ WorkOS::Types::ListStruct.from_response(
157
+ response,
158
+ model: WorkOS::GroupRoleAssignment,
159
+ filters: {group_id: group_id, role_assignments: role_assignments}
160
+ )
161
+ end
162
+
163
+ # Remove group role assignments by criteria
164
+ # @param group_id [String] The ID of the group.
165
+ # @param role_slug [String] The slug of the role to remove assignments for.
166
+ # @param resource_id [String, nil] The ID of the resource. Mutually exclusive with `resource_external_id` and `resource_type_slug`.
167
+ # @param resource_external_id [String, nil] The external ID of the resource.
168
+ # @param resource_type_slug [String, nil] The resource type slug.
169
+ # @param request_options [Hash] (see WorkOS::Types::RequestOptions)
170
+ # @return [void]
171
+ def delete_group_role_assignments(
172
+ group_id:,
173
+ role_slug:,
174
+ resource_id: nil,
175
+ resource_external_id: nil,
176
+ resource_type_slug: nil,
177
+ request_options: {}
178
+ )
179
+ body = {
180
+ "role_slug" => role_slug,
181
+ "resource_id" => resource_id,
182
+ "resource_external_id" => resource_external_id,
183
+ "resource_type_slug" => resource_type_slug
184
+ }.compact
185
+ @client.request(
186
+ method: :delete,
187
+ path: "/authorization/groups/#{WorkOS::Util.encode_path(group_id)}/role_assignments",
188
+ auth: true,
189
+ body: body,
190
+ request_options: request_options
191
+ )
192
+ nil
193
+ end
194
+
195
+ # Get a group role assignment
196
+ # @param group_id [String] The ID of the group.
197
+ # @param role_assignment_id [String] The ID of the group role assignment.
198
+ # @param request_options [Hash] (see WorkOS::Types::RequestOptions)
199
+ # @return [WorkOS::GroupRoleAssignment]
200
+ def get_group_role_assignment(
201
+ group_id:,
202
+ role_assignment_id:,
203
+ request_options: {}
204
+ )
205
+ response = @client.request(
206
+ method: :get,
207
+ path: "/authorization/groups/#{WorkOS::Util.encode_path(group_id)}/role_assignments/#{WorkOS::Util.encode_path(role_assignment_id)}",
208
+ auth: true,
209
+ request_options: request_options
210
+ )
211
+ result = WorkOS::GroupRoleAssignment.new(response.body)
212
+ result.last_response = WorkOS::Types::ApiResponse.new(http_status: response.code.to_i, http_headers: response.each_header.to_h, request_id: response["x-request-id"])
213
+ result
214
+ end
215
+
216
+ # Remove a group role assignment
217
+ # @param group_id [String] The ID of the group.
218
+ # @param role_assignment_id [String] The ID of the group role assignment to remove.
219
+ # @param request_options [Hash] (see WorkOS::Types::RequestOptions)
220
+ # @return [void]
221
+ def delete_group_role_assignment(
222
+ group_id:,
223
+ role_assignment_id:,
224
+ request_options: {}
225
+ )
226
+ @client.request(
227
+ method: :delete,
228
+ path: "/authorization/groups/#{WorkOS::Util.encode_path(group_id)}/role_assignments/#{WorkOS::Util.encode_path(role_assignment_id)}",
229
+ auth: true,
230
+ request_options: request_options
231
+ )
232
+ nil
233
+ end
234
+
55
235
  # Check authorization
56
236
  # @param organization_membership_id [String] The ID of the organization membership to check.
57
237
  # @param permission_slug [String] The slug of the permission to check.
@@ -93,7 +273,7 @@ module WorkOS
93
273
  # @param before [String, nil] An object ID that defines your place in the list. When the ID is not present, you are at the end of the list. For example, if you make a list request and receive 100 objects, ending with `"obj_123"`, your subsequent call can include `before="obj_123"` to fetch a new batch of objects before `"obj_123"`.
94
274
  # @param after [String, nil] An object ID that defines your place in the list. When the ID is not present, you are at the end of the list. For example, if you make a list request and receive 100 objects, ending with `"obj_123"`, your subsequent call can include `after="obj_123"` to fetch a new batch of objects after `"obj_123"`.
95
275
  # @param limit [Integer, nil] Upper limit on the number of objects to return, between `1` and `100`.
96
- # @param order [WorkOS::Types::AuthorizationOrder, nil] Order the results by the creation time. Supported values are `"asc"` (ascending), `"desc"` (descending), and `"normal"` (descending with reversed cursor semantics where `before` fetches older records and `after` fetches newer records). Defaults to descending.
276
+ # @param order [WorkOS::Types::PaginationOrder, nil] Order the results by the creation time. Supported values are `"asc"` (ascending), `"desc"` (descending), and `"normal"` (descending with reversed cursor semantics where `before` fetches older records and `after` fetches newer records).
97
277
  # @param permission_slug [String] The permission slug to filter by. Only child resources where the organization membership has this permission are returned.
98
278
  # @param parent_resource [WorkOS::Authorization::ParentResourceById, WorkOS::Authorization::ParentResourceByExternalId] Identifies the parent resource.
99
279
  # @param request_options [Hash] (see WorkOS::Types::RequestOptions)
@@ -104,7 +284,7 @@ module WorkOS
104
284
  parent_resource:,
105
285
  before: nil,
106
286
  after: nil,
107
- limit: nil,
287
+ limit: 10,
108
288
  order: "desc",
109
289
  request_options: {}
110
290
  )
@@ -157,7 +337,7 @@ module WorkOS
157
337
  # @param before [String, nil] An object ID that defines your place in the list. When the ID is not present, you are at the end of the list. For example, if you make a list request and receive 100 objects, ending with `"obj_123"`, your subsequent call can include `before="obj_123"` to fetch a new batch of objects before `"obj_123"`.
158
338
  # @param after [String, nil] An object ID that defines your place in the list. When the ID is not present, you are at the end of the list. For example, if you make a list request and receive 100 objects, ending with `"obj_123"`, your subsequent call can include `after="obj_123"` to fetch a new batch of objects after `"obj_123"`.
159
339
  # @param limit [Integer, nil] Upper limit on the number of objects to return, between `1` and `100`.
160
- # @param order [WorkOS::Types::AuthorizationOrder, nil] Order the results by the creation time. Supported values are `"asc"` (ascending), `"desc"` (descending), and `"normal"` (descending with reversed cursor semantics where `before` fetches older records and `after` fetches newer records). Defaults to descending.
340
+ # @param order [WorkOS::Types::PaginationOrder, nil] Order the results by the creation time. Supported values are `"asc"` (ascending), `"desc"` (descending), and `"normal"` (descending with reversed cursor semantics where `before` fetches older records and `after` fetches newer records).
161
341
  # @param request_options [Hash] (see WorkOS::Types::RequestOptions)
162
342
  # @return [WorkOS::Types::ListStruct<WorkOS::AuthorizationPermission>]
163
343
  def list_effective_permissions(
@@ -165,7 +345,7 @@ module WorkOS
165
345
  resource_id:,
166
346
  before: nil,
167
347
  after: nil,
168
- limit: nil,
348
+ limit: 10,
169
349
  order: "desc",
170
350
  request_options: {}
171
351
  )
@@ -208,7 +388,7 @@ module WorkOS
208
388
  # @param before [String, nil] An object ID that defines your place in the list. When the ID is not present, you are at the end of the list. For example, if you make a list request and receive 100 objects, ending with `"obj_123"`, your subsequent call can include `before="obj_123"` to fetch a new batch of objects before `"obj_123"`.
209
389
  # @param after [String, nil] An object ID that defines your place in the list. When the ID is not present, you are at the end of the list. For example, if you make a list request and receive 100 objects, ending with `"obj_123"`, your subsequent call can include `after="obj_123"` to fetch a new batch of objects after `"obj_123"`.
210
390
  # @param limit [Integer, nil] Upper limit on the number of objects to return, between `1` and `100`.
211
- # @param order [WorkOS::Types::AuthorizationOrder, nil] Order the results by the creation time. Supported values are `"asc"` (ascending), `"desc"` (descending), and `"normal"` (descending with reversed cursor semantics where `before` fetches older records and `after` fetches newer records). Defaults to descending.
391
+ # @param order [WorkOS::Types::PaginationOrder, nil] Order the results by the creation time. Supported values are `"asc"` (ascending), `"desc"` (descending), and `"normal"` (descending with reversed cursor semantics where `before` fetches older records and `after` fetches newer records).
212
392
  # @param request_options [Hash] (see WorkOS::Types::RequestOptions)
213
393
  # @return [WorkOS::Types::ListStruct<WorkOS::AuthorizationPermission>]
214
394
  def list_effective_permissions_by_external_id(
@@ -217,7 +397,7 @@ module WorkOS
217
397
  external_id:,
218
398
  before: nil,
219
399
  after: nil,
220
- limit: nil,
400
+ limit: 10,
221
401
  order: "desc",
222
402
  request_options: {}
223
403
  )
@@ -259,22 +439,31 @@ module WorkOS
259
439
  # @param before [String, nil] An object ID that defines your place in the list. When the ID is not present, you are at the end of the list. For example, if you make a list request and receive 100 objects, ending with `"obj_123"`, your subsequent call can include `before="obj_123"` to fetch a new batch of objects before `"obj_123"`.
260
440
  # @param after [String, nil] An object ID that defines your place in the list. When the ID is not present, you are at the end of the list. For example, if you make a list request and receive 100 objects, ending with `"obj_123"`, your subsequent call can include `after="obj_123"` to fetch a new batch of objects after `"obj_123"`.
261
441
  # @param limit [Integer, nil] Upper limit on the number of objects to return, between `1` and `100`.
262
- # @param order [WorkOS::Types::AuthorizationOrder, nil] Order the results by the creation time. Supported values are `"asc"` (ascending), `"desc"` (descending), and `"normal"` (descending with reversed cursor semantics where `before` fetches older records and `after` fetches newer records). Defaults to descending.
442
+ # @param order [WorkOS::Types::PaginationOrder, nil] Order the results by the creation time. Supported values are `"asc"` (ascending), `"desc"` (descending), and `"normal"` (descending with reversed cursor semantics where `before` fetches older records and `after` fetches newer records).
443
+ # @param resource_id [String, nil] Filter assignments by the ID of the resource.
444
+ # @param resource_external_id [String, nil] Filter assignments by the external ID of the resource.
445
+ # @param resource_type_slug [String, nil] Filter assignments by the slug of the resource type.
263
446
  # @param request_options [Hash] (see WorkOS::Types::RequestOptions)
264
- # @return [WorkOS::Types::ListStruct<WorkOS::RoleAssignment>]
447
+ # @return [WorkOS::Types::ListStruct<WorkOS::UserRoleAssignment>]
265
448
  def list_role_assignments(
266
449
  organization_membership_id:,
267
450
  before: nil,
268
451
  after: nil,
269
- limit: nil,
452
+ limit: 10,
270
453
  order: "desc",
454
+ resource_id: nil,
455
+ resource_external_id: nil,
456
+ resource_type_slug: nil,
271
457
  request_options: {}
272
458
  )
273
459
  params = {
274
460
  "before" => before,
275
461
  "after" => after,
276
462
  "limit" => limit,
277
- "order" => order
463
+ "order" => order,
464
+ "resource_id" => resource_id,
465
+ "resource_external_id" => resource_external_id,
466
+ "resource_type_slug" => resource_type_slug
278
467
  }.compact
279
468
  response = @client.request(
280
469
  method: :get,
@@ -290,13 +479,16 @@ module WorkOS
290
479
  after: cursor,
291
480
  limit: limit,
292
481
  order: order,
482
+ resource_id: resource_id,
483
+ resource_external_id: resource_external_id,
484
+ resource_type_slug: resource_type_slug,
293
485
  request_options: request_options
294
486
  )
295
487
  }
296
488
  WorkOS::Types::ListStruct.from_response(
297
489
  response,
298
- model: WorkOS::RoleAssignment,
299
- filters: {organization_membership_id: organization_membership_id, before: before, limit: limit, order: order},
490
+ model: WorkOS::UserRoleAssignment,
491
+ filters: {organization_membership_id: organization_membership_id, before: before, limit: limit, order: order, resource_id: resource_id, resource_external_id: resource_external_id, resource_type_slug: resource_type_slug},
300
492
  fetch_next: fetch_next
301
493
  )
302
494
  end
@@ -306,7 +498,7 @@ module WorkOS
306
498
  # @param role_slug [String] The slug of the role to assign.
307
499
  # @param resource_target [WorkOS::Authorization::ResourceTargetById, WorkOS::Authorization::ResourceTargetByExternalId] Identifies the resource target.
308
500
  # @param request_options [Hash] (see WorkOS::Types::RequestOptions)
309
- # @return [WorkOS::RoleAssignment]
501
+ # @return [WorkOS::UserRoleAssignment]
310
502
  def assign_role(
311
503
  organization_membership_id:,
312
504
  role_slug:,
@@ -332,7 +524,7 @@ module WorkOS
332
524
  body: body,
333
525
  request_options: request_options
334
526
  )
335
- result = WorkOS::RoleAssignment.new(response.body)
527
+ result = WorkOS::UserRoleAssignment.new(response.body)
336
528
  result.last_response = WorkOS::Types::ApiResponse.new(http_status: response.code.to_i, http_headers: response.each_header.to_h, request_id: response["x-request-id"])
337
529
  result
338
530
  end
@@ -671,7 +863,7 @@ module WorkOS
671
863
  organization_id:,
672
864
  resource_type_slug:,
673
865
  external_id:,
674
- cascade_delete: nil,
866
+ cascade_delete: false,
675
867
  request_options: {}
676
868
  )
677
869
  params = {
@@ -694,7 +886,7 @@ module WorkOS
694
886
  # @param before [String, nil] An object ID that defines your place in the list. When the ID is not present, you are at the end of the list. For example, if you make a list request and receive 100 objects, ending with `"obj_123"`, your subsequent call can include `before="obj_123"` to fetch a new batch of objects before `"obj_123"`.
695
887
  # @param after [String, nil] An object ID that defines your place in the list. When the ID is not present, you are at the end of the list. For example, if you make a list request and receive 100 objects, ending with `"obj_123"`, your subsequent call can include `after="obj_123"` to fetch a new batch of objects after `"obj_123"`.
696
888
  # @param limit [Integer, nil] Upper limit on the number of objects to return, between `1` and `100`.
697
- # @param order [WorkOS::Types::AuthorizationOrder, nil] Order the results by the creation time. Supported values are `"asc"` (ascending), `"desc"` (descending), and `"normal"` (descending with reversed cursor semantics where `before` fetches older records and `after` fetches newer records). Defaults to descending.
889
+ # @param order [WorkOS::Types::PaginationOrder, nil] Order the results by the creation time. Supported values are `"asc"` (ascending), `"desc"` (descending), and `"normal"` (descending with reversed cursor semantics where `before` fetches older records and `after` fetches newer records).
698
890
  # @param permission_slug [String] The permission slug to filter by. Only users with this permission on the resource are returned.
699
891
  # @param assignment [WorkOS::Types::AuthorizationAssignment, nil] Filter by assignment type. Use "direct" for direct assignments only, or "indirect" to include inherited assignments.
700
892
  # @param request_options [Hash] (see WorkOS::Types::RequestOptions)
@@ -706,7 +898,7 @@ module WorkOS
706
898
  permission_slug:,
707
899
  before: nil,
708
900
  after: nil,
709
- limit: nil,
901
+ limit: 10,
710
902
  order: "desc",
711
903
  assignment: nil,
712
904
  request_options: {}
@@ -748,27 +940,82 @@ module WorkOS
748
940
  )
749
941
  end
750
942
 
943
+ # List role assignments for a resource by external ID
944
+ # @param organization_id [String] The ID of the organization that owns the resource.
945
+ # @param resource_type_slug [String] The slug of the resource type.
946
+ # @param external_id [String] An identifier you provide to reference the resource in your system.
947
+ # @param before [String, nil] An object ID that defines your place in the list. When the ID is not present, you are at the end of the list. For example, if you make a list request and receive 100 objects, ending with `"obj_123"`, your subsequent call can include `before="obj_123"` to fetch a new batch of objects before `"obj_123"`.
948
+ # @param after [String, nil] An object ID that defines your place in the list. When the ID is not present, you are at the end of the list. For example, if you make a list request and receive 100 objects, ending with `"obj_123"`, your subsequent call can include `after="obj_123"` to fetch a new batch of objects after `"obj_123"`.
949
+ # @param limit [Integer, nil] Upper limit on the number of objects to return, between `1` and `100`.
950
+ # @param order [WorkOS::Types::PaginationOrder, nil] Order the results by the creation time. Supported values are `"asc"` (ascending), `"desc"` (descending), and `"normal"` (descending with reversed cursor semantics where `before` fetches older records and `after` fetches newer records).
951
+ # @param role_slug [String, nil] Filter assignments by the slug of the role.
952
+ # @param request_options [Hash] (see WorkOS::Types::RequestOptions)
953
+ # @return [WorkOS::Types::ListStruct<WorkOS::UserRoleAssignment>]
954
+ def list_role_assignments_for_resource_by_external_id(
955
+ organization_id:,
956
+ resource_type_slug:,
957
+ external_id:,
958
+ before: nil,
959
+ after: nil,
960
+ limit: 10,
961
+ order: "desc",
962
+ role_slug: nil,
963
+ request_options: {}
964
+ )
965
+ params = {
966
+ "before" => before,
967
+ "after" => after,
968
+ "limit" => limit,
969
+ "order" => order,
970
+ "role_slug" => role_slug
971
+ }.compact
972
+ response = @client.request(
973
+ method: :get,
974
+ path: "/authorization/organizations/#{WorkOS::Util.encode_path(organization_id)}/resources/#{WorkOS::Util.encode_path(resource_type_slug)}/#{WorkOS::Util.encode_path(external_id)}/role_assignments",
975
+ auth: true,
976
+ params: params,
977
+ request_options: request_options
978
+ )
979
+ fetch_next = ->(cursor) {
980
+ list_role_assignments_for_resource_by_external_id(
981
+ organization_id: organization_id,
982
+ resource_type_slug: resource_type_slug,
983
+ external_id: external_id,
984
+ before: before,
985
+ after: cursor,
986
+ limit: limit,
987
+ order: order,
988
+ role_slug: role_slug,
989
+ request_options: request_options
990
+ )
991
+ }
992
+ WorkOS::Types::ListStruct.from_response(
993
+ response,
994
+ model: WorkOS::UserRoleAssignment,
995
+ filters: {organization_id: organization_id, resource_type_slug: resource_type_slug, external_id: external_id, before: before, limit: limit, order: order, role_slug: role_slug},
996
+ fetch_next: fetch_next
997
+ )
998
+ end
999
+
751
1000
  # List resources
752
1001
  # @param before [String, nil] An object ID that defines your place in the list. When the ID is not present, you are at the end of the list. For example, if you make a list request and receive 100 objects, ending with `"obj_123"`, your subsequent call can include `before="obj_123"` to fetch a new batch of objects before `"obj_123"`.
753
1002
  # @param after [String, nil] An object ID that defines your place in the list. When the ID is not present, you are at the end of the list. For example, if you make a list request and receive 100 objects, ending with `"obj_123"`, your subsequent call can include `after="obj_123"` to fetch a new batch of objects after `"obj_123"`.
754
1003
  # @param limit [Integer, nil] Upper limit on the number of objects to return, between `1` and `100`.
755
- # @param order [WorkOS::Types::AuthorizationOrder, nil] Order the results by the creation time. Supported values are `"asc"` (ascending), `"desc"` (descending), and `"normal"` (descending with reversed cursor semantics where `before` fetches older records and `after` fetches newer records). Defaults to descending.
1004
+ # @param order [WorkOS::Types::PaginationOrder, nil] Order the results by the creation time. Supported values are `"asc"` (ascending), `"desc"` (descending), and `"normal"` (descending with reversed cursor semantics where `before` fetches older records and `after` fetches newer records).
756
1005
  # @param organization_id [String, nil] Filter resources by organization ID.
757
1006
  # @param resource_type_slug [String, nil] Filter resources by resource type slug.
758
1007
  # @param resource_external_id [String, nil] Filter resources by external ID.
759
- # @param search [String, nil] Search resources by name.
760
1008
  # @param parent [WorkOS::Authorization::ParentById, WorkOS::Authorization::ParentByExternalId, nil] Identifies the parent.
761
1009
  # @param request_options [Hash] (see WorkOS::Types::RequestOptions)
762
1010
  # @return [WorkOS::Types::ListStruct<WorkOS::AuthorizationResource>]
763
1011
  def list_resources(
764
1012
  before: nil,
765
1013
  after: nil,
766
- limit: nil,
1014
+ limit: 10,
767
1015
  order: "desc",
768
1016
  organization_id: nil,
769
1017
  resource_type_slug: nil,
770
1018
  resource_external_id: nil,
771
- search: nil,
772
1019
  parent: nil,
773
1020
  request_options: {}
774
1021
  )
@@ -779,8 +1026,7 @@ module WorkOS
779
1026
  "order" => order,
780
1027
  "organization_id" => organization_id,
781
1028
  "resource_type_slug" => resource_type_slug,
782
- "resource_external_id" => resource_external_id,
783
- "search" => search
1029
+ "resource_external_id" => resource_external_id
784
1030
  }.compact
785
1031
  if parent
786
1032
  case parent
@@ -809,7 +1055,6 @@ module WorkOS
809
1055
  organization_id: organization_id,
810
1056
  resource_type_slug: resource_type_slug,
811
1057
  resource_external_id: resource_external_id,
812
- search: search,
813
1058
  parent: parent,
814
1059
  request_options: request_options
815
1060
  )
@@ -817,7 +1062,7 @@ module WorkOS
817
1062
  WorkOS::Types::ListStruct.from_response(
818
1063
  response,
819
1064
  model: WorkOS::AuthorizationResource,
820
- filters: {before: before, limit: limit, order: order, organization_id: organization_id, resource_type_slug: resource_type_slug, resource_external_id: resource_external_id, search: search, parent: parent},
1065
+ filters: {before: before, limit: limit, order: order, organization_id: organization_id, resource_type_slug: resource_type_slug, resource_external_id: resource_external_id, parent: parent},
821
1066
  fetch_next: fetch_next
822
1067
  )
823
1068
  end
@@ -937,7 +1182,7 @@ module WorkOS
937
1182
  # @return [void]
938
1183
  def delete_resource(
939
1184
  resource_id:,
940
- cascade_delete: nil,
1185
+ cascade_delete: false,
941
1186
  request_options: {}
942
1187
  )
943
1188
  params = {
@@ -958,7 +1203,7 @@ module WorkOS
958
1203
  # @param before [String, nil] An object ID that defines your place in the list. When the ID is not present, you are at the end of the list. For example, if you make a list request and receive 100 objects, ending with `"obj_123"`, your subsequent call can include `before="obj_123"` to fetch a new batch of objects before `"obj_123"`.
959
1204
  # @param after [String, nil] An object ID that defines your place in the list. When the ID is not present, you are at the end of the list. For example, if you make a list request and receive 100 objects, ending with `"obj_123"`, your subsequent call can include `after="obj_123"` to fetch a new batch of objects after `"obj_123"`.
960
1205
  # @param limit [Integer, nil] Upper limit on the number of objects to return, between `1` and `100`.
961
- # @param order [WorkOS::Types::AuthorizationOrder, nil] Order the results by the creation time. Supported values are `"asc"` (ascending), `"desc"` (descending), and `"normal"` (descending with reversed cursor semantics where `before` fetches older records and `after` fetches newer records). Defaults to descending.
1206
+ # @param order [WorkOS::Types::PaginationOrder, nil] Order the results by the creation time. Supported values are `"asc"` (ascending), `"desc"` (descending), and `"normal"` (descending with reversed cursor semantics where `before` fetches older records and `after` fetches newer records).
962
1207
  # @param permission_slug [String] The permission slug to filter by. Only users with this permission on the resource are returned.
963
1208
  # @param assignment [WorkOS::Types::AuthorizationAssignment, nil] Filter by assignment type. Use `direct` for direct assignments only, or `indirect` to include inherited assignments.
964
1209
  # @param request_options [Hash] (see WorkOS::Types::RequestOptions)
@@ -968,7 +1213,7 @@ module WorkOS
968
1213
  permission_slug:,
969
1214
  before: nil,
970
1215
  after: nil,
971
- limit: nil,
1216
+ limit: 10,
972
1217
  order: "desc",
973
1218
  assignment: nil,
974
1219
  request_options: {}
@@ -1008,6 +1253,57 @@ module WorkOS
1008
1253
  )
1009
1254
  end
1010
1255
 
1256
+ # List role assignments for a resource
1257
+ # @param resource_id [String] The ID of the authorization resource.
1258
+ # @param before [String, nil] An object ID that defines your place in the list. When the ID is not present, you are at the end of the list. For example, if you make a list request and receive 100 objects, ending with `"obj_123"`, your subsequent call can include `before="obj_123"` to fetch a new batch of objects before `"obj_123"`.
1259
+ # @param after [String, nil] An object ID that defines your place in the list. When the ID is not present, you are at the end of the list. For example, if you make a list request and receive 100 objects, ending with `"obj_123"`, your subsequent call can include `after="obj_123"` to fetch a new batch of objects after `"obj_123"`.
1260
+ # @param limit [Integer, nil] Upper limit on the number of objects to return, between `1` and `100`.
1261
+ # @param order [WorkOS::Types::PaginationOrder, nil] Order the results by the creation time. Supported values are `"asc"` (ascending), `"desc"` (descending), and `"normal"` (descending with reversed cursor semantics where `before` fetches older records and `after` fetches newer records).
1262
+ # @param role_slug [String, nil] Filter assignments by the slug of the role.
1263
+ # @param request_options [Hash] (see WorkOS::Types::RequestOptions)
1264
+ # @return [WorkOS::Types::ListStruct<WorkOS::UserRoleAssignment>]
1265
+ def list_role_assignments_for_resource(
1266
+ resource_id:,
1267
+ before: nil,
1268
+ after: nil,
1269
+ limit: 10,
1270
+ order: "desc",
1271
+ role_slug: nil,
1272
+ request_options: {}
1273
+ )
1274
+ params = {
1275
+ "before" => before,
1276
+ "after" => after,
1277
+ "limit" => limit,
1278
+ "order" => order,
1279
+ "role_slug" => role_slug
1280
+ }.compact
1281
+ response = @client.request(
1282
+ method: :get,
1283
+ path: "/authorization/resources/#{WorkOS::Util.encode_path(resource_id)}/role_assignments",
1284
+ auth: true,
1285
+ params: params,
1286
+ request_options: request_options
1287
+ )
1288
+ fetch_next = ->(cursor) {
1289
+ list_role_assignments_for_resource(
1290
+ resource_id: resource_id,
1291
+ before: before,
1292
+ after: cursor,
1293
+ limit: limit,
1294
+ order: order,
1295
+ role_slug: role_slug,
1296
+ request_options: request_options
1297
+ )
1298
+ }
1299
+ WorkOS::Types::ListStruct.from_response(
1300
+ response,
1301
+ model: WorkOS::UserRoleAssignment,
1302
+ filters: {resource_id: resource_id, before: before, limit: limit, order: order, role_slug: role_slug},
1303
+ fetch_next: fetch_next
1304
+ )
1305
+ end
1306
+
1011
1307
  # List environment roles
1012
1308
  # @param request_options [Hash] (see WorkOS::Types::RequestOptions)
1013
1309
  # @return [WorkOS::RoleList]
@@ -1156,13 +1452,13 @@ module WorkOS
1156
1452
  # @param before [String, nil] An object ID that defines your place in the list. When the ID is not present, you are at the end of the list. For example, if you make a list request and receive 100 objects, ending with `"obj_123"`, your subsequent call can include `before="obj_123"` to fetch a new batch of objects before `"obj_123"`.
1157
1453
  # @param after [String, nil] An object ID that defines your place in the list. When the ID is not present, you are at the end of the list. For example, if you make a list request and receive 100 objects, ending with `"obj_123"`, your subsequent call can include `after="obj_123"` to fetch a new batch of objects after `"obj_123"`.
1158
1454
  # @param limit [Integer, nil] Upper limit on the number of objects to return, between `1` and `100`.
1159
- # @param order [WorkOS::Types::PermissionsOrder, nil] Order the results by the creation time. Supported values are `"asc"` (ascending), `"desc"` (descending), and `"normal"` (descending with reversed cursor semantics where `before` fetches older records and `after` fetches newer records). Defaults to descending.
1455
+ # @param order [WorkOS::Types::PaginationOrder, nil] Order the results by the creation time. Supported values are `"asc"` (ascending), `"desc"` (descending), and `"normal"` (descending with reversed cursor semantics where `before` fetches older records and `after` fetches newer records).
1160
1456
  # @param request_options [Hash] (see WorkOS::Types::RequestOptions)
1161
1457
  # @return [WorkOS::Types::ListStruct<WorkOS::AuthorizationPermission>]
1162
1458
  def list_permissions(
1163
1459
  before: nil,
1164
1460
  after: nil,
1165
- limit: nil,
1461
+ limit: 10,
1166
1462
  order: "desc",
1167
1463
  request_options: {}
1168
1464
  )