struct.proto 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  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/struct.proto";
  33. message StructTestCases {
  34. StructWrapper empty_value = 1;
  35. StructWrapper empty_value2 = 2;
  36. StructWrapper null_value = 3;
  37. StructWrapper simple_struct = 4;
  38. StructWrapper longer_struct = 5;
  39. StructWrapper struct_with_nested_struct = 6;
  40. StructWrapper struct_with_nested_list = 7;
  41. StructWrapper struct_with_list_of_nulls = 8;
  42. StructWrapper struct_with_list_of_lists = 9;
  43. StructWrapper struct_with_list_of_structs = 10;
  44. StructWrapper struct_with_empty_list = 11;
  45. StructWrapper struct_with_list_with_empty_struct = 12;
  46. google.protobuf.Struct top_level_struct = 13;
  47. google.protobuf.Struct top_level_struct_with_empty_list = 14;
  48. google.protobuf.Struct top_level_struct_with_list_with_empty_struct = 15;
  49. ValueWrapper value_wrapper_simple = 16;
  50. ValueWrapper value_wrapper_with_struct = 17;
  51. ValueWrapper value_wrapper_with_list = 18;
  52. ValueWrapper value_wrapper_with_empty_list = 19;
  53. ValueWrapper value_wrapper_with_list_with_empty_struct = 20;
  54. ListValueWrapper list_value_wrapper = 21;
  55. ListValueWrapper list_value_wrapper_with_empty_list = 22;
  56. ListValueWrapper list_value_wrapper_with_list_with_empty_struct = 23;
  57. google.protobuf.Value top_level_value_simple = 24;
  58. google.protobuf.Value top_level_value_with_struct = 25;
  59. google.protobuf.Value top_level_value_with_list = 26;
  60. google.protobuf.Value top_level_value_with_empty_list = 27;
  61. google.protobuf.Value top_level_value_with_list_with_empty_struct = 28;
  62. google.protobuf.ListValue top_level_listvalue = 29;
  63. google.protobuf.ListValue top_level_empty_listvalue = 30;
  64. google.protobuf.ListValue top_level_listvalue_with_empty_struct = 31;
  65. RepeatedValueWrapper repeated_value = 32;
  66. RepeatedValueWrapper repeated_value_nested_list = 33;
  67. RepeatedValueWrapper repeated_value_nested_list2 = 34;
  68. RepeatedValueWrapper repeated_value_nested_list3 = 35;
  69. RepeatedListValueWrapper repeated_listvalue = 36;
  70. MapOfStruct map_of_struct = 37;
  71. MapOfStruct map_of_struct_value = 38;
  72. MapOfStruct map_of_listvalue = 39;
  73. }
  74. message StructWrapper {
  75. google.protobuf.Struct struct = 1;
  76. }
  77. message ValueWrapper {
  78. google.protobuf.Value value = 1;
  79. }
  80. message RepeatedValueWrapper {
  81. repeated google.protobuf.Value values = 1;
  82. }
  83. message ListValueWrapper {
  84. google.protobuf.ListValue shopping_list = 1;
  85. }
  86. message RepeatedListValueWrapper {
  87. repeated google.protobuf.ListValue dimensions = 1;
  88. }
  89. message MapOfStruct {
  90. map<string, google.protobuf.Struct> struct_map = 1;
  91. map<string, google.protobuf.Value> value_map = 2;
  92. map<string, google.protobuf.ListValue> listvalue_map = 3;
  93. }
  94. // Hack to test return types with Struct as top-level message. Struct typers
  95. // cannot be directly used in API requests. Hence using Dummy as request type.
  96. message Dummy {
  97. string text = 1;
  98. }
  99. service StructTestService {
  100. rpc Call(Dummy) returns (StructTestCases);
  101. }
  102. message StructType {
  103. google.protobuf.Struct object = 1;
  104. }