
syntax = "proto2";

package test;
import "yara.proto";

option (yara.module_options) = {
  name : "pb_tests"
  root_message: "RootMessage";
};


message Struct {
  option (yara.message_options).name = "struct";
  required string f_string = 1;
  enum Enum {
    option (yara.enum_options).name = "enum";
    FIRST = 0;
    SECOND = 1;
  }
  optional Enum f_enum = 2;
  message NestedStruct {
    optional int32 f_int32 = 1;
    optional string f_string = 2;
  }
  optional NestedStruct f_nested_struct = 3;
  repeated NestedStruct f_nested_struct_array = 4;
}

message MapStruct {
  optional int32 f_int32 = 1;
  optional int64 f_int64 = 2;
}

message RootMessage {
  optional int32 f_int32 = 1;
  optional int64 f_int64 = 2;
  //optional uint32 f_uint32 = 3;  // not supported
  //optional uint64 f_uint64 = 4;  // not supported
  optional sint32 f_sint32 = 5;
  optional sint64 f_sint64 = 6;
  //optional fixed32 f_fixed32 = 7;  // not supported
  //optional fixed64 f_fixed64 = 8;  // not supported
  optional sfixed32 f_sfixed32 = 9;
  optional sfixed64 f_sfixed64 = 10;
  optional bool f_bool = 11;
  optional string f_string = 12;
  optional bytes f_bytes = 13;
  repeated Struct f_struct_array = 14;
  map<string, int32> f_map_int32 = 15;
  map<string, bool> f_map_bool = 16;
  map<string, string> f_map_string = 17;
  map<string, float> f_map_float = 18;
  map<string, MapStruct> f_map_struct = 19;
  oneof f_oneof {
    string f_oneof_string = 20;
    MapStruct f_oneof_struct = 21;
  }
  optional string f_ignored = 22 [(yara.field_options).ignore = true];
  optional string f_renamed = 23 [(yara.field_options).name = "f_yara_name"];
}
