class GoodData::LCM2::SynchronizeLabelTypes

Constants

DESCRIPTION
PARAMS
RESULT_HEADER

Public Class Methods

call(params) click to toggle source
# File lib/gooddata/lcm/actions/synchronize_label_types.rb, line 35
def call(params)
  results = []

  client = params.gdc_gd_client
  development_client = params.development_client

  params.synchronize.peach do |info|
    from = info.from
    to = info.to

    from_project = development_client.projects(from) || fail("Invalid 'from' project specified - '#{from}'")
    to_projects = to.pmap do |project|
      client.projects(project.pid)
    end

    GoodData::LCM.transfer_label_types(from_project, to_projects)

    to_projects.each do |project|
      results << {
        from: from,
        to: project.pid,
        status: 'ok'
      }
    end
  end

  # Return results
  results
end