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.19-java lib/gooddata/bricks/middleware/bulk_salesforce_middleware.rb
gooddata-2.1.19 lib/gooddata/bricks/middleware/bulk_salesforce_middleware.rb
gooddata-2.1.17-java lib/gooddata/bricks/middleware/bulk_salesforce_middleware.rb
gooddata-2.1.17 lib/gooddata/bricks/middleware/bulk_salesforce_middleware.rb
gooddata-2.1.15-java lib/gooddata/bricks/middleware/bulk_salesforce_middleware.rb
gooddata-2.1.15 lib/gooddata/bricks/middleware/bulk_salesforce_middleware.rb
gooddata-2.1.14-java lib/gooddata/bricks/middleware/bulk_salesforce_middleware.rb
gooddata-2.1.14 lib/gooddata/bricks/middleware/bulk_salesforce_middleware.rb
gooddata-2.1.13-java lib/gooddata/bricks/middleware/bulk_salesforce_middleware.rb
gooddata-2.1.13 lib/gooddata/bricks/middleware/bulk_salesforce_middleware.rb
gooddata-2.1.12-java lib/gooddata/bricks/middleware/bulk_salesforce_middleware.rb
gooddata-2.1.12 lib/gooddata/bricks/middleware/bulk_salesforce_middleware.rb
gooddata-2.1.11-java lib/gooddata/bricks/middleware/bulk_salesforce_middleware.rb
gooddata-2.1.11 lib/gooddata/bricks/middleware/bulk_salesforce_middleware.rb
gooddata-2.1.10-java lib/gooddata/bricks/middleware/bulk_salesforce_middleware.rb
gooddata-2.1.10 lib/gooddata/bricks/middleware/bulk_salesforce_middleware.rb
gooddata-2.1.9-java lib/gooddata/bricks/middleware/bulk_salesforce_middleware.rb
gooddata-2.1.9 lib/gooddata/bricks/middleware/bulk_salesforce_middleware.rb
gooddata-2.1.8-java lib/gooddata/bricks/middleware/bulk_salesforce_middleware.rb
gooddata-2.1.8 lib/gooddata/bricks/middleware/bulk_salesforce_middleware.rb