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 {
    option message_set_wire_format = true;

    required 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;
    }
    optional DNT dnt = 5 [default = DO_NOT_TRACK];
    message Inner {
        required int64 ival = 1;
        optional bool booly = 2;
        message MoreInner {
           required bool nothing = 1;
        }
        message AnotherInner {
            required bool nothing = 1;
            optional MoreInner f2 = 2;
        }
    }
    required 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;
    required SearchRequest.Inner scoped = 3;
}

message Result {
    required string url = 1;
    optional string title = 2;
    repeated string snippets = 3;
    required SearchRequest.Inner.MoreInner i = 4;
    extensions 100 to 199;
}

extend SearchRequest.Inner.MoreInner {
    optional float bar = 101 [packed=true];
    required org.infinispan.protostream.lib.Base base = 102;
}
