protobuf_file_options_ut.proto 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142
  1. import "yt/yt_proto/yt/formats/extension.proto";
  2. package NYT.NTestingFileOptions;
  3. option (NYT.file_default_field_flags) = SERIALIZATION_YT;
  4. option (NYT.file_default_field_flags) = MAP_AS_LIST_OF_STRUCTS;
  5. option (NYT.file_default_message_flags) = DEPRECATED_SORT_FIELDS_AS_IN_PROTO_FILE;
  6. option (NYT.file_default_oneof_flags) = SEPARATE_FIELDS;
  7. message TUrlRow
  8. {
  9. optional string Host = 1 [(NYT.column_name) = "Host"];
  10. optional string Path = 2 [(NYT.column_name) = "Path"];
  11. optional sint32 HttpCode = 3 [(NYT.column_name) = "HttpCode"];
  12. }
  13. message TRowFieldSerializationOption
  14. {
  15. optional TUrlRow UrlRow_1 = 1 [(NYT.flags) = SERIALIZATION_PROTOBUF];
  16. optional TUrlRow UrlRow_2 = 2;
  17. }
  18. message TRowMixedSerializationOptions
  19. {
  20. option (NYT.default_field_flags) = SERIALIZATION_PROTOBUF;
  21. optional TUrlRow UrlRow_1 = 1;
  22. optional TUrlRow UrlRow_2 = 2 [(NYT.flags) = SERIALIZATION_YT];
  23. }
  24. message TRowSerializedRepeatedFields
  25. {
  26. repeated int64 Ints = 1;
  27. repeated TUrlRow UrlRows = 2;
  28. }
  29. message TFieldSortOrder
  30. {
  31. message TEmbeddedDefault {
  32. optional int64 x = 2;
  33. optional string y = 12;
  34. optional bool z = 1;
  35. }
  36. message TEmbeddedAsInProtoFile {
  37. option (NYT.message_flags) = DEPRECATED_SORT_FIELDS_AS_IN_PROTO_FILE;
  38. optional int64 x = 2;
  39. optional string y = 12;
  40. optional bool z = 1;
  41. }
  42. message TEmbeddedByFieldNumber {
  43. option (NYT.message_flags) = SORT_FIELDS_BY_FIELD_NUMBER;
  44. optional int64 x = 2;
  45. optional string y = 12;
  46. optional bool z = 1;
  47. }
  48. option (NYT.default_field_flags) = SERIALIZATION_YT;
  49. optional TEmbeddedDefault EmbeddedDefault = 1;
  50. optional TEmbeddedAsInProtoFile EmbeddedAsInProtoFile = 2;
  51. optional TEmbeddedByFieldNumber EmbeddedByFieldNumber = 3;
  52. }
  53. message TWithMap
  54. {
  55. message TEmbedded {
  56. optional int64 x = 1;
  57. optional string y = 2;
  58. }
  59. map<int64, TEmbedded> MapDefault = 1;
  60. map<int64, TEmbedded> MapDict = 5 [(NYT.flags) = MAP_AS_DICT];
  61. }
  62. message TWithOneof
  63. {
  64. message TEmbedded
  65. {
  66. oneof Oneof {
  67. int64 x = 1;
  68. string y = 2;
  69. }
  70. }
  71. message TDefaultVariant
  72. {
  73. option (NYT.default_oneof_flags) = VARIANT;
  74. optional string field = 1;
  75. oneof Oneof2
  76. {
  77. string y2 = 4;
  78. TEmbedded z2 = 6;
  79. int64 x2 = 2;
  80. }
  81. oneof Oneof1
  82. {
  83. option (NYT.oneof_flags) = SEPARATE_FIELDS;
  84. int64 x1 = 10;
  85. string y1 = 3;
  86. TEmbedded z1 = 5;
  87. }
  88. }
  89. message TNoDefault
  90. {
  91. optional string field = 1;
  92. oneof Oneof2
  93. {
  94. string y2 = 4;
  95. TEmbedded z2 = 6;
  96. int64 x2 = 2;
  97. }
  98. oneof Oneof1
  99. {
  100. int64 x1 = 10;
  101. string y1 = 3;
  102. TEmbedded z1 = 5;
  103. }
  104. }
  105. message TSerializationProtobuf
  106. {
  107. option (NYT.default_field_flags) = SERIALIZATION_PROTOBUF;
  108. oneof Oneof
  109. {
  110. int64 x1 = 2;
  111. string y1 = 1;
  112. TEmbedded z1 = 3;
  113. }
  114. }
  115. optional TDefaultVariant DefaultVariant = 1;
  116. optional TNoDefault NoDefault = 2;
  117. optional TSerializationProtobuf SerializationProtobuf = 3;
  118. oneof TopLevelOneof
  119. {
  120. int64 MemberOfTopLevelOneof = 4;
  121. }
  122. }