syntax = "proto3";

package org.infinispan.protostream.test;

import "org/infinispan/protostream/lib/base.proto";
import "org/infinispan/protostream/lib/base2.proto";

option java_outer_classname = "file-option";
option java_package = "com.pkg";

message SearchRequest {
    string query = 1;
    /* a comment  */
    optional int32 page_number = 2;// [default = 10];
    optional int32 result_per_page = 3; // Another Comment
    repeated int32 flags = 4 [packed = true];
    enum DNT {
        option allow_alias = true;
        DO_NOT_TRACK = 0;
        TRACK_FOR_SURE = 1;
        DONT_CARE = 2;
        SOME_ALIAS = 1;
    }
    optional DNT dnt = 5; // [default = DO_NOT_TRACK];
    message Inner {
        int64 ival = 1;
        optional bool booly = 2;
        message MoreInner {
           bool nothing = 1;
        }
        message AnotherInner {
            bool nothing = 1;
            optional MoreInner f2 = 2;
        }
    }
    aEnum reqEnum = 6 [deprecated=true];
    optional string label = 7; // [default = "whatever"];
    optional Inner typed = 8; 
}

enum aEnum {
    VAL0 = 0;
    VAL1 = 1;
}

message SearchResponse {
    repeated Result result = 1;
    optional org.infinispan.protostream.lib.Base base = 2;
    SearchRequest.Inner scoped = 3;
}

message Result {
    string url = 1;
    optional string title = 2;
    repeated string snippets = 3;
    SearchRequest.Inner.MoreInner i = 4;
    map<string,string> props = 5 [deprecated = false];
}
