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:, ownership: "user", request_options: {}) ⇒ WorkOS::DataIntegrationConfigurationListResponse
List providers for an organization.
-
#update_organization_data_integration_configuration(organization_id:, slug:, enabled: nil, scopes: WorkOS::OMIT, client_id: nil, client_secret: nil, config: nil, ownership: "user", 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:, ownership: "user", request_options: {}) ⇒ WorkOS::DataIntegrationConfigurationListResponse
List providers for an organization
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 |
# File 'lib/workos/pipes_provider.rb', line 18 def list_organization_data_integration_configurations( organization_id:, ownership: "user", request_options: {} ) params = { "ownership" => ownership }.compact response = @client.request( method: :get, path: "/organizations/#{WorkOS::Util.encode_path(organization_id)}/data_integration_configurations", auth: true, params: params, 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: WorkOS::OMIT, client_id: nil, client_secret: nil, config: nil, ownership: "user", request_options: {}) ⇒ WorkOS::DataIntegrationConfigurationResponse
Configure a provider for an organization
49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 |
# File 'lib/workos/pipes_provider.rb', line 49 def update_organization_data_integration_configuration( organization_id:, slug:, enabled: nil, scopes: WorkOS::OMIT, client_id: nil, client_secret: nil, config: nil, ownership: "user", request_options: {} ) params = { "ownership" => ownership }.compact body = { "enabled" => enabled, "client_id" => client_id, "client_secret" => client_secret, "config" => config }.compact body["scopes"] = scopes unless scopes.equal?(WorkOS::OMIT) response = @client.request( method: :put, path: "/organizations/#{WorkOS::Util.encode_path(organization_id)}/data_integration_configurations/#{WorkOS::Util.encode_path(slug)}", auth: true, params: params, 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 |