// Copyright 2019 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

syntax = "proto2";

package feedwire1;

option optimize_for = LITE_RUNTIME;

option java_package = "org.chromium.components.feed.core.proto.wire";
option java_outer_classname = "FeedQueryProto";

message FeedQuery {
  enum RequestReason {
    // Bucket for any not listed. Should not be used (prefer adding a new
    // request reason)
    UNKNOWN_REQUEST_REASON = 0;

    // App is manually triggering a request, outside of scheduling a request.
    // Should be used rarely.
    MANUAL_REFRESH = 1;

    // Host wants a request to refresh content.
    SCHEDULED_REFRESH = 2;

    // Loading more content (should be deprecated soon for more clarity behind
    // reason).
    NEXT_PAGE_SCROLL = 4;

    // Refresh after clearing all content
    CLEAR_ALL = 5;

    // Refresh from zero state (no content)
    ZERO_STATE_REFRESH = 6;

    // Initial loading of content for a session
    INITIAL_LOAD = 7;

    // Loading new content (while displaying existing content)
    WITH_CONTENT = 8;

    reserved 3;
  }

  // The reason the query is being initiated.
  optional RequestReason reason = 1;

  // Used to fetch the next page when scrolling copied from
  // Token.next_page_token
  optional bytes page_token = 2;
}
