Class: WorkOS::PipesProvider
- Inherits:
-
Object
- Object
- WorkOS::PipesProvider
- Defined in:
- lib/workos/pipes_provider.rb
Instance Method Summary collapse
-
#initialize(client) ⇒ PipesProvider
constructor
A new instance of PipesProvider.
-
#list_organization_data_integration_configurations(organization_id:, request_options: {}) ⇒ WorkOS::DataIntegrationConfigurationListResponse
List providers for an organization.
-
#update_organization_data_integration_configuration(organization_id:, slug:, enabled: nil, scopes: nil, client_id: nil, client_secret: nil, request_options: {}) ⇒ WorkOS::DataIntegrationConfigurationResponse
Configure a provider for an organization.
Constructor Details
#initialize(client) ⇒ PipesProvider
Returns a new instance of PipesProvider.
9 10 11 |
# File 'lib/workos/pipes_provider.rb', line 9 def initialize(client) @client = client end |
Instance Method Details
#list_organization_data_integration_configurations(organization_id:, request_options: {}) ⇒ WorkOS::DataIntegrationConfigurationListResponse
List providers for an organization
17 18 19 20 21 22 23 24 25 26 27 28 29 30 |
# File 'lib/workos/pipes_provider.rb', line 17 def list_organization_data_integration_configurations( organization_id:, request_options: {} ) response = @client.request( method: :get, path: "/organizations/#{WorkOS::Util.encode_path(organization_id)}/data_integration_configurations", auth: true, request_options: ) result = WorkOS::DataIntegrationConfigurationListResponse.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_data_integration_configuration(organization_id:, slug:, enabled: nil, scopes: nil, client_id: nil, client_secret: nil, request_options: {}) ⇒ WorkOS::DataIntegrationConfigurationResponse
Configure a provider for an organization
41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 |
# File 'lib/workos/pipes_provider.rb', line 41 def update_organization_data_integration_configuration( organization_id:, slug:, enabled: nil, scopes: nil, client_id: nil, client_secret: nil, request_options: {} ) body = { "enabled" => enabled, "scopes" => scopes, "client_id" => client_id, "client_secret" => client_secret }.compact response = @client.request( method: :put, path: "/organizations/#{WorkOS::Util.encode_path(organization_id)}/data_integration_configurations/#{WorkOS::Util.encode_path(slug)}", auth: true, body: body, request_options: ) result = WorkOS::DataIntegrationConfigurationResponse.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 |