workos 10.4.0 → 10.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (558) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/ci.yml +1 -1
  3. data/.github/workflows/docs.yml +2 -2
  4. data/.github/workflows/lint.yml +1 -1
  5. data/.github/workflows/release-please.yml +4 -4
  6. data/.github/workflows/release.yml +1 -1
  7. data/.last-synced-sha +1 -1
  8. data/.oagen-manifest.json +454 -2
  9. data/.release-please-manifest.json +1 -1
  10. data/.ruby-version +1 -1
  11. data/CHANGELOG.md +326 -0
  12. data/Gemfile.lock +2 -2
  13. data/README.md +2 -2
  14. data/lib/workos/admin_portal/generate_link.rb +3 -0
  15. data/lib/workos/admin_portal/revoke_link.rb +22 -0
  16. data/lib/workos/admin_portal.rb +27 -0
  17. data/lib/workos/agents/agent_blueprint.rb +3 -0
  18. data/lib/workos/agents/agent_blueprint_invocable_as.rb +18 -0
  19. data/lib/workos/agents/agent_blueprints_create_request.rb +3 -0
  20. data/lib/workos/agents/agent_blueprints_create_request_invocable_as.rb +18 -0
  21. data/lib/workos/agents/agent_blueprints_update_request.rb +3 -0
  22. data/lib/workos/agents/agent_blueprints_update_request_invocable_as.rb +18 -0
  23. data/lib/workos/agents/agent_registration.rb +3 -0
  24. data/lib/workos/agents/list_metadata.rb +22 -0
  25. data/lib/workos/agents.rb +25 -0
  26. data/lib/workos/api_keys/api_key_data_integration_vended_credential.rb +28 -0
  27. data/lib/workos/authorization/patch_group_role_assignments.rb +22 -0
  28. data/lib/workos/authorization/user_role_assignment_source.rb +5 -2
  29. data/lib/workos/authorization/user_role_assignment_source_group.rb +7 -0
  30. data/lib/workos/authorization.rb +26 -0
  31. data/lib/workos/base_client.rb +3 -0
  32. data/lib/workos/connect/connect_application.rb +3 -0
  33. data/lib/workos/connect/create_oauth_application.rb +3 -0
  34. data/lib/workos/connect/update_oauth_application.rb +5 -2
  35. data/lib/workos/connect.rb +6 -0
  36. data/lib/workos/directory_sync/directory_sync_rate_limit_error.rb +25 -0
  37. data/lib/workos/directory_sync/directory_sync_response.rb +18 -0
  38. data/lib/workos/directory_sync.rb +19 -0
  39. data/lib/workos/events.rb +3 -11
  40. data/lib/workos/feature_flags/flag_created_data.rb +1 -46
  41. data/lib/workos/feature_flags/flag_deleted_data.rb +1 -1
  42. data/lib/workos/feature_flags/flag_rule.rb +49 -0
  43. data/lib/workos/feature_flags/flag_rule_updated_data.rb +1 -1
  44. data/lib/workos/feature_flags/flag_target.rb +52 -0
  45. data/lib/workos/feature_flags/flag_target_with_rule_id.rb +46 -0
  46. data/lib/workos/feature_flags/flag_target_with_value_type.rb +49 -0
  47. data/lib/workos/feature_flags/flag_updated_context_previous_attribute.rb +1 -12
  48. data/lib/workos/feature_flags/flag_updated_context_previous_attribute_data.rb +1 -25
  49. data/lib/workos/feature_flags/flag_updated_context_previous_attribute_data_owner.rb +7 -0
  50. data/lib/workos/feature_flags/flag_updated_data.rb +1 -1
  51. data/lib/workos/groups/patch_group_memberships.rb +22 -0
  52. data/lib/workos/groups.rb +28 -0
  53. data/lib/workos/inflections.rb +30 -0
  54. data/lib/workos/organizations/it_contact_list_list_metadata.rb +22 -0
  55. data/lib/workos/organizations/organization_authentication_methods_required_oauth_error_body.rb +22 -0
  56. data/lib/workos/organizations/organization_connected_account_import_error_body.rb +22 -0
  57. data/lib/workos/organizations/organization_membership_not_found_oauth_error_body.rb +22 -0
  58. data/lib/workos/organizations/organization_not_found_oauth_error_body.rb +22 -0
  59. data/lib/workos/organizations/organization_selection_required_error_body.rb +22 -0
  60. data/lib/workos/organizations/organization_selection_required_error_body_with_organization.rb +7 -0
  61. data/lib/workos/organizations/organization_selection_required_error_body_with_organizations.rb +25 -0
  62. data/lib/workos/pipes/connected_account.rb +11 -2
  63. data/lib/workos/pipes/connected_account_input.rb +6 -0
  64. data/lib/workos/pipes/connected_account_warning.rb +22 -0
  65. data/lib/workos/pipes/create_connected_account.rb +40 -0
  66. data/lib/workos/pipes/create_organization_connected_account.rb +43 -0
  67. data/lib/workos/pipes/data_integration_authorize_url_response.rb +9 -2
  68. data/lib/workos/pipes/data_integration_credentials_response.rb +1 -1
  69. data/lib/workos/pipes/data_integration_finish_connection_response.rb +18 -0
  70. data/lib/workos/pipes/{data_integration_credentials_response_credential.rb → data_integration_vended_credential.rb} +9 -3
  71. data/lib/workos/pipes/data_integrations_create_api_key_connection_request.rb +37 -0
  72. data/lib/workos/pipes/data_integrations_create_client_credentials_connection_request.rb +43 -0
  73. data/lib/workos/pipes/data_integrations_finish_connection_request.rb +25 -0
  74. data/lib/workos/pipes/data_integrations_get_data_integration_authorize_url_request.rb +17 -2
  75. data/lib/workos/pipes/data_integrations_list_response_data_connected_account.rb +10 -1
  76. data/lib/workos/pipes/data_integrations_list_response_data_connected_account_warning.rb +7 -0
  77. data/lib/workos/pipes/data_integrations_upsert_api_key_request.rb +14 -5
  78. data/lib/workos/pipes/data_integrations_upsert_client_credentials_request.rb +14 -5
  79. data/lib/workos/pipes/organization_connected_account.rb +40 -0
  80. data/lib/workos/pipes.rb +216 -20
  81. data/lib/workos/shared/access_denied_oauth_error_body.rb +22 -0
  82. data/lib/workos/shared/account_selection_required_error_body.rb +7 -0
  83. data/lib/workos/shared/agent_blueprint_created_data.rb +3 -0
  84. data/lib/workos/shared/agent_blueprint_created_data_invocable_as.rb +18 -0
  85. data/lib/workos/shared/agent_blueprint_updated_data.rb +40 -1
  86. data/lib/workos/shared/agent_blueprint_updated_data_invocable_as.rb +18 -0
  87. data/lib/workos/shared/already_claimed_error_body.rb +22 -0
  88. data/lib/workos/shared/application_consent_required_error_body.rb +22 -0
  89. data/lib/workos/shared/auth_method_mismatch_error_body.rb +7 -0
  90. data/lib/workos/shared/authorization_pending_oauth_error_body.rb +22 -0
  91. data/lib/workos/shared/authorization_url_not_found_error_body.rb +22 -0
  92. data/lib/workos/shared/authorization_url_request_error_body.rb +22 -0
  93. data/lib/workos/shared/client_credentials_data_integration_vended_credential.rb +40 -0
  94. data/lib/workos/shared/code_challenge_not_found_error_body.rb +22 -0
  95. data/lib/workos/shared/connect_application_oauth.rb +3 -0
  96. data/lib/workos/shared/connected_account_limit_reached_error_body.rb +22 -0
  97. data/lib/workos/shared/daily_quota_exceeded_error_body.rb +22 -0
  98. data/lib/workos/shared/data_integration_access_token_response_with_access_token.rb +22 -0
  99. data/lib/workos/shared/data_integration_access_token_response_with_access_token_access_token.rb +7 -0
  100. data/lib/workos/shared/data_integration_access_token_response_with_error.rb +22 -0
  101. data/lib/workos/shared/data_integration_credentials_response_with_credential.rb +22 -0
  102. data/lib/workos/shared/data_integration_credentials_response_with_error.rb +22 -0
  103. data/lib/workos/shared/entity_not_found_error_body.rb +22 -0
  104. data/lib/workos/shared/error_body.rb +7 -0
  105. data/lib/workos/shared/error_body_with_code.rb +7 -0
  106. data/lib/workos/shared/error_body_with_code_errors.rb +25 -0
  107. data/lib/workos/shared/error_body_with_code_field_error.rb +22 -0
  108. data/lib/workos/shared/error_body_with_code_field_errors.rb +22 -0
  109. data/lib/workos/shared/error_body_with_code_instance_path_error.rb +18 -0
  110. data/lib/workos/shared/error_body_with_code_instance_path_errors.rb +25 -0
  111. data/lib/workos/shared/error_body_with_code_status_code.rb +25 -0
  112. data/lib/workos/shared/error_body_with_constraints_property_error.rb +22 -0
  113. data/lib/workos/shared/error_body_with_constraints_property_errors.rb +22 -0
  114. data/lib/workos/shared/error_body_with_error.rb +22 -0
  115. data/lib/workos/shared/error_body_with_error_message_list.rb +22 -0
  116. data/lib/workos/shared/error_body_with_message_or_message_list.rb +18 -0
  117. data/lib/workos/shared/expired_token_oauth_error_body.rb +22 -0
  118. data/lib/workos/shared/external_auth_session_already_completed_error_body.rb +22 -0
  119. data/lib/workos/shared/external_id_already_used_error_body.rb +22 -0
  120. data/lib/workos/shared/extra_attributes_required_oauth_error_body.rb +22 -0
  121. data/lib/workos/shared/feature_flags_flag_created.rb +34 -0
  122. data/lib/workos/shared/feature_flags_flag_created_context.rb +22 -0
  123. data/lib/workos/shared/feature_flags_flag_created_context_actor.rb +25 -0
  124. data/lib/workos/shared/feature_flags_flag_created_data.rb +52 -0
  125. data/lib/workos/shared/feature_flags_flag_created_data_owner.rb +7 -0
  126. data/lib/workos/shared/feature_flags_flag_deleted.rb +34 -0
  127. data/lib/workos/shared/feature_flags_flag_deleted_context.rb +22 -0
  128. data/lib/workos/shared/feature_flags_flag_deleted_context_actor.rb +25 -0
  129. data/lib/workos/shared/feature_flags_flag_deleted_data.rb +7 -0
  130. data/lib/workos/shared/feature_flags_flag_deleted_data_owner.rb +7 -0
  131. data/lib/workos/shared/feature_flags_flag_rule_created.rb +34 -0
  132. data/lib/workos/shared/feature_flags_flag_rule_created_context.rb +22 -0
  133. data/lib/workos/shared/feature_flags_flag_rule_created_context_actor.rb +25 -0
  134. data/lib/workos/shared/feature_flags_flag_rule_deleted.rb +34 -0
  135. data/lib/workos/shared/feature_flags_flag_rule_deleted_context.rb +22 -0
  136. data/lib/workos/shared/feature_flags_flag_rule_deleted_context_actor.rb +25 -0
  137. data/lib/workos/shared/feature_flags_flag_rule_updated.rb +34 -0
  138. data/lib/workos/shared/feature_flags_flag_rule_updated_context.rb +25 -0
  139. data/lib/workos/shared/feature_flags_flag_rule_updated_context_actor.rb +25 -0
  140. data/lib/workos/shared/feature_flags_flag_rule_updated_context_previous_attribute.rb +18 -0
  141. data/lib/workos/shared/feature_flags_flag_rule_updated_context_previous_attribute_data.rb +18 -0
  142. data/lib/workos/shared/feature_flags_flag_target_created.rb +34 -0
  143. data/lib/workos/shared/feature_flags_flag_target_created_context.rb +22 -0
  144. data/lib/workos/shared/feature_flags_flag_target_created_context_actor.rb +25 -0
  145. data/lib/workos/shared/feature_flags_flag_target_deleted.rb +34 -0
  146. data/lib/workos/shared/feature_flags_flag_target_deleted_context.rb +22 -0
  147. data/lib/workos/shared/feature_flags_flag_target_deleted_context_actor.rb +25 -0
  148. data/lib/workos/shared/feature_flags_flag_updated.rb +34 -0
  149. data/lib/workos/shared/feature_flags_flag_updated_context.rb +25 -0
  150. data/lib/workos/shared/feature_flags_flag_updated_context_actor.rb +25 -0
  151. data/lib/workos/shared/feature_flags_flag_updated_context_previous_attribute.rb +18 -0
  152. data/lib/workos/shared/feature_flags_flag_updated_context_previous_attribute_data.rb +34 -0
  153. data/lib/workos/shared/feature_flags_flag_updated_context_previous_attribute_data_owner.rb +7 -0
  154. data/lib/workos/shared/feature_flags_flag_updated_data.rb +7 -0
  155. data/lib/workos/shared/feature_flags_flag_updated_data_owner.rb +7 -0
  156. data/lib/workos/shared/idp_metadata_fetch_failed_error_body.rb +22 -0
  157. data/lib/workos/shared/invalid_client_oauth_error_body.rb +22 -0
  158. data/lib/workos/shared/invalid_connection_oauth_error_body.rb +22 -0
  159. data/lib/workos/shared/invalid_credentials_error_body.rb +22 -0
  160. data/lib/workos/shared/invalid_email_error_body.rb +22 -0
  161. data/lib/workos/shared/invalid_grant_oauth_error_body.rb +22 -0
  162. data/lib/workos/shared/invalid_idp_sso_url_error_body.rb +22 -0
  163. data/lib/workos/shared/invalid_link_authorization_code_oauth_error_body.rb +22 -0
  164. data/lib/workos/shared/invalid_locale_error_body.rb +22 -0
  165. data/lib/workos/shared/invalid_metadata_error_body.rb +22 -0
  166. data/lib/workos/shared/invalid_one_time_code_error_body.rb +22 -0
  167. data/lib/workos/shared/invalid_organization_id_error_body.rb +22 -0
  168. data/lib/workos/shared/invalid_password_hash_error_body.rb +22 -0
  169. data/lib/workos/shared/invalid_pending_authentication_token_error_body.rb +22 -0
  170. data/lib/workos/shared/invalid_profile_oauth_error_body.rb +22 -0
  171. data/lib/workos/shared/invalid_refresh_token_error_body.rb +22 -0
  172. data/lib/workos/shared/invalid_request_oauth_error_body.rb +22 -0
  173. data/lib/workos/shared/invalid_request_parameters_error_body.rb +22 -0
  174. data/lib/workos/shared/invalid_request_parameters_error_body_with_errors.rb +25 -0
  175. data/lib/workos/shared/invalid_role_error_body.rb +22 -0
  176. data/lib/workos/shared/invalid_url_error_body.rb +22 -0
  177. data/lib/workos/shared/mfa_challenge_error_body.rb +22 -0
  178. data/lib/workos/shared/mfa_enrollment_error_body.rb +22 -0
  179. data/lib/workos/shared/mfa_enrollment_oauth_error_body.rb +22 -0
  180. data/lib/workos/shared/multiple_roles_not_enabled_error_body.rb +22 -0
  181. data/lib/workos/shared/must_use_sso_for_selected_organization_message_error_body.rb +18 -0
  182. data/lib/workos/shared/oauth_data_integration_vended_credential.rb +40 -0
  183. data/lib/workos/shared/oauth_error_body.rb +22 -0
  184. data/lib/workos/shared/one_time_code_expired_error_body.rb +22 -0
  185. data/lib/workos/shared/one_time_code_previously_used_error_body.rb +22 -0
  186. data/lib/workos/shared/one_time_code_too_many_attempts_error_body.rb +22 -0
  187. data/lib/workos/shared/passkey_progressive_enrollment_error_body.rb +22 -0
  188. data/lib/workos/shared/phone_number_required_error_body.rb +22 -0
  189. data/lib/workos/shared/pipe_connected_account.rb +6 -0
  190. data/lib/workos/shared/pkce_not_supported_oauth_error_body.rb +22 -0
  191. data/lib/workos/shared/policy_denied_error_body.rb +22 -0
  192. data/lib/workos/shared/radar_challenge_error_body.rb +22 -0
  193. data/lib/workos/shared/radar_sign_up_challenge_error_body.rb +22 -0
  194. data/lib/workos/shared/radar_sms_sign_in_challenge_error_body.rb +22 -0
  195. data/lib/workos/shared/rate_limit_exceeded_error_body_with_retry_after.rb +25 -0
  196. data/lib/workos/shared/sign_up_not_allowed_oauth_error_body.rb +22 -0
  197. data/lib/workos/shared/slow_down_oauth_error_body.rb +22 -0
  198. data/lib/workos/shared/sms_challenge_quota_reached_error_body.rb +22 -0
  199. data/lib/workos/shared/sms_challenge_rate_limited_error_body.rb +22 -0
  200. data/lib/workos/shared/sso_required_oauth_error_body_with_connection_ids_list_email_pending_authentication_token.rb +31 -0
  201. data/lib/workos/shared/sub_resource_scoped_role_not_allowed_error_body_with_role_slug.rb +25 -0
  202. data/lib/workos/shared/token_too_big_oauth_error_body.rb +22 -0
  203. data/lib/workos/shared/too_many_failed_verification_attempts_error_body_with_retry_after.rb +25 -0
  204. data/lib/workos/shared/too_many_requests_oauth_error_body.rb +22 -0
  205. data/lib/workos/shared/unauthorized_client_oauth_error_body.rb +22 -0
  206. data/lib/workos/shared/unauthorized_error_body.rb +18 -0
  207. data/lib/workos/shared/update_audit_logs_retention_with_retention_period.rb +18 -0
  208. data/lib/workos/shared/update_audit_logs_retention_with_retention_period_in_days.rb +26 -0
  209. data/lib/workos/shared/update_user_organization_membership_with_role_slug.rb +18 -0
  210. data/lib/workos/shared/update_user_organization_membership_with_role_slugs.rb +18 -0
  211. data/lib/workos/shared/verification_id_required_error_body.rb +22 -0
  212. data/lib/workos/sso/connection_could_not_be_verified_error_body.rb +22 -0
  213. data/lib/workos/sso/connection_creation_conflict_error_body.rb +22 -0
  214. data/lib/workos/sso/connection_creation_not_found_error_body.rb +22 -0
  215. data/lib/workos/sso/connection_finish_error_body.rb +22 -0
  216. data/lib/workos/sso/connection_type_not_updatable_error_body.rb +22 -0
  217. data/lib/workos/sso/token_query.rb +3 -0
  218. data/lib/workos/sso.rb +3 -0
  219. data/lib/workos/types/agent_blueprint_created_data_invocable_as_instance_types.rb +13 -0
  220. data/lib/workos/types/agent_blueprint_invocable_as_instance_types.rb +9 -0
  221. data/lib/workos/types/agent_blueprint_updated_data_invocable_as_instance_types.rb +9 -0
  222. data/lib/workos/types/agent_blueprints_create_request_invocable_as_instance_types.rb +9 -0
  223. data/lib/workos/types/agent_blueprints_update_request_invocable_as_instance_types.rb +9 -0
  224. data/lib/workos/types/agent_instance_created_data_type.rb +1 -5
  225. data/lib/workos/types/agent_instance_deleted_data_type.rb +1 -1
  226. data/lib/workos/types/agent_instance_type.rb +1 -1
  227. data/lib/workos/types/authorization_url_not_found_error_body_code.rb +14 -0
  228. data/lib/workos/types/authorization_url_request_error_body_code.rb +14 -0
  229. data/lib/workos/types/connection_creation_conflict_error_body_code.rb +13 -0
  230. data/lib/workos/types/connection_creation_not_found_error_body_code.rb +13 -0
  231. data/lib/workos/types/connection_finish_error_body_code.rb +29 -0
  232. data/lib/workos/types/create_connected_account_state.rb +9 -0
  233. data/lib/workos/types/create_magic_code_and_return_locale.rb +101 -0
  234. data/lib/workos/types/create_organization_connected_account_state.rb +9 -0
  235. data/lib/workos/types/create_password_reset_token_locale.rb +9 -0
  236. data/lib/workos/types/create_user_invite_options_locale.rb +1 -93
  237. data/lib/workos/types/create_webhook_endpoint_events.rb +9 -1
  238. data/lib/workos/types/data_integration_access_token_response_with_error_error.rb +9 -0
  239. data/lib/workos/types/data_integration_credentials_response_with_error_error.rb +9 -0
  240. data/lib/workos/types/data_integrations_create_api_key_connection_request_connection_owner.rb +9 -0
  241. data/lib/workos/types/data_integrations_create_client_credentials_connection_request_connection_owner.rb +9 -0
  242. data/lib/workos/types/data_integrations_get_data_integration_authorize_url_request_connection_intent.rb +13 -0
  243. data/lib/workos/types/error_body_code.rb +183 -0
  244. data/lib/workos/types/feature_flags_flag_created_context_actor_source.rb +9 -0
  245. data/lib/workos/types/feature_flags_flag_deleted_context_actor_source.rb +9 -0
  246. data/lib/workos/types/feature_flags_flag_rule_created_context_actor_source.rb +9 -0
  247. data/lib/workos/types/feature_flags_flag_rule_deleted_context_actor_source.rb +9 -0
  248. data/lib/workos/types/feature_flags_flag_rule_updated_context_actor_source.rb +9 -0
  249. data/lib/workos/types/feature_flags_flag_target_created_context_actor_source.rb +9 -0
  250. data/lib/workos/types/feature_flags_flag_target_deleted_context_actor_source.rb +9 -0
  251. data/lib/workos/types/feature_flags_flag_updated_context_actor_source.rb +9 -0
  252. data/lib/workos/types/organization_connected_account_import_error_body_code.rb +14 -0
  253. data/lib/workos/types/organization_connected_account_state.rb +9 -0
  254. data/lib/workos/types/resend_user_invite_options_locale.rb +1 -1
  255. data/lib/workos/types/resource_export_completed_data_resource_type.rb +4 -1
  256. data/lib/workos/types/send_email_change_locale.rb +9 -0
  257. data/lib/workos/types/send_verification_email_locale.rb +9 -0
  258. data/lib/workos/types/update_audit_logs_retention_with_retention_period_retention_period.rb +9 -0
  259. data/lib/workos/types/user_connected_account_import_error_body_code.rb +15 -0
  260. data/lib/workos/types/vault_dek_rekeyed_data_actor_source.rb +9 -0
  261. data/lib/workos/types/widget_session_token_scopes.rb +3 -1
  262. data/lib/workos/user_management/action_denied_error_body.rb +22 -0
  263. data/lib/workos/user_management/authentication_method_not_allowed_error_body.rb +22 -0
  264. data/lib/workos/user_management/authentication_method_not_allowed_oauth_error_body.rb +22 -0
  265. data/lib/workos/user_management/create_magic_code_and_return.rb +5 -2
  266. data/lib/workos/user_management/create_password_reset_token.rb +16 -1
  267. data/lib/workos/user_management/email_already_in_use_error_body.rb +22 -0
  268. data/lib/workos/user_management/email_already_verified_error_body.rb +22 -0
  269. data/lib/workos/user_management/email_change_not_allowed_error_body.rb +22 -0
  270. data/lib/workos/user_management/email_completion_required_error_body_with_email_completion_token.rb +25 -0
  271. data/lib/workos/user_management/email_domain_not_deliverable_error_body.rb +22 -0
  272. data/lib/workos/user_management/email_not_available_error_body.rb +22 -0
  273. data/lib/workos/user_management/email_password_auth_disabled_error_body.rb +22 -0
  274. data/lib/workos/user_management/email_verification_required_error_body.rb +22 -0
  275. data/lib/workos/user_management/invitation_cannot_be_used_for_email_oauth_error_body.rb +22 -0
  276. data/lib/workos/user_management/invitation_invalid_oauth_error_body.rb +22 -0
  277. data/lib/workos/user_management/password_and_password_hash_provided_error_body.rb +22 -0
  278. data/lib/workos/user_management/password_and_password_hash_type_provided_error_body.rb +22 -0
  279. data/lib/workos/user_management/password_salt_position_requires_password_hash_error_body.rb +22 -0
  280. data/lib/workos/user_management/password_strength_error_error_body_with_errors.rb +25 -0
  281. data/lib/workos/user_management/send_email_change.rb +6 -2
  282. data/lib/workos/user_management/send_verification_email.rb +18 -0
  283. data/lib/workos/user_management/user_connected_account_import_error_body.rb +22 -0
  284. data/lib/workos/user_management/user_consent_options_not_supported_error_body.rb +22 -0
  285. data/lib/workos/user_management/user_creation_error_error_body_with_errors.rb +25 -0
  286. data/lib/workos/user_management/user_mismatch_error_body.rb +22 -0
  287. data/lib/workos/user_management/waitlist_list_response.rb +25 -0
  288. data/lib/workos/user_management/waitlist_list_response_list_metadata.rb +7 -0
  289. data/lib/workos/user_management.rb +26 -11
  290. data/lib/workos/vault/vault_dek_rekeyed.rb +34 -0
  291. data/lib/workos/vault/vault_dek_rekeyed_data.rb +31 -0
  292. data/lib/workos/version.rb +1 -1
  293. data/rbi/workos/access_denied_oauth_error_body.rbi +30 -0
  294. data/rbi/workos/account_selection_required_error_body.rbi +30 -0
  295. data/rbi/workos/action_denied_error_body.rbi +30 -0
  296. data/rbi/workos/admin_portal.rbi +11 -1
  297. data/rbi/workos/agent_blueprint.rbi +6 -0
  298. data/rbi/workos/agent_blueprint_created_data.rbi +6 -0
  299. data/rbi/workos/agent_blueprint_created_data_invocable_as.rbi +24 -0
  300. data/rbi/workos/agent_blueprint_invocable_as.rbi +24 -0
  301. data/rbi/workos/agent_blueprint_updated_data.rbi +6 -0
  302. data/rbi/workos/agent_blueprint_updated_data_invocable_as.rbi +24 -0
  303. data/rbi/workos/agent_blueprints_create_request.rbi +6 -0
  304. data/rbi/workos/agent_blueprints_create_request_invocable_as.rbi +24 -0
  305. data/rbi/workos/agent_blueprints_update_request.rbi +6 -0
  306. data/rbi/workos/agent_blueprints_update_request_invocable_as.rbi +24 -0
  307. data/rbi/workos/agent_registration.rbi +6 -0
  308. data/rbi/workos/agents.rbi +29 -19
  309. data/rbi/workos/already_claimed_error_body.rbi +30 -0
  310. data/rbi/workos/api_key_data_integration_vended_credential.rbi +42 -0
  311. data/rbi/workos/api_keys.rbi +5 -5
  312. data/rbi/workos/application_consent_required_error_body.rbi +30 -0
  313. data/rbi/workos/audit_logs.rbi +10 -10
  314. data/rbi/workos/auth_method_mismatch_error_body.rbi +30 -0
  315. data/rbi/workos/authentication_method_not_allowed_error_body.rbi +30 -0
  316. data/rbi/workos/authentication_method_not_allowed_oauth_error_body.rbi +30 -0
  317. data/rbi/workos/authorization.rbi +55 -45
  318. data/rbi/workos/authorization_pending_oauth_error_body.rbi +30 -0
  319. data/rbi/workos/authorization_url_not_found_error_body.rbi +30 -0
  320. data/rbi/workos/authorization_url_request_error_body.rbi +30 -0
  321. data/rbi/workos/client_api.rbi +1 -1
  322. data/rbi/workos/client_credentials_data_integration_vended_credential.rbi +66 -0
  323. data/rbi/workos/code_challenge_not_found_error_body.rbi +30 -0
  324. data/rbi/workos/connect.rbi +12 -10
  325. data/rbi/workos/connect_application_oauth.rbi +6 -0
  326. data/rbi/workos/connected_account.rbi +18 -0
  327. data/rbi/workos/connected_account_input.rbi +12 -0
  328. data/rbi/workos/connected_account_limit_reached_error_body.rbi +30 -0
  329. data/rbi/workos/connected_account_warning.rbi +30 -0
  330. data/rbi/workos/connection_could_not_be_verified_error_body.rbi +30 -0
  331. data/rbi/workos/connection_creation_conflict_error_body.rbi +30 -0
  332. data/rbi/workos/connection_creation_not_found_error_body.rbi +30 -0
  333. data/rbi/workos/connection_finish_error_body.rbi +30 -0
  334. data/rbi/workos/connection_type_not_updatable_error_body.rbi +30 -0
  335. data/rbi/workos/create_connected_account.rbi +66 -0
  336. data/rbi/workos/create_magic_code_and_return.rbi +6 -0
  337. data/rbi/workos/create_oauth_application.rbi +6 -0
  338. data/rbi/workos/create_organization_connected_account.rbi +72 -0
  339. data/rbi/workos/create_password_reset_token.rbi +6 -0
  340. data/rbi/workos/daily_quota_exceeded_error_body.rbi +30 -0
  341. data/rbi/workos/data_integration_access_token_response_with_access_token.rbi +30 -0
  342. data/rbi/workos/{data_integration_credentials_response_credential.rbi → data_integration_access_token_response_with_access_token_access_token.rbi} +3 -9
  343. data/rbi/workos/data_integration_access_token_response_with_error.rbi +30 -0
  344. data/rbi/workos/data_integration_authorize_url_response.rbi +12 -0
  345. data/rbi/workos/data_integration_credentials_response.rbi +2 -2
  346. data/rbi/workos/data_integration_credentials_response_with_credential.rbi +30 -0
  347. data/rbi/workos/data_integration_credentials_response_with_error.rbi +30 -0
  348. data/rbi/workos/data_integration_finish_connection_response.rbi +24 -0
  349. data/rbi/workos/data_integration_vended_credential.rbi +66 -0
  350. data/rbi/workos/data_integrations_create_api_key_connection_request.rbi +60 -0
  351. data/rbi/workos/data_integrations_create_client_credentials_connection_request.rbi +72 -0
  352. data/rbi/workos/data_integrations_finish_connection_request.rbi +36 -0
  353. data/rbi/workos/data_integrations_get_data_integration_authorize_url_request.rbi +30 -0
  354. data/rbi/workos/data_integrations_list_response_data_connected_account.rbi +18 -0
  355. data/rbi/workos/data_integrations_list_response_data_connected_account_warning.rbi +30 -0
  356. data/rbi/workos/data_integrations_upsert_api_key_request.rbi +24 -6
  357. data/rbi/workos/data_integrations_upsert_client_credentials_request.rbi +24 -6
  358. data/rbi/workos/directory_sync.rbi +15 -7
  359. data/rbi/workos/directory_sync_rate_limit_error.rbi +36 -0
  360. data/rbi/workos/directory_sync_response.rbi +24 -0
  361. data/rbi/workos/email_already_in_use_error_body.rbi +30 -0
  362. data/rbi/workos/email_already_verified_error_body.rbi +30 -0
  363. data/rbi/workos/email_change_not_allowed_error_body.rbi +30 -0
  364. data/rbi/workos/email_completion_required_error_body_with_email_completion_token.rbi +36 -0
  365. data/rbi/workos/email_domain_not_deliverable_error_body.rbi +30 -0
  366. data/rbi/workos/email_not_available_error_body.rbi +30 -0
  367. data/rbi/workos/email_password_auth_disabled_error_body.rbi +30 -0
  368. data/rbi/workos/email_verification_required_error_body.rbi +30 -0
  369. data/rbi/workos/entity_not_found_error_body.rbi +30 -0
  370. data/rbi/workos/error_body.rbi +24 -0
  371. data/rbi/workos/error_body_with_code.rbi +30 -0
  372. data/rbi/workos/error_body_with_code_errors.rbi +36 -0
  373. data/rbi/workos/error_body_with_code_field_error.rbi +30 -0
  374. data/rbi/workos/error_body_with_code_field_errors.rbi +30 -0
  375. data/rbi/workos/error_body_with_code_instance_path_error.rbi +24 -0
  376. data/rbi/workos/error_body_with_code_instance_path_errors.rbi +36 -0
  377. data/rbi/workos/error_body_with_code_status_code.rbi +36 -0
  378. data/rbi/workos/error_body_with_constraints_property_error.rbi +30 -0
  379. data/rbi/workos/error_body_with_constraints_property_errors.rbi +30 -0
  380. data/rbi/workos/error_body_with_error.rbi +30 -0
  381. data/rbi/workos/error_body_with_error_message_list.rbi +30 -0
  382. data/rbi/workos/error_body_with_message_or_message_list.rbi +24 -0
  383. data/rbi/workos/events.rbi +1 -3
  384. data/rbi/workos/expired_token_oauth_error_body.rbi +30 -0
  385. data/rbi/workos/external_auth_session_already_completed_error_body.rbi +30 -0
  386. data/rbi/workos/external_id_already_used_error_body.rbi +30 -0
  387. data/rbi/workos/extra_attributes_required_oauth_error_body.rbi +30 -0
  388. data/rbi/workos/feature_flags.rbi +8 -8
  389. data/rbi/workos/feature_flags_flag_created.rbi +54 -0
  390. data/rbi/workos/feature_flags_flag_created_context.rbi +30 -0
  391. data/rbi/workos/feature_flags_flag_created_context_actor.rbi +36 -0
  392. data/rbi/workos/feature_flags_flag_created_data.rbi +90 -0
  393. data/rbi/workos/feature_flags_flag_created_data_owner.rbi +36 -0
  394. data/rbi/workos/feature_flags_flag_deleted.rbi +54 -0
  395. data/rbi/workos/feature_flags_flag_deleted_context.rbi +30 -0
  396. data/rbi/workos/feature_flags_flag_deleted_context_actor.rbi +36 -0
  397. data/rbi/workos/feature_flags_flag_deleted_data.rbi +90 -0
  398. data/rbi/workos/feature_flags_flag_deleted_data_owner.rbi +36 -0
  399. data/rbi/workos/feature_flags_flag_rule_created.rbi +54 -0
  400. data/rbi/workos/feature_flags_flag_rule_created_context.rbi +30 -0
  401. data/rbi/workos/feature_flags_flag_rule_created_context_actor.rbi +36 -0
  402. data/rbi/workos/feature_flags_flag_rule_deleted.rbi +54 -0
  403. data/rbi/workos/feature_flags_flag_rule_deleted_context.rbi +30 -0
  404. data/rbi/workos/feature_flags_flag_rule_deleted_context_actor.rbi +36 -0
  405. data/rbi/workos/feature_flags_flag_rule_updated.rbi +54 -0
  406. data/rbi/workos/feature_flags_flag_rule_updated_context.rbi +36 -0
  407. data/rbi/workos/feature_flags_flag_rule_updated_context_actor.rbi +36 -0
  408. data/rbi/workos/feature_flags_flag_rule_updated_context_previous_attribute.rbi +24 -0
  409. data/rbi/workos/feature_flags_flag_rule_updated_context_previous_attribute_data.rbi +24 -0
  410. data/rbi/workos/feature_flags_flag_target_created.rbi +54 -0
  411. data/rbi/workos/feature_flags_flag_target_created_context.rbi +30 -0
  412. data/rbi/workos/feature_flags_flag_target_created_context_actor.rbi +36 -0
  413. data/rbi/workos/feature_flags_flag_target_deleted.rbi +54 -0
  414. data/rbi/workos/feature_flags_flag_target_deleted_context.rbi +30 -0
  415. data/rbi/workos/feature_flags_flag_target_deleted_context_actor.rbi +36 -0
  416. data/rbi/workos/feature_flags_flag_updated.rbi +54 -0
  417. data/rbi/workos/feature_flags_flag_updated_context.rbi +36 -0
  418. data/rbi/workos/feature_flags_flag_updated_context_actor.rbi +36 -0
  419. data/rbi/workos/feature_flags_flag_updated_context_previous_attribute.rbi +24 -0
  420. data/rbi/workos/feature_flags_flag_updated_context_previous_attribute_data.rbi +54 -0
  421. data/rbi/workos/feature_flags_flag_updated_context_previous_attribute_data_owner.rbi +36 -0
  422. data/rbi/workos/feature_flags_flag_updated_data.rbi +90 -0
  423. data/rbi/workos/feature_flags_flag_updated_data_owner.rbi +36 -0
  424. data/rbi/workos/flag_rule.rbi +84 -0
  425. data/rbi/workos/flag_target.rbi +90 -0
  426. data/rbi/workos/flag_target_with_rule_id.rbi +78 -0
  427. data/rbi/workos/flag_target_with_value_type.rbi +84 -0
  428. data/rbi/workos/flag_updated_context_previous_attribute_data.rbi +6 -0
  429. data/rbi/workos/flag_updated_context_previous_attribute_data_owner.rbi +36 -0
  430. data/rbi/workos/generate_link.rbi +6 -0
  431. data/rbi/workos/group_role_assignment_list.rbi +36 -0
  432. data/rbi/workos/groups.rbi +19 -8
  433. data/rbi/workos/idp_metadata_fetch_failed_error_body.rbi +30 -0
  434. data/rbi/workos/invalid_client_oauth_error_body.rbi +30 -0
  435. data/rbi/workos/invalid_connection_oauth_error_body.rbi +30 -0
  436. data/rbi/workos/invalid_credentials_error_body.rbi +30 -0
  437. data/rbi/workos/invalid_email_error_body.rbi +30 -0
  438. data/rbi/workos/invalid_grant_oauth_error_body.rbi +30 -0
  439. data/rbi/workos/invalid_idp_sso_url_error_body.rbi +30 -0
  440. data/rbi/workos/invalid_link_authorization_code_oauth_error_body.rbi +30 -0
  441. data/rbi/workos/invalid_locale_error_body.rbi +30 -0
  442. data/rbi/workos/invalid_metadata_error_body.rbi +30 -0
  443. data/rbi/workos/invalid_one_time_code_error_body.rbi +30 -0
  444. data/rbi/workos/invalid_organization_id_error_body.rbi +30 -0
  445. data/rbi/workos/invalid_password_hash_error_body.rbi +30 -0
  446. data/rbi/workos/invalid_pending_authentication_token_error_body.rbi +30 -0
  447. data/rbi/workos/invalid_profile_oauth_error_body.rbi +30 -0
  448. data/rbi/workos/invalid_refresh_token_error_body.rbi +30 -0
  449. data/rbi/workos/invalid_request_oauth_error_body.rbi +30 -0
  450. data/rbi/workos/invalid_request_parameters_error_body.rbi +30 -0
  451. data/rbi/workos/invalid_request_parameters_error_body_with_errors.rbi +36 -0
  452. data/rbi/workos/invalid_role_error_body.rbi +30 -0
  453. data/rbi/workos/invalid_url_error_body.rbi +30 -0
  454. data/rbi/workos/invitation_cannot_be_used_for_email_oauth_error_body.rbi +30 -0
  455. data/rbi/workos/invitation_invalid_oauth_error_body.rbi +30 -0
  456. data/rbi/workos/it_contact_list.rbi +36 -0
  457. data/rbi/workos/it_contact_list_list_metadata.rbi +30 -0
  458. data/rbi/workos/list_metadata.rbi +30 -0
  459. data/rbi/workos/mfa_challenge_error_body.rbi +30 -0
  460. data/rbi/workos/mfa_enrollment_error_body.rbi +30 -0
  461. data/rbi/workos/mfa_enrollment_oauth_error_body.rbi +30 -0
  462. data/rbi/workos/multi_factor_auth.rbi +7 -7
  463. data/rbi/workos/multiple_roles_not_enabled_error_body.rbi +30 -0
  464. data/rbi/workos/must_use_sso_for_selected_organization_message_error_body.rbi +24 -0
  465. data/rbi/workos/oauth_data_integration_vended_credential.rbi +66 -0
  466. data/rbi/workos/oauth_error_body.rbi +30 -0
  467. data/rbi/workos/one_time_code_expired_error_body.rbi +30 -0
  468. data/rbi/workos/one_time_code_previously_used_error_body.rbi +30 -0
  469. data/rbi/workos/one_time_code_too_many_attempts_error_body.rbi +30 -0
  470. data/rbi/workos/organization_authentication_methods_required_oauth_error_body.rbi +30 -0
  471. data/rbi/workos/organization_connected_account.rbi +66 -0
  472. data/rbi/workos/organization_connected_account_import_error_body.rbi +30 -0
  473. data/rbi/workos/organization_domains.rbi +4 -4
  474. data/rbi/workos/organization_membership_not_found_oauth_error_body.rbi +30 -0
  475. data/rbi/workos/organization_membership_service.rbi +8 -8
  476. data/rbi/workos/organization_not_found_oauth_error_body.rbi +30 -0
  477. data/rbi/workos/organization_selection_required_error_body.rbi +30 -0
  478. data/rbi/workos/organization_selection_required_error_body_with_organization.rbi +30 -0
  479. data/rbi/workos/organization_selection_required_error_body_with_organizations.rbi +36 -0
  480. data/rbi/workos/organizations.rbi +13 -13
  481. data/rbi/workos/passkey_progressive_enrollment_error_body.rbi +30 -0
  482. data/rbi/workos/password_and_password_hash_provided_error_body.rbi +30 -0
  483. data/rbi/workos/password_and_password_hash_type_provided_error_body.rbi +30 -0
  484. data/rbi/workos/password_salt_position_requires_password_hash_error_body.rbi +30 -0
  485. data/rbi/workos/password_strength_error_error_body_with_errors.rbi +36 -0
  486. data/rbi/workos/patch_group_memberships.rbi +30 -0
  487. data/rbi/workos/patch_group_role_assignments.rbi +30 -0
  488. data/rbi/workos/phone_number_required_error_body.rbi +30 -0
  489. data/rbi/workos/pipe_connected_account.rbi +12 -0
  490. data/rbi/workos/pipes.rbi +92 -25
  491. data/rbi/workos/pipes_provider.rbi +2 -2
  492. data/rbi/workos/pkce_not_supported_oauth_error_body.rbi +30 -0
  493. data/rbi/workos/platform_teams.rbi +2 -2
  494. data/rbi/workos/policy_denied_error_body.rbi +30 -0
  495. data/rbi/workos/radar.rbi +4 -4
  496. data/rbi/workos/radar_challenge_error_body.rbi +30 -0
  497. data/rbi/workos/radar_sign_up_challenge_error_body.rbi +30 -0
  498. data/rbi/workos/radar_sms_sign_in_challenge_error_body.rbi +30 -0
  499. data/rbi/workos/rate_limit_exceeded_error_body_with_retry_after.rbi +36 -0
  500. data/rbi/workos/revoke_link.rbi +30 -0
  501. data/rbi/workos/send_email_change.rbi +6 -0
  502. data/rbi/workos/send_verification_email.rbi +24 -0
  503. data/rbi/workos/sign_up_not_allowed_oauth_error_body.rbi +30 -0
  504. data/rbi/workos/slow_down_oauth_error_body.rbi +30 -0
  505. data/rbi/workos/sms_challenge_quota_reached_error_body.rbi +30 -0
  506. data/rbi/workos/sms_challenge_rate_limited_error_body.rbi +30 -0
  507. data/rbi/workos/sso.rbi +19 -18
  508. data/rbi/workos/sso_required_oauth_error_body_with_connection_ids_list_email_pending_authentication_token.rbi +48 -0
  509. data/rbi/workos/sub_resource_scoped_role_not_allowed_error_body_with_role_slug.rbi +36 -0
  510. data/rbi/workos/token_query.rbi +6 -0
  511. data/rbi/workos/token_too_big_oauth_error_body.rbi +30 -0
  512. data/rbi/workos/too_many_failed_verification_attempts_error_body_with_retry_after.rbi +36 -0
  513. data/rbi/workos/too_many_requests_oauth_error_body.rbi +30 -0
  514. data/rbi/workos/unauthorized_client_oauth_error_body.rbi +30 -0
  515. data/rbi/workos/unauthorized_error_body.rbi +24 -0
  516. data/rbi/workos/update_audit_logs_retention_with_retention_period.rbi +24 -0
  517. data/rbi/workos/update_audit_logs_retention_with_retention_period_in_days.rbi +24 -0
  518. data/rbi/workos/update_oauth_application.rbi +6 -0
  519. data/rbi/workos/update_user_organization_membership_with_role_slug.rbi +24 -0
  520. data/rbi/workos/update_user_organization_membership_with_role_slugs.rbi +24 -0
  521. data/rbi/workos/user_connected_account_import_error_body.rbi +30 -0
  522. data/rbi/workos/user_consent_options_not_supported_error_body.rbi +30 -0
  523. data/rbi/workos/user_creation_error_error_body_with_errors.rbi +36 -0
  524. data/rbi/workos/user_management.rbi +77 -61
  525. data/rbi/workos/user_mismatch_error_body.rbi +30 -0
  526. data/rbi/workos/user_role_assignment_source.rbi +6 -0
  527. data/rbi/workos/user_role_assignment_source_group.rbi +30 -0
  528. data/rbi/workos/vault.rbi +11 -11
  529. data/rbi/workos/vault_dek_rekeyed.rbi +54 -0
  530. data/rbi/workos/vault_dek_rekeyed_data.rbi +48 -0
  531. data/rbi/workos/verification_id_required_error_body.rbi +30 -0
  532. data/rbi/workos/version_list_response.rbi +30 -0
  533. data/rbi/workos/waitlist_list_response.rbi +36 -0
  534. data/rbi/workos/waitlist_list_response_list_metadata.rbi +30 -0
  535. data/rbi/workos/webhooks.rbi +4 -4
  536. data/rbi/workos/widgets.rbi +1 -1
  537. data/test/workos/test_admin_portal.rb +9 -1
  538. data/test/workos/test_admin_portal_model_round_trip.rb +14 -0
  539. data/test/workos/test_agents.rb +8 -0
  540. data/test/workos/test_agents_model_round_trip.rb +46 -0
  541. data/test/workos/test_api_keys_model_round_trip.rb +14 -0
  542. data/test/workos/test_authorization.rb +8 -0
  543. data/test/workos/test_authorization_model_round_trip.rb +38 -1
  544. data/test/workos/test_base_client.rb +4 -3
  545. data/test/workos/test_connect_model_round_trip.rb +3 -1
  546. data/test/workos/test_directory_sync.rb +8 -0
  547. data/test/workos/test_directory_sync_model_round_trip.rb +24 -0
  548. data/test/workos/test_feature_flags_model_round_trip.rb +123 -0
  549. data/test/workos/test_groups.rb +8 -0
  550. data/test/workos/test_groups_model_round_trip.rb +11 -0
  551. data/test/workos/test_organizations_model_round_trip.rb +111 -0
  552. data/test/workos/test_pipes.rb +28 -4
  553. data/test/workos/test_pipes_model_round_trip.rb +214 -51
  554. data/test/workos/test_shared_model_round_trip.rb +2066 -423
  555. data/test/workos/test_sso_model_round_trip.rb +61 -0
  556. data/test/workos/test_user_management_model_round_trip.rb +297 -3
  557. data/test/workos/test_vault_model_round_trip.rb +63 -0
  558. metadata +423 -3
data/lib/workos/pipes.rb CHANGED
@@ -108,6 +108,35 @@ module WorkOS
108
108
  result
109
109
  end
110
110
 
111
+ # Finish connection
112
+ # @param connect_code [String] The `connect_code` WorkOS added to `return_to` when the user finished authorizing. It can be used once and expires 90 seconds after the redirect.
113
+ # @param code_verifier [String] The code verifier `code_challenge` was derived from: 43 to 128 characters from `A-Z`, `a-z`, `0-9`, `-`, `.`, `_` and `~`. A wrong verifier uses up the `connect_code`, and the user has to connect again.
114
+ # @param state [String, nil] The `state` WorkOS added to `return_to` alongside `connect_code`. Optional; it is only used to correlate the request in logs.
115
+ # @param request_options [Hash] (see WorkOS::Types::RequestOptions)
116
+ # @return [WorkOS::DataIntegrationFinishConnectionResponse]
117
+ def finish_connection(
118
+ connect_code:,
119
+ code_verifier:,
120
+ state: nil,
121
+ request_options: {}
122
+ )
123
+ body = {
124
+ "connect_code" => connect_code,
125
+ "code_verifier" => code_verifier,
126
+ "state" => state
127
+ }.compact
128
+ response = @client.request(
129
+ method: :post,
130
+ path: "/data-integrations/finish",
131
+ auth: true,
132
+ body: body,
133
+ request_options: request_options
134
+ )
135
+ result = WorkOS::DataIntegrationFinishConnectionResponse.new(response.body)
136
+ 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"])
137
+ result
138
+ end
139
+
111
140
  # Get a data integration
112
141
  # @param slug [String] The slug identifier of the data integration.
113
142
  # @param request_options [Hash] (see WorkOS::Types::RequestOptions)
@@ -184,31 +213,83 @@ module WorkOS
184
213
  nil
185
214
  end
186
215
 
216
+ # Create another API key connected account
217
+ # @param slug [String] The identifier of the integration.
218
+ # @param account_display_name [String, nil] A mutable, non-unique label. Omit to preserve an existing label; null clears it. Labels are never account identifiers.
219
+ # @param account_identifier [String, nil] A developer-attested provider account identifier, never inferred from a label or credential. Omit to preserve an existing identifier; null clears it.
220
+ # @param user_id [String] A [User](https://workos.com/docs/reference/authkit/user) identifier.
221
+ # @param organization_id [String, nil] An [Organization](https://workos.com/docs/reference/organization) identifier. Optional parameter to scope the connection to a specific organization. Required when `connection_owner` is `organization`.
222
+ # @param connection_owner [WorkOS::Types::DataIntegrationsCreateApiKeyConnectionRequestConnectionOwner, nil] Whose connection to create or rotate. `user` (the default) addresses the connection owned by `user_id`. `organization` addresses the connection shared by every member of `organization_id`; `user_id` then identifies the member performing the request and must be an active member of the organization.
223
+ # @param secret [String] The API key secret to store for this integration.
224
+ # @param connection_intent [String] Must be `add`: this endpoint only creates another connection. The first connection for an owner shape fills the compatibility slot; later connections are standard.
225
+ # @param request_options [Hash] (see WorkOS::Types::RequestOptions)
226
+ # @return [WorkOS::ConnectedAccount]
227
+ def create_data_integration_api_key(
228
+ slug:,
229
+ user_id:,
230
+ secret:,
231
+ connection_intent:,
232
+ account_display_name: WorkOS::OMIT,
233
+ account_identifier: WorkOS::OMIT,
234
+ organization_id: nil,
235
+ connection_owner: nil,
236
+ request_options: {}
237
+ )
238
+ body = {
239
+ "user_id" => user_id,
240
+ "organization_id" => organization_id,
241
+ "connection_owner" => connection_owner,
242
+ "secret" => secret,
243
+ "connection_intent" => connection_intent
244
+ }.compact
245
+ body["account_display_name"] = account_display_name unless account_display_name.equal?(WorkOS::OMIT)
246
+ body["account_identifier"] = account_identifier unless account_identifier.equal?(WorkOS::OMIT)
247
+ response = @client.request(
248
+ method: :post,
249
+ path: "/data-integrations/#{WorkOS::Util.encode_path(slug)}/api-key",
250
+ auth: true,
251
+ body: body,
252
+ request_options: request_options
253
+ )
254
+ result = WorkOS::ConnectedAccount.new(response.body)
255
+ 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"])
256
+ result
257
+ end
258
+
187
259
  # Upsert an API key for a connected account
188
260
  # @param slug [String] The identifier of the integration.
261
+ # @param account_display_name [String, nil] A mutable, non-unique label. Omit to preserve an existing label; null clears it. Labels are never account identifiers.
262
+ # @param account_identifier [String, nil] A developer-attested provider account identifier, never inferred from a label or credential. Omit to preserve an existing identifier; null clears it.
189
263
  # @param user_id [String] A [User](https://workos.com/docs/reference/authkit/user) identifier.
190
264
  # @param organization_id [String, nil] An [Organization](https://workos.com/docs/reference/organization) identifier. Optional parameter to scope the connection to a specific organization. Required when `connection_owner` is `organization`.
191
- # @param connected_account_id [String, nil] A [connected account](https://workos.com/docs/reference/pipes/connected-account) identifier. Use this to rotate a specific existing connection.
192
265
  # @param connection_owner [WorkOS::Types::DataIntegrationsUpsertApiKeyRequestConnectionOwner, nil] Whose connection to create or rotate. `user` (the default) addresses the connection owned by `user_id`. `organization` addresses the connection shared by every member of `organization_id`; `user_id` then identifies the member performing the request and must be an active member of the organization.
193
266
  # @param secret [String] The API key secret to store for this integration.
267
+ # @param connection_intent [String, nil] Send `reauthorize` with `connected_account_id` to reauthorize one exact connection. Omit it to use the compatibility connection; creating another connection lives on the POST route.
268
+ # @param connected_account_id [String, nil] The exact connected account to reauthorize. Required with `connection_intent: reauthorize`; it may also be sent on its own to reauthorize that connection.
194
269
  # @param request_options [Hash] (see WorkOS::Types::RequestOptions)
195
270
  # @return [WorkOS::ConnectedAccount]
196
271
  def update_data_integration_api_key(
197
272
  slug:,
198
273
  user_id:,
199
274
  secret:,
275
+ account_display_name: WorkOS::OMIT,
276
+ account_identifier: WorkOS::OMIT,
200
277
  organization_id: nil,
201
- connected_account_id: nil,
202
278
  connection_owner: nil,
279
+ connection_intent: nil,
280
+ connected_account_id: nil,
203
281
  request_options: {}
204
282
  )
205
283
  body = {
206
284
  "user_id" => user_id,
207
285
  "organization_id" => organization_id,
208
- "connected_account_id" => connected_account_id,
209
286
  "connection_owner" => connection_owner,
210
- "secret" => secret
287
+ "secret" => secret,
288
+ "connection_intent" => connection_intent,
289
+ "connected_account_id" => connected_account_id
211
290
  }.compact
291
+ body["account_display_name"] = account_display_name unless account_display_name.equal?(WorkOS::OMIT)
292
+ body["account_identifier"] = account_identifier unless account_identifier.equal?(WorkOS::OMIT)
212
293
  response = @client.request(
213
294
  method: :put,
214
295
  path: "/data-integrations/#{WorkOS::Util.encode_path(slug)}/api-key",
@@ -223,20 +304,30 @@ module WorkOS
223
304
 
224
305
  # Get authorization URL
225
306
  # @param slug [String] The slug identifier of the provider (e.g., `github`, `slack`, `notion`).
307
+ # @param account_display_name [String, nil] A mutable, non-unique label. Omit to preserve an existing label; null clears it. Labels are never account identifiers.
226
308
  # @param user_id [String] The ID of the user to authorize. When `connection_owner` is `organization`, this is the user authorizing on behalf of the organization; they must be an active member of the organization and do not become the owner of the resulting connected account.
227
309
  # @param organization_id [String, nil] An organization ID to scope the authorization to a specific organization. Required when `connection_owner` is `organization`.
228
310
  # @param connection_owner [WorkOS::Types::DataIntegrationsGetDataIntegrationAuthorizeUrlRequestConnectionOwner, nil] Who will own the connected account. `user` (the default) connects the user's own account. `organization` connects the organization's shared account and requires `organization_id`.
229
- # @param return_to [String, nil] The URL to redirect the user to after authorization.
311
+ # @param return_to [String, nil] The URL to redirect the user to after authorization. Required with `code_challenge`, and must then exactly match a redirect URI registered on one of the environment's applications. Loopback URLs match on any port; wildcard redirect URIs are not honored, and a `return_to` with a query string or fragment never matches.
312
+ # @param code_challenge [String, nil] A PKCE-style code challenge: the base64url-encoded SHA-256 of a `code_verifier` your app keeps. When set, the connection isn't saved when the user finishes authorizing. Instead, the user is redirected to `return_to` with a `connect_code` and `state`, and your app must call [Finish connection](https://workos.com/docs/reference/pipes/connected-account/finish-connection) with the `connect_code` and `code_verifier` within 90 seconds to save it.
313
+ # @param code_challenge_method [String, nil] The method used to derive `code_challenge`. Only `S256` is supported, and it is the default. Requires `code_challenge`.
230
314
  # @param config [Hash{String => String}, nil] Connect-time config values for the provider-declared `installation`-scope fields (e.g. a Zendesk `subdomain`), keyed by the config field. Only fields the provider declares may be supplied, and required fields must be provided unless already pinned on the integration.
315
+ # @param connection_intent [WorkOS::Types::DataIntegrationsGetDataIntegrationAuthorizeUrlRequestConnectionIntent, nil] Which connection the request targets. Omit it to use the compatibility connection. Send `add` to create another connection: the first connection for an owner shape fills the compatibility slot, and later connections are standard. Send `reauthorize` with `connected_account_id` to reauthorize one exact connection.
316
+ # @param connected_account_id [String, nil] The exact connected account to reauthorize. Required with `connection_intent: reauthorize` and not accepted otherwise.
231
317
  # @param request_options [Hash] (see WorkOS::Types::RequestOptions)
232
318
  # @return [WorkOS::DataIntegrationAuthorizeUrlResponse]
233
319
  def authorize_data_integration(
234
320
  slug:,
235
321
  user_id:,
322
+ account_display_name: WorkOS::OMIT,
236
323
  organization_id: nil,
237
324
  connection_owner: nil,
238
325
  return_to: nil,
326
+ code_challenge: nil,
327
+ code_challenge_method: nil,
239
328
  config: nil,
329
+ connection_intent: nil,
330
+ connected_account_id: nil,
240
331
  request_options: {}
241
332
  )
242
333
  body = {
@@ -244,8 +335,13 @@ module WorkOS
244
335
  "organization_id" => organization_id,
245
336
  "connection_owner" => connection_owner,
246
337
  "return_to" => return_to,
247
- "config" => config
338
+ "code_challenge" => code_challenge,
339
+ "code_challenge_method" => code_challenge_method,
340
+ "config" => config,
341
+ "connection_intent" => connection_intent,
342
+ "connected_account_id" => connected_account_id
248
343
  }.compact
344
+ body["account_display_name"] = account_display_name unless account_display_name.equal?(WorkOS::OMIT)
249
345
  response = @client.request(
250
346
  method: :post,
251
347
  path: "/data-integrations/#{WorkOS::Util.encode_path(slug)}/authorize",
@@ -258,15 +354,67 @@ module WorkOS
258
354
  result
259
355
  end
260
356
 
357
+ # Create another client credentials connected account
358
+ # @param slug [String] The identifier of the integration.
359
+ # @param account_display_name [String, nil] A mutable, non-unique label. Omit to preserve an existing label; null clears it. Labels are never account identifiers.
360
+ # @param account_identifier [String, nil] A developer-attested provider account identifier, never inferred from a label or credential. Omit to preserve an existing identifier; null clears it.
361
+ # @param user_id [String] A [User](https://workos.com/docs/reference/authkit/user) identifier.
362
+ # @param organization_id [String, nil] An [Organization](https://workos.com/docs/reference/organization) identifier. Optional parameter to scope the connection to a specific organization. Required when `connection_owner` is `organization`.
363
+ # @param connection_owner [WorkOS::Types::DataIntegrationsCreateClientCredentialsConnectionRequestConnectionOwner, nil] Whose connection to create or rotate. `user` (the default) addresses the connection owned by `user_id`. `organization` addresses the connection shared by every member of `organization_id`; `user_id` then identifies the member performing the request and must be an active member of the organization.
364
+ # @param client_id [String] The OAuth client ID to store for this integration.
365
+ # @param client_secret [String] The OAuth client secret to store for this integration.
366
+ # @param config [Hash{String => String}, nil] Provider-specific configuration values collected for this installation, keyed by the provider's config field descriptors.
367
+ # @param connection_intent [String] Must be `add`: this endpoint only creates another connection. The first connection for an owner shape fills the compatibility slot; later connections are standard.
368
+ # @param request_options [Hash] (see WorkOS::Types::RequestOptions)
369
+ # @return [WorkOS::ConnectedAccount]
370
+ def create_data_integration_client_credential(
371
+ slug:,
372
+ user_id:,
373
+ client_id:,
374
+ client_secret:,
375
+ connection_intent:,
376
+ account_display_name: WorkOS::OMIT,
377
+ account_identifier: WorkOS::OMIT,
378
+ organization_id: nil,
379
+ connection_owner: nil,
380
+ config: nil,
381
+ request_options: {}
382
+ )
383
+ body = {
384
+ "user_id" => user_id,
385
+ "organization_id" => organization_id,
386
+ "connection_owner" => connection_owner,
387
+ "client_id" => client_id,
388
+ "client_secret" => client_secret,
389
+ "config" => config,
390
+ "connection_intent" => connection_intent
391
+ }.compact
392
+ body["account_display_name"] = account_display_name unless account_display_name.equal?(WorkOS::OMIT)
393
+ body["account_identifier"] = account_identifier unless account_identifier.equal?(WorkOS::OMIT)
394
+ response = @client.request(
395
+ method: :post,
396
+ path: "/data-integrations/#{WorkOS::Util.encode_path(slug)}/client-credentials",
397
+ auth: true,
398
+ body: body,
399
+ request_options: request_options
400
+ )
401
+ result = WorkOS::ConnectedAccount.new(response.body)
402
+ 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"])
403
+ result
404
+ end
405
+
261
406
  # Upsert client credentials for a connected account
262
407
  # @param slug [String] The identifier of the integration.
408
+ # @param account_display_name [String, nil] A mutable, non-unique label. Omit to preserve an existing label; null clears it. Labels are never account identifiers.
409
+ # @param account_identifier [String, nil] A developer-attested provider account identifier, never inferred from a label or credential. Omit to preserve an existing identifier; null clears it.
263
410
  # @param user_id [String] A [User](https://workos.com/docs/reference/authkit/user) identifier.
264
411
  # @param organization_id [String, nil] An [Organization](https://workos.com/docs/reference/organization) identifier. Optional parameter to scope the connection to a specific organization. Required when `connection_owner` is `organization`.
265
- # @param connected_account_id [String, nil] A [connected account](https://workos.com/docs/reference/pipes/connected-account) identifier. Use this to rotate a specific existing connection.
266
412
  # @param connection_owner [WorkOS::Types::DataIntegrationsUpsertClientCredentialsRequestConnectionOwner, nil] Whose connection to create or rotate. `user` (the default) addresses the connection owned by `user_id`. `organization` addresses the connection shared by every member of `organization_id`; `user_id` then identifies the member performing the request and must be an active member of the organization.
267
413
  # @param client_id [String] The OAuth client ID to store for this integration.
268
414
  # @param client_secret [String] The OAuth client secret to store for this integration.
269
415
  # @param config [Hash{String => String}, nil] Provider-specific configuration values collected for this installation, keyed by the provider's config field descriptors.
416
+ # @param connection_intent [String, nil] Send `reauthorize` with `connected_account_id` to reauthorize one exact connection. Omit it to use the compatibility connection; creating another connection lives on the POST route.
417
+ # @param connected_account_id [String, nil] The exact connected account to reauthorize. Required with `connection_intent: reauthorize`; it may also be sent on its own to reauthorize that connection.
270
418
  # @param request_options [Hash] (see WorkOS::Types::RequestOptions)
271
419
  # @return [WorkOS::ConnectedAccount]
272
420
  def update_data_integration_client_credentials(
@@ -274,21 +422,27 @@ module WorkOS
274
422
  user_id:,
275
423
  client_id:,
276
424
  client_secret:,
425
+ account_display_name: WorkOS::OMIT,
426
+ account_identifier: WorkOS::OMIT,
277
427
  organization_id: nil,
278
- connected_account_id: nil,
279
428
  connection_owner: nil,
280
429
  config: nil,
430
+ connection_intent: nil,
431
+ connected_account_id: nil,
281
432
  request_options: {}
282
433
  )
283
434
  body = {
284
435
  "user_id" => user_id,
285
436
  "organization_id" => organization_id,
286
- "connected_account_id" => connected_account_id,
287
437
  "connection_owner" => connection_owner,
288
438
  "client_id" => client_id,
289
439
  "client_secret" => client_secret,
290
- "config" => config
440
+ "config" => config,
441
+ "connection_intent" => connection_intent,
442
+ "connected_account_id" => connected_account_id
291
443
  }.compact
444
+ body["account_display_name"] = account_display_name unless account_display_name.equal?(WorkOS::OMIT)
445
+ body["account_identifier"] = account_identifier unless account_identifier.equal?(WorkOS::OMIT)
292
446
  response = @client.request(
293
447
  method: :put,
294
448
  path: "/data-integrations/#{WorkOS::Util.encode_path(slug)}/client-credentials",
@@ -484,21 +638,29 @@ module WorkOS
484
638
  # Import an organization connected account
485
639
  # @param organization_id [String] An [Organization](https://workos.com/docs/reference/organization) identifier.
486
640
  # @param slug [String] The slug identifier of the provider (e.g., `github`, `slack`, `notion`).
641
+ # @param account_display_name [String, nil] A mutable, non-unique connection label; null clears it. Not an account identifier.
642
+ # @param account_identifier [String, nil] A developer-attested account identifier; null clears it.
487
643
  # @param access_token [String, nil] The OAuth access token for the connected account.
488
644
  # @param refresh_token [String, nil] The OAuth refresh token for the connected account.
489
645
  # @param expires_at [String, nil] The ISO-8601 timestamp when the access token expires. Required when `access_token` is provided for tokens that expire.
490
646
  # @param scopes [Array<String>, nil] The OAuth scopes granted for this connection.
491
- # @param state [WorkOS::Types::ConnectedAccountInputState, nil] Explicitly set the state of the connected account. When omitted, the state is derived from the token combination provided.
647
+ # @param state [WorkOS::Types::CreateOrganizationConnectedAccountState, nil] Explicitly set the state of the connected account. When omitted, the state is derived from the token combination provided.
648
+ # @param user_id [String] The [User](https://workos.com/docs/reference/authkit/user) identifier of the organization member on whose behalf the connected account is being imported or updated. The user must be an active member of the organization.
649
+ # @param connection_intent [String, nil] Set to `add` to create another connected account. Omit this field for permanent compatibility behavior.
492
650
  # @param request_options [Hash] (see WorkOS::Types::RequestOptions)
493
651
  # @return [WorkOS::ConnectedAccount]
494
652
  def create_organization_connected_account(
495
653
  organization_id:,
496
654
  slug:,
655
+ user_id:,
656
+ account_display_name: WorkOS::OMIT,
657
+ account_identifier: WorkOS::OMIT,
497
658
  access_token: nil,
498
659
  refresh_token: nil,
499
660
  expires_at: nil,
500
661
  scopes: nil,
501
662
  state: nil,
663
+ connection_intent: nil,
502
664
  request_options: {}
503
665
  )
504
666
  body = {
@@ -506,8 +668,12 @@ module WorkOS
506
668
  "refresh_token" => refresh_token,
507
669
  "expires_at" => expires_at,
508
670
  "scopes" => scopes,
509
- "state" => state
671
+ "state" => state,
672
+ "user_id" => user_id,
673
+ "connection_intent" => connection_intent
510
674
  }.compact
675
+ body["account_display_name"] = account_display_name unless account_display_name.equal?(WorkOS::OMIT)
676
+ body["account_identifier"] = account_identifier unless account_identifier.equal?(WorkOS::OMIT)
511
677
  response = @client.request(
512
678
  method: :post,
513
679
  path: "/organizations/#{WorkOS::Util.encode_path(organization_id)}/connected_accounts/#{WorkOS::Util.encode_path(slug)}",
@@ -523,18 +689,25 @@ module WorkOS
523
689
  # Update an organization connected account
524
690
  # @param organization_id [String] An [Organization](https://workos.com/docs/reference/organization) identifier.
525
691
  # @param slug [String] The slug identifier of the provider (e.g., `github`, `slack`, `notion`).
692
+ # @param account_display_name [String, nil] A mutable, non-unique connection label; null clears it. Not an account identifier.
693
+ # @param account_identifier [String, nil] A developer-attested account identifier; null clears it.
526
694
  # @param access_token [String, nil] The OAuth access token for the connected account.
527
695
  # @param refresh_token [String, nil] The OAuth refresh token for the connected account.
528
696
  # @param expires_at [String, nil] The ISO-8601 timestamp when the access token expires. Required when `access_token` is provided for tokens that expire.
529
697
  # @param scopes [Array<String>, nil] The OAuth scopes granted for this connection.
530
- # @param state [WorkOS::Types::ConnectedAccountInputState, nil] Explicitly set the state of the connected account. When omitted, the state is derived from the token combination provided.
531
- # @param supports_multiple_connections [Boolean, nil] Set to `true` to use the plural connection contract. When omitted or `false`, only the compatibility connection is considered.
698
+ # @param state [WorkOS::Types::OrganizationConnectedAccountState, nil] Explicitly set the state of the connected account. When omitted, the state is derived from the token combination provided.
699
+ # @param user_id [String] The [User](https://workos.com/docs/reference/authkit/user) identifier of the organization member on whose behalf the connected account is being imported or updated. The user must be an active member of the organization.
700
+ # @param supports_multiple_connections [Boolean, nil] Accepted for compatibility; does not change update targeting. Omit intent and selector to update the compatibility connection, or supply `connected_account_id` to update an exact connection.
532
701
  # @param connected_account_id [String, nil] A [connected account](https://workos.com/docs/reference/pipes/connected-account) identifier. Use this to select the connection to update.
702
+ # @param connection_intent [String, nil] Set to `reauthorize` with `connected_account_id` to update one exact connection. The intent may be omitted when supplying an ID. Omit both for permanent compatibility behavior.
533
703
  # @param request_options [Hash] (see WorkOS::Types::RequestOptions)
534
704
  # @return [WorkOS::ConnectedAccount]
535
705
  def update_organization_connected_account(
536
706
  organization_id:,
537
707
  slug:,
708
+ user_id:,
709
+ account_display_name: WorkOS::OMIT,
710
+ account_identifier: WorkOS::OMIT,
538
711
  access_token: nil,
539
712
  refresh_token: nil,
540
713
  expires_at: nil,
@@ -542,19 +715,24 @@ module WorkOS
542
715
  state: nil,
543
716
  supports_multiple_connections: nil,
544
717
  connected_account_id: nil,
718
+ connection_intent: nil,
545
719
  request_options: {}
546
720
  )
547
721
  params = {
548
722
  "supports_multiple_connections" => supports_multiple_connections,
549
- "connected_account_id" => connected_account_id
723
+ "connected_account_id" => connected_account_id,
724
+ "connection_intent" => connection_intent
550
725
  }.compact
551
726
  body = {
552
727
  "access_token" => access_token,
553
728
  "refresh_token" => refresh_token,
554
729
  "expires_at" => expires_at,
555
730
  "scopes" => scopes,
556
- "state" => state
731
+ "state" => state,
732
+ "user_id" => user_id
557
733
  }.compact
734
+ body["account_display_name"] = account_display_name unless account_display_name.equal?(WorkOS::OMIT)
735
+ body["account_identifier"] = account_identifier unless account_identifier.equal?(WorkOS::OMIT)
558
736
  response = @client.request(
559
737
  method: :put,
560
738
  path: "/organizations/#{WorkOS::Util.encode_path(organization_id)}/connected_accounts/#{WorkOS::Util.encode_path(slug)}",
@@ -657,22 +835,28 @@ module WorkOS
657
835
  # Import a connected account
658
836
  # @param user_id [String] A [User](https://workos.com/docs/reference/authkit/user) identifier.
659
837
  # @param slug [String] The slug identifier of the provider (e.g., `github`, `slack`, `notion`).
838
+ # @param account_display_name [String, nil] A mutable, non-unique connection label; null clears it. Not an account identifier.
839
+ # @param account_identifier [String, nil] A developer-attested account identifier; null clears it.
660
840
  # @param access_token [String, nil] The OAuth access token for the connected account.
661
841
  # @param refresh_token [String, nil] The OAuth refresh token for the connected account.
662
842
  # @param expires_at [String, nil] The ISO-8601 timestamp when the access token expires. Required when `access_token` is provided for tokens that expire.
663
843
  # @param scopes [Array<String>, nil] The OAuth scopes granted for this connection.
664
- # @param state [WorkOS::Types::ConnectedAccountInputState, nil] Explicitly set the state of the connected account. When omitted, the state is derived from the token combination provided.
844
+ # @param state [WorkOS::Types::CreateConnectedAccountState, nil] Explicitly set the state of the connected account. When omitted, the state is derived from the token combination provided.
845
+ # @param connection_intent [String, nil] Set to `add` to create another connected account. Omit this field for permanent compatibility behavior.
665
846
  # @param organization_id [String, nil] An [Organization](https://workos.com/docs/reference/organization) identifier. Optional parameter if the connection is scoped to an organization.
666
847
  # @param request_options [Hash] (see WorkOS::Types::RequestOptions)
667
848
  # @return [WorkOS::ConnectedAccount]
668
849
  def create_user_connected_account(
669
850
  user_id:,
670
851
  slug:,
852
+ account_display_name: WorkOS::OMIT,
853
+ account_identifier: WorkOS::OMIT,
671
854
  access_token: nil,
672
855
  refresh_token: nil,
673
856
  expires_at: nil,
674
857
  scopes: nil,
675
858
  state: nil,
859
+ connection_intent: nil,
676
860
  organization_id: nil,
677
861
  request_options: {}
678
862
  )
@@ -684,8 +868,11 @@ module WorkOS
684
868
  "refresh_token" => refresh_token,
685
869
  "expires_at" => expires_at,
686
870
  "scopes" => scopes,
687
- "state" => state
871
+ "state" => state,
872
+ "connection_intent" => connection_intent
688
873
  }.compact
874
+ body["account_display_name"] = account_display_name unless account_display_name.equal?(WorkOS::OMIT)
875
+ body["account_identifier"] = account_identifier unless account_identifier.equal?(WorkOS::OMIT)
689
876
  response = @client.request(
690
877
  method: :post,
691
878
  path: "/user_management/users/#{WorkOS::Util.encode_path(user_id)}/connected_accounts/#{WorkOS::Util.encode_path(slug)}",
@@ -702,19 +889,24 @@ module WorkOS
702
889
  # Update a connected account
703
890
  # @param user_id [String] A [User](https://workos.com/docs/reference/authkit/user) identifier.
704
891
  # @param slug [String] The slug identifier of the provider (e.g., `github`, `slack`, `notion`).
892
+ # @param account_display_name [String, nil] A mutable, non-unique connection label; null clears it. Not an account identifier.
893
+ # @param account_identifier [String, nil] A developer-attested account identifier; null clears it.
705
894
  # @param access_token [String, nil] The OAuth access token for the connected account.
706
895
  # @param refresh_token [String, nil] The OAuth refresh token for the connected account.
707
896
  # @param expires_at [String, nil] The ISO-8601 timestamp when the access token expires. Required when `access_token` is provided for tokens that expire.
708
897
  # @param scopes [Array<String>, nil] The OAuth scopes granted for this connection.
709
898
  # @param state [WorkOS::Types::ConnectedAccountInputState, nil] Explicitly set the state of the connected account. When omitted, the state is derived from the token combination provided.
710
899
  # @param organization_id [String, nil] An [Organization](https://workos.com/docs/reference/organization) identifier. Optional parameter if the connection is scoped to an organization.
711
- # @param supports_multiple_connections [Boolean, nil] Set to `true` to use the plural connection contract. When omitted or `false`, only the compatibility connection is considered.
900
+ # @param supports_multiple_connections [Boolean, nil] Accepted for compatibility; does not change update targeting. Omit intent and selector to update the compatibility connection, or supply `connected_account_id` to update an exact connection.
712
901
  # @param connected_account_id [String, nil] A [connected account](https://workos.com/docs/reference/pipes/connected-account) identifier. Use this to select the connection to update.
902
+ # @param connection_intent [String, nil] Set to `reauthorize` with `connected_account_id` to update one exact connection. The intent may be omitted when supplying an ID. Omit both for permanent compatibility behavior.
713
903
  # @param request_options [Hash] (see WorkOS::Types::RequestOptions)
714
904
  # @return [WorkOS::ConnectedAccount]
715
905
  def update_user_connected_account(
716
906
  user_id:,
717
907
  slug:,
908
+ account_display_name: WorkOS::OMIT,
909
+ account_identifier: WorkOS::OMIT,
718
910
  access_token: nil,
719
911
  refresh_token: nil,
720
912
  expires_at: nil,
@@ -723,12 +915,14 @@ module WorkOS
723
915
  organization_id: nil,
724
916
  supports_multiple_connections: nil,
725
917
  connected_account_id: nil,
918
+ connection_intent: nil,
726
919
  request_options: {}
727
920
  )
728
921
  params = {
729
922
  "organization_id" => organization_id,
730
923
  "supports_multiple_connections" => supports_multiple_connections,
731
- "connected_account_id" => connected_account_id
924
+ "connected_account_id" => connected_account_id,
925
+ "connection_intent" => connection_intent
732
926
  }.compact
733
927
  body = {
734
928
  "access_token" => access_token,
@@ -737,6 +931,8 @@ module WorkOS
737
931
  "scopes" => scopes,
738
932
  "state" => state
739
933
  }.compact
934
+ body["account_display_name"] = account_display_name unless account_display_name.equal?(WorkOS::OMIT)
935
+ body["account_identifier"] = account_identifier unless account_identifier.equal?(WorkOS::OMIT)
740
936
  response = @client.request(
741
937
  method: :put,
742
938
  path: "/user_management/users/#{WorkOS::Util.encode_path(user_id)}/connected_accounts/#{WorkOS::Util.encode_path(slug)}",
@@ -0,0 +1,22 @@
1
+ # frozen_string_literal: true
2
+
3
+ # This file is auto-generated by oagen. Do not edit.
4
+
5
+ module WorkOS
6
+ class AccessDeniedOAuthErrorBody < WorkOS::Types::BaseModel
7
+ HASH_ATTRS = {
8
+ error: :error,
9
+ error_description: :error_description
10
+ }.freeze
11
+
12
+ attr_accessor \
13
+ :error,
14
+ :error_description
15
+
16
+ def initialize(json)
17
+ hash = self.class.normalize(json)
18
+ @error = hash[:error]
19
+ @error_description = hash[:error_description]
20
+ end
21
+ end
22
+ end
@@ -0,0 +1,7 @@
1
+ # frozen_string_literal: true
2
+
3
+ # This file is auto-generated by oagen. Do not edit.
4
+
5
+ module WorkOS
6
+ AccountSelectionRequiredErrorBody = AccountSelectionRequiredError
7
+ end
@@ -11,6 +11,7 @@ module WorkOS
11
11
  description: :description,
12
12
  permissions: :permissions,
13
13
  invocable_by: :invocable_by,
14
+ invocable_as: :invocable_as,
14
15
  session_settings: :session_settings,
15
16
  created_at: :created_at,
16
17
  updated_at: :updated_at
@@ -23,6 +24,7 @@ module WorkOS
23
24
  :description,
24
25
  :permissions,
25
26
  :invocable_by,
27
+ :invocable_as,
26
28
  :session_settings,
27
29
  :created_at,
28
30
  :updated_at
@@ -35,6 +37,7 @@ module WorkOS
35
37
  @description = hash[:description]
36
38
  @permissions = hash[:permissions] || []
37
39
  @invocable_by = hash[:invocable_by] ? WorkOS::AgentBlueprintCreatedDataInvocableBy.new(hash[:invocable_by]) : nil
40
+ @invocable_as = hash[:invocable_as] ? WorkOS::AgentBlueprintCreatedDataInvocableAs.new(hash[:invocable_as]) : nil
38
41
  @session_settings = hash[:session_settings] ? WorkOS::AgentBlueprintCreatedDataSessionSetting.new(hash[:session_settings]) : nil
39
42
  @created_at = hash[:created_at]
40
43
  @updated_at = hash[:updated_at]
@@ -0,0 +1,18 @@
1
+ # frozen_string_literal: true
2
+
3
+ # This file is auto-generated by oagen. Do not edit.
4
+
5
+ module WorkOS
6
+ class AgentBlueprintCreatedDataInvocableAs < WorkOS::Types::BaseModel
7
+ HASH_ATTRS = {
8
+ instance_types: :instance_types
9
+ }.freeze
10
+
11
+ attr_accessor :instance_types
12
+
13
+ def initialize(json)
14
+ hash = self.class.normalize(json)
15
+ @instance_types = hash[:instance_types] || []
16
+ end
17
+ end
18
+ end
@@ -3,5 +3,44 @@
3
3
  # This file is auto-generated by oagen. Do not edit.
4
4
 
5
5
  module WorkOS
6
- AgentBlueprintUpdatedData = AgentBlueprintCreatedData
6
+ class AgentBlueprintUpdatedData < WorkOS::Types::BaseModel
7
+ HASH_ATTRS = {
8
+ object: :object,
9
+ id: :id,
10
+ name: :name,
11
+ description: :description,
12
+ permissions: :permissions,
13
+ invocable_by: :invocable_by,
14
+ invocable_as: :invocable_as,
15
+ session_settings: :session_settings,
16
+ created_at: :created_at,
17
+ updated_at: :updated_at
18
+ }.freeze
19
+
20
+ attr_accessor \
21
+ :object,
22
+ :id,
23
+ :name,
24
+ :description,
25
+ :permissions,
26
+ :invocable_by,
27
+ :invocable_as,
28
+ :session_settings,
29
+ :created_at,
30
+ :updated_at
31
+
32
+ def initialize(json)
33
+ hash = self.class.normalize(json)
34
+ @object = hash[:object]
35
+ @id = hash[:id]
36
+ @name = hash[:name]
37
+ @description = hash[:description]
38
+ @permissions = hash[:permissions] || []
39
+ @invocable_by = hash[:invocable_by] ? WorkOS::AgentBlueprintUpdatedDataInvocableBy.new(hash[:invocable_by]) : nil
40
+ @invocable_as = hash[:invocable_as] ? WorkOS::AgentBlueprintUpdatedDataInvocableAs.new(hash[:invocable_as]) : nil
41
+ @session_settings = hash[:session_settings] ? WorkOS::AgentBlueprintUpdatedDataSessionSetting.new(hash[:session_settings]) : nil
42
+ @created_at = hash[:created_at]
43
+ @updated_at = hash[:updated_at]
44
+ end
45
+ end
7
46
  end
@@ -0,0 +1,18 @@
1
+ # frozen_string_literal: true
2
+
3
+ # This file is auto-generated by oagen. Do not edit.
4
+
5
+ module WorkOS
6
+ class AgentBlueprintUpdatedDataInvocableAs < WorkOS::Types::BaseModel
7
+ HASH_ATTRS = {
8
+ instance_types: :instance_types
9
+ }.freeze
10
+
11
+ attr_accessor :instance_types
12
+
13
+ def initialize(json)
14
+ hash = self.class.normalize(json)
15
+ @instance_types = hash[:instance_types] || []
16
+ end
17
+ end
18
+ end
@@ -0,0 +1,22 @@
1
+ # frozen_string_literal: true
2
+
3
+ # This file is auto-generated by oagen. Do not edit.
4
+
5
+ module WorkOS
6
+ class AlreadyClaimedErrorBody < WorkOS::Types::BaseModel
7
+ HASH_ATTRS = {
8
+ code: :code,
9
+ message: :message
10
+ }.freeze
11
+
12
+ attr_accessor \
13
+ :code,
14
+ :message
15
+
16
+ def initialize(json)
17
+ hash = self.class.normalize(json)
18
+ @code = hash[:code]
19
+ @message = hash[:message]
20
+ end
21
+ end
22
+ end
@@ -0,0 +1,22 @@
1
+ # frozen_string_literal: true
2
+
3
+ # This file is auto-generated by oagen. Do not edit.
4
+
5
+ module WorkOS
6
+ class ApplicationConsentRequiredErrorBody < WorkOS::Types::BaseModel
7
+ HASH_ATTRS = {
8
+ code: :code,
9
+ message: :message
10
+ }.freeze
11
+
12
+ attr_accessor \
13
+ :code,
14
+ :message
15
+
16
+ def initialize(json)
17
+ hash = self.class.normalize(json)
18
+ @code = hash[:code]
19
+ @message = hash[:message]
20
+ end
21
+ end
22
+ end