Sha256: 6a198373103c00fa6a74ac7da1ebc60f3f9b3fe9dc0fead65045c21874dd800c

Contents?: true

Size: 1.59 KB

Versions: 58

Compression:

Stored size: 1.59 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_relative 'base_action'

module GoodData
  module LCM2
    class CollectMultipleProjectsColumn < BaseAction
      DESCRIPTION = 'Collect multiple_projects_column to be used in user actions'

      PARAMS = define_params(self) do
        description 'Client Used for Connecting to GD'
        param :gdc_gd_client, instance_of(Type::GdClientType), required: true

        description 'Identifier of column that identifies the relation to the projects in an user action input'
        param :multiple_projects_column, instance_of(Type::StringType), required: false

        description 'Synchronization Mode for user action (e.g. sync_one_project_based_on_pid)'
        param :sync_mode, instance_of(Type::StringType), required: false

        description 'Logger'
        param :gdc_logger, instance_of(Type::GdLogger), required: true
      end

      CLIENT_ID_MODES = %w(
        sync_domain_client_workspaces
        sync_one_project_based_on_custom_id
        sync_multiple_projects_based_on_custom_id
      )

      class << self
        def call(params)
          column = params.multiple_projects_column
          column = CLIENT_ID_MODES.include?(params.sync_mode) ? 'client_id' : 'project_id' unless column

          {
            results: [{ multiple_projects_column: column }],
            params: { multiple_projects_column: column }
          }
        end
      end
    end
  end
end

Version data entries

58 entries across 58 versions & 1 rubygems

Version Path
gooddata-2.3.1-java lib/gooddata/lcm/actions/collect_multiple_projects_column.rb
gooddata-2.3.1 lib/gooddata/lcm/actions/collect_multiple_projects_column.rb
gooddata-2.3.0-java lib/gooddata/lcm/actions/collect_multiple_projects_column.rb
gooddata-2.3.0 lib/gooddata/lcm/actions/collect_multiple_projects_column.rb
gooddata-2.2.0-java lib/gooddata/lcm/actions/collect_multiple_projects_column.rb
gooddata-2.2.0 lib/gooddata/lcm/actions/collect_multiple_projects_column.rb
gooddata-2.1.19-java lib/gooddata/lcm/actions/collect_multiple_projects_column.rb
gooddata-2.1.19 lib/gooddata/lcm/actions/collect_multiple_projects_column.rb
gooddata-2.1.17-java lib/gooddata/lcm/actions/collect_multiple_projects_column.rb
gooddata-2.1.17 lib/gooddata/lcm/actions/collect_multiple_projects_column.rb
gooddata-2.1.15-java lib/gooddata/lcm/actions/collect_multiple_projects_column.rb
gooddata-2.1.15 lib/gooddata/lcm/actions/collect_multiple_projects_column.rb
gooddata-2.1.14-java lib/gooddata/lcm/actions/collect_multiple_projects_column.rb
gooddata-2.1.14 lib/gooddata/lcm/actions/collect_multiple_projects_column.rb
gooddata-2.1.13-java lib/gooddata/lcm/actions/collect_multiple_projects_column.rb
gooddata-2.1.13 lib/gooddata/lcm/actions/collect_multiple_projects_column.rb
gooddata-2.1.12-java lib/gooddata/lcm/actions/collect_multiple_projects_column.rb
gooddata-2.1.12 lib/gooddata/lcm/actions/collect_multiple_projects_column.rb
gooddata-2.1.11-java lib/gooddata/lcm/actions/collect_multiple_projects_column.rb
gooddata-2.1.11 lib/gooddata/lcm/actions/collect_multiple_projects_column.rb