2021-03-11 19:13:27 +05:30
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
module BulkImports
|
|
|
|
module Pipeline
|
|
|
|
class ExtractedData
|
|
|
|
attr_reader :data
|
|
|
|
|
|
|
|
def initialize(data: nil, page_info: {})
|
|
|
|
@data = Array.wrap(data)
|
|
|
|
@page_info = page_info
|
|
|
|
end
|
|
|
|
|
|
|
|
def has_next_page?
|
2021-04-29 21:17:54 +05:30
|
|
|
Gitlab::Utils.to_boolean(
|
|
|
|
@page_info&.dig('has_next_page'),
|
|
|
|
default: false
|
|
|
|
)
|
2021-03-11 19:13:27 +05:30
|
|
|
end
|
|
|
|
|
|
|
|
def next_page
|
2021-04-29 21:17:54 +05:30
|
|
|
@page_info&.dig('next_page')
|
2021-03-11 19:13:27 +05:30
|
|
|
end
|
|
|
|
|
|
|
|
def each(&block)
|
|
|
|
data.each(&block)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|