default_value.proto 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170
  1. // Protocol Buffers - Google's data interchange format
  2. // Copyright 2008 Google Inc. All rights reserved.
  3. // https://developers.google.com/protocol-buffers/
  4. //
  5. // Redistribution and use in source and binary forms, with or without
  6. // modification, are permitted provided that the following conditions are
  7. // met:
  8. //
  9. // * Redistributions of source code must retain the above copyright
  10. // notice, this list of conditions and the following disclaimer.
  11. // * Redistributions in binary form must reproduce the above
  12. // copyright notice, this list of conditions and the following disclaimer
  13. // in the documentation and/or other materials provided with the
  14. // distribution.
  15. // * Neither the name of Google Inc. nor the names of its
  16. // contributors may be used to endorse or promote products derived from
  17. // this software without specific prior written permission.
  18. //
  19. // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  20. // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  21. // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  22. // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  23. // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  24. // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  25. // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  26. // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  27. // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  28. // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  29. // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  30. syntax = "proto3";
  31. package google.protobuf.testing;
  32. import "google/protobuf/any.proto";
  33. import "google/protobuf/struct.proto";
  34. import "google/protobuf/wrappers.proto";
  35. message DefaultValueTestCases {
  36. DoubleMessage empty_double = 1;
  37. DoubleMessage double_with_default_value = 2;
  38. DoubleMessage double_with_nondefault_value = 3;
  39. DoubleMessage repeated_double = 4;
  40. DoubleMessage nested_message = 5;
  41. DoubleMessage repeated_nested_message = 6;
  42. DoubleMessage double_message_with_oneof = 7;
  43. StructMessage empty_struct = 201;
  44. StructMessage empty_struct2 = 202;
  45. StructMessage struct_with_null_value = 203;
  46. StructMessage struct_with_values = 204;
  47. StructMessage struct_with_nested_struct = 205;
  48. StructMessage struct_with_nested_list = 206;
  49. StructMessage struct_with_list_of_nulls = 207;
  50. StructMessage struct_with_list_of_lists = 208;
  51. StructMessage struct_with_list_of_structs = 209;
  52. google.protobuf.Struct top_level_struct = 210;
  53. ValueMessage value_wrapper_simple = 212;
  54. ValueMessage value_wrapper_with_struct = 213;
  55. ValueMessage value_wrapper_with_list = 214;
  56. ListValueMessage list_value_wrapper = 215;
  57. google.protobuf.Value top_level_value_simple = 216;
  58. google.protobuf.Value top_level_value_with_struct = 217;
  59. google.protobuf.Value top_level_value_with_list = 218;
  60. google.protobuf.ListValue top_level_listvalue = 219;
  61. AnyMessage empty_any = 301;
  62. AnyMessage type_only_any = 302;
  63. AnyMessage recursive_any = 303;
  64. AnyMessage any_with_message_value = 304;
  65. AnyMessage any_with_nested_message = 305;
  66. AnyMessage any_with_message_containing_map = 306;
  67. AnyMessage any_with_message_containing_struct = 307;
  68. google.protobuf.Any top_level_any = 308;
  69. StringtoIntMap empty_map = 401;
  70. StringtoIntMap string_to_int = 402;
  71. IntToStringMap int_to_string = 403;
  72. MixedMap mixed1 = 404;
  73. MixedMap2 mixed2 = 405;
  74. MixedMap2 empty_mixed2 = 406;
  75. MessageMap map_of_objects = 407;
  76. MixedMap mixed_empty = 408;
  77. MessageMap message_map_empty = 409;
  78. DoubleValueMessage double_value = 501;
  79. DoubleValueMessage double_value_default = 502;
  80. }
  81. message DoubleMessage {
  82. double double_value = 1;
  83. repeated double repeated_double = 2;
  84. DoubleMessage nested_message = 3;
  85. repeated DoubleMessage repeated_nested_message = 4;
  86. google.protobuf.DoubleValue double_wrapper = 100;
  87. oneof value {
  88. string str_value = 112;
  89. int64 num_value = 113;
  90. }
  91. }
  92. message StructMessage {
  93. google.protobuf.Struct struct = 1;
  94. }
  95. message ValueMessage {
  96. google.protobuf.Value value = 1;
  97. }
  98. message ListValueMessage {
  99. google.protobuf.ListValue shopping_list = 1;
  100. }
  101. message RequestMessage {
  102. string content = 1;
  103. }
  104. // A test service.
  105. service DefaultValueTestService {
  106. // A test method.
  107. rpc Call(RequestMessage) returns (DefaultValueTestCases);
  108. }
  109. message AnyMessage {
  110. google.protobuf.Any any = 1;
  111. AnyData data = 2;
  112. }
  113. message AnyData {
  114. int32 attr = 1;
  115. string str = 2;
  116. repeated string msgs = 3;
  117. AnyData nested_data = 4;
  118. map<string, string> map_data = 7;
  119. google.protobuf.Struct struct_data = 8;
  120. repeated AnyData repeated_data = 9;
  121. }
  122. message StringtoIntMap {
  123. map<string, int32> map = 1;
  124. }
  125. message IntToStringMap {
  126. map<int32, string> map = 1;
  127. }
  128. message MixedMap {
  129. string msg = 1;
  130. map<string, float> map = 2;
  131. int32 int_value = 3;
  132. }
  133. message MixedMap2 {
  134. enum E {
  135. E0 = 0;
  136. E1 = 1;
  137. E2 = 2;
  138. E3 = 3;
  139. }
  140. map<int32, bool> map = 1;
  141. E ee = 2;
  142. string msg = 4;
  143. }
  144. message MessageMap {
  145. message M {
  146. int32 inner_int = 1;
  147. string inner_text = 2;
  148. }
  149. map<string, M> map = 1;
  150. }
  151. message DoubleValueMessage {
  152. google.protobuf.DoubleValue double = 1;
  153. }