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.1.10-java lib/gooddata/lcm/actions/collect_multiple_projects_column.rb
gooddata-2.1.10 lib/gooddata/lcm/actions/collect_multiple_projects_column.rb
gooddata-2.1.9-java lib/gooddata/lcm/actions/collect_multiple_projects_column.rb
gooddata-2.1.9 lib/gooddata/lcm/actions/collect_multiple_projects_column.rb
gooddata-2.1.8-java lib/gooddata/lcm/actions/collect_multiple_projects_column.rb
gooddata-2.1.8 lib/gooddata/lcm/actions/collect_multiple_projects_column.rb
gooddata-2.1.7-java lib/gooddata/lcm/actions/collect_multiple_projects_column.rb
gooddata-2.1.7 lib/gooddata/lcm/actions/collect_multiple_projects_column.rb
gooddata-2.1.6-java lib/gooddata/lcm/actions/collect_multiple_projects_column.rb
gooddata-2.1.6 lib/gooddata/lcm/actions/collect_multiple_projects_column.rb
gooddata-2.1.5-java lib/gooddata/lcm/actions/collect_multiple_projects_column.rb
gooddata-2.1.5 lib/gooddata/lcm/actions/collect_multiple_projects_column.rb
gooddata-2.1.4-java lib/gooddata/lcm/actions/collect_multiple_projects_column.rb
gooddata-2.1.4 lib/gooddata/lcm/actions/collect_multiple_projects_column.rb
gooddata-2.1.3-java lib/gooddata/lcm/actions/collect_multiple_projects_column.rb
gooddata-2.1.3 lib/gooddata/lcm/actions/collect_multiple_projects_column.rb
gooddata-2.1.2-java lib/gooddata/lcm/actions/collect_multiple_projects_column.rb
gooddata-2.1.2 lib/gooddata/lcm/actions/collect_multiple_projects_column.rb
gooddata-2.1.1-java lib/gooddata/lcm/actions/collect_multiple_projects_column.rb
gooddata-2.1.1 lib/gooddata/lcm/actions/collect_multiple_projects_column.rb