Class: GoodData::LCM2::CollectMultipleProjectsColumn

Inherits:
BaseAction show all
Defined in:
lib/gooddata/lcm/actions/collect_multiple_projects_column.rb

Constant Summary collapse

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
)

Constants inherited from BaseAction

BaseAction::FAILED_CLIENTS, BaseAction::FAILED_PROJECTS, BaseAction::FAILED_SEGMENTS, BaseAction::SYNC_FAILED_LIST

Constants included from Dsl::Dsl

Dsl::Dsl::DEFAULT_OPTS, Dsl::Dsl::TYPES

Class Method Summary collapse

Methods inherited from BaseAction

add_failed_client, add_failed_project, add_failed_segment, add_new_clients_to_project_client_mapping, check_params, collect_synced_status, continue_on_error, print_result, process_failed_project, process_failed_projects, sync_failed_client, sync_failed_project, sync_failed_segment, without_check

Methods included from Dsl::Dsl

#define_params, #define_type, #process

Class Method Details

.call(params) ⇒ Object



34
35
36
37
38
39
40
41
42
# File 'lib/gooddata/lcm/actions/collect_multiple_projects_column.rb', line 34

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