def fetch(device_uuid, session_id, queue='main')
      validate_device!(device_uuid)
      raise ArgumentError, "session_id must not be nil nor empty" unless session_id && !session_id.strip.empty?
      raise ArgumentError, "queue name must not be nil nor empty" unless queue && !queue.strip.empty?

      status, _, root = @client.get("/sync/#{session_id}/queues/#{queue}", {}, build_headers(device_uuid))
      return nil if status == 204

      root[:items].map do |item|
        klass = classify_type(item[:meta][:type])
        next unless klass
        [build_meta(item[:meta]), klass.new(item[:data])]
      end
    end
def fetch(device_uuid, session_id, queue='main')
      validate_device!(device_uuid)
      raise ArgumentError, "session_id must not be nil nor empty" unless session_id && !session_id.strip.empty?
      raise ArgumentError, "queue name must not be nil nor empty" unless queue && !queue.strip.empty?

      status, _, root = @client.get("/sync/#{session_id}/queues/#{queue}", {}, build_headers(device_uuid))
      return nil if status == 204

      root[:items].map do |item|
        klass = classify_type(item[:meta][:type])
        next unless klass
        [build_meta(item[:meta]), klass.new(item[:data])]
      end
    end
Get data from queue

 get '/sync/{session_id}/queues/main'

 Fetch fresh data from the main queue.
 Using session identifier you call continously the `#fetch` method to drain the main queue.

 @param device_uuid [String] Device's UUID for which to perform synchronization
 @param session_id [String] Unique identifier of a synchronization session.
 @param queue [String|Symbol] Queue name.
 @return [Array<Array<Meta, Model>>] The list of sync's metadata associated with data and data, or nil if nothing more to synchronize.