Class: WorkOS::Pipes
- Inherits:
-
Object
- Object
- WorkOS::Pipes
- Defined in:
- lib/workos/pipes.rb
Instance Method Summary collapse
-
#authorize_data_integration(slug:, user_id:, organization_id: nil, connection_owner: nil, return_to: nil, config: nil, request_options: {}) ⇒ WorkOS::DataIntegrationAuthorizeUrlResponse
Get authorization URL.
-
#create_data_integration(provider:, ownership: nil, description: WorkOS::OMIT, enabled: nil, scopes: WorkOS::OMIT, auth_methods: nil, config: nil, credentials: nil, api_key: nil, custom_provider: nil, request_options: {}) ⇒ WorkOS::DataIntegration
Create a data integration.
-
#create_data_integration_credential(slug:, user_id:, organization_id: nil, connected_account_id: nil, connection_owner: nil, supports_multiple_connections: nil, request_options: {}) ⇒ WorkOS::DataIntegrationCredentialsResponse
Vend credentials for a connected account.
-
#create_organization_connected_account(organization_id:, slug:, access_token: nil, refresh_token: nil, expires_at: nil, scopes: nil, state: nil, request_options: {}) ⇒ WorkOS::ConnectedAccount
Import an organization connected account.
-
#create_user_connected_account(user_id:, slug:, access_token: nil, refresh_token: nil, expires_at: nil, scopes: nil, state: nil, organization_id: nil, request_options: {}) ⇒ WorkOS::ConnectedAccount
Import a connected account.
-
#delete_data_integration(slug:, request_options: {}) ⇒ void
Delete a data integration.
-
#delete_data_integration_organization(slug:, request_options: {}) ⇒ void
Delete an organization-owned data integration.
-
#delete_organization_connected_account(organization_id:, slug:, supports_multiple_connections: nil, connected_account_id: nil, request_options: {}) ⇒ void
Delete an organization connected account.
-
#delete_user_connected_account(user_id:, slug:, organization_id: nil, supports_multiple_connections: nil, connected_account_id: nil, request_options: {}) ⇒ void
Delete a connected account.
-
#get_access_token(provider:, user_id:, organization_id: WorkOS::OMIT, connected_account_id: nil, connection_owner: nil, supports_multiple_connections: nil, request_options: {}) ⇒ WorkOS::DataIntegrationAccessTokenResponse
Get an access token for a connected account.
-
#get_data_integration(slug:, request_options: {}) ⇒ WorkOS::DataIntegration
Get a data integration.
-
#get_organization_connected_account(organization_id:, slug:, supports_multiple_connections: nil, connected_account_id: nil, request_options: {}) ⇒ WorkOS::ConnectedAccount
Get an organization connected account.
-
#get_user_connected_account(user_id:, slug:, organization_id: nil, supports_multiple_connections: nil, connected_account_id: nil, request_options: {}) ⇒ WorkOS::ConnectedAccount
Get a connected account.
-
#initialize(client) ⇒ Pipes
constructor
A new instance of Pipes.
-
#list_data_integration_organization(slug:, request_options: {}) ⇒ WorkOS::DataIntegration
Get an organization-owned data integration.
-
#list_data_integrations(before: nil, after: nil, limit: 10, order: "desc", ownership: nil, request_options: {}) ⇒ WorkOS::Types::ListStruct<WorkOS::DataIntegration>
List data integrations.
-
#list_organization_data_providers(organization_id:, supports_multiple_connections: nil, request_options: {}) ⇒ WorkOS::DataIntegrationsListResponse
List providers for an organization.
-
#list_user_data_providers(user_id:, organization_id: nil, supports_multiple_connections: nil, request_options: {}) ⇒ WorkOS::DataIntegrationsListResponse
List providers for a user.
-
#update_data_integration(slug:, description: WorkOS::OMIT, enabled: nil, scopes: WorkOS::OMIT, credentials: nil, api_key: nil, custom_provider: nil, request_options: {}) ⇒ WorkOS::DataIntegration
Update a data integration.
-
#update_data_integration_api_key(slug:, user_id:, secret:, organization_id: nil, connected_account_id: nil, connection_owner: nil, request_options: {}) ⇒ WorkOS::ConnectedAccount
Upsert an API key for a connected account.
-
#update_data_integration_client_credentials(slug:, user_id:, client_id:, client_secret:, organization_id: nil, connected_account_id: nil, connection_owner: nil, config: nil, request_options: {}) ⇒ WorkOS::ConnectedAccount
Upsert client credentials for a connected account.
-
#update_data_integration_organization(slug:, description: WorkOS::OMIT, enabled: nil, scopes: WorkOS::OMIT, credentials: nil, api_key: nil, custom_provider: nil, request_options: {}) ⇒ WorkOS::DataIntegration
Update an organization-owned data integration.
-
#update_organization_connected_account(organization_id:, slug:, access_token: nil, refresh_token: nil, expires_at: nil, scopes: nil, state: nil, supports_multiple_connections: nil, connected_account_id: nil, request_options: {}) ⇒ WorkOS::ConnectedAccount
Update an organization connected account.
-
#update_user_connected_account(user_id:, slug:, access_token: nil, refresh_token: nil, expires_at: nil, scopes: nil, state: nil, organization_id: nil, supports_multiple_connections: nil, connected_account_id: nil, request_options: {}) ⇒ WorkOS::ConnectedAccount
Update a connected account.
Constructor Details
#initialize(client) ⇒ Pipes
Returns a new instance of Pipes.
9 10 11 |
# File 'lib/workos/pipes.rb', line 9 def initialize(client) @client = client end |
Instance Method Details
#authorize_data_integration(slug:, user_id:, organization_id: nil, connection_owner: nil, return_to: nil, config: nil, request_options: {}) ⇒ WorkOS::DataIntegrationAuthorizeUrlResponse
Get authorization URL
233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 |
# File 'lib/workos/pipes.rb', line 233 def ( slug:, user_id:, organization_id: nil, connection_owner: nil, return_to: nil, config: nil, request_options: {} ) body = { "user_id" => user_id, "organization_id" => organization_id, "connection_owner" => connection_owner, "return_to" => return_to, "config" => config }.compact response = @client.request( method: :post, path: "/data-integrations/#{WorkOS::Util.encode_path(slug)}/authorize", auth: true, body: body, request_options: ) result = WorkOS::DataIntegrationAuthorizeUrlResponse.new(response.body) 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"]) result end |
#create_data_integration(provider:, ownership: nil, description: WorkOS::OMIT, enabled: nil, scopes: WorkOS::OMIT, auth_methods: nil, config: nil, credentials: nil, api_key: nil, custom_provider: nil, request_options: {}) ⇒ WorkOS::DataIntegration
Create a data integration
74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 |
# File 'lib/workos/pipes.rb', line 74 def create_data_integration( provider:, ownership: nil, description: WorkOS::OMIT, enabled: nil, scopes: WorkOS::OMIT, auth_methods: nil, config: nil, credentials: nil, api_key: nil, custom_provider: nil, request_options: {} ) body = { "provider" => provider, "ownership" => ownership, "enabled" => enabled, "auth_methods" => auth_methods, "config" => config, "credentials" => credentials, "api_key" => api_key, "custom_provider" => custom_provider }.compact body["description"] = description unless description.equal?(WorkOS::OMIT) body["scopes"] = scopes unless scopes.equal?(WorkOS::OMIT) response = @client.request( method: :post, path: "/data-integrations", auth: true, body: body, request_options: ) result = WorkOS::DataIntegration.new(response.body) 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"]) result end |
#create_data_integration_credential(slug:, user_id:, organization_id: nil, connected_account_id: nil, connection_owner: nil, supports_multiple_connections: nil, request_options: {}) ⇒ WorkOS::DataIntegrationCredentialsResponse
Vend credentials for a connected account
313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 |
# File 'lib/workos/pipes.rb', line 313 def create_data_integration_credential( slug:, user_id:, organization_id: nil, connected_account_id: nil, connection_owner: nil, supports_multiple_connections: nil, request_options: {} ) body = { "user_id" => user_id, "organization_id" => organization_id, "connected_account_id" => connected_account_id, "connection_owner" => connection_owner, "supports_multiple_connections" => supports_multiple_connections }.compact response = @client.request( method: :post, path: "/data-integrations/#{WorkOS::Util.encode_path(slug)}/credentials", auth: true, body: body, request_options: ) result = WorkOS::DataIntegrationCredentialsResponse.new(response.body) 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"]) result end |
#create_organization_connected_account(organization_id:, slug:, access_token: nil, refresh_token: nil, expires_at: nil, scopes: nil, state: nil, request_options: {}) ⇒ WorkOS::ConnectedAccount
Import an organization connected account
494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 |
# File 'lib/workos/pipes.rb', line 494 def create_organization_connected_account( organization_id:, slug:, access_token: nil, refresh_token: nil, expires_at: nil, scopes: nil, state: nil, request_options: {} ) body = { "access_token" => access_token, "refresh_token" => refresh_token, "expires_at" => expires_at, "scopes" => scopes, "state" => state }.compact response = @client.request( method: :post, path: "/organizations/#{WorkOS::Util.encode_path(organization_id)}/connected_accounts/#{WorkOS::Util.encode_path(slug)}", auth: true, body: body, request_options: ) result = WorkOS::ConnectedAccount.new(response.body) 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"]) result end |
#create_user_connected_account(user_id:, slug:, access_token: nil, refresh_token: nil, expires_at: nil, scopes: nil, state: nil, organization_id: nil, request_options: {}) ⇒ WorkOS::ConnectedAccount
Import a connected account
668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 |
# File 'lib/workos/pipes.rb', line 668 def create_user_connected_account( user_id:, slug:, access_token: nil, refresh_token: nil, expires_at: nil, scopes: nil, state: nil, organization_id: nil, request_options: {} ) params = { "organization_id" => organization_id }.compact body = { "access_token" => access_token, "refresh_token" => refresh_token, "expires_at" => expires_at, "scopes" => scopes, "state" => state }.compact response = @client.request( method: :post, path: "/user_management/users/#{WorkOS::Util.encode_path(user_id)}/connected_accounts/#{WorkOS::Util.encode_path(slug)}", auth: true, params: params, body: body, request_options: ) result = WorkOS::ConnectedAccount.new(response.body) 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"]) result end |
#delete_data_integration(slug:, request_options: {}) ⇒ void
This method returns an undefined value.
Delete a data integration
174 175 176 177 178 179 180 181 182 183 184 185 |
# File 'lib/workos/pipes.rb', line 174 def delete_data_integration( slug:, request_options: {} ) @client.request( method: :delete, path: "/data-integrations/#{WorkOS::Util.encode_path(slug)}", auth: true, request_options: ) nil end |
#delete_data_integration_organization(slug:, request_options: {}) ⇒ void
This method returns an undefined value.
Delete an organization-owned data integration
404 405 406 407 408 409 410 411 412 413 414 415 |
# File 'lib/workos/pipes.rb', line 404 def delete_data_integration_organization( slug:, request_options: {} ) @client.request( method: :delete, path: "/data-integrations/#{WorkOS::Util.encode_path(slug)}/organization", auth: true, request_options: ) nil end |
#delete_organization_connected_account(organization_id:, slug:, supports_multiple_connections: nil, connected_account_id: nil, request_options: {}) ⇒ void
This method returns an undefined value.
Delete an organization connected account
578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 |
# File 'lib/workos/pipes.rb', line 578 def delete_organization_connected_account( organization_id:, slug:, supports_multiple_connections: nil, connected_account_id: nil, request_options: {} ) params = { "supports_multiple_connections" => supports_multiple_connections, "connected_account_id" => connected_account_id }.compact @client.request( method: :delete, path: "/organizations/#{WorkOS::Util.encode_path(organization_id)}/connected_accounts/#{WorkOS::Util.encode_path(slug)}", auth: true, params: params, request_options: ) nil end |
#delete_user_connected_account(user_id:, slug:, organization_id: nil, supports_multiple_connections: nil, connected_account_id: nil, request_options: {}) ⇒ void
This method returns an undefined value.
Delete a connected account
761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 |
# File 'lib/workos/pipes.rb', line 761 def delete_user_connected_account( user_id:, slug:, organization_id: nil, supports_multiple_connections: nil, connected_account_id: nil, request_options: {} ) params = { "organization_id" => organization_id, "supports_multiple_connections" => supports_multiple_connections, "connected_account_id" => connected_account_id }.compact @client.request( method: :delete, path: "/user_management/users/#{WorkOS::Util.encode_path(user_id)}/connected_accounts/#{WorkOS::Util.encode_path(slug)}", auth: true, params: params, request_options: ) nil end |
#get_access_token(provider:, user_id:, organization_id: WorkOS::OMIT, connected_account_id: nil, connection_owner: nil, supports_multiple_connections: nil, request_options: {}) ⇒ WorkOS::DataIntegrationAccessTokenResponse
Get an access token for a connected account
426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 |
# File 'lib/workos/pipes.rb', line 426 def get_access_token( provider:, user_id:, organization_id: WorkOS::OMIT, connected_account_id: nil, connection_owner: nil, supports_multiple_connections: nil, request_options: {} ) body = { "user_id" => user_id, "connected_account_id" => connected_account_id, "connection_owner" => connection_owner, "supports_multiple_connections" => supports_multiple_connections }.compact body["organization_id"] = organization_id unless organization_id.equal?(WorkOS::OMIT) response = @client.request( method: :post, path: "/data-integrations/#{WorkOS::Util.encode_path(provider)}/token", auth: true, body: body, request_options: ) result = WorkOS::DataIntegrationAccessTokenResponse.new(response.body) 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"]) result end |
#get_data_integration(slug:, request_options: {}) ⇒ WorkOS::DataIntegration
Get a data integration
115 116 117 118 119 120 121 122 123 124 125 126 127 128 |
# File 'lib/workos/pipes.rb', line 115 def get_data_integration( slug:, request_options: {} ) response = @client.request( method: :get, path: "/data-integrations/#{WorkOS::Util.encode_path(slug)}", auth: true, request_options: ) result = WorkOS::DataIntegration.new(response.body) 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"]) result end |
#get_organization_connected_account(organization_id:, slug:, supports_multiple_connections: nil, connected_account_id: nil, request_options: {}) ⇒ WorkOS::ConnectedAccount
Get an organization connected account
461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 |
# File 'lib/workos/pipes.rb', line 461 def get_organization_connected_account( organization_id:, slug:, supports_multiple_connections: nil, connected_account_id: nil, request_options: {} ) params = { "supports_multiple_connections" => supports_multiple_connections, "connected_account_id" => connected_account_id }.compact response = @client.request( method: :get, path: "/organizations/#{WorkOS::Util.encode_path(organization_id)}/connected_accounts/#{WorkOS::Util.encode_path(slug)}", auth: true, params: params, request_options: ) result = WorkOS::ConnectedAccount.new(response.body) 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"]) result end |
#get_user_connected_account(user_id:, slug:, organization_id: nil, supports_multiple_connections: nil, connected_account_id: nil, request_options: {}) ⇒ WorkOS::ConnectedAccount
Get a connected account
632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 |
# File 'lib/workos/pipes.rb', line 632 def get_user_connected_account( user_id:, slug:, organization_id: nil, supports_multiple_connections: nil, connected_account_id: nil, request_options: {} ) params = { "organization_id" => organization_id, "supports_multiple_connections" => supports_multiple_connections, "connected_account_id" => connected_account_id }.compact response = @client.request( method: :get, path: "/user_management/users/#{WorkOS::Util.encode_path(user_id)}/connected_accounts/#{WorkOS::Util.encode_path(slug)}", auth: true, params: params, request_options: ) result = WorkOS::ConnectedAccount.new(response.body) 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"]) result end |
#list_data_integration_organization(slug:, request_options: {}) ⇒ WorkOS::DataIntegration
Get an organization-owned data integration
345 346 347 348 349 350 351 352 353 354 355 356 357 358 |
# File 'lib/workos/pipes.rb', line 345 def list_data_integration_organization( slug:, request_options: {} ) response = @client.request( method: :get, path: "/data-integrations/#{WorkOS::Util.encode_path(slug)}/organization", auth: true, request_options: ) result = WorkOS::DataIntegration.new(response.body) 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"]) result end |
#list_data_integrations(before: nil, after: nil, limit: 10, order: "desc", ownership: nil, request_options: {}) ⇒ WorkOS::Types::ListStruct<WorkOS::DataIntegration>
List data integrations
21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 |
# File 'lib/workos/pipes.rb', line 21 def list_data_integrations( before: nil, after: nil, limit: 10, order: "desc", ownership: nil, request_options: {} ) params = { "before" => before, "after" => after, "limit" => limit, "order" => order, "ownership" => ownership }.compact response = @client.request( method: :get, path: "/data-integrations", auth: true, params: params, request_options: ) fetch_next = ->(cursor) { list_data_integrations( before: before, after: cursor, limit: limit, order: order, ownership: ownership, request_options: ) } WorkOS::Types::ListStruct.from_response( response, model: WorkOS::DataIntegration, filters: {before: before, limit: limit, order: order, ownership: ownership}, fetch_next: fetch_next ) end |
#list_organization_data_providers(organization_id:, supports_multiple_connections: nil, request_options: {}) ⇒ WorkOS::DataIntegrationsListResponse
List providers for an organization
604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 |
# File 'lib/workos/pipes.rb', line 604 def list_organization_data_providers( organization_id:, supports_multiple_connections: nil, request_options: {} ) params = { "supports_multiple_connections" => supports_multiple_connections }.compact response = @client.request( method: :get, path: "/organizations/#{WorkOS::Util.encode_path(organization_id)}/data_providers", auth: true, params: params, request_options: ) result = WorkOS::DataIntegrationsListResponse.new(response.body) 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"]) result end |
#list_user_data_providers(user_id:, organization_id: nil, supports_multiple_connections: nil, request_options: {}) ⇒ WorkOS::DataIntegrationsListResponse
List providers for a user
790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 |
# File 'lib/workos/pipes.rb', line 790 def list_user_data_providers( user_id:, organization_id: nil, supports_multiple_connections: nil, request_options: {} ) params = { "organization_id" => organization_id, "supports_multiple_connections" => supports_multiple_connections }.compact response = @client.request( method: :get, path: "/user_management/users/#{WorkOS::Util.encode_path(user_id)}/data_providers", auth: true, params: params, request_options: ) result = WorkOS::DataIntegrationsListResponse.new(response.body) 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"]) result end |
#update_data_integration(slug:, description: WorkOS::OMIT, enabled: nil, scopes: WorkOS::OMIT, credentials: nil, api_key: nil, custom_provider: nil, request_options: {}) ⇒ WorkOS::DataIntegration
Update a data integration
140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 |
# File 'lib/workos/pipes.rb', line 140 def update_data_integration( slug:, description: WorkOS::OMIT, enabled: nil, scopes: WorkOS::OMIT, credentials: nil, api_key: nil, custom_provider: nil, request_options: {} ) body = { "enabled" => enabled, "credentials" => credentials, "api_key" => api_key, "custom_provider" => custom_provider }.compact body["description"] = description unless description.equal?(WorkOS::OMIT) body["scopes"] = scopes unless scopes.equal?(WorkOS::OMIT) response = @client.request( method: :put, path: "/data-integrations/#{WorkOS::Util.encode_path(slug)}", auth: true, body: body, request_options: ) result = WorkOS::DataIntegration.new(response.body) 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"]) result end |
#update_data_integration_api_key(slug:, user_id:, secret:, organization_id: nil, connected_account_id: nil, connection_owner: nil, request_options: {}) ⇒ WorkOS::ConnectedAccount
Upsert an API key for a connected account
196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 |
# File 'lib/workos/pipes.rb', line 196 def update_data_integration_api_key( slug:, user_id:, secret:, organization_id: nil, connected_account_id: nil, connection_owner: nil, request_options: {} ) body = { "user_id" => user_id, "organization_id" => organization_id, "connected_account_id" => connected_account_id, "connection_owner" => connection_owner, "secret" => secret }.compact response = @client.request( method: :put, path: "/data-integrations/#{WorkOS::Util.encode_path(slug)}/api-key", auth: true, body: body, request_options: ) result = WorkOS::ConnectedAccount.new(response.body) 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"]) result end |
#update_data_integration_client_credentials(slug:, user_id:, client_id:, client_secret:, organization_id: nil, connected_account_id: nil, connection_owner: nil, config: nil, request_options: {}) ⇒ WorkOS::ConnectedAccount
Upsert client credentials for a connected account
272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 |
# File 'lib/workos/pipes.rb', line 272 def update_data_integration_client_credentials( slug:, user_id:, client_id:, client_secret:, organization_id: nil, connected_account_id: nil, connection_owner: nil, config: nil, request_options: {} ) body = { "user_id" => user_id, "organization_id" => organization_id, "connected_account_id" => connected_account_id, "connection_owner" => connection_owner, "client_id" => client_id, "client_secret" => client_secret, "config" => config }.compact response = @client.request( method: :put, path: "/data-integrations/#{WorkOS::Util.encode_path(slug)}/client-credentials", auth: true, body: body, request_options: ) result = WorkOS::ConnectedAccount.new(response.body) 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"]) result end |
#update_data_integration_organization(slug:, description: WorkOS::OMIT, enabled: nil, scopes: WorkOS::OMIT, credentials: nil, api_key: nil, custom_provider: nil, request_options: {}) ⇒ WorkOS::DataIntegration
Update an organization-owned data integration
370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 |
# File 'lib/workos/pipes.rb', line 370 def update_data_integration_organization( slug:, description: WorkOS::OMIT, enabled: nil, scopes: WorkOS::OMIT, credentials: nil, api_key: nil, custom_provider: nil, request_options: {} ) body = { "enabled" => enabled, "credentials" => credentials, "api_key" => api_key, "custom_provider" => custom_provider }.compact body["description"] = description unless description.equal?(WorkOS::OMIT) body["scopes"] = scopes unless scopes.equal?(WorkOS::OMIT) response = @client.request( method: :put, path: "/data-integrations/#{WorkOS::Util.encode_path(slug)}/organization", auth: true, body: body, request_options: ) result = WorkOS::DataIntegration.new(response.body) 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"]) result end |
#update_organization_connected_account(organization_id:, slug:, access_token: nil, refresh_token: nil, expires_at: nil, scopes: nil, state: nil, supports_multiple_connections: nil, connected_account_id: nil, request_options: {}) ⇒ WorkOS::ConnectedAccount
Update an organization connected account
535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 |
# File 'lib/workos/pipes.rb', line 535 def update_organization_connected_account( organization_id:, slug:, access_token: nil, refresh_token: nil, expires_at: nil, scopes: nil, state: nil, supports_multiple_connections: nil, connected_account_id: nil, request_options: {} ) params = { "supports_multiple_connections" => supports_multiple_connections, "connected_account_id" => connected_account_id }.compact body = { "access_token" => access_token, "refresh_token" => refresh_token, "expires_at" => expires_at, "scopes" => scopes, "state" => state }.compact response = @client.request( method: :put, path: "/organizations/#{WorkOS::Util.encode_path(organization_id)}/connected_accounts/#{WorkOS::Util.encode_path(slug)}", auth: true, params: params, body: body, request_options: ) result = WorkOS::ConnectedAccount.new(response.body) 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"]) result end |
#update_user_connected_account(user_id:, slug:, access_token: nil, refresh_token: nil, expires_at: nil, scopes: nil, state: nil, organization_id: nil, supports_multiple_connections: nil, connected_account_id: nil, request_options: {}) ⇒ WorkOS::ConnectedAccount
Update a connected account
715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 |
# File 'lib/workos/pipes.rb', line 715 def update_user_connected_account( user_id:, slug:, access_token: nil, refresh_token: nil, expires_at: nil, scopes: nil, state: nil, organization_id: nil, supports_multiple_connections: nil, connected_account_id: nil, request_options: {} ) params = { "organization_id" => organization_id, "supports_multiple_connections" => supports_multiple_connections, "connected_account_id" => connected_account_id }.compact body = { "access_token" => access_token, "refresh_token" => refresh_token, "expires_at" => expires_at, "scopes" => scopes, "state" => state }.compact response = @client.request( method: :put, path: "/user_management/users/#{WorkOS::Util.encode_path(user_id)}/connected_accounts/#{WorkOS::Util.encode_path(slug)}", auth: true, params: params, body: body, request_options: ) result = WorkOS::ConnectedAccount.new(response.body) 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"]) result end |