Class: GoodData::LCM2::CollectProjectsWarningStatus

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

Constant Summary collapse

DESCRIPTION =
'Collect synced projects status'
PARAMS =
define_params(self) do
  description 'Abort on error'
  param :abort_on_error, instance_of(Type::StringType), required: false

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

  description 'Collect synced status'
  param :collect_synced_status, instance_of(Type::BooleanType), required: false

  description 'Sync failed list'
  param :sync_failed_list, instance_of(Type::HashType), required: false
end
RESULT_HEADER =
%i[segment client project_pid failed_action]

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, 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



27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
# File 'lib/gooddata/lcm/actions/collect_projects_warning_status.rb', line 27

def call(params)
  results = []
  return results unless collect_synced_status(params)

  sync_failed_list = params[SYNC_FAILED_LIST]
  if sync_failed_list
    failed_detailed_projects = sync_failed_list[:failed_detailed_projects]
    failed_detailed_projects.each do |failed_detailed_project|
      results << {
        segment: failed_detailed_project[:segment],
        client: failed_detailed_project[:client_id],
        project_pid: failed_detailed_project[:project_id],
        failed_action: failed_detailed_project[:action]
      }
    end
  end

  results
end


47
48
49
# File 'lib/gooddata/lcm/actions/collect_projects_warning_status.rb', line 47

def print_result(params)
  collect_synced_status(params)
end