123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237 |
- package NProtobufJsonTest;
- import "google/protobuf/any.proto";
- import "google/protobuf/duration.proto";
- import "google/protobuf/timestamp.proto";
- import "library/cpp/protobuf/json/proto/enum_options.proto";
- enum EEnum {
- E_0 = 0;
- E_1 = 1;
- E_2 = 2;
- E_3 = 3;
- };
- enum EJsonEnum {
- J_0 = 0 [(json_enum_value)="enum_0"];
- J_1 = 1 [(json_enum_value)="enum_1"];
- }
- message TFlatOptional {
- optional int32 I32 = 1;
- optional int64 I64 = 2;
- optional uint32 UI32 = 3;
- optional uint64 UI64 = 4;
- optional sint32 SI32 = 5;
- optional sint64 SI64 = 6;
- optional fixed32 FI32 = 7;
- optional fixed64 FI64 = 8;
- optional sfixed32 SFI32 = 9;
- optional sfixed64 SFI64 = 10;
- optional bool Bool = 11;
- optional string String = 12;
- optional bytes Bytes = 13;
- optional EEnum Enum = 14;
- optional float Float = 15;
- optional double Double = 16;
- optional string OneString = 17;
- optional string OneTwoString = 18;
- optional string ABC = 19;
- optional string UserID = 20;
- };
- message TFlatRequired {
- required int32 I32 = 1;
- required int64 I64 = 2;
- required uint32 UI32 = 3;
- required uint64 UI64 = 4;
- required sint32 SI32 = 5;
- required sint64 SI64 = 6;
- required fixed32 FI32 = 7;
- required fixed64 FI64 = 8;
- required sfixed32 SFI32 = 9;
- required sfixed64 SFI64 = 10;
- required bool Bool = 11;
- required string String = 12;
- required bytes Bytes = 13;
- required EEnum Enum = 14;
- required float Float = 15;
- required double Double = 16;
- required string OneString = 17;
- required string OneTwoString = 18;
- required string ABC = 19;
- required string UserID = 20;
- };
- message TFlatRepeated {
- repeated int32 I32 = 1;
- repeated int64 I64 = 2;
- repeated uint32 UI32 = 3;
- repeated uint64 UI64 = 4;
- repeated sint32 SI32 = 5;
- repeated sint64 SI64 = 6;
- repeated fixed32 FI32 = 7;
- repeated fixed64 FI64 = 8;
- repeated sfixed32 SFI32 = 9;
- repeated sfixed64 SFI64 = 10;
- repeated bool Bool = 11;
- repeated string String = 12;
- repeated bytes Bytes = 13;
- repeated EEnum Enum = 14;
- repeated float Float = 15;
- repeated double Double = 16;
- repeated string OneString = 17;
- repeated string OneTwoString = 18;
- repeated string ABC = 19;
- repeated string UserID = 20;
- };
- message TFlatDefault {
- optional int32 I32 = 1 [default = 132];
- optional int64 I64 = 2 [default = 164];
- optional uint32 UI32 = 3 [default = 232];
- optional uint64 UI64 = 4 [default = 264];
- optional sint32 SI32 = 5 [default = 332];
- optional sint64 SI64 = 6 [default = 364];
- optional fixed32 FI32 = 7 [default = 432];
- optional fixed64 FI64 = 8 [default = 464];
- optional sfixed32 SFI32 = 9 [default = 532];
- optional sfixed64 SFI64 = 10 [default = 564];
- optional bool Bool = 11 [default = true];
- optional string String = 12 [default = "string"];
- optional bytes Bytes = 13 [default = "bytes"];
- optional EEnum Enum = 14 [default = E_2];
- optional float Float = 15 [default = 0.123];
- optional double Double = 16 [default = 0.456];
- optional string OneString = 17 [default = "string"];
- optional string OneTwoString = 18 [default = "string"];
- optional string ABC = 19 [default = "abc"];
- optional string UserID = 20 [default = "some_id"];
- };
- message TFlatOneOfDefault {
- oneof Choice {
- string ChoiceOne = 1 [default = "one"];
- string ChoiceTwo = 2 [default = "two"];
- }
- }
- message TCompositeOptional {
- optional TFlatOptional Part = 1;
- };
- message TCompositeRequired {
- required TFlatRequired Part = 1;
- };
- message TCompositeRepeated {
- repeated TFlatOptional Part = 1;
- };
- message TMapType {
- map<string, string> Items = 1;
- };
- message TNameGeneratorType {
- optional int32 Field = 1;
- };
- message TEnumValueGeneratorType {
- enum EEnum {
- ENUM_42 = 1;
- };
- optional EEnum Enum = 1;
- };
- message TComplexMapType {
- map<int32, int32> I32 = 1;
- map<int64, int64> I64 = 2;
- map<uint32, uint32> UI32 = 3;
- map<uint64, uint64> UI64 = 4;
- map<sint32, sint32> SI32 = 5;
- map<sint64, sint64> SI64 = 6;
- map<fixed32, fixed32> FI32 = 7;
- map<fixed64, fixed64> FI64 = 8;
- map<sfixed32, sfixed32> SFI32 = 9;
- map<sfixed64, sfixed64> SFI64 = 10;
- map<bool, bool> Bool = 11;
- map<string, string> String = 12;
- map<string, EEnum> Enum = 13;
- map<string, float> Float = 14;
- map<string, double> Double = 15;
- map<string, TComplexMapType> Nested = 16;
- };
- message TWithJsonName {
- optional int32 my_upper = 1 [json_name = "My-Upper"];
- optional int32 My_lower = 2 [json_name = "my-lower"];
- optional int32 Def_upper = 3; // json_name = "DefUpper"
- optional int32 def_lower = 4; // json_name = "defLower"
- }
- message TSingleRequiredString {
- required string String = 1;
- }
- message TSingleDefaultString {
- optional string String = 1 [default = "value"];
- }
- message TSingleRepeatedString {
- repeated string RepeatedString = 1;
- }
- message TSingleRepeatedInt {
- repeated int32 RepeatedInt = 1;
- }
- message TSingleDuration {
- required google.protobuf.Duration Duration = 1;
- }
- message TSingleTimestamp {
- required google.protobuf.Timestamp Timestamp = 1;
- }
- message TExtensionField {
- extensions 100 to 199;
- }
- message TCustomJsonEnumValue {
- optional EJsonEnum JsonEnum = 1 [json_name="json_enum"];
- }
- extend TExtensionField {
- optional int32 bar = 123;
- }
- message TContainsAny {
- optional google.protobuf.Any Any = 1;
- }
|