reproto 0.1.1__py3-none-any.whl → 0.1.3__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (127) hide show
  1. .git/COMMIT_EDITMSG +29 -1
  2. .git/index +0 -0
  3. .git/logs/HEAD +4 -0
  4. .git/logs/refs/heads/iyue +4 -0
  5. .git/logs/refs/remotes/gitlab/iyue +4 -0
  6. .git/logs/refs/remotes/origin/iyue +4 -0
  7. .git/objects/00/81a7e1ec3251cc192ed2b73d5be897593fb872 +0 -0
  8. .git/objects/00/885cebf557ff261574deb93cb96449d06db01c +0 -0
  9. .git/objects/02/33f5b60263e5dc6d041c0b223a0724eb650faa +0 -0
  10. .git/objects/03/3fab23ccc74b707a31f6f37dc5df42c100aac0 +0 -0
  11. .git/objects/07/557fbd1d149ce51af8e98e8ca8590757a89dfa +0 -0
  12. .git/objects/07/b71df33935c14ddf99e3480c04eca4685028bc +0 -0
  13. .git/objects/0b/e20ea749c6ae1075ae98f9426e00b0a4a235af +0 -0
  14. .git/objects/12/f9cc4ad0b4f0af4f7bae379f281b2cebe7cc7f +0 -0
  15. .git/objects/13/5f50fea51c72f977f48d06a7584aba0f61e260 +0 -0
  16. .git/objects/1b/97584ebada3e93d7a2cfa4a1aae0b79c414d20 +0 -0
  17. .git/objects/1b/f0c1ad9586578e8332d061f7648dcb041ec063 +0 -0
  18. .git/objects/1e/46816d16e7c9db7575f1964403c3daa105be5c +0 -0
  19. .git/objects/24/d78e796570a8572a03bc1dd26608a7cfb506f8 +2 -0
  20. .git/objects/27/24208ca2442e8ab9b453d0eb230fa41243b270 +0 -0
  21. .git/objects/2a/fe93d8bcbeab9e136d8b6766604c32b3610314 +0 -0
  22. .git/objects/2d/2b812ca27c477f9e1b2c2706a5eb795ffcf8eb +0 -0
  23. .git/objects/2d/8a0da260a710010ae62be134ac1cea6ceecfd1 +0 -0
  24. .git/objects/2d/e8ecbb5ab5de1a032bef3f4606ce5fa7c6c4e8 +0 -0
  25. .git/objects/30/9347e5681d80bd3c7949882e27090dd9070d16 +0 -0
  26. .git/objects/33/633c9df669ff8cf38638717937a54990814268 +0 -0
  27. .git/objects/39/993e3600bf4ab82aa361b738ee97a108787450 +0 -0
  28. .git/objects/3b/ab663710fd6b43d9372313fced9043c4cb07dd +0 -0
  29. .git/objects/3e/b3f1273caf6814dfa69325ccbd9fd1340cf20a +0 -0
  30. .git/objects/3f/b8830f516342a0ae1cb7c34b65016827cb9570 +4 -0
  31. .git/objects/41/f40c22247de377be99e30784229f3f128508a2 +0 -0
  32. .git/objects/45/fbc774dedb61c7c205ea732f59a8dca8d13555 +3 -0
  33. .git/objects/48/cb11e75518a53be14146018214110986fade67 +0 -0
  34. .git/objects/4f/c6dc41f9c0a1a8e0eedd3ba49c43d78d0dbaba +0 -0
  35. .git/objects/59/4c23f158ccbd0a4288f9ea046d06160195afbf +0 -0
  36. .git/objects/5b/d4d87753b79e9157817f0c2e6964a731052854 +0 -0
  37. .git/objects/60/5cb6fd6a9f8894ad4d43a9b8e4785c1b3b0e17 +1 -0
  38. .git/objects/60/f61a0ea50091eac8d344c86597375cbdfc2785 +0 -0
  39. .git/objects/63/ddda2a403efaab3f4c6597b3a73a7b1147adb5 +0 -0
  40. .git/objects/65/0189fe083bd711e45d463b229a72be619abad2 +0 -0
  41. .git/objects/66/663db35bfec8ef5f1a5b1c840fde1bb62a0eb8 +0 -0
  42. .git/objects/66/6c5c5fc30435228116fa08c9d821bebaaa8926 +0 -0
  43. .git/objects/7c/ef0adfb28fd774bc78061c6f088e1ef9b050f6 +0 -0
  44. .git/objects/7d/dc129188a10c68ab756ef2cacb292c76920403 +0 -0
  45. .git/objects/80/17038e0f7818a44a742f77c86f4f88ed768fcd +0 -0
  46. .git/objects/87/c7db6c91c17a2df84b56d30bd24a0f6b9dbdd9 +0 -0
  47. .git/objects/8a/0ed0ed8886fbc823e8d2258fa6d18699e94e25 +0 -0
  48. .git/objects/8d/d857b3d0ab3f5cd2e9173d532ef86e30df8eda +0 -0
  49. .git/objects/92/984cf67b2c25d435468a8218daa26ba0466054 +0 -0
  50. .git/objects/93/140b54b1fb9116ee214afee8abf2c72a232487 +0 -0
  51. .git/objects/93/68f2c32f83054ab072b7c9686d8baa0bad7f12 +4 -0
  52. .git/objects/9a/5ad062be9f6e001f4237a598a08981aba731e6 +0 -0
  53. .git/objects/9e/23448ac58f907d9d123c32bdccedbb3d6741b5 +0 -0
  54. .git/objects/a0/d192999af7e2cbfa6a9ccd04d720a04e5a06d5 +0 -0
  55. .git/objects/a1/655e0cb323c300562f97dcc67d5a446908c8ec +0 -0
  56. .git/objects/a5/38cc82cef7c49500d3522220f0f60a9ebc1ae6 +0 -0
  57. .git/objects/a9/41063a7ce89c353fa24378ec7c3f12f08f9df8 +0 -0
  58. .git/objects/a9/cc7923c34a4c97c5711d6309672f41d46c612a +0 -0
  59. .git/objects/ac/5c983d949d8c928bb022badf801e45e75e785e +0 -0
  60. .git/objects/af/c9cc15629847447063e86a82b8b56abb4fc08f +0 -0
  61. .git/objects/b0/82ca2c1b5a03edff25da3c2b2b573d049877e9 +0 -0
  62. .git/objects/b1/db1c131cf32916028342c0037ce8eb57a8eb26 +0 -0
  63. .git/objects/b2/8334b94392b8af397a05ed702690fa6c9ab1ca +0 -0
  64. .git/objects/b8/7c89dcfce9e244ff5ef6a4bd394de12e8c8092 +0 -0
  65. .git/objects/bc/e98bdb71c8681acb460195fdcbbe5d36290976 +0 -0
  66. .git/objects/c1/87d5e047eca86cfd8d444be2987aaa3f62c4d6 +0 -0
  67. .git/objects/c4/c2da96b0bb8db2acb0e6615cf340c7e51af26b +0 -0
  68. .git/objects/c5/13a96e7584636b20b12280c029750d5bc3da1e +0 -0
  69. .git/objects/c7/c34283697bd3cce07db53953eda25ee7cc371e +0 -0
  70. .git/objects/c9/d60d922a04b87587cd67b0abf9fe5a7b7b76cd +0 -0
  71. .git/objects/d2/69b1676dbf32f76a7c405d0b4ea6a70ac3a626 +0 -0
  72. .git/objects/d3/5a918b1d9125ad35d60e08b181323df3246f1a +0 -0
  73. .git/objects/d8/eaf86669fbfd10497570c1784db1ed2696b588 +0 -0
  74. .git/objects/d9/3bd435c8c7ad4efb83dff04d5450fabb9e3faf +0 -0
  75. .git/objects/d9/90e6d553577d37ebce8b28b3015ecbde038b42 +0 -0
  76. .git/objects/da/13cc15bcd8ee39c81f36dee7f179a569ecab0b +0 -0
  77. .git/objects/e3/27755808d88c7ae5c06c229cf18bd0519646df +0 -0
  78. .git/objects/e4/4c1d8a90207ac082d8ab7ff0db66708e2ebc31 +0 -0
  79. .git/objects/e5/83e7c40be934d16a1fa2e973487b395d930f42 +0 -0
  80. .git/objects/ed/1ae867d5e63195845afc58d88c38ecbdea97df +0 -0
  81. .git/objects/ef/f44e5099da27f7fb1ef14bb34902ccf4250b89 +0 -0
  82. .git/objects/f5/1be495b96272fa2e47f30071aed35ac1f0dd2c +0 -0
  83. .git/objects/f8/ed595d25bd9d500e765a792c513878f7ddb1f7 +0 -0
  84. .git/objects/fd/0bc07dc3c95e6168ab6d367d9eca139ac1e539 +0 -0
  85. .git/refs/heads/iyue +1 -1
  86. .git/refs/remotes/gitlab/iyue +1 -1
  87. .git/refs/remotes/origin/iyue +1 -1
  88. .gitignore +2 -1
  89. README.md +104 -190
  90. core/__init__.py +23 -0
  91. core/info_decoder.py +520 -10
  92. core/reconstructor.py +159 -21
  93. generation/__init__.py +17 -0
  94. generation/proto_generator.py +62 -16
  95. include/google/protobuf/any.proto +162 -0
  96. include/google/protobuf/api.proto +207 -0
  97. include/google/protobuf/compiler/plugin.proto +180 -0
  98. include/google/protobuf/cpp_features.proto +67 -0
  99. include/google/protobuf/descriptor.proto +1417 -0
  100. include/google/protobuf/duration.proto +115 -0
  101. include/google/protobuf/empty.proto +51 -0
  102. include/google/protobuf/field_mask.proto +245 -0
  103. include/google/protobuf/go_features.proto +80 -0
  104. include/google/protobuf/java_features.proto +130 -0
  105. include/google/protobuf/source_context.proto +48 -0
  106. include/google/protobuf/struct.proto +95 -0
  107. include/google/protobuf/timestamp.proto +144 -0
  108. include/google/protobuf/type.proto +193 -0
  109. include/google/protobuf/wrappers.proto +157 -0
  110. main.py +53 -56
  111. models/__init__.py +31 -24
  112. parsing/__init__.py +22 -0
  113. parsing/enum_parser.py +10 -2
  114. parsing/java_parser.py +302 -13
  115. pyproject.toml +1 -1
  116. reproto-0.1.3.dist-info/METADATA +209 -0
  117. {reproto-0.1.1.dist-info → reproto-0.1.3.dist-info}/RECORD +125 -31
  118. utils/__init__.py +40 -0
  119. utils/builtin_proto.py +269 -0
  120. utils/file_cache.py +8 -1
  121. utils/report_utils.py +71 -0
  122. utils/type_index.py +8 -1
  123. utils/type_utils.py +39 -6
  124. core/bytecode_parser.py +0 -274
  125. reproto-0.1.1.dist-info/METADATA +0 -295
  126. {reproto-0.1.1.dist-info → reproto-0.1.3.dist-info}/WHEEL +0 -0
  127. {reproto-0.1.1.dist-info → reproto-0.1.3.dist-info}/entry_points.txt +0 -0
@@ -0,0 +1,95 @@
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
+
31
+ syntax = "proto3";
32
+
33
+ package google.protobuf;
34
+
35
+ option cc_enable_arenas = true;
36
+ option go_package = "google.golang.org/protobuf/types/known/structpb";
37
+ option java_package = "com.google.protobuf";
38
+ option java_outer_classname = "StructProto";
39
+ option java_multiple_files = true;
40
+ option objc_class_prefix = "GPB";
41
+ option csharp_namespace = "Google.Protobuf.WellKnownTypes";
42
+
43
+ // `Struct` represents a structured data value, consisting of fields
44
+ // which map to dynamically typed values. In some languages, `Struct`
45
+ // might be supported by a native representation. For example, in
46
+ // scripting languages like JS a struct is represented as an
47
+ // object. The details of that representation are described together
48
+ // with the proto support for the language.
49
+ //
50
+ // The JSON representation for `Struct` is JSON object.
51
+ message Struct {
52
+ // Unordered map of dynamically typed values.
53
+ map<string, Value> fields = 1;
54
+ }
55
+
56
+ // `Value` represents a dynamically typed value which can be either
57
+ // null, a number, a string, a boolean, a recursive struct value, or a
58
+ // list of values. A producer of value is expected to set one of these
59
+ // variants. Absence of any variant indicates an error.
60
+ //
61
+ // The JSON representation for `Value` is JSON value.
62
+ message Value {
63
+ // The kind of value.
64
+ oneof kind {
65
+ // Represents a null value.
66
+ NullValue null_value = 1;
67
+ // Represents a double value.
68
+ double number_value = 2;
69
+ // Represents a string value.
70
+ string string_value = 3;
71
+ // Represents a boolean value.
72
+ bool bool_value = 4;
73
+ // Represents a structured value.
74
+ Struct struct_value = 5;
75
+ // Represents a repeated `Value`.
76
+ ListValue list_value = 6;
77
+ }
78
+ }
79
+
80
+ // `NullValue` is a singleton enumeration to represent the null value for the
81
+ // `Value` type union.
82
+ //
83
+ // The JSON representation for `NullValue` is JSON `null`.
84
+ enum NullValue {
85
+ // Null value.
86
+ NULL_VALUE = 0;
87
+ }
88
+
89
+ // `ListValue` is a wrapper around a repeated field of values.
90
+ //
91
+ // The JSON representation for `ListValue` is JSON array.
92
+ message ListValue {
93
+ // Repeated field of dynamically typed values.
94
+ repeated Value values = 1;
95
+ }
@@ -0,0 +1,144 @@
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
+
31
+ syntax = "proto3";
32
+
33
+ package google.protobuf;
34
+
35
+ option cc_enable_arenas = true;
36
+ option go_package = "google.golang.org/protobuf/types/known/timestamppb";
37
+ option java_package = "com.google.protobuf";
38
+ option java_outer_classname = "TimestampProto";
39
+ option java_multiple_files = true;
40
+ option objc_class_prefix = "GPB";
41
+ option csharp_namespace = "Google.Protobuf.WellKnownTypes";
42
+
43
+ // A Timestamp represents a point in time independent of any time zone or local
44
+ // calendar, encoded as a count of seconds and fractions of seconds at
45
+ // nanosecond resolution. The count is relative to an epoch at UTC midnight on
46
+ // January 1, 1970, in the proleptic Gregorian calendar which extends the
47
+ // Gregorian calendar backwards to year one.
48
+ //
49
+ // All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap
50
+ // second table is needed for interpretation, using a [24-hour linear
51
+ // smear](https://developers.google.com/time/smear).
52
+ //
53
+ // The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By
54
+ // restricting to that range, we ensure that we can convert to and from [RFC
55
+ // 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings.
56
+ //
57
+ // # Examples
58
+ //
59
+ // Example 1: Compute Timestamp from POSIX `time()`.
60
+ //
61
+ // Timestamp timestamp;
62
+ // timestamp.set_seconds(time(NULL));
63
+ // timestamp.set_nanos(0);
64
+ //
65
+ // Example 2: Compute Timestamp from POSIX `gettimeofday()`.
66
+ //
67
+ // struct timeval tv;
68
+ // gettimeofday(&tv, NULL);
69
+ //
70
+ // Timestamp timestamp;
71
+ // timestamp.set_seconds(tv.tv_sec);
72
+ // timestamp.set_nanos(tv.tv_usec * 1000);
73
+ //
74
+ // Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`.
75
+ //
76
+ // FILETIME ft;
77
+ // GetSystemTimeAsFileTime(&ft);
78
+ // UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime;
79
+ //
80
+ // // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z
81
+ // // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z.
82
+ // Timestamp timestamp;
83
+ // timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL));
84
+ // timestamp.set_nanos((INT32) ((ticks % 10000000) * 100));
85
+ //
86
+ // Example 4: Compute Timestamp from Java `System.currentTimeMillis()`.
87
+ //
88
+ // long millis = System.currentTimeMillis();
89
+ //
90
+ // Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000)
91
+ // .setNanos((int) ((millis % 1000) * 1000000)).build();
92
+ //
93
+ // Example 5: Compute Timestamp from Java `Instant.now()`.
94
+ //
95
+ // Instant now = Instant.now();
96
+ //
97
+ // Timestamp timestamp =
98
+ // Timestamp.newBuilder().setSeconds(now.getEpochSecond())
99
+ // .setNanos(now.getNano()).build();
100
+ //
101
+ // Example 6: Compute Timestamp from current time in Python.
102
+ //
103
+ // timestamp = Timestamp()
104
+ // timestamp.GetCurrentTime()
105
+ //
106
+ // # JSON Mapping
107
+ //
108
+ // In JSON format, the Timestamp type is encoded as a string in the
109
+ // [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the
110
+ // format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z"
111
+ // where {year} is always expressed using four digits while {month}, {day},
112
+ // {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional
113
+ // seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution),
114
+ // are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone
115
+ // is required. A proto3 JSON serializer should always use UTC (as indicated by
116
+ // "Z") when printing the Timestamp type and a proto3 JSON parser should be
117
+ // able to accept both UTC and other timezones (as indicated by an offset).
118
+ //
119
+ // For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past
120
+ // 01:30 UTC on January 15, 2017.
121
+ //
122
+ // In JavaScript, one can convert a Date object to this format using the
123
+ // standard
124
+ // [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString)
125
+ // method. In Python, a standard `datetime.datetime` object can be converted
126
+ // to this format using
127
+ // [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with
128
+ // the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use
129
+ // the Joda Time's [`ISODateTimeFormat.dateTime()`](
130
+ // http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime()
131
+ // ) to obtain a formatter capable of generating timestamps in this format.
132
+ //
133
+ message Timestamp {
134
+ // Represents seconds of UTC time since Unix epoch
135
+ // 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to
136
+ // 9999-12-31T23:59:59Z inclusive.
137
+ int64 seconds = 1;
138
+
139
+ // Non-negative fractions of a second at nanosecond resolution. Negative
140
+ // second values with fractions must still have non-negative nanos values
141
+ // that count forward in time. Must be from 0 to 999,999,999
142
+ // inclusive.
143
+ int32 nanos = 2;
144
+ }
@@ -0,0 +1,193 @@
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
+
31
+ syntax = "proto3";
32
+
33
+ package google.protobuf;
34
+
35
+ import "google/protobuf/any.proto";
36
+ import "google/protobuf/source_context.proto";
37
+
38
+ option cc_enable_arenas = true;
39
+ option java_package = "com.google.protobuf";
40
+ option java_outer_classname = "TypeProto";
41
+ option java_multiple_files = true;
42
+ option objc_class_prefix = "GPB";
43
+ option csharp_namespace = "Google.Protobuf.WellKnownTypes";
44
+ option go_package = "google.golang.org/protobuf/types/known/typepb";
45
+
46
+ // A protocol buffer message type.
47
+ message Type {
48
+ // The fully qualified message name.
49
+ string name = 1;
50
+ // The list of fields.
51
+ repeated Field fields = 2;
52
+ // The list of types appearing in `oneof` definitions in this type.
53
+ repeated string oneofs = 3;
54
+ // The protocol buffer options.
55
+ repeated Option options = 4;
56
+ // The source context.
57
+ SourceContext source_context = 5;
58
+ // The source syntax.
59
+ Syntax syntax = 6;
60
+ // The source edition string, only valid when syntax is SYNTAX_EDITIONS.
61
+ string edition = 7;
62
+ }
63
+
64
+ // A single field of a message type.
65
+ message Field {
66
+ // Basic field types.
67
+ enum Kind {
68
+ // Field type unknown.
69
+ TYPE_UNKNOWN = 0;
70
+ // Field type double.
71
+ TYPE_DOUBLE = 1;
72
+ // Field type float.
73
+ TYPE_FLOAT = 2;
74
+ // Field type int64.
75
+ TYPE_INT64 = 3;
76
+ // Field type uint64.
77
+ TYPE_UINT64 = 4;
78
+ // Field type int32.
79
+ TYPE_INT32 = 5;
80
+ // Field type fixed64.
81
+ TYPE_FIXED64 = 6;
82
+ // Field type fixed32.
83
+ TYPE_FIXED32 = 7;
84
+ // Field type bool.
85
+ TYPE_BOOL = 8;
86
+ // Field type string.
87
+ TYPE_STRING = 9;
88
+ // Field type group. Proto2 syntax only, and deprecated.
89
+ TYPE_GROUP = 10;
90
+ // Field type message.
91
+ TYPE_MESSAGE = 11;
92
+ // Field type bytes.
93
+ TYPE_BYTES = 12;
94
+ // Field type uint32.
95
+ TYPE_UINT32 = 13;
96
+ // Field type enum.
97
+ TYPE_ENUM = 14;
98
+ // Field type sfixed32.
99
+ TYPE_SFIXED32 = 15;
100
+ // Field type sfixed64.
101
+ TYPE_SFIXED64 = 16;
102
+ // Field type sint32.
103
+ TYPE_SINT32 = 17;
104
+ // Field type sint64.
105
+ TYPE_SINT64 = 18;
106
+ }
107
+
108
+ // Whether a field is optional, required, or repeated.
109
+ enum Cardinality {
110
+ // For fields with unknown cardinality.
111
+ CARDINALITY_UNKNOWN = 0;
112
+ // For optional fields.
113
+ CARDINALITY_OPTIONAL = 1;
114
+ // For required fields. Proto2 syntax only.
115
+ CARDINALITY_REQUIRED = 2;
116
+ // For repeated fields.
117
+ CARDINALITY_REPEATED = 3;
118
+ }
119
+
120
+ // The field type.
121
+ Kind kind = 1;
122
+ // The field cardinality.
123
+ Cardinality cardinality = 2;
124
+ // The field number.
125
+ int32 number = 3;
126
+ // The field name.
127
+ string name = 4;
128
+ // The field type URL, without the scheme, for message or enumeration
129
+ // types. Example: `"type.googleapis.com/google.protobuf.Timestamp"`.
130
+ string type_url = 6;
131
+ // The index of the field type in `Type.oneofs`, for message or enumeration
132
+ // types. The first type has index 1; zero means the type is not in the list.
133
+ int32 oneof_index = 7;
134
+ // Whether to use alternative packed wire representation.
135
+ bool packed = 8;
136
+ // The protocol buffer options.
137
+ repeated Option options = 9;
138
+ // The field JSON name.
139
+ string json_name = 10;
140
+ // The string value of the default value of this field. Proto2 syntax only.
141
+ string default_value = 11;
142
+ }
143
+
144
+ // Enum type definition.
145
+ message Enum {
146
+ // Enum type name.
147
+ string name = 1;
148
+ // Enum value definitions.
149
+ repeated EnumValue enumvalue = 2;
150
+ // Protocol buffer options.
151
+ repeated Option options = 3;
152
+ // The source context.
153
+ SourceContext source_context = 4;
154
+ // The source syntax.
155
+ Syntax syntax = 5;
156
+ // The source edition string, only valid when syntax is SYNTAX_EDITIONS.
157
+ string edition = 6;
158
+ }
159
+
160
+ // Enum value definition.
161
+ message EnumValue {
162
+ // Enum value name.
163
+ string name = 1;
164
+ // Enum value number.
165
+ int32 number = 2;
166
+ // Protocol buffer options.
167
+ repeated Option options = 3;
168
+ }
169
+
170
+ // A protocol buffer option, which can be attached to a message, field,
171
+ // enumeration, etc.
172
+ message Option {
173
+ // The option's name. For protobuf built-in options (options defined in
174
+ // descriptor.proto), this is the short name. For example, `"map_entry"`.
175
+ // For custom options, it should be the fully-qualified name. For example,
176
+ // `"google.api.http"`.
177
+ string name = 1;
178
+ // The option's value packed in an Any message. If the value is a primitive,
179
+ // the corresponding wrapper type defined in google/protobuf/wrappers.proto
180
+ // should be used. If the value is an enum, it should be stored as an int32
181
+ // value using the google.protobuf.Int32Value type.
182
+ Any value = 2;
183
+ }
184
+
185
+ // The syntax in which a protocol buffer element is defined.
186
+ enum Syntax {
187
+ // Syntax `proto2`.
188
+ SYNTAX_PROTO2 = 0;
189
+ // Syntax `proto3`.
190
+ SYNTAX_PROTO3 = 1;
191
+ // Syntax `editions`.
192
+ SYNTAX_EDITIONS = 2;
193
+ }
@@ -0,0 +1,157 @@
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
+ //
31
+ // Wrappers for primitive (non-message) types. These types were needed
32
+ // for legacy reasons and are not recommended for use in new APIs.
33
+ //
34
+ // Historically these wrappers were useful to have presence on proto3 primitive
35
+ // fields, but proto3 syntax has been updated to support the `optional` keyword.
36
+ // Using that keyword is now the strongly preferred way to add presence to
37
+ // proto3 primitive fields.
38
+ //
39
+ // A secondary usecase was to embed primitives in the `google.protobuf.Any`
40
+ // type: it is now recommended that you embed your value in your own wrapper
41
+ // message which can be specifically documented.
42
+ //
43
+ // These wrappers have no meaningful use within repeated fields as they lack
44
+ // the ability to detect presence on individual elements.
45
+ // These wrappers have no meaningful use within a map or a oneof since
46
+ // individual entries of a map or fields of a oneof can already detect presence.
47
+
48
+ syntax = "proto3";
49
+
50
+ package google.protobuf;
51
+
52
+ option cc_enable_arenas = true;
53
+ option go_package = "google.golang.org/protobuf/types/known/wrapperspb";
54
+ option java_package = "com.google.protobuf";
55
+ option java_outer_classname = "WrappersProto";
56
+ option java_multiple_files = true;
57
+ option objc_class_prefix = "GPB";
58
+ option csharp_namespace = "Google.Protobuf.WellKnownTypes";
59
+
60
+ // Wrapper message for `double`.
61
+ //
62
+ // The JSON representation for `DoubleValue` is JSON number.
63
+ //
64
+ // Not recommended for use in new APIs, but still useful for legacy APIs and
65
+ // has no plan to be removed.
66
+ message DoubleValue {
67
+ // The double value.
68
+ double value = 1;
69
+ }
70
+
71
+ // Wrapper message for `float`.
72
+ //
73
+ // The JSON representation for `FloatValue` is JSON number.
74
+ //
75
+ // Not recommended for use in new APIs, but still useful for legacy APIs and
76
+ // has no plan to be removed.
77
+ message FloatValue {
78
+ // The float value.
79
+ float value = 1;
80
+ }
81
+
82
+ // Wrapper message for `int64`.
83
+ //
84
+ // The JSON representation for `Int64Value` is JSON string.
85
+ //
86
+ // Not recommended for use in new APIs, but still useful for legacy APIs and
87
+ // has no plan to be removed.
88
+ message Int64Value {
89
+ // The int64 value.
90
+ int64 value = 1;
91
+ }
92
+
93
+ // Wrapper message for `uint64`.
94
+ //
95
+ // The JSON representation for `UInt64Value` is JSON string.
96
+ //
97
+ // Not recommended for use in new APIs, but still useful for legacy APIs and
98
+ // has no plan to be removed.
99
+ message UInt64Value {
100
+ // The uint64 value.
101
+ uint64 value = 1;
102
+ }
103
+
104
+ // Wrapper message for `int32`.
105
+ //
106
+ // The JSON representation for `Int32Value` is JSON number.
107
+ //
108
+ // Not recommended for use in new APIs, but still useful for legacy APIs and
109
+ // has no plan to be removed.
110
+ message Int32Value {
111
+ // The int32 value.
112
+ int32 value = 1;
113
+ }
114
+
115
+ // Wrapper message for `uint32`.
116
+ //
117
+ // The JSON representation for `UInt32Value` is JSON number.
118
+ //
119
+ // Not recommended for use in new APIs, but still useful for legacy APIs and
120
+ // has no plan to be removed.
121
+ message UInt32Value {
122
+ // The uint32 value.
123
+ uint32 value = 1;
124
+ }
125
+
126
+ // Wrapper message for `bool`.
127
+ //
128
+ // The JSON representation for `BoolValue` is JSON `true` and `false`.
129
+ //
130
+ // Not recommended for use in new APIs, but still useful for legacy APIs and
131
+ // has no plan to be removed.
132
+ message BoolValue {
133
+ // The bool value.
134
+ bool value = 1;
135
+ }
136
+
137
+ // Wrapper message for `string`.
138
+ //
139
+ // The JSON representation for `StringValue` is JSON string.
140
+ //
141
+ // Not recommended for use in new APIs, but still useful for legacy APIs and
142
+ // has no plan to be removed.
143
+ message StringValue {
144
+ // The string value.
145
+ string value = 1;
146
+ }
147
+
148
+ // Wrapper message for `bytes`.
149
+ //
150
+ // The JSON representation for `BytesValue` is JSON string.
151
+ //
152
+ // Not recommended for use in new APIs, but still useful for legacy APIs and
153
+ // has no plan to be removed.
154
+ message BytesValue {
155
+ // The bytes value.
156
+ bytes value = 1;
157
+ }