2017-08-14 11:56:23 +00:00
|
|
|
class Sequencer
|
|
|
|
class Unit
|
|
|
|
module Exchange
|
|
|
|
module Folders
|
|
|
|
class IdPathMap < Sequencer::Unit::Base
|
2017-09-15 10:55:49 +00:00
|
|
|
include ::Sequencer::Unit::Exchange::Folders::Mixin::Folder
|
2017-08-14 11:56:23 +00:00
|
|
|
|
|
|
|
provides :ews_folder_id_path_map
|
|
|
|
|
|
|
|
def process
|
|
|
|
state.provide(:ews_folder_id_path_map) do
|
|
|
|
|
|
|
|
ids = state.optional(:ews_folder_ids)
|
|
|
|
ids ||= []
|
|
|
|
|
|
|
|
ews_folder.id_folder_map.collect do |id, folder|
|
|
|
|
next if ids.present? && ids.exclude?(id)
|
|
|
|
next if folder.total_count.blank?
|
|
|
|
next if folder.total_count.zero?
|
|
|
|
|
|
|
|
[id, ews_folder.display_path(folder)]
|
|
|
|
end.compact.to_h
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|