def enumerator
      Enumerator.new do |yielder|
        response = get_initial_response

        loop do
          items = response.records

          # If there are no records, we're done
          break if items.empty?

          # Otherwise, iterate through the records...
          items.each { |item| yielder << item }

          # ...and fetch the next page
          @params ||= {}
          @params[:page] ||= 1
          @params[:page] += 1

          response = @service.list(**@params)
        end
      end.lazy
    end
def enumerator
      Enumerator.new do |yielder|
        response = get_initial_response

        loop do
          items = response.records

          # If there are no records, we're done
          break if items.empty?

          # Otherwise, iterate through the records...
          items.each { |item| yielder << item }

          # ...and fetch the next page
          @params ||= {}
          @params[:page] ||= 1
          @params[:page] += 1

          response = @service.list(**@params)
        end
      end.lazy
    end
Get a lazy enumerable for listing data from the API