reproto 0.1.1__py3-none-any.whl → 0.1.2__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.
- .git/COMMIT_EDITMSG +30 -1
- .git/index +0 -0
- .git/logs/HEAD +1 -0
- .git/logs/refs/heads/iyue +1 -0
- .git/logs/refs/remotes/gitlab/iyue +1 -0
- .git/logs/refs/remotes/origin/iyue +1 -0
- .git/objects/03/3fab23ccc74b707a31f6f37dc5df42c100aac0 +0 -0
- .git/objects/07/b71df33935c14ddf99e3480c04eca4685028bc +0 -0
- .git/objects/0b/e20ea749c6ae1075ae98f9426e00b0a4a235af +0 -0
- .git/objects/13/5f50fea51c72f977f48d06a7584aba0f61e260 +0 -0
- .git/objects/1b/97584ebada3e93d7a2cfa4a1aae0b79c414d20 +0 -0
- .git/objects/1b/f0c1ad9586578e8332d061f7648dcb041ec063 +0 -0
- .git/objects/1e/46816d16e7c9db7575f1964403c3daa105be5c +0 -0
- .git/objects/27/24208ca2442e8ab9b453d0eb230fa41243b270 +0 -0
- .git/objects/2d/2b812ca27c477f9e1b2c2706a5eb795ffcf8eb +0 -0
- .git/objects/3f/b8830f516342a0ae1cb7c34b65016827cb9570 +4 -0
- .git/objects/41/f40c22247de377be99e30784229f3f128508a2 +0 -0
- .git/objects/48/cb11e75518a53be14146018214110986fade67 +0 -0
- .git/objects/4f/c6dc41f9c0a1a8e0eedd3ba49c43d78d0dbaba +0 -0
- .git/objects/59/4c23f158ccbd0a4288f9ea046d06160195afbf +0 -0
- .git/objects/5b/d4d87753b79e9157817f0c2e6964a731052854 +0 -0
- .git/objects/65/0189fe083bd711e45d463b229a72be619abad2 +0 -0
- .git/objects/66/663db35bfec8ef5f1a5b1c840fde1bb62a0eb8 +0 -0
- .git/objects/8a/0ed0ed8886fbc823e8d2258fa6d18699e94e25 +0 -0
- .git/objects/8d/d857b3d0ab3f5cd2e9173d532ef86e30df8eda +0 -0
- .git/objects/9e/23448ac58f907d9d123c32bdccedbb3d6741b5 +0 -0
- .git/objects/a0/d192999af7e2cbfa6a9ccd04d720a04e5a06d5 +0 -0
- .git/objects/a9/cc7923c34a4c97c5711d6309672f41d46c612a +0 -0
- .git/objects/af/c9cc15629847447063e86a82b8b56abb4fc08f +0 -0
- .git/objects/b1/db1c131cf32916028342c0037ce8eb57a8eb26 +0 -0
- .git/objects/b2/8334b94392b8af397a05ed702690fa6c9ab1ca +0 -0
- .git/objects/b8/7c89dcfce9e244ff5ef6a4bd394de12e8c8092 +0 -0
- .git/objects/d9/3bd435c8c7ad4efb83dff04d5450fabb9e3faf +0 -0
- .git/objects/e3/27755808d88c7ae5c06c229cf18bd0519646df +0 -0
- .git/objects/e5/83e7c40be934d16a1fa2e973487b395d930f42 +0 -0
- .git/objects/ed/1ae867d5e63195845afc58d88c38ecbdea97df +0 -0
- .git/objects/ef/f44e5099da27f7fb1ef14bb34902ccf4250b89 +0 -0
- .git/objects/f5/1be495b96272fa2e47f30071aed35ac1f0dd2c +0 -0
- .git/objects/fd/0bc07dc3c95e6168ab6d367d9eca139ac1e539 +0 -0
- .git/refs/heads/iyue +1 -1
- .git/refs/remotes/gitlab/iyue +1 -1
- .git/refs/remotes/origin/iyue +1 -1
- .gitignore +2 -1
- core/info_decoder.py +507 -6
- core/reconstructor.py +135 -6
- generation/proto_generator.py +51 -11
- include/google/protobuf/any.proto +162 -0
- include/google/protobuf/api.proto +207 -0
- include/google/protobuf/compiler/plugin.proto +180 -0
- include/google/protobuf/cpp_features.proto +67 -0
- include/google/protobuf/descriptor.proto +1417 -0
- include/google/protobuf/duration.proto +115 -0
- include/google/protobuf/empty.proto +51 -0
- include/google/protobuf/field_mask.proto +245 -0
- include/google/protobuf/go_features.proto +80 -0
- include/google/protobuf/java_features.proto +130 -0
- include/google/protobuf/source_context.proto +48 -0
- include/google/protobuf/struct.proto +95 -0
- include/google/protobuf/timestamp.proto +144 -0
- include/google/protobuf/type.proto +193 -0
- include/google/protobuf/wrappers.proto +157 -0
- parsing/java_parser.py +295 -12
- pyproject.toml +1 -1
- {reproto-0.1.1.dist-info → reproto-0.1.2.dist-info}/METADATA +1 -1
- {reproto-0.1.1.dist-info → reproto-0.1.2.dist-info}/RECORD +69 -20
- utils/builtin_proto.py +262 -0
- utils/type_utils.py +39 -6
- {reproto-0.1.1.dist-info → reproto-0.1.2.dist-info}/WHEEL +0 -0
- {reproto-0.1.1.dist-info → reproto-0.1.2.dist-info}/entry_points.txt +0 -0
@@ -0,0 +1,115 @@
|
|
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/durationpb";
|
37
|
+
option java_package = "com.google.protobuf";
|
38
|
+
option java_outer_classname = "DurationProto";
|
39
|
+
option java_multiple_files = true;
|
40
|
+
option objc_class_prefix = "GPB";
|
41
|
+
option csharp_namespace = "Google.Protobuf.WellKnownTypes";
|
42
|
+
|
43
|
+
// A Duration represents a signed, fixed-length span of time represented
|
44
|
+
// as a count of seconds and fractions of seconds at nanosecond
|
45
|
+
// resolution. It is independent of any calendar and concepts like "day"
|
46
|
+
// or "month". It is related to Timestamp in that the difference between
|
47
|
+
// two Timestamp values is a Duration and it can be added or subtracted
|
48
|
+
// from a Timestamp. Range is approximately +-10,000 years.
|
49
|
+
//
|
50
|
+
// # Examples
|
51
|
+
//
|
52
|
+
// Example 1: Compute Duration from two Timestamps in pseudo code.
|
53
|
+
//
|
54
|
+
// Timestamp start = ...;
|
55
|
+
// Timestamp end = ...;
|
56
|
+
// Duration duration = ...;
|
57
|
+
//
|
58
|
+
// duration.seconds = end.seconds - start.seconds;
|
59
|
+
// duration.nanos = end.nanos - start.nanos;
|
60
|
+
//
|
61
|
+
// if (duration.seconds < 0 && duration.nanos > 0) {
|
62
|
+
// duration.seconds += 1;
|
63
|
+
// duration.nanos -= 1000000000;
|
64
|
+
// } else if (duration.seconds > 0 && duration.nanos < 0) {
|
65
|
+
// duration.seconds -= 1;
|
66
|
+
// duration.nanos += 1000000000;
|
67
|
+
// }
|
68
|
+
//
|
69
|
+
// Example 2: Compute Timestamp from Timestamp + Duration in pseudo code.
|
70
|
+
//
|
71
|
+
// Timestamp start = ...;
|
72
|
+
// Duration duration = ...;
|
73
|
+
// Timestamp end = ...;
|
74
|
+
//
|
75
|
+
// end.seconds = start.seconds + duration.seconds;
|
76
|
+
// end.nanos = start.nanos + duration.nanos;
|
77
|
+
//
|
78
|
+
// if (end.nanos < 0) {
|
79
|
+
// end.seconds -= 1;
|
80
|
+
// end.nanos += 1000000000;
|
81
|
+
// } else if (end.nanos >= 1000000000) {
|
82
|
+
// end.seconds += 1;
|
83
|
+
// end.nanos -= 1000000000;
|
84
|
+
// }
|
85
|
+
//
|
86
|
+
// Example 3: Compute Duration from datetime.timedelta in Python.
|
87
|
+
//
|
88
|
+
// td = datetime.timedelta(days=3, minutes=10)
|
89
|
+
// duration = Duration()
|
90
|
+
// duration.FromTimedelta(td)
|
91
|
+
//
|
92
|
+
// # JSON Mapping
|
93
|
+
//
|
94
|
+
// In JSON format, the Duration type is encoded as a string rather than an
|
95
|
+
// object, where the string ends in the suffix "s" (indicating seconds) and
|
96
|
+
// is preceded by the number of seconds, with nanoseconds expressed as
|
97
|
+
// fractional seconds. For example, 3 seconds with 0 nanoseconds should be
|
98
|
+
// encoded in JSON format as "3s", while 3 seconds and 1 nanosecond should
|
99
|
+
// be expressed in JSON format as "3.000000001s", and 3 seconds and 1
|
100
|
+
// microsecond should be expressed in JSON format as "3.000001s".
|
101
|
+
//
|
102
|
+
message Duration {
|
103
|
+
// Signed seconds of the span of time. Must be from -315,576,000,000
|
104
|
+
// to +315,576,000,000 inclusive. Note: these bounds are computed from:
|
105
|
+
// 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years
|
106
|
+
int64 seconds = 1;
|
107
|
+
|
108
|
+
// Signed fractions of a second at nanosecond resolution of the span
|
109
|
+
// of time. Durations less than one second are represented with a 0
|
110
|
+
// `seconds` field and a positive or negative `nanos` field. For durations
|
111
|
+
// of one second or more, a non-zero value for the `nanos` field must be
|
112
|
+
// of the same sign as the `seconds` field. Must be from -999,999,999
|
113
|
+
// to +999,999,999 inclusive.
|
114
|
+
int32 nanos = 2;
|
115
|
+
}
|
@@ -0,0 +1,51 @@
|
|
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 go_package = "google.golang.org/protobuf/types/known/emptypb";
|
36
|
+
option java_package = "com.google.protobuf";
|
37
|
+
option java_outer_classname = "EmptyProto";
|
38
|
+
option java_multiple_files = true;
|
39
|
+
option objc_class_prefix = "GPB";
|
40
|
+
option csharp_namespace = "Google.Protobuf.WellKnownTypes";
|
41
|
+
option cc_enable_arenas = true;
|
42
|
+
|
43
|
+
// A generic empty message that you can re-use to avoid defining duplicated
|
44
|
+
// empty messages in your APIs. A typical example is to use it as the request
|
45
|
+
// or the response type of an API method. For instance:
|
46
|
+
//
|
47
|
+
// service Foo {
|
48
|
+
// rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty);
|
49
|
+
// }
|
50
|
+
//
|
51
|
+
message Empty {}
|
@@ -0,0 +1,245 @@
|
|
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 java_package = "com.google.protobuf";
|
36
|
+
option java_outer_classname = "FieldMaskProto";
|
37
|
+
option java_multiple_files = true;
|
38
|
+
option objc_class_prefix = "GPB";
|
39
|
+
option csharp_namespace = "Google.Protobuf.WellKnownTypes";
|
40
|
+
option go_package = "google.golang.org/protobuf/types/known/fieldmaskpb";
|
41
|
+
option cc_enable_arenas = true;
|
42
|
+
|
43
|
+
// `FieldMask` represents a set of symbolic field paths, for example:
|
44
|
+
//
|
45
|
+
// paths: "f.a"
|
46
|
+
// paths: "f.b.d"
|
47
|
+
//
|
48
|
+
// Here `f` represents a field in some root message, `a` and `b`
|
49
|
+
// fields in the message found in `f`, and `d` a field found in the
|
50
|
+
// message in `f.b`.
|
51
|
+
//
|
52
|
+
// Field masks are used to specify a subset of fields that should be
|
53
|
+
// returned by a get operation or modified by an update operation.
|
54
|
+
// Field masks also have a custom JSON encoding (see below).
|
55
|
+
//
|
56
|
+
// # Field Masks in Projections
|
57
|
+
//
|
58
|
+
// When used in the context of a projection, a response message or
|
59
|
+
// sub-message is filtered by the API to only contain those fields as
|
60
|
+
// specified in the mask. For example, if the mask in the previous
|
61
|
+
// example is applied to a response message as follows:
|
62
|
+
//
|
63
|
+
// f {
|
64
|
+
// a : 22
|
65
|
+
// b {
|
66
|
+
// d : 1
|
67
|
+
// x : 2
|
68
|
+
// }
|
69
|
+
// y : 13
|
70
|
+
// }
|
71
|
+
// z: 8
|
72
|
+
//
|
73
|
+
// The result will not contain specific values for fields x,y and z
|
74
|
+
// (their value will be set to the default, and omitted in proto text
|
75
|
+
// output):
|
76
|
+
//
|
77
|
+
//
|
78
|
+
// f {
|
79
|
+
// a : 22
|
80
|
+
// b {
|
81
|
+
// d : 1
|
82
|
+
// }
|
83
|
+
// }
|
84
|
+
//
|
85
|
+
// A repeated field is not allowed except at the last position of a
|
86
|
+
// paths string.
|
87
|
+
//
|
88
|
+
// If a FieldMask object is not present in a get operation, the
|
89
|
+
// operation applies to all fields (as if a FieldMask of all fields
|
90
|
+
// had been specified).
|
91
|
+
//
|
92
|
+
// Note that a field mask does not necessarily apply to the
|
93
|
+
// top-level response message. In case of a REST get operation, the
|
94
|
+
// field mask applies directly to the response, but in case of a REST
|
95
|
+
// list operation, the mask instead applies to each individual message
|
96
|
+
// in the returned resource list. In case of a REST custom method,
|
97
|
+
// other definitions may be used. Where the mask applies will be
|
98
|
+
// clearly documented together with its declaration in the API. In
|
99
|
+
// any case, the effect on the returned resource/resources is required
|
100
|
+
// behavior for APIs.
|
101
|
+
//
|
102
|
+
// # Field Masks in Update Operations
|
103
|
+
//
|
104
|
+
// A field mask in update operations specifies which fields of the
|
105
|
+
// targeted resource are going to be updated. The API is required
|
106
|
+
// to only change the values of the fields as specified in the mask
|
107
|
+
// and leave the others untouched. If a resource is passed in to
|
108
|
+
// describe the updated values, the API ignores the values of all
|
109
|
+
// fields not covered by the mask.
|
110
|
+
//
|
111
|
+
// If a repeated field is specified for an update operation, new values will
|
112
|
+
// be appended to the existing repeated field in the target resource. Note that
|
113
|
+
// a repeated field is only allowed in the last position of a `paths` string.
|
114
|
+
//
|
115
|
+
// If a sub-message is specified in the last position of the field mask for an
|
116
|
+
// update operation, then new value will be merged into the existing sub-message
|
117
|
+
// in the target resource.
|
118
|
+
//
|
119
|
+
// For example, given the target message:
|
120
|
+
//
|
121
|
+
// f {
|
122
|
+
// b {
|
123
|
+
// d: 1
|
124
|
+
// x: 2
|
125
|
+
// }
|
126
|
+
// c: [1]
|
127
|
+
// }
|
128
|
+
//
|
129
|
+
// And an update message:
|
130
|
+
//
|
131
|
+
// f {
|
132
|
+
// b {
|
133
|
+
// d: 10
|
134
|
+
// }
|
135
|
+
// c: [2]
|
136
|
+
// }
|
137
|
+
//
|
138
|
+
// then if the field mask is:
|
139
|
+
//
|
140
|
+
// paths: ["f.b", "f.c"]
|
141
|
+
//
|
142
|
+
// then the result will be:
|
143
|
+
//
|
144
|
+
// f {
|
145
|
+
// b {
|
146
|
+
// d: 10
|
147
|
+
// x: 2
|
148
|
+
// }
|
149
|
+
// c: [1, 2]
|
150
|
+
// }
|
151
|
+
//
|
152
|
+
// An implementation may provide options to override this default behavior for
|
153
|
+
// repeated and message fields.
|
154
|
+
//
|
155
|
+
// In order to reset a field's value to the default, the field must
|
156
|
+
// be in the mask and set to the default value in the provided resource.
|
157
|
+
// Hence, in order to reset all fields of a resource, provide a default
|
158
|
+
// instance of the resource and set all fields in the mask, or do
|
159
|
+
// not provide a mask as described below.
|
160
|
+
//
|
161
|
+
// If a field mask is not present on update, the operation applies to
|
162
|
+
// all fields (as if a field mask of all fields has been specified).
|
163
|
+
// Note that in the presence of schema evolution, this may mean that
|
164
|
+
// fields the client does not know and has therefore not filled into
|
165
|
+
// the request will be reset to their default. If this is unwanted
|
166
|
+
// behavior, a specific service may require a client to always specify
|
167
|
+
// a field mask, producing an error if not.
|
168
|
+
//
|
169
|
+
// As with get operations, the location of the resource which
|
170
|
+
// describes the updated values in the request message depends on the
|
171
|
+
// operation kind. In any case, the effect of the field mask is
|
172
|
+
// required to be honored by the API.
|
173
|
+
//
|
174
|
+
// ## Considerations for HTTP REST
|
175
|
+
//
|
176
|
+
// The HTTP kind of an update operation which uses a field mask must
|
177
|
+
// be set to PATCH instead of PUT in order to satisfy HTTP semantics
|
178
|
+
// (PUT must only be used for full updates).
|
179
|
+
//
|
180
|
+
// # JSON Encoding of Field Masks
|
181
|
+
//
|
182
|
+
// In JSON, a field mask is encoded as a single string where paths are
|
183
|
+
// separated by a comma. Fields name in each path are converted
|
184
|
+
// to/from lower-camel naming conventions.
|
185
|
+
//
|
186
|
+
// As an example, consider the following message declarations:
|
187
|
+
//
|
188
|
+
// message Profile {
|
189
|
+
// User user = 1;
|
190
|
+
// Photo photo = 2;
|
191
|
+
// }
|
192
|
+
// message User {
|
193
|
+
// string display_name = 1;
|
194
|
+
// string address = 2;
|
195
|
+
// }
|
196
|
+
//
|
197
|
+
// In proto a field mask for `Profile` may look as such:
|
198
|
+
//
|
199
|
+
// mask {
|
200
|
+
// paths: "user.display_name"
|
201
|
+
// paths: "photo"
|
202
|
+
// }
|
203
|
+
//
|
204
|
+
// In JSON, the same mask is represented as below:
|
205
|
+
//
|
206
|
+
// {
|
207
|
+
// mask: "user.displayName,photo"
|
208
|
+
// }
|
209
|
+
//
|
210
|
+
// # Field Masks and Oneof Fields
|
211
|
+
//
|
212
|
+
// Field masks treat fields in oneofs just as regular fields. Consider the
|
213
|
+
// following message:
|
214
|
+
//
|
215
|
+
// message SampleMessage {
|
216
|
+
// oneof test_oneof {
|
217
|
+
// string name = 4;
|
218
|
+
// SubMessage sub_message = 9;
|
219
|
+
// }
|
220
|
+
// }
|
221
|
+
//
|
222
|
+
// The field mask can be:
|
223
|
+
//
|
224
|
+
// mask {
|
225
|
+
// paths: "name"
|
226
|
+
// }
|
227
|
+
//
|
228
|
+
// Or:
|
229
|
+
//
|
230
|
+
// mask {
|
231
|
+
// paths: "sub_message"
|
232
|
+
// }
|
233
|
+
//
|
234
|
+
// Note that oneof type names ("test_oneof" in this case) cannot be used in
|
235
|
+
// paths.
|
236
|
+
//
|
237
|
+
// ## Field Mask Verification
|
238
|
+
//
|
239
|
+
// The implementation of any API method which has a FieldMask type field in the
|
240
|
+
// request should verify the included field paths, and return an
|
241
|
+
// `INVALID_ARGUMENT` error if any path is unmappable.
|
242
|
+
message FieldMask {
|
243
|
+
// The set of field mask paths.
|
244
|
+
repeated string paths = 1;
|
245
|
+
}
|
@@ -0,0 +1,80 @@
|
|
1
|
+
// Protocol Buffers - Google's data interchange format
|
2
|
+
// Copyright 2023 Google Inc. All rights reserved.
|
3
|
+
//
|
4
|
+
// Use of this source code is governed by a BSD-style
|
5
|
+
// license that can be found in the LICENSE file or at
|
6
|
+
// https://developers.google.com/open-source/licenses/bsd
|
7
|
+
|
8
|
+
syntax = "proto2";
|
9
|
+
|
10
|
+
package pb;
|
11
|
+
|
12
|
+
import "google/protobuf/descriptor.proto";
|
13
|
+
|
14
|
+
option go_package = "google.golang.org/protobuf/types/gofeaturespb";
|
15
|
+
|
16
|
+
extend google.protobuf.FeatureSet {
|
17
|
+
optional GoFeatures go = 1002;
|
18
|
+
}
|
19
|
+
|
20
|
+
message GoFeatures {
|
21
|
+
// Whether or not to generate the deprecated UnmarshalJSON method for enums.
|
22
|
+
// Can only be true for proto using the Open Struct api.
|
23
|
+
optional bool legacy_unmarshal_json_enum = 1 [
|
24
|
+
retention = RETENTION_RUNTIME,
|
25
|
+
targets = TARGET_TYPE_ENUM,
|
26
|
+
targets = TARGET_TYPE_FILE,
|
27
|
+
feature_support = {
|
28
|
+
edition_introduced: EDITION_2023,
|
29
|
+
edition_deprecated: EDITION_2023,
|
30
|
+
deprecation_warning: "The legacy UnmarshalJSON API is deprecated and "
|
31
|
+
"will be removed in a future edition.",
|
32
|
+
},
|
33
|
+
edition_defaults = { edition: EDITION_LEGACY, value: "true" },
|
34
|
+
edition_defaults = { edition: EDITION_PROTO3, value: "false" }
|
35
|
+
];
|
36
|
+
|
37
|
+
enum APILevel {
|
38
|
+
// API_LEVEL_UNSPECIFIED results in selecting the OPEN API,
|
39
|
+
// but needs to be a separate value to distinguish between
|
40
|
+
// an explicitly set api level or a missing api level.
|
41
|
+
API_LEVEL_UNSPECIFIED = 0;
|
42
|
+
API_OPEN = 1;
|
43
|
+
API_HYBRID = 2;
|
44
|
+
API_OPAQUE = 3;
|
45
|
+
}
|
46
|
+
|
47
|
+
// One of OPEN, HYBRID or OPAQUE.
|
48
|
+
optional APILevel api_level = 2 [
|
49
|
+
retention = RETENTION_RUNTIME,
|
50
|
+
targets = TARGET_TYPE_MESSAGE,
|
51
|
+
targets = TARGET_TYPE_FILE,
|
52
|
+
feature_support = {
|
53
|
+
edition_introduced: EDITION_2023,
|
54
|
+
},
|
55
|
+
edition_defaults = { edition: EDITION_LEGACY, value: "API_LEVEL_UNSPECIFIED" },
|
56
|
+
edition_defaults = { edition: EDITION_2024, value: "API_OPAQUE" }
|
57
|
+
];
|
58
|
+
|
59
|
+
enum StripEnumPrefix {
|
60
|
+
STRIP_ENUM_PREFIX_UNSPECIFIED = 0;
|
61
|
+
STRIP_ENUM_PREFIX_KEEP = 1;
|
62
|
+
STRIP_ENUM_PREFIX_GENERATE_BOTH = 2;
|
63
|
+
STRIP_ENUM_PREFIX_STRIP = 3;
|
64
|
+
}
|
65
|
+
|
66
|
+
optional StripEnumPrefix strip_enum_prefix = 3 [
|
67
|
+
retention = RETENTION_RUNTIME,
|
68
|
+
targets = TARGET_TYPE_ENUM,
|
69
|
+
targets = TARGET_TYPE_ENUM_ENTRY,
|
70
|
+
targets = TARGET_TYPE_FILE,
|
71
|
+
feature_support = {
|
72
|
+
edition_introduced: EDITION_2024,
|
73
|
+
},
|
74
|
+
// TODO: change the default to STRIP_ENUM_PREFIX_STRIP for edition 2025.
|
75
|
+
edition_defaults = {
|
76
|
+
edition: EDITION_LEGACY,
|
77
|
+
value: "STRIP_ENUM_PREFIX_KEEP"
|
78
|
+
}
|
79
|
+
];
|
80
|
+
}
|
@@ -0,0 +1,130 @@
|
|
1
|
+
|
2
|
+
// Protocol Buffers - Google's data interchange format
|
3
|
+
// Copyright 2023 Google Inc. All rights reserved.
|
4
|
+
//
|
5
|
+
// Use of this source code is governed by a BSD-style
|
6
|
+
// license that can be found in the LICENSE file or at
|
7
|
+
// https://developers.google.com/open-source/licenses/bsd
|
8
|
+
|
9
|
+
syntax = "proto2";
|
10
|
+
|
11
|
+
package pb;
|
12
|
+
|
13
|
+
import "google/protobuf/descriptor.proto";
|
14
|
+
|
15
|
+
option java_package = "com.google.protobuf";
|
16
|
+
option java_outer_classname = "JavaFeaturesProto";
|
17
|
+
|
18
|
+
extend google.protobuf.FeatureSet {
|
19
|
+
optional JavaFeatures java = 1001;
|
20
|
+
}
|
21
|
+
|
22
|
+
message JavaFeatures {
|
23
|
+
// Whether or not to treat an enum field as closed. This option is only
|
24
|
+
// applicable to enum fields, and will be removed in the future. It is
|
25
|
+
// consistent with the legacy behavior of using proto3 enum types for proto2
|
26
|
+
// fields.
|
27
|
+
optional bool legacy_closed_enum = 1 [
|
28
|
+
retention = RETENTION_RUNTIME,
|
29
|
+
targets = TARGET_TYPE_FIELD,
|
30
|
+
targets = TARGET_TYPE_FILE,
|
31
|
+
feature_support = {
|
32
|
+
edition_introduced: EDITION_2023,
|
33
|
+
edition_deprecated: EDITION_2023,
|
34
|
+
deprecation_warning: "The legacy closed enum behavior in Java is "
|
35
|
+
"deprecated and is scheduled to be removed in "
|
36
|
+
"edition 2025. See http://protobuf.dev/programming-guides/enum/#java for "
|
37
|
+
"more information.",
|
38
|
+
},
|
39
|
+
edition_defaults = { edition: EDITION_LEGACY, value: "true" },
|
40
|
+
edition_defaults = { edition: EDITION_PROTO3, value: "false" }
|
41
|
+
];
|
42
|
+
|
43
|
+
// The UTF8 validation strategy to use.
|
44
|
+
enum Utf8Validation {
|
45
|
+
// Invalid default, which should never be used.
|
46
|
+
UTF8_VALIDATION_UNKNOWN = 0;
|
47
|
+
// Respect the UTF8 validation behavior specified by the global
|
48
|
+
// utf8_validation feature.
|
49
|
+
DEFAULT = 1;
|
50
|
+
// Verifies UTF8 validity overriding the global utf8_validation
|
51
|
+
// feature. This represents the legacy java_string_check_utf8 option.
|
52
|
+
VERIFY = 2;
|
53
|
+
}
|
54
|
+
optional Utf8Validation utf8_validation = 2 [
|
55
|
+
retention = RETENTION_RUNTIME,
|
56
|
+
targets = TARGET_TYPE_FIELD,
|
57
|
+
targets = TARGET_TYPE_FILE,
|
58
|
+
feature_support = {
|
59
|
+
edition_introduced: EDITION_2023,
|
60
|
+
edition_deprecated: EDITION_2024,
|
61
|
+
deprecation_warning: "The Java-specific utf8 validation feature is "
|
62
|
+
"deprecated and is scheduled to be removed in "
|
63
|
+
"edition 2025. Utf8 validation behavior should "
|
64
|
+
"use the global cross-language utf8_validation "
|
65
|
+
"feature.",
|
66
|
+
},
|
67
|
+
edition_defaults = { edition: EDITION_LEGACY, value: "DEFAULT" }
|
68
|
+
];
|
69
|
+
|
70
|
+
// Allows creation of large Java enums, extending beyond the standard
|
71
|
+
// constant limits imposed by the Java language.
|
72
|
+
optional bool large_enum = 3 [
|
73
|
+
retention = RETENTION_RUNTIME,
|
74
|
+
targets = TARGET_TYPE_ENUM,
|
75
|
+
targets = TARGET_TYPE_FILE,
|
76
|
+
feature_support = {
|
77
|
+
edition_introduced: EDITION_2024,
|
78
|
+
},
|
79
|
+
edition_defaults = { edition: EDITION_LEGACY, value: "false" }
|
80
|
+
];
|
81
|
+
|
82
|
+
// Whether to use the old default outer class name scheme, or the new feature
|
83
|
+
// which adds a "Proto" suffix to the outer class name.
|
84
|
+
//
|
85
|
+
// Users will not be able to set this option, because we removed it in the
|
86
|
+
// same edition that it was introduced. But we use it to determine which
|
87
|
+
// naming scheme to use for outer class name defaults.
|
88
|
+
optional bool use_old_outer_classname_default = 4 [
|
89
|
+
retention = RETENTION_RUNTIME,
|
90
|
+
targets = TARGET_TYPE_FILE,
|
91
|
+
feature_support = {
|
92
|
+
edition_introduced: EDITION_2024,
|
93
|
+
edition_removed: EDITION_2024,
|
94
|
+
},
|
95
|
+
edition_defaults = { edition: EDITION_LEGACY, value: "true" },
|
96
|
+
edition_defaults = { edition: EDITION_2024, value: "false" }
|
97
|
+
];
|
98
|
+
|
99
|
+
message NestInFileClassFeature {
|
100
|
+
enum NestInFileClass {
|
101
|
+
// Invalid default, which should never be used.
|
102
|
+
NEST_IN_FILE_CLASS_UNKNOWN = 0;
|
103
|
+
// Do not nest the generated class in the file class.
|
104
|
+
NO = 1;
|
105
|
+
// Nest the generated class in the file class.
|
106
|
+
YES = 2;
|
107
|
+
// Fall back to the `java_multiple_files` option. Users won't be able to
|
108
|
+
// set this option.
|
109
|
+
LEGACY = 3 [feature_support = {
|
110
|
+
edition_introduced: EDITION_2024
|
111
|
+
edition_removed: EDITION_2024
|
112
|
+
}];
|
113
|
+
}
|
114
|
+
reserved 1 to max;
|
115
|
+
}
|
116
|
+
|
117
|
+
// Whether to nest the generated class in the generated file class. This is
|
118
|
+
// only applicable to *top-level* messages, enums, and services.
|
119
|
+
optional NestInFileClassFeature.NestInFileClass nest_in_file_class = 5 [
|
120
|
+
retention = RETENTION_SOURCE,
|
121
|
+
targets = TARGET_TYPE_MESSAGE,
|
122
|
+
targets = TARGET_TYPE_ENUM,
|
123
|
+
targets = TARGET_TYPE_SERVICE,
|
124
|
+
feature_support = {
|
125
|
+
edition_introduced: EDITION_2024,
|
126
|
+
},
|
127
|
+
edition_defaults = { edition: EDITION_LEGACY, value: "LEGACY" },
|
128
|
+
edition_defaults = { edition: EDITION_2024, value: "NO" }
|
129
|
+
];
|
130
|
+
}
|
@@ -0,0 +1,48 @@
|
|
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 java_package = "com.google.protobuf";
|
36
|
+
option java_outer_classname = "SourceContextProto";
|
37
|
+
option java_multiple_files = true;
|
38
|
+
option objc_class_prefix = "GPB";
|
39
|
+
option csharp_namespace = "Google.Protobuf.WellKnownTypes";
|
40
|
+
option go_package = "google.golang.org/protobuf/types/known/sourcecontextpb";
|
41
|
+
|
42
|
+
// `SourceContext` represents information about the source of a
|
43
|
+
// protobuf element, like the file in which it is defined.
|
44
|
+
message SourceContext {
|
45
|
+
// The path-qualified name of the .proto file that contained the associated
|
46
|
+
// protobuf element. For example: `"google/protobuf/source_context.proto"`.
|
47
|
+
string file_name = 1;
|
48
|
+
}
|