Sha256: 5c1e00368c64fe0ebd4e6dd787bd3821e2198a80f9079ace998a69b1e1435ca7

Contents?: true

Size: 1.04 KB

Versions: 71

Compression:

Stored size: 1.04 KB

Contents

# encoding: UTF-8
#
# Copyright (c) 2010-2017 GoodData Corporation. All rights reserved.
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree.

require 'salesforce_bulk_query'

require_relative 'base_middleware'

module GoodData
  module Bricks
    class BulkSalesforceMiddleware < Bricks::Middleware
      DEFAULT_VERSION = '29.0'.freeze

      def self.create_client(params)
        salesforce = nil
        if params['salesforce_client']

          client = params['salesforce_client']
          client.authenticate!

          salesforce = SalesforceBulkQuery::Api.new(client, logger: params['GDC_LOGGER'])
          # SalesforceBulkQuery adds its own Restforce logging so turn it off
          Restforce.log = false if params['GDC_LOGGER']
        end
        params.merge('salesforce_bulk_client' => salesforce)
      end

      def call(params)
        params = params.to_hash
        params = self.class.create_client(params)
        @app.call(params)
      end
    end
  end
end

Version data entries

71 entries across 71 versions & 1 rubygems

Version Path
gooddata-2.1.7-java lib/gooddata/bricks/middleware/bulk_salesforce_middleware.rb
gooddata-2.1.7 lib/gooddata/bricks/middleware/bulk_salesforce_middleware.rb
gooddata-2.1.6-java lib/gooddata/bricks/middleware/bulk_salesforce_middleware.rb
gooddata-2.1.6 lib/gooddata/bricks/middleware/bulk_salesforce_middleware.rb
gooddata-2.1.5-java lib/gooddata/bricks/middleware/bulk_salesforce_middleware.rb
gooddata-2.1.5 lib/gooddata/bricks/middleware/bulk_salesforce_middleware.rb
gooddata-2.1.4-java lib/gooddata/bricks/middleware/bulk_salesforce_middleware.rb
gooddata-2.1.4 lib/gooddata/bricks/middleware/bulk_salesforce_middleware.rb
gooddata-2.1.3-java lib/gooddata/bricks/middleware/bulk_salesforce_middleware.rb
gooddata-2.1.3 lib/gooddata/bricks/middleware/bulk_salesforce_middleware.rb
gooddata-2.1.2-java lib/gooddata/bricks/middleware/bulk_salesforce_middleware.rb
gooddata-2.1.2 lib/gooddata/bricks/middleware/bulk_salesforce_middleware.rb
gooddata-2.1.1-java lib/gooddata/bricks/middleware/bulk_salesforce_middleware.rb
gooddata-2.1.1 lib/gooddata/bricks/middleware/bulk_salesforce_middleware.rb
gooddata-2.1.0-java lib/gooddata/bricks/middleware/bulk_salesforce_middleware.rb
gooddata-2.1.0 lib/gooddata/bricks/middleware/bulk_salesforce_middleware.rb
gooddata-2.0.1-java lib/gooddata/bricks/middleware/bulk_salesforce_middleware.rb
gooddata-2.0.1 lib/gooddata/bricks/middleware/bulk_salesforce_middleware.rb
gooddata-2.0.0-java lib/gooddata/bricks/middleware/bulk_salesforce_middleware.rb
gooddata-2.0.0 lib/gooddata/bricks/middleware/bulk_salesforce_middleware.rb