local C={}function C.new()local C={}return C end function C.mock()local K=C.new()K.items={id="";type=""}K.keyword=""K.previousPageCursor=""K.nextPageCursor=""return K end function C.fromSearchItemsDetails(K)local V=C.new()V.items={}for C,K in ipairs(K.data)do V.items[C]={id=tostring(K.id);type=tostring(K.itemType)}end V.keyword=K.keyword V.previousPageCursor=K.previousPageCursor V.nextPageCursor=K.nextPageCursor return V end return C


local SortResults = {}

function SortResults.new()
    local sortResults = {}

	return sortResults
end

function SortResults.mock()
	local self = SortResults.new()

	self.items = {
		id = "",
		type = ""
    }

	self.keyword = ""
	self.previousPageCursor = ""
	self.nextPageCursor = ""

	return self
end

function SortResults.fromSearchItemsDetails(itemDetailsResponse)
	local self = SortResults.new()

	self.items = {}
    for i, itemData in ipairs(itemDetailsResponse.data) do
		self.items[i] = {
			id = tostring(itemData.id),
			type = tostring(itemData.itemType)
		}
    end

	self.keyword = itemDetailsResponse.keyword
	self.previousPageCursor = itemDetailsResponse.previousPageCursor
	self.nextPageCursor = itemDetailsResponse.nextPageCursor

	return self
end

return SortResults
