grpc-tools 1.81.1 → 1.82.0.pre1

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 (38) hide show
  1. checksums.yaml +4 -4
  2. data/bin/x86-linux/google/protobuf/any.proto +52 -108
  3. data/bin/x86-linux/google/protobuf/descriptor.proto +67 -29
  4. data/bin/x86-linux/google/protobuf/field_mask.proto +16 -18
  5. data/bin/x86-linux/google/protobuf/struct.proto +38 -22
  6. data/bin/x86-linux/google/protobuf/timestamp.proto +3 -3
  7. data/bin/x86-linux/grpc_ruby_plugin +0 -0
  8. data/bin/x86-linux/protoc +0 -0
  9. data/bin/x86-windows/google/protobuf/any.proto +52 -108
  10. data/bin/x86-windows/google/protobuf/descriptor.proto +67 -29
  11. data/bin/x86-windows/google/protobuf/field_mask.proto +16 -18
  12. data/bin/x86-windows/google/protobuf/struct.proto +38 -22
  13. data/bin/x86-windows/google/protobuf/timestamp.proto +3 -3
  14. data/bin/x86-windows/grpc_ruby_plugin.exe +0 -0
  15. data/bin/x86-windows/protoc.exe +0 -0
  16. data/bin/x86_64-linux/google/protobuf/any.proto +52 -108
  17. data/bin/x86_64-linux/google/protobuf/descriptor.proto +67 -29
  18. data/bin/x86_64-linux/google/protobuf/field_mask.proto +16 -18
  19. data/bin/x86_64-linux/google/protobuf/struct.proto +38 -22
  20. data/bin/x86_64-linux/google/protobuf/timestamp.proto +3 -3
  21. data/bin/x86_64-linux/grpc_ruby_plugin +0 -0
  22. data/bin/x86_64-linux/protoc +0 -0
  23. data/bin/x86_64-macos/google/protobuf/any.proto +52 -108
  24. data/bin/x86_64-macos/google/protobuf/descriptor.proto +67 -29
  25. data/bin/x86_64-macos/google/protobuf/field_mask.proto +16 -18
  26. data/bin/x86_64-macos/google/protobuf/struct.proto +38 -22
  27. data/bin/x86_64-macos/google/protobuf/timestamp.proto +3 -3
  28. data/bin/x86_64-macos/grpc_ruby_plugin +0 -0
  29. data/bin/x86_64-macos/protoc +0 -0
  30. data/bin/x86_64-windows/google/protobuf/any.proto +52 -108
  31. data/bin/x86_64-windows/google/protobuf/descriptor.proto +67 -29
  32. data/bin/x86_64-windows/google/protobuf/field_mask.proto +16 -18
  33. data/bin/x86_64-windows/google/protobuf/struct.proto +38 -22
  34. data/bin/x86_64-windows/google/protobuf/timestamp.proto +3 -3
  35. data/bin/x86_64-windows/grpc_ruby_plugin.exe +0 -0
  36. data/bin/x86_64-windows/protoc.exe +0 -0
  37. data/version.rb +1 -1
  38. metadata +4 -4
@@ -42,121 +42,65 @@ option csharp_namespace = "Google.Protobuf.WellKnownTypes";
42
42
  // `Any` contains an arbitrary serialized protocol buffer message along with a
43
43
  // URL that describes the type of the serialized message.
44
44
  //
45
- // Protobuf library provides support to pack/unpack Any values in the form
46
- // of utility functions or additional generated methods of the Any type.
47
- //
48
- // Example 1: Pack and unpack a message in C++.
49
- //
50
- // Foo foo = ...;
51
- // Any any;
52
- // any.PackFrom(foo);
53
- // ...
54
- // if (any.UnpackTo(&foo)) {
55
- // ...
56
- // }
57
- //
58
- // Example 2: Pack and unpack a message in Java.
59
- //
60
- // Foo foo = ...;
61
- // Any any = Any.pack(foo);
62
- // ...
63
- // if (any.is(Foo.class)) {
64
- // foo = any.unpack(Foo.class);
65
- // }
66
- // // or ...
67
- // if (any.isSameTypeAs(Foo.getDefaultInstance())) {
68
- // foo = any.unpack(Foo.getDefaultInstance());
69
- // }
70
- //
71
- // Example 3: Pack and unpack a message in Python.
72
- //
73
- // foo = Foo(...)
74
- // any = Any()
75
- // any.Pack(foo)
76
- // ...
77
- // if any.Is(Foo.DESCRIPTOR):
78
- // any.Unpack(foo)
79
- // ...
80
- //
81
- // Example 4: Pack and unpack a message in Go
82
- //
83
- // foo := &pb.Foo{...}
84
- // any, err := anypb.New(foo)
85
- // if err != nil {
86
- // ...
87
- // }
88
- // ...
89
- // foo := &pb.Foo{}
90
- // if err := any.UnmarshalTo(foo); err != nil {
91
- // ...
92
- // }
93
- //
94
- // The pack methods provided by protobuf library will by default use
95
- // 'type.googleapis.com/full.type.name' as the type URL and the unpack
96
- // methods only use the fully qualified type name after the last '/'
97
- // in the type URL, for example "foo.bar.com/x/y.z" will yield type
98
- // name "y.z".
99
- //
100
- // JSON
101
- // ====
102
- // The JSON representation of an `Any` value uses the regular
103
- // representation of the deserialized, embedded message, with an
104
- // additional field `@type` which contains the type URL. Example:
105
- //
106
- // package google.profile;
107
- // message Person {
108
- // string first_name = 1;
109
- // string last_name = 2;
110
- // }
111
- //
112
- // {
113
- // "@type": "type.googleapis.com/google.profile.Person",
114
- // "firstName": <string>,
115
- // "lastName": <string>
116
- // }
117
- //
118
- // If the embedded message type is well-known and has a custom JSON
119
- // representation, that representation will be embedded adding a field
120
- // `value` which holds the custom JSON in addition to the `@type`
121
- // field. Example (for message [google.protobuf.Duration][]):
122
- //
123
- // {
124
- // "@type": "type.googleapis.com/google.protobuf.Duration",
125
- // "value": "1.212s"
126
- // }
127
- //
45
+ // In its binary encoding, an `Any` is an ordinary message; but in other wire
46
+ // forms like JSON, it has a special encoding. The format of the type URL is
47
+ // described on the `type_url` field.
48
+ //
49
+ // Protobuf APIs provide utilities to interact with `Any` values:
50
+ //
51
+ // - A 'pack' operation accepts a message and constructs a generic `Any` wrapper
52
+ // around it.
53
+ // - An 'unpack' operation reads the content of an `Any` message, either into an
54
+ // existing message or a new one. Unpack operations must check the type of the
55
+ // value they unpack against the declared `type_url`.
56
+ // - An 'is' operation decides whether an `Any` contains a message of the given
57
+ // type, i.e. whether it can 'unpack' that type.
58
+ //
59
+ // The JSON format representation of an `Any` follows one of these cases:
60
+ //
61
+ // - For types without special-cased JSON encodings, the JSON format
62
+ // representation of the `Any` is the same as that of the message, with an
63
+ // additional `@type` field which contains the type URL.
64
+ // - For types with special-cased JSON encodings (typically called 'well-known'
65
+ // types, listed in https://protobuf.dev/programming-guides/json/#any), the
66
+ // JSON format representation has a key `@type` which contains the type URL
67
+ // and a key `value` which contains the JSON-serialized value.
68
+ //
69
+ // The text format representation of an `Any` is like a message with one field
70
+ // whose name is the type URL in brackets. For example, an `Any` containing a
71
+ // `foo.Bar` message may be written `[type.googleapis.com/foo.Bar] { a: 2 }`.
128
72
  message Any {
129
- // A URL/resource name that uniquely identifies the type of the serialized
130
- // protocol buffer message. This string must contain at least
131
- // one "/" character. The last segment of the URL's path must represent
132
- // the fully qualified name of the type (as in
133
- // `path/google.protobuf.Duration`). The name should be in a canonical form
134
- // (e.g., leading "." is not accepted).
73
+ // Identifies the type of the serialized Protobuf message with a URI reference
74
+ // consisting of a prefix ending in a slash and the fully-qualified type name.
135
75
  //
136
- // In practice, teams usually precompile into the binary all types that they
137
- // expect it to use in the context of Any. However, for URLs which use the
138
- // scheme `http`, `https`, or no scheme, one can optionally set up a type
139
- // server that maps type URLs to message definitions as follows:
76
+ // Example: type.googleapis.com/google.protobuf.StringValue
140
77
  //
141
- // * If no scheme is provided, `https` is assumed.
142
- // * An HTTP GET on the URL must yield a [google.protobuf.Type][]
143
- // value in binary format, or produce an error.
144
- // * Applications are allowed to cache lookup results based on the
145
- // URL, or have them precompiled into a binary to avoid any
146
- // lookup. Therefore, binary compatibility needs to be preserved
147
- // on changes to types. (Use versioned type names to manage
148
- // breaking changes.)
78
+ // This string must contain at least one `/` character, and the content after
79
+ // the last `/` must be the fully-qualified name of the type in canonical
80
+ // form, without a leading dot. Do not write a scheme on these URI references
81
+ // so that clients do not attempt to contact them.
149
82
  //
150
- // Note: this functionality is not currently available in the official
151
- // protobuf release, and it is not used for type URLs beginning with
152
- // type.googleapis.com. As of May 2023, there are no widely used type server
153
- // implementations and no plans to implement one.
83
+ // The prefix is arbitrary and Protobuf implementations are expected to
84
+ // simply strip off everything up to and including the last `/` to identify
85
+ // the type. `type.googleapis.com/` is a common default prefix that some
86
+ // legacy implementations require. This prefix does not indicate the origin of
87
+ // the type, and URIs containing it are not expected to respond to any
88
+ // requests.
154
89
  //
155
- // Schemes other than `http`, `https` (or the empty scheme) might be
156
- // used with implementation specific semantics.
90
+ // All type URL strings must be legal URI references with the additional
91
+ // restriction (for the text format) that the content of the reference
92
+ // must consist only of alphanumeric characters, percent-encoded escapes, and
93
+ // characters in the following set (not including the outer backticks):
94
+ // `/-.~_!$&()*+,;=`. Despite our allowing percent encodings, implementations
95
+ // should not unescape them to prevent confusion with existing parsers. For
96
+ // example, `type.googleapis.com%2FFoo` should be rejected.
157
97
  //
98
+ // In the original design of `Any`, the possibility of launching a type
99
+ // resolution service at these type URLs was considered but Protobuf never
100
+ // implemented one and considers contacting these URLs to be problematic and
101
+ // a potential security issue. Do not attempt to contact type URLs.
158
102
  string type_url = 1;
159
103
 
160
- // Must be a valid serialized protocol buffer of the above specified type.
104
+ // Holds a Protobuf serialization of the type described by type_url.
161
105
  bytes value = 2;
162
106
  }
@@ -1,32 +1,9 @@
1
1
  // Protocol Buffers - Google's data interchange format
2
- // Copyright 2008 Google Inc. All rights reserved.
3
- // https://developers.google.com/protocol-buffers/
2
+ // Copyright 2008 Google LLC. All rights reserved.
4
3
  //
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.
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
30
7
 
31
8
  // Author: kenton@google.com (Kenton Varda)
32
9
  // Based on original Protocol Buffers design by
@@ -85,6 +62,7 @@ enum Edition {
85
62
  // comparison.
86
63
  EDITION_2023 = 1000;
87
64
  EDITION_2024 = 1001;
65
+ EDITION_2026 = 1002;
88
66
 
89
67
  // A placeholder edition for developing and testing unscheduled features.
90
68
  EDITION_UNSTABLE = 9999;
@@ -189,6 +167,9 @@ message DescriptorProto {
189
167
  }
190
168
 
191
169
  message ExtensionRangeOptions {
170
+ // Range reserved for first-class custom options defined by the Protobuf
171
+ // team. User custom options must use the 1000+ range instead.
172
+ extensions 990 to 998;
192
173
  // The parser stores options it doesn't recognize here. See above.
193
174
  repeated UninterpretedOption uninterpreted_option = 999;
194
175
 
@@ -476,7 +457,17 @@ message FileOptions {
476
457
  // named by java_outer_classname. However, the wrapper class will still be
477
458
  // generated to contain the file's getDescriptor() method as well as any
478
459
  // top-level extensions defined in the file.
479
- optional bool java_multiple_files = 10 [default = false];
460
+ optional bool java_multiple_files = 10 [
461
+ default = false,
462
+ feature_support = {
463
+ edition_introduced: EDITION_PROTO2
464
+ edition_removed: EDITION_2024
465
+ removal_error: "This behavior is enabled by default in editions 2024 and above. "
466
+ "To disable it, you can set `features.(pb.java).nest_in_file_class = YES` "
467
+ "on individual messages, enums, or services."
468
+
469
+ }
470
+ ];
480
471
 
481
472
  // This option does nothing.
482
473
  optional bool java_generate_equals_and_hash = 20 [deprecated=true];
@@ -573,6 +564,14 @@ message FileOptions {
573
564
  // developers should rely on the protoreflect APIs for their client language.
574
565
  optional FeatureSet features = 50;
575
566
 
567
+ // Range reserved for first-class custom options defined by the Protobuf
568
+ // team. User custom options must use the 1000+ range instead.
569
+ extensions 990 to 998 [declaration = {
570
+ number: 990,
571
+ full_name: ".pb.file.cpp",
572
+ type: ".pb.file.CppFileOptions"
573
+ }];
574
+
576
575
  // The parser stores options it doesn't recognize here.
577
576
  // See the documentation for the "Options" section above.
578
577
  repeated UninterpretedOption uninterpreted_option = 999;
@@ -662,6 +661,10 @@ message MessageOptions {
662
661
  // developers should rely on the protoreflect APIs for their client language.
663
662
  optional FeatureSet features = 12;
664
663
 
664
+ // Range reserved for first-class custom options defined by the Protobuf
665
+ // team. User custom options must use the 1000+ range instead.
666
+ extensions 990 to 998;
667
+
665
668
  // The parser stores options it doesn't recognize here. See above.
666
669
  repeated UninterpretedOption uninterpreted_option = 999;
667
670
 
@@ -825,9 +828,17 @@ message FieldOptions {
825
828
  // this one, the last default assigned will be used, and proto files will
826
829
  // not be able to override it.
827
830
  optional Edition edition_removed = 4;
831
+
832
+ // The removal error text if this feature is used after the edition it was
833
+ // removed in.
834
+ optional string removal_error = 5;
828
835
  }
829
836
  optional FeatureSupport feature_support = 22;
830
837
 
838
+ // Range reserved for first-class custom options defined by the Protobuf
839
+ // team. User custom options must use the 1000+ range instead.
840
+ extensions 990 to 998;
841
+
831
842
  // The parser stores options it doesn't recognize here. See above.
832
843
  repeated UninterpretedOption uninterpreted_option = 999;
833
844
 
@@ -845,6 +856,10 @@ message OneofOptions {
845
856
  // developers should rely on the protoreflect APIs for their client language.
846
857
  optional FeatureSet features = 1;
847
858
 
859
+ // Range reserved for first-class custom options defined by the Protobuf
860
+ // team. User custom options must use the 1000+ range instead.
861
+ extensions 990 to 998;
862
+
848
863
  // The parser stores options it doesn't recognize here. See above.
849
864
  repeated UninterpretedOption uninterpreted_option = 999;
850
865
 
@@ -880,6 +895,10 @@ message EnumOptions {
880
895
  // developers should rely on the protoreflect APIs for their client language.
881
896
  optional FeatureSet features = 7;
882
897
 
898
+ // Range reserved for first-class custom options defined by the Protobuf
899
+ // team. User custom options must use the 1000+ range instead.
900
+ extensions 990 to 998;
901
+
883
902
  // The parser stores options it doesn't recognize here. See above.
884
903
  repeated UninterpretedOption uninterpreted_option = 999;
885
904
 
@@ -908,6 +927,10 @@ message EnumValueOptions {
908
927
  // Information about the support window of a feature value.
909
928
  optional FieldOptions.FeatureSupport feature_support = 4;
910
929
 
930
+ // Range reserved for first-class extension options defined by the Protobuf
931
+ // team. Custom options must use the 1000+ range instead.
932
+ extensions 990 to 998;
933
+
911
934
  // The parser stores options it doesn't recognize here. See above.
912
935
  repeated UninterpretedOption uninterpreted_option = 999;
913
936
 
@@ -934,6 +957,10 @@ message ServiceOptions {
934
957
  // this is a formalization for deprecating services.
935
958
  optional bool deprecated = 33 [default = false];
936
959
 
960
+ // Range reserved for first-class custom options defined by the Protobuf
961
+ // team. User custom options must use the 1000+ range instead.
962
+ extensions 990 to 998;
963
+
937
964
  // The parser stores options it doesn't recognize here. See above.
938
965
  repeated UninterpretedOption uninterpreted_option = 999;
939
966
 
@@ -971,6 +998,10 @@ message MethodOptions {
971
998
  // developers should rely on the protoreflect APIs for their client language.
972
999
  optional FeatureSet features = 35;
973
1000
 
1001
+ // Range reserved for first-class custom options defined by the Protobuf
1002
+ // team. User custom options must use the 1000+ range instead.
1003
+ extensions 990 to 998;
1004
+
974
1005
  // The parser stores options it doesn't recognize here. See above.
975
1006
  repeated UninterpretedOption uninterpreted_option = 999;
976
1007
 
@@ -1119,6 +1150,7 @@ message FeatureSet {
1119
1150
  ENFORCE_NAMING_STYLE_UNKNOWN = 0;
1120
1151
  STYLE2024 = 1;
1121
1152
  STYLE_LEGACY = 2;
1153
+ STYLE2026 = 3;
1122
1154
  }
1123
1155
  optional EnforceNamingStyle enforce_naming_style = 7 [
1124
1156
  retention = RETENTION_SOURCE,
@@ -1135,7 +1167,8 @@ message FeatureSet {
1135
1167
  edition_introduced: EDITION_2024,
1136
1168
  },
1137
1169
  edition_defaults = { edition: EDITION_LEGACY, value: "STYLE_LEGACY" },
1138
- edition_defaults = { edition: EDITION_2024, value: "STYLE2024" }
1170
+ edition_defaults = { edition: EDITION_2024, value: "STYLE2024" },
1171
+ edition_defaults = { edition: EDITION_UNSTABLE, value: "STYLE2026" }
1139
1172
  ];
1140
1173
 
1141
1174
  message VisibilityFeature {
@@ -1188,6 +1221,11 @@ message FeatureSet {
1188
1221
  full_name: ".pb.python",
1189
1222
  type: ".pb.PythonFeatures"
1190
1223
  },
1224
+ declaration = {
1225
+ number: 1004,
1226
+ full_name: ".pb.csharp",
1227
+ type: ".pb.CSharpFeatures"
1228
+ },
1191
1229
  declaration = {
1192
1230
  number: 1100,
1193
1231
  full_name: ".imp.impress_feature_set",
@@ -152,24 +152,22 @@ option cc_enable_arenas = true;
152
152
  // An implementation may provide options to override this default behavior for
153
153
  // repeated and message fields.
154
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.
155
+ // Note that libraries which implement FieldMask resolution have various
156
+ // different behaviors in the face of empty masks or the special "*" mask.
157
+ // When implementing a service you should confirm these cases have the
158
+ // appropriate behavior in the underlying FieldMask library that you desire,
159
+ // and you may need to special case those cases in your application code if
160
+ // the underlying field mask library behavior differs from your intended
161
+ // service semantics.
162
+ //
163
+ // Update methods implementing https://google.aip.dev/134
164
+ // - MUST support the special value * meaning "full replace"
165
+ // - MUST treat an omitted field mask as "replace fields which are present".
166
+ //
167
+ // Other methods implementing https://google.aip.dev/157
168
+ // - SHOULD support the special value "*" to mean "get all".
169
+ // - MUST treat an omitted field mask to mean "get all", unless otherwise
170
+ // documented.
173
171
  //
174
172
  // ## Considerations for HTTP REST
175
173
  //
@@ -40,55 +40,71 @@ option java_multiple_files = true;
40
40
  option objc_class_prefix = "GPB";
41
41
  option csharp_namespace = "Google.Protobuf.WellKnownTypes";
42
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.
43
+ // Represents a JSON object.
49
44
  //
50
- // The JSON representation for `Struct` is JSON object.
45
+ // An unordered key-value map, intending to perfectly capture the semantics of a
46
+ // JSON object. This enables parsing any arbitrary JSON payload as a message
47
+ // field in ProtoJSON format.
48
+ //
49
+ // This follows RFC 8259 guidelines for interoperable JSON: notably this type
50
+ // cannot represent large Int64 values or `NaN`/`Infinity` numbers,
51
+ // since the JSON format generally does not support those values in its number
52
+ // type.
53
+ //
54
+ // If you do not intend to parse arbitrary JSON into your message, a custom
55
+ // typed message should be preferred instead of using this type.
51
56
  message Struct {
52
57
  // Unordered map of dynamically typed values.
53
58
  map<string, Value> fields = 1;
54
59
  }
55
60
 
61
+ // Represents a JSON value.
62
+ //
56
63
  // `Value` represents a dynamically typed value which can be either
57
64
  // null, a number, a string, a boolean, a recursive struct value, or a
58
65
  // 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.
66
+ // variants. Absence of any variant is an invalid state.
62
67
  message Value {
63
68
  // The kind of value.
64
69
  oneof kind {
65
- // Represents a null value.
70
+ // Represents a JSON `null`.
66
71
  NullValue null_value = 1;
67
- // Represents a double value.
72
+
73
+ // Represents a JSON number. Must not be `NaN`, `Infinity` or
74
+ // `-Infinity`, since those are not supported in JSON. This also cannot
75
+ // represent large Int64 values, since JSON format generally does not
76
+ // support them in its number type.
68
77
  double number_value = 2;
69
- // Represents a string value.
78
+
79
+ // Represents a JSON string.
70
80
  string string_value = 3;
71
- // Represents a boolean value.
81
+
82
+ // Represents a JSON boolean (`true` or `false` literal in JSON).
72
83
  bool bool_value = 4;
73
- // Represents a structured value.
84
+
85
+ // Represents a JSON object.
74
86
  Struct struct_value = 5;
75
- // Represents a repeated `Value`.
87
+
88
+ // Represents a JSON array.
76
89
  ListValue list_value = 6;
77
90
  }
78
91
  }
79
92
 
80
- // `NullValue` is a singleton enumeration to represent the null value for the
81
- // `Value` type union.
93
+ // Represents a JSON `null`.
82
94
  //
83
- // The JSON representation for `NullValue` is JSON `null`.
95
+ // `NullValue` is a sentinel, using an enum with only one value to represent
96
+ // the null value for the `Value` type union.
97
+ //
98
+ // A field of type `NullValue` with any value other than `0` is considered
99
+ // invalid. Most ProtoJSON serializers will emit a Value with a `null_value` set
100
+ // as a JSON `null` regardless of the integer value, and so will round trip to
101
+ // a `0` value.
84
102
  enum NullValue {
85
103
  // Null value.
86
104
  NULL_VALUE = 0;
87
105
  }
88
106
 
89
- // `ListValue` is a wrapper around a repeated field of values.
90
- //
91
- // The JSON representation for `ListValue` is JSON array.
107
+ // Represents a JSON array.
92
108
  message ListValue {
93
109
  // Repeated field of dynamically typed values.
94
110
  repeated Value values = 1;
@@ -112,8 +112,8 @@ option csharp_namespace = "Google.Protobuf.WellKnownTypes";
112
112
  // {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional
113
113
  // seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution),
114
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
115
+ // is required. A ProtoJSON serializer should always use UTC (as indicated by
116
+ // "Z") when printing the Timestamp type and a ProtoJSON parser should be
117
117
  // able to accept both UTC and other timezones (as indicated by an offset).
118
118
  //
119
119
  // For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past
@@ -132,7 +132,7 @@ option csharp_namespace = "Google.Protobuf.WellKnownTypes";
132
132
  //
133
133
  message Timestamp {
134
134
  // Represents seconds of UTC time since Unix epoch 1970-01-01T00:00:00Z. Must
135
- // be between -315576000000 and 315576000000 inclusive (which corresponds to
135
+ // be between -62135596800 and 253402300799 inclusive (which corresponds to
136
136
  // 0001-01-01T00:00:00Z to 9999-12-31T23:59:59Z).
137
137
  int64 seconds = 1;
138
138
 
Binary file
Binary file