def each(path, params = {}, header = {}, &block)
      # retrieve the resources using the max page size (least nr of API calls)
      next_path = expand_path(path, {per_page: MAX_PAGE_SIZE, page: 1}.merge(params))
      size = 0
      while next_path
        # retrieve the records (with retry and optionally wait for rate-limit)
        response = get(next_path, {}, header)
        # raise exception in case the response is invalid
        raise ::Itrp::Exception.new(response.message) unless response.valid?
        # yield the resources
        response.json.each{ |resource| yield resource }
        size += response.json.size
        # go to the next page
        next_path = response.pagination_relative_link(:next)
      end
      size
    end
def each(path, params = {}, header = {}, &block)
      # retrieve the resources using the max page size (least nr of API calls)
      next_path = expand_path(path, {per_page: MAX_PAGE_SIZE, page: 1}.merge(params))
      size = 0
      while next_path
        # retrieve the records (with retry and optionally wait for rate-limit)
        response = get(next_path, {}, header)
        # raise exception in case the response is invalid
        raise ::Itrp::Exception.new(response.message) unless response.valid?
        # yield the resources
        response.json.each{ |resource| yield resource }
        size += response.json.size
        # go to the next page
        next_path = response.pagination_relative_link(:next)
      end
      size
    end
Yield all retrieved resources one-by-one for the given (paged) API query.
 Raises an ::Itrp::Exception with the response retrieved from ITRP is invalid
 Returns total nr of resources yielded (for logging)