workos 10.4.0 → 10.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 (159) 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 +1 -1
  6. data/.github/workflows/release.yml +1 -1
  7. data/.last-synced-sha +1 -1
  8. data/.oagen-manifest.json +92 -2
  9. data/.release-please-manifest.json +1 -1
  10. data/.ruby-version +1 -1
  11. data/CHANGELOG.md +214 -0
  12. data/Gemfile.lock +2 -2
  13. data/lib/workos/admin_portal/generate_link.rb +3 -0
  14. data/lib/workos/admin_portal/revoke_link.rb +22 -0
  15. data/lib/workos/admin_portal.rb +27 -0
  16. data/lib/workos/agents/agent_blueprint.rb +3 -0
  17. data/lib/workos/agents/agent_blueprint_invocable_as.rb +18 -0
  18. data/lib/workos/agents/agent_blueprints_create_request.rb +3 -0
  19. data/lib/workos/agents/agent_blueprints_create_request_invocable_as.rb +18 -0
  20. data/lib/workos/agents/agent_blueprints_update_request.rb +3 -0
  21. data/lib/workos/agents/agent_blueprints_update_request_invocable_as.rb +18 -0
  22. data/lib/workos/agents/agent_registration.rb +3 -0
  23. data/lib/workos/agents.rb +25 -0
  24. data/lib/workos/authorization/user_role_assignment_source.rb +5 -2
  25. data/lib/workos/authorization/user_role_assignment_source_group.rb +7 -0
  26. data/lib/workos/directory_sync/directory_sync_rate_limit_error.rb +25 -0
  27. data/lib/workos/directory_sync/directory_sync_response.rb +18 -0
  28. data/lib/workos/directory_sync.rb +19 -0
  29. data/lib/workos/feature_flags/flag_updated_context_previous_attribute_data.rb +3 -0
  30. data/lib/workos/feature_flags/flag_updated_context_previous_attribute_data_owner.rb +7 -0
  31. data/lib/workos/pipes/add_data_integrations_get_data_integration_authorize_url_request.rb +37 -0
  32. data/lib/workos/pipes/connected_account.rb +6 -0
  33. data/lib/workos/pipes/connected_account_input.rb +6 -0
  34. data/lib/workos/pipes/connected_account_write_response.rb +73 -0
  35. data/lib/workos/pipes/connected_account_write_response_warning.rb +22 -0
  36. data/lib/workos/pipes/create_connected_account.rb +40 -0
  37. data/lib/workos/pipes/create_organization_connected_account.rb +43 -0
  38. data/lib/workos/pipes/data_integration_credentials_response.rb +1 -1
  39. data/lib/workos/pipes/{data_integration_credentials_response_credential.rb → data_integration_vended_credential.rb} +9 -3
  40. data/lib/workos/pipes/data_integrations_create_api_key_connection_request.rb +37 -0
  41. data/lib/workos/pipes/data_integrations_create_client_credentials_connection_request.rb +43 -0
  42. data/lib/workos/pipes/data_integrations_get_data_integration_authorize_url_request.rb +3 -0
  43. data/lib/workos/pipes/data_integrations_list_response_data_connected_account.rb +6 -0
  44. data/lib/workos/pipes/data_integrations_upsert_api_key_request.rb +6 -3
  45. data/lib/workos/pipes/data_integrations_upsert_api_key_request_2.rb +37 -0
  46. data/lib/workos/pipes/data_integrations_upsert_client_credentials_request.rb +6 -3
  47. data/lib/workos/pipes/data_integrations_upsert_client_credentials_request_2.rb +43 -0
  48. data/lib/workos/pipes/organization_connected_account.rb +40 -0
  49. data/lib/workos/pipes/reauthorize_data_integrations_get_data_integration_authorize_url_request.rb +40 -0
  50. data/lib/workos/pipes/reauthorize_data_integrations_upsert_api_key_request.rb +40 -0
  51. data/lib/workos/pipes/reauthorize_data_integrations_upsert_client_credentials_request.rb +46 -0
  52. data/lib/workos/pipes.rb +192 -31
  53. data/lib/workos/shared/agent_blueprint_created_data.rb +3 -0
  54. data/lib/workos/shared/agent_blueprint_created_data_invocable_as.rb +18 -0
  55. data/lib/workos/shared/agent_blueprint_updated_data.rb +40 -1
  56. data/lib/workos/shared/agent_blueprint_updated_data_invocable_as.rb +18 -0
  57. data/lib/workos/shared/pipe_connected_account.rb +6 -0
  58. data/lib/workos/sso/token_query.rb +3 -0
  59. data/lib/workos/sso.rb +3 -0
  60. data/lib/workos/types/add_data_integrations_get_data_integration_authorize_url_request_connection_owner.rb +13 -0
  61. data/lib/workos/types/agent_blueprint_created_data_invocable_as_instance_types.rb +13 -0
  62. data/lib/workos/types/agent_blueprint_invocable_as_instance_types.rb +9 -0
  63. data/lib/workos/types/agent_blueprint_updated_data_invocable_as_instance_types.rb +9 -0
  64. data/lib/workos/types/agent_blueprints_create_request_invocable_as_instance_types.rb +9 -0
  65. data/lib/workos/types/agent_blueprints_update_request_invocable_as_instance_types.rb +9 -0
  66. data/lib/workos/types/agent_instance_created_data_type.rb +1 -5
  67. data/lib/workos/types/agent_instance_deleted_data_type.rb +1 -1
  68. data/lib/workos/types/agent_instance_type.rb +1 -1
  69. data/lib/workos/types/connected_account_write_response_auth_method.rb +9 -0
  70. data/lib/workos/types/connected_account_write_response_connection_role.rb +9 -0
  71. data/lib/workos/types/connected_account_write_response_state.rb +9 -0
  72. data/lib/workos/types/create_connected_account_state.rb +9 -0
  73. data/lib/workos/types/create_data_integration_ownership.rb +1 -5
  74. data/lib/workos/types/create_organization_connected_account_state.rb +9 -0
  75. data/lib/workos/types/data_integration_ownership.rb +1 -1
  76. data/lib/workos/types/data_integrations_create_api_key_connection_request_connection_owner.rb +9 -0
  77. data/lib/workos/types/data_integrations_create_client_credentials_connection_request_connection_owner.rb +9 -0
  78. data/lib/workos/types/data_integrations_get_data_integration_authorize_url_request_connection_owner.rb +1 -1
  79. data/lib/workos/types/data_integrations_get_user_token_request_connection_owner.rb +1 -1
  80. data/lib/workos/types/data_integrations_list_response_data_connection_owner.rb +1 -1
  81. data/lib/workos/types/data_integrations_upsert_api_key_request_2_connection_owner.rb +9 -0
  82. data/lib/workos/types/data_integrations_upsert_api_key_request_connection_owner.rb +1 -1
  83. data/lib/workos/types/data_integrations_upsert_client_credentials_request_2_connection_owner.rb +9 -0
  84. data/lib/workos/types/data_integrations_upsert_client_credentials_request_connection_owner.rb +1 -1
  85. data/lib/workos/types/data_integrations_vend_credentials_request_connection_owner.rb +1 -1
  86. data/lib/workos/types/organization_connected_account_state.rb +9 -0
  87. data/lib/workos/types/pipes_ownership.rb +1 -1
  88. data/lib/workos/types/reauthorize_data_integrations_get_data_integration_authorize_url_request_connection_owner.rb +9 -0
  89. data/lib/workos/types/reauthorize_data_integrations_upsert_api_key_request_connection_owner.rb +9 -0
  90. data/lib/workos/types/reauthorize_data_integrations_upsert_client_credentials_request_connection_owner.rb +9 -0
  91. data/lib/workos/types/resource_export_completed_data_resource_type.rb +2 -1
  92. data/lib/workos/types/vault_dek_rekeyed_data_actor_source.rb +9 -0
  93. data/lib/workos/user_management.rb +1 -1
  94. data/lib/workos/vault/vault_dek_rekeyed.rb +34 -0
  95. data/lib/workos/vault/vault_dek_rekeyed_data.rb +31 -0
  96. data/lib/workos/version.rb +1 -1
  97. data/rbi/workos/add_data_integrations_get_data_integration_authorize_url_request.rbi +60 -0
  98. data/rbi/workos/admin_portal.rbi +11 -1
  99. data/rbi/workos/agent_blueprint.rbi +6 -0
  100. data/rbi/workos/agent_blueprint_created_data.rbi +6 -0
  101. data/rbi/workos/agent_blueprint_created_data_invocable_as.rbi +24 -0
  102. data/rbi/workos/agent_blueprint_invocable_as.rbi +24 -0
  103. data/rbi/workos/agent_blueprint_updated_data.rbi +6 -0
  104. data/rbi/workos/agent_blueprint_updated_data_invocable_as.rbi +24 -0
  105. data/rbi/workos/agent_blueprints_create_request.rbi +6 -0
  106. data/rbi/workos/agent_blueprints_create_request_invocable_as.rbi +24 -0
  107. data/rbi/workos/agent_blueprints_update_request.rbi +6 -0
  108. data/rbi/workos/agent_blueprints_update_request_invocable_as.rbi +24 -0
  109. data/rbi/workos/agent_registration.rbi +6 -0
  110. data/rbi/workos/agents.rbi +12 -2
  111. data/rbi/workos/connected_account.rbi +12 -0
  112. data/rbi/workos/connected_account_input.rbi +12 -0
  113. data/rbi/workos/connected_account_write_response.rbi +132 -0
  114. data/rbi/workos/connected_account_write_response_warning.rbi +30 -0
  115. data/rbi/workos/create_connected_account.rbi +66 -0
  116. data/rbi/workos/create_organization_connected_account.rbi +72 -0
  117. data/rbi/workos/data_integration_credentials_response.rbi +2 -2
  118. data/rbi/workos/data_integration_vended_credential.rbi +66 -0
  119. data/rbi/workos/data_integrations_create_api_key_connection_request.rbi +60 -0
  120. data/rbi/workos/data_integrations_create_client_credentials_connection_request.rbi +72 -0
  121. data/rbi/workos/data_integrations_get_data_integration_authorize_url_request.rbi +6 -0
  122. data/rbi/workos/data_integrations_list_response_data_connected_account.rbi +12 -0
  123. data/rbi/workos/data_integrations_upsert_api_key_request.rbi +12 -6
  124. data/rbi/workos/data_integrations_upsert_api_key_request_2.rbi +60 -0
  125. data/rbi/workos/data_integrations_upsert_client_credentials_request.rbi +12 -6
  126. data/rbi/workos/data_integrations_upsert_client_credentials_request_2.rbi +72 -0
  127. data/rbi/workos/directory_sync.rbi +8 -0
  128. data/rbi/workos/directory_sync_rate_limit_error.rbi +36 -0
  129. data/rbi/workos/directory_sync_response.rbi +24 -0
  130. data/rbi/workos/flag_updated_context_previous_attribute_data.rbi +6 -0
  131. data/rbi/workos/flag_updated_context_previous_attribute_data_owner.rbi +36 -0
  132. data/rbi/workos/generate_link.rbi +6 -0
  133. data/rbi/workos/organization_connected_account.rbi +66 -0
  134. data/rbi/workos/pipe_connected_account.rbi +12 -0
  135. data/rbi/workos/pipes.rbi +64 -15
  136. data/rbi/workos/reauthorize_data_integrations_get_data_integration_authorize_url_request.rbi +66 -0
  137. data/rbi/workos/reauthorize_data_integrations_upsert_api_key_request.rbi +66 -0
  138. data/rbi/workos/reauthorize_data_integrations_upsert_client_credentials_request.rbi +78 -0
  139. data/rbi/workos/revoke_link.rbi +30 -0
  140. data/rbi/workos/sso.rbi +2 -1
  141. data/rbi/workos/token_query.rbi +6 -0
  142. data/rbi/workos/user_role_assignment_source.rbi +6 -0
  143. data/rbi/workos/user_role_assignment_source_group.rbi +30 -0
  144. data/rbi/workos/vault_dek_rekeyed.rbi +54 -0
  145. data/rbi/workos/{data_integration_credentials_response_credential.rbi → vault_dek_rekeyed_data.rbi} +13 -19
  146. data/test/workos/test_admin_portal.rb +9 -1
  147. data/test/workos/test_admin_portal_model_round_trip.rb +14 -0
  148. data/test/workos/test_agents.rb +8 -0
  149. data/test/workos/test_agents_model_round_trip.rb +35 -0
  150. data/test/workos/test_authorization_model_round_trip.rb +15 -1
  151. data/test/workos/test_directory_sync.rb +8 -0
  152. data/test/workos/test_directory_sync_model_round_trip.rb +24 -0
  153. data/test/workos/test_feature_flags_model_round_trip.rb +16 -0
  154. data/test/workos/test_pipes.rb +20 -4
  155. data/test/workos/test_pipes_model_round_trip.rb +284 -15
  156. data/test/workos/test_shared_model_round_trip.rb +30 -6
  157. data/test/workos/test_sso_model_round_trip.rb +1 -0
  158. data/test/workos/test_vault_model_round_trip.rb +33 -0
  159. metadata +73 -3
@@ -0,0 +1,40 @@
1
+ # frozen_string_literal: true
2
+
3
+ # This file is auto-generated by oagen. Do not edit.
4
+
5
+ module WorkOS
6
+ class OrganizationConnectedAccount < WorkOS::Types::BaseModel
7
+ HASH_ATTRS = {
8
+ account_display_name: :account_display_name,
9
+ account_identifier: :account_identifier,
10
+ access_token: :access_token,
11
+ refresh_token: :refresh_token,
12
+ expires_at: :expires_at,
13
+ scopes: :scopes,
14
+ state: :state,
15
+ user_id: :user_id
16
+ }.freeze
17
+
18
+ attr_accessor \
19
+ :account_display_name,
20
+ :account_identifier,
21
+ :access_token,
22
+ :refresh_token,
23
+ :expires_at,
24
+ :scopes,
25
+ :state,
26
+ :user_id
27
+
28
+ def initialize(json)
29
+ hash = self.class.normalize(json)
30
+ @account_display_name = hash[:account_display_name]
31
+ @account_identifier = hash[:account_identifier]
32
+ @access_token = hash[:access_token]
33
+ @refresh_token = hash[:refresh_token]
34
+ @expires_at = hash[:expires_at]
35
+ @scopes = hash[:scopes] || []
36
+ @state = hash[:state]
37
+ @user_id = hash[:user_id]
38
+ end
39
+ end
40
+ end
@@ -0,0 +1,40 @@
1
+ # frozen_string_literal: true
2
+
3
+ # This file is auto-generated by oagen. Do not edit.
4
+
5
+ module WorkOS
6
+ class ReauthorizeDataIntegrationsGetDataIntegrationAuthorizeUrlRequest < WorkOS::Types::BaseModel
7
+ HASH_ATTRS = {
8
+ account_display_name: :account_display_name,
9
+ user_id: :user_id,
10
+ organization_id: :organization_id,
11
+ connection_owner: :connection_owner,
12
+ return_to: :return_to,
13
+ config: :config,
14
+ connection_intent: :connection_intent,
15
+ connected_account_id: :connected_account_id
16
+ }.freeze
17
+
18
+ attr_accessor \
19
+ :account_display_name,
20
+ :user_id,
21
+ :organization_id,
22
+ :connection_owner,
23
+ :return_to,
24
+ :config,
25
+ :connection_intent,
26
+ :connected_account_id
27
+
28
+ def initialize(json)
29
+ hash = self.class.normalize(json)
30
+ @account_display_name = hash[:account_display_name]
31
+ @user_id = hash[:user_id]
32
+ @organization_id = hash[:organization_id]
33
+ @connection_owner = hash[:connection_owner]
34
+ @return_to = hash[:return_to]
35
+ @config = hash[:config] || {}
36
+ @connection_intent = hash[:connection_intent]
37
+ @connected_account_id = hash[:connected_account_id]
38
+ end
39
+ end
40
+ end
@@ -0,0 +1,40 @@
1
+ # frozen_string_literal: true
2
+
3
+ # This file is auto-generated by oagen. Do not edit.
4
+
5
+ module WorkOS
6
+ class ReauthorizeDataIntegrationsUpsertApiKeyRequest < WorkOS::Types::BaseModel
7
+ HASH_ATTRS = {
8
+ account_display_name: :account_display_name,
9
+ account_identifier: :account_identifier,
10
+ user_id: :user_id,
11
+ organization_id: :organization_id,
12
+ connection_owner: :connection_owner,
13
+ secret: :secret,
14
+ connection_intent: :connection_intent,
15
+ connected_account_id: :connected_account_id
16
+ }.freeze
17
+
18
+ attr_accessor \
19
+ :account_display_name,
20
+ :account_identifier,
21
+ :user_id,
22
+ :organization_id,
23
+ :connection_owner,
24
+ :secret,
25
+ :connection_intent,
26
+ :connected_account_id
27
+
28
+ def initialize(json)
29
+ hash = self.class.normalize(json)
30
+ @account_display_name = hash[:account_display_name]
31
+ @account_identifier = hash[:account_identifier]
32
+ @user_id = hash[:user_id]
33
+ @organization_id = hash[:organization_id]
34
+ @connection_owner = hash[:connection_owner]
35
+ @secret = hash[:secret]
36
+ @connection_intent = hash[:connection_intent]
37
+ @connected_account_id = hash[:connected_account_id]
38
+ end
39
+ end
40
+ end
@@ -0,0 +1,46 @@
1
+ # frozen_string_literal: true
2
+
3
+ # This file is auto-generated by oagen. Do not edit.
4
+
5
+ module WorkOS
6
+ class ReauthorizeDataIntegrationsUpsertClientCredentialsRequest < WorkOS::Types::BaseModel
7
+ HASH_ATTRS = {
8
+ account_display_name: :account_display_name,
9
+ account_identifier: :account_identifier,
10
+ user_id: :user_id,
11
+ organization_id: :organization_id,
12
+ connection_owner: :connection_owner,
13
+ client_id: :client_id,
14
+ client_secret: :client_secret,
15
+ config: :config,
16
+ connection_intent: :connection_intent,
17
+ connected_account_id: :connected_account_id
18
+ }.freeze
19
+
20
+ attr_accessor \
21
+ :account_display_name,
22
+ :account_identifier,
23
+ :user_id,
24
+ :organization_id,
25
+ :connection_owner,
26
+ :client_id,
27
+ :client_secret,
28
+ :config,
29
+ :connection_intent,
30
+ :connected_account_id
31
+
32
+ def initialize(json)
33
+ hash = self.class.normalize(json)
34
+ @account_display_name = hash[:account_display_name]
35
+ @account_identifier = hash[:account_identifier]
36
+ @user_id = hash[:user_id]
37
+ @organization_id = hash[:organization_id]
38
+ @connection_owner = hash[:connection_owner]
39
+ @client_id = hash[:client_id]
40
+ @client_secret = hash[:client_secret]
41
+ @config = hash[:config] || {}
42
+ @connection_intent = hash[:connection_intent]
43
+ @connected_account_id = hash[:connected_account_id]
44
+ end
45
+ end
46
+ end
data/lib/workos/pipes.rb CHANGED
@@ -184,31 +184,83 @@ module WorkOS
184
184
  nil
185
185
  end
186
186
 
187
+ # Create another API key connected account
188
+ # @param slug [String] The identifier of the integration.
189
+ # @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.
190
+ # @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.
191
+ # @param user_id [String] A [User](https://workos.com/docs/reference/authkit/user) identifier.
192
+ # @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`.
193
+ # @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.
194
+ # @param secret [String] The API key secret to store for this integration.
195
+ # @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. Creating an additional connection is not yet available: until it is, `add` succeeds only when the owner has no connection for this integration and otherwise returns 404 `multiple_connections_unavailable`.
196
+ # @param request_options [Hash] (see WorkOS::Types::RequestOptions)
197
+ # @return [WorkOS::ConnectedAccountWriteResponse]
198
+ def create_data_integration_api_key(
199
+ slug:,
200
+ user_id:,
201
+ secret:,
202
+ connection_intent:,
203
+ account_display_name: WorkOS::OMIT,
204
+ account_identifier: WorkOS::OMIT,
205
+ organization_id: nil,
206
+ connection_owner: nil,
207
+ request_options: {}
208
+ )
209
+ body = {
210
+ "user_id" => user_id,
211
+ "organization_id" => organization_id,
212
+ "connection_owner" => connection_owner,
213
+ "secret" => secret,
214
+ "connection_intent" => connection_intent
215
+ }.compact
216
+ body["account_display_name"] = account_display_name unless account_display_name.equal?(WorkOS::OMIT)
217
+ body["account_identifier"] = account_identifier unless account_identifier.equal?(WorkOS::OMIT)
218
+ response = @client.request(
219
+ method: :post,
220
+ path: "/data-integrations/#{WorkOS::Util.encode_path(slug)}/api-key",
221
+ auth: true,
222
+ body: body,
223
+ request_options: request_options
224
+ )
225
+ result = WorkOS::ConnectedAccountWriteResponse.new(response.body)
226
+ 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"])
227
+ result
228
+ end
229
+
187
230
  # Upsert an API key for a connected account
188
231
  # @param slug [String] The identifier of the integration.
232
+ # @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.
233
+ # @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
234
  # @param user_id [String] A [User](https://workos.com/docs/reference/authkit/user) identifier.
190
235
  # @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
236
  # @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
237
  # @param secret [String] The API key secret to store for this integration.
238
+ # @param connection_intent [String, nil] Reauthorize exactly the connection named by `connected_account_id`.
239
+ # @param connected_account_id [String, nil] The exact connected account to reauthorize. Required with `connection_intent: reauthorize`.
194
240
  # @param request_options [Hash] (see WorkOS::Types::RequestOptions)
195
- # @return [WorkOS::ConnectedAccount]
241
+ # @return [WorkOS::ConnectedAccountWriteResponse]
196
242
  def update_data_integration_api_key(
197
243
  slug:,
198
244
  user_id:,
199
245
  secret:,
246
+ account_display_name: WorkOS::OMIT,
247
+ account_identifier: WorkOS::OMIT,
200
248
  organization_id: nil,
201
- connected_account_id: nil,
202
249
  connection_owner: nil,
250
+ connection_intent: nil,
251
+ connected_account_id: nil,
203
252
  request_options: {}
204
253
  )
205
254
  body = {
206
255
  "user_id" => user_id,
207
256
  "organization_id" => organization_id,
208
- "connected_account_id" => connected_account_id,
209
257
  "connection_owner" => connection_owner,
210
- "secret" => secret
258
+ "secret" => secret,
259
+ "connection_intent" => connection_intent,
260
+ "connected_account_id" => connected_account_id
211
261
  }.compact
262
+ body["account_display_name"] = account_display_name unless account_display_name.equal?(WorkOS::OMIT)
263
+ body["account_identifier"] = account_identifier unless account_identifier.equal?(WorkOS::OMIT)
212
264
  response = @client.request(
213
265
  method: :put,
214
266
  path: "/data-integrations/#{WorkOS::Util.encode_path(slug)}/api-key",
@@ -216,27 +268,33 @@ module WorkOS
216
268
  body: body,
217
269
  request_options: request_options
218
270
  )
219
- result = WorkOS::ConnectedAccount.new(response.body)
271
+ result = WorkOS::ConnectedAccountWriteResponse.new(response.body)
220
272
  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"])
221
273
  result
222
274
  end
223
275
 
224
276
  # Get authorization URL
225
277
  # @param slug [String] The slug identifier of the provider (e.g., `github`, `slack`, `notion`).
278
+ # @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
279
  # @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
280
  # @param organization_id [String, nil] An organization ID to scope the authorization to a specific organization. Required when `connection_owner` is `organization`.
228
281
  # @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
282
  # @param return_to [String, nil] The URL to redirect the user to after authorization.
230
283
  # @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.
284
+ # @param connection_intent [String, nil] Create another connection. The first connection for an owner shape fills the compatibility slot; later connections are standard. Creating an additional connection is not yet available: until it is, `add` succeeds only when the owner has no connection for this integration and otherwise returns 404 `multiple_connections_unavailable`. Omit `connection_intent` to use the compatibility connection, or send `reauthorize` with `connected_account_id` to reauthorize one exact connection.
285
+ # @param connected_account_id [String, nil] The exact connected account to reauthorize. Required with `connection_intent: reauthorize`.
231
286
  # @param request_options [Hash] (see WorkOS::Types::RequestOptions)
232
287
  # @return [WorkOS::DataIntegrationAuthorizeUrlResponse]
233
288
  def authorize_data_integration(
234
289
  slug:,
235
290
  user_id:,
291
+ account_display_name: WorkOS::OMIT,
236
292
  organization_id: nil,
237
293
  connection_owner: nil,
238
294
  return_to: nil,
239
295
  config: nil,
296
+ connection_intent: nil,
297
+ connected_account_id: nil,
240
298
  request_options: {}
241
299
  )
242
300
  body = {
@@ -244,8 +302,11 @@ module WorkOS
244
302
  "organization_id" => organization_id,
245
303
  "connection_owner" => connection_owner,
246
304
  "return_to" => return_to,
247
- "config" => config
305
+ "config" => config,
306
+ "connection_intent" => connection_intent,
307
+ "connected_account_id" => connected_account_id
248
308
  }.compact
309
+ body["account_display_name"] = account_display_name unless account_display_name.equal?(WorkOS::OMIT)
249
310
  response = @client.request(
250
311
  method: :post,
251
312
  path: "/data-integrations/#{WorkOS::Util.encode_path(slug)}/authorize",
@@ -258,37 +319,95 @@ module WorkOS
258
319
  result
259
320
  end
260
321
 
322
+ # Create another client credentials connected account
323
+ # @param slug [String] The identifier of the integration.
324
+ # @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.
325
+ # @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.
326
+ # @param user_id [String] A [User](https://workos.com/docs/reference/authkit/user) identifier.
327
+ # @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`.
328
+ # @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.
329
+ # @param client_id [String] The OAuth client ID to store for this integration.
330
+ # @param client_secret [String] The OAuth client secret to store for this integration.
331
+ # @param config [Hash{String => String}, nil] Provider-specific configuration values collected for this installation, keyed by the provider's config field descriptors.
332
+ # @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. Creating an additional connection is not yet available: until it is, `add` succeeds only when the owner has no connection for this integration and otherwise returns 404 `multiple_connections_unavailable`.
333
+ # @param request_options [Hash] (see WorkOS::Types::RequestOptions)
334
+ # @return [WorkOS::ConnectedAccountWriteResponse]
335
+ def create_data_integration_client_credential(
336
+ slug:,
337
+ user_id:,
338
+ client_id:,
339
+ client_secret:,
340
+ connection_intent:,
341
+ account_display_name: WorkOS::OMIT,
342
+ account_identifier: WorkOS::OMIT,
343
+ organization_id: nil,
344
+ connection_owner: nil,
345
+ config: nil,
346
+ request_options: {}
347
+ )
348
+ body = {
349
+ "user_id" => user_id,
350
+ "organization_id" => organization_id,
351
+ "connection_owner" => connection_owner,
352
+ "client_id" => client_id,
353
+ "client_secret" => client_secret,
354
+ "config" => config,
355
+ "connection_intent" => connection_intent
356
+ }.compact
357
+ body["account_display_name"] = account_display_name unless account_display_name.equal?(WorkOS::OMIT)
358
+ body["account_identifier"] = account_identifier unless account_identifier.equal?(WorkOS::OMIT)
359
+ response = @client.request(
360
+ method: :post,
361
+ path: "/data-integrations/#{WorkOS::Util.encode_path(slug)}/client-credentials",
362
+ auth: true,
363
+ body: body,
364
+ request_options: request_options
365
+ )
366
+ result = WorkOS::ConnectedAccountWriteResponse.new(response.body)
367
+ 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"])
368
+ result
369
+ end
370
+
261
371
  # Upsert client credentials for a connected account
262
372
  # @param slug [String] The identifier of the integration.
373
+ # @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.
374
+ # @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
375
  # @param user_id [String] A [User](https://workos.com/docs/reference/authkit/user) identifier.
264
376
  # @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
377
  # @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
378
  # @param client_id [String] The OAuth client ID to store for this integration.
268
379
  # @param client_secret [String] The OAuth client secret to store for this integration.
269
380
  # @param config [Hash{String => String}, nil] Provider-specific configuration values collected for this installation, keyed by the provider's config field descriptors.
381
+ # @param connection_intent [String, nil] Reauthorize exactly the connection named by `connected_account_id`.
382
+ # @param connected_account_id [String, nil] The exact connected account to reauthorize. Required with `connection_intent: reauthorize`.
270
383
  # @param request_options [Hash] (see WorkOS::Types::RequestOptions)
271
- # @return [WorkOS::ConnectedAccount]
384
+ # @return [WorkOS::ConnectedAccountWriteResponse]
272
385
  def update_data_integration_client_credentials(
273
386
  slug:,
274
387
  user_id:,
275
388
  client_id:,
276
389
  client_secret:,
390
+ account_display_name: WorkOS::OMIT,
391
+ account_identifier: WorkOS::OMIT,
277
392
  organization_id: nil,
278
- connected_account_id: nil,
279
393
  connection_owner: nil,
280
394
  config: nil,
395
+ connection_intent: nil,
396
+ connected_account_id: nil,
281
397
  request_options: {}
282
398
  )
283
399
  body = {
284
400
  "user_id" => user_id,
285
401
  "organization_id" => organization_id,
286
- "connected_account_id" => connected_account_id,
287
402
  "connection_owner" => connection_owner,
288
403
  "client_id" => client_id,
289
404
  "client_secret" => client_secret,
290
- "config" => config
405
+ "config" => config,
406
+ "connection_intent" => connection_intent,
407
+ "connected_account_id" => connected_account_id
291
408
  }.compact
409
+ body["account_display_name"] = account_display_name unless account_display_name.equal?(WorkOS::OMIT)
410
+ body["account_identifier"] = account_identifier unless account_identifier.equal?(WorkOS::OMIT)
292
411
  response = @client.request(
293
412
  method: :put,
294
413
  path: "/data-integrations/#{WorkOS::Util.encode_path(slug)}/client-credentials",
@@ -296,7 +415,7 @@ module WorkOS
296
415
  body: body,
297
416
  request_options: request_options
298
417
  )
299
- result = WorkOS::ConnectedAccount.new(response.body)
418
+ result = WorkOS::ConnectedAccountWriteResponse.new(response.body)
300
419
  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"])
301
420
  result
302
421
  end
@@ -484,21 +603,29 @@ module WorkOS
484
603
  # Import an organization connected account
485
604
  # @param organization_id [String] An [Organization](https://workos.com/docs/reference/organization) identifier.
486
605
  # @param slug [String] The slug identifier of the provider (e.g., `github`, `slack`, `notion`).
606
+ # @param account_display_name [String, nil] A mutable, non-unique connection label; null clears it. Not an account identifier.
607
+ # @param account_identifier [String, nil] A developer-attested account identifier; null clears it.
487
608
  # @param access_token [String, nil] The OAuth access token for the connected account.
488
609
  # @param refresh_token [String, nil] The OAuth refresh token for the connected account.
489
610
  # @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
611
  # @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.
612
+ # @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.
613
+ # @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.
614
+ # @param connection_intent [String, nil] Set to `add` to create another connected account. Omit this field for permanent compatibility behavior. Creating an additional connection is not yet available: until it is, `add` succeeds only when the owner has no connection for this integration, which creates the compatibility connection, and otherwise returns 404 `multiple_connections_unavailable`.
492
615
  # @param request_options [Hash] (see WorkOS::Types::RequestOptions)
493
- # @return [WorkOS::ConnectedAccount]
616
+ # @return [WorkOS::ConnectedAccountWriteResponse]
494
617
  def create_organization_connected_account(
495
618
  organization_id:,
496
619
  slug:,
620
+ user_id:,
621
+ account_display_name: WorkOS::OMIT,
622
+ account_identifier: WorkOS::OMIT,
497
623
  access_token: nil,
498
624
  refresh_token: nil,
499
625
  expires_at: nil,
500
626
  scopes: nil,
501
627
  state: nil,
628
+ connection_intent: nil,
502
629
  request_options: {}
503
630
  )
504
631
  body = {
@@ -506,8 +633,12 @@ module WorkOS
506
633
  "refresh_token" => refresh_token,
507
634
  "expires_at" => expires_at,
508
635
  "scopes" => scopes,
509
- "state" => state
636
+ "state" => state,
637
+ "user_id" => user_id,
638
+ "connection_intent" => connection_intent
510
639
  }.compact
640
+ body["account_display_name"] = account_display_name unless account_display_name.equal?(WorkOS::OMIT)
641
+ body["account_identifier"] = account_identifier unless account_identifier.equal?(WorkOS::OMIT)
511
642
  response = @client.request(
512
643
  method: :post,
513
644
  path: "/organizations/#{WorkOS::Util.encode_path(organization_id)}/connected_accounts/#{WorkOS::Util.encode_path(slug)}",
@@ -515,7 +646,7 @@ module WorkOS
515
646
  body: body,
516
647
  request_options: request_options
517
648
  )
518
- result = WorkOS::ConnectedAccount.new(response.body)
649
+ result = WorkOS::ConnectedAccountWriteResponse.new(response.body)
519
650
  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"])
520
651
  result
521
652
  end
@@ -523,18 +654,25 @@ module WorkOS
523
654
  # Update an organization connected account
524
655
  # @param organization_id [String] An [Organization](https://workos.com/docs/reference/organization) identifier.
525
656
  # @param slug [String] The slug identifier of the provider (e.g., `github`, `slack`, `notion`).
657
+ # @param account_display_name [String, nil] A mutable, non-unique connection label; null clears it. Not an account identifier.
658
+ # @param account_identifier [String, nil] A developer-attested account identifier; null clears it.
526
659
  # @param access_token [String, nil] The OAuth access token for the connected account.
527
660
  # @param refresh_token [String, nil] The OAuth refresh token for the connected account.
528
661
  # @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
662
  # @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.
663
+ # @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.
664
+ # @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.
665
+ # @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
666
  # @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.
667
+ # @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
668
  # @param request_options [Hash] (see WorkOS::Types::RequestOptions)
534
- # @return [WorkOS::ConnectedAccount]
669
+ # @return [WorkOS::ConnectedAccountWriteResponse]
535
670
  def update_organization_connected_account(
536
671
  organization_id:,
537
672
  slug:,
673
+ user_id:,
674
+ account_display_name: WorkOS::OMIT,
675
+ account_identifier: WorkOS::OMIT,
538
676
  access_token: nil,
539
677
  refresh_token: nil,
540
678
  expires_at: nil,
@@ -542,19 +680,24 @@ module WorkOS
542
680
  state: nil,
543
681
  supports_multiple_connections: nil,
544
682
  connected_account_id: nil,
683
+ connection_intent: nil,
545
684
  request_options: {}
546
685
  )
547
686
  params = {
548
687
  "supports_multiple_connections" => supports_multiple_connections,
549
- "connected_account_id" => connected_account_id
688
+ "connected_account_id" => connected_account_id,
689
+ "connection_intent" => connection_intent
550
690
  }.compact
551
691
  body = {
552
692
  "access_token" => access_token,
553
693
  "refresh_token" => refresh_token,
554
694
  "expires_at" => expires_at,
555
695
  "scopes" => scopes,
556
- "state" => state
696
+ "state" => state,
697
+ "user_id" => user_id
557
698
  }.compact
699
+ body["account_display_name"] = account_display_name unless account_display_name.equal?(WorkOS::OMIT)
700
+ body["account_identifier"] = account_identifier unless account_identifier.equal?(WorkOS::OMIT)
558
701
  response = @client.request(
559
702
  method: :put,
560
703
  path: "/organizations/#{WorkOS::Util.encode_path(organization_id)}/connected_accounts/#{WorkOS::Util.encode_path(slug)}",
@@ -563,7 +706,7 @@ module WorkOS
563
706
  body: body,
564
707
  request_options: request_options
565
708
  )
566
- result = WorkOS::ConnectedAccount.new(response.body)
709
+ result = WorkOS::ConnectedAccountWriteResponse.new(response.body)
567
710
  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"])
568
711
  result
569
712
  end
@@ -657,22 +800,28 @@ module WorkOS
657
800
  # Import a connected account
658
801
  # @param user_id [String] A [User](https://workos.com/docs/reference/authkit/user) identifier.
659
802
  # @param slug [String] The slug identifier of the provider (e.g., `github`, `slack`, `notion`).
803
+ # @param account_display_name [String, nil] A mutable, non-unique connection label; null clears it. Not an account identifier.
804
+ # @param account_identifier [String, nil] A developer-attested account identifier; null clears it.
660
805
  # @param access_token [String, nil] The OAuth access token for the connected account.
661
806
  # @param refresh_token [String, nil] The OAuth refresh token for the connected account.
662
807
  # @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
808
  # @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.
809
+ # @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.
810
+ # @param connection_intent [String, nil] Set to `add` to create another connected account. Omit this field for permanent compatibility behavior. Creating an additional connection is not yet available: until it is, `add` succeeds only when the owner has no connection for this integration, which creates the compatibility connection, and otherwise returns 404 `multiple_connections_unavailable`.
665
811
  # @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
812
  # @param request_options [Hash] (see WorkOS::Types::RequestOptions)
667
- # @return [WorkOS::ConnectedAccount]
813
+ # @return [WorkOS::ConnectedAccountWriteResponse]
668
814
  def create_user_connected_account(
669
815
  user_id:,
670
816
  slug:,
817
+ account_display_name: WorkOS::OMIT,
818
+ account_identifier: WorkOS::OMIT,
671
819
  access_token: nil,
672
820
  refresh_token: nil,
673
821
  expires_at: nil,
674
822
  scopes: nil,
675
823
  state: nil,
824
+ connection_intent: nil,
676
825
  organization_id: nil,
677
826
  request_options: {}
678
827
  )
@@ -684,8 +833,11 @@ module WorkOS
684
833
  "refresh_token" => refresh_token,
685
834
  "expires_at" => expires_at,
686
835
  "scopes" => scopes,
687
- "state" => state
836
+ "state" => state,
837
+ "connection_intent" => connection_intent
688
838
  }.compact
839
+ body["account_display_name"] = account_display_name unless account_display_name.equal?(WorkOS::OMIT)
840
+ body["account_identifier"] = account_identifier unless account_identifier.equal?(WorkOS::OMIT)
689
841
  response = @client.request(
690
842
  method: :post,
691
843
  path: "/user_management/users/#{WorkOS::Util.encode_path(user_id)}/connected_accounts/#{WorkOS::Util.encode_path(slug)}",
@@ -694,7 +846,7 @@ module WorkOS
694
846
  body: body,
695
847
  request_options: request_options
696
848
  )
697
- result = WorkOS::ConnectedAccount.new(response.body)
849
+ result = WorkOS::ConnectedAccountWriteResponse.new(response.body)
698
850
  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"])
699
851
  result
700
852
  end
@@ -702,19 +854,24 @@ module WorkOS
702
854
  # Update a connected account
703
855
  # @param user_id [String] A [User](https://workos.com/docs/reference/authkit/user) identifier.
704
856
  # @param slug [String] The slug identifier of the provider (e.g., `github`, `slack`, `notion`).
857
+ # @param account_display_name [String, nil] A mutable, non-unique connection label; null clears it. Not an account identifier.
858
+ # @param account_identifier [String, nil] A developer-attested account identifier; null clears it.
705
859
  # @param access_token [String, nil] The OAuth access token for the connected account.
706
860
  # @param refresh_token [String, nil] The OAuth refresh token for the connected account.
707
861
  # @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
862
  # @param scopes [Array<String>, nil] The OAuth scopes granted for this connection.
709
863
  # @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
864
  # @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.
865
+ # @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
866
  # @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.
867
+ # @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
868
  # @param request_options [Hash] (see WorkOS::Types::RequestOptions)
714
- # @return [WorkOS::ConnectedAccount]
869
+ # @return [WorkOS::ConnectedAccountWriteResponse]
715
870
  def update_user_connected_account(
716
871
  user_id:,
717
872
  slug:,
873
+ account_display_name: WorkOS::OMIT,
874
+ account_identifier: WorkOS::OMIT,
718
875
  access_token: nil,
719
876
  refresh_token: nil,
720
877
  expires_at: nil,
@@ -723,12 +880,14 @@ module WorkOS
723
880
  organization_id: nil,
724
881
  supports_multiple_connections: nil,
725
882
  connected_account_id: nil,
883
+ connection_intent: nil,
726
884
  request_options: {}
727
885
  )
728
886
  params = {
729
887
  "organization_id" => organization_id,
730
888
  "supports_multiple_connections" => supports_multiple_connections,
731
- "connected_account_id" => connected_account_id
889
+ "connected_account_id" => connected_account_id,
890
+ "connection_intent" => connection_intent
732
891
  }.compact
733
892
  body = {
734
893
  "access_token" => access_token,
@@ -737,6 +896,8 @@ module WorkOS
737
896
  "scopes" => scopes,
738
897
  "state" => state
739
898
  }.compact
899
+ body["account_display_name"] = account_display_name unless account_display_name.equal?(WorkOS::OMIT)
900
+ body["account_identifier"] = account_identifier unless account_identifier.equal?(WorkOS::OMIT)
740
901
  response = @client.request(
741
902
  method: :put,
742
903
  path: "/user_management/users/#{WorkOS::Util.encode_path(user_id)}/connected_accounts/#{WorkOS::Util.encode_path(slug)}",
@@ -745,7 +906,7 @@ module WorkOS
745
906
  body: body,
746
907
  request_options: request_options
747
908
  )
748
- result = WorkOS::ConnectedAccount.new(response.body)
909
+ result = WorkOS::ConnectedAccountWriteResponse.new(response.body)
749
910
  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"])
750
911
  result
751
912
  end