Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(520)

Side by Side Diff: third_party/protobuf/csharp/src/Google.Protobuf/WellKnownTypes/FieldMask.cs

Issue 2495533002: third_party/protobuf: Update to HEAD (83d681ee2c) (Closed)
Patch Set: Make chrome settings proto generated file a component Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Generated by the protocol buffer compiler. DO NOT EDIT! 1 // Generated by the protocol buffer compiler. DO NOT EDIT!
2 // source: google/protobuf/field_mask.proto 2 // source: google/protobuf/field_mask.proto
3 #pragma warning disable 1591, 0612, 3021 3 #pragma warning disable 1591, 0612, 3021
4 #region Designer generated code 4 #region Designer generated code
5 5
6 using pb = global::Google.Protobuf; 6 using pb = global::Google.Protobuf;
7 using pbc = global::Google.Protobuf.Collections; 7 using pbc = global::Google.Protobuf.Collections;
8 using pbr = global::Google.Protobuf.Reflection; 8 using pbr = global::Google.Protobuf.Reflection;
9 using scg = global::System.Collections.Generic; 9 using scg = global::System.Collections.Generic;
10 namespace Google.Protobuf.WellKnownTypes { 10 namespace Google.Protobuf.WellKnownTypes {
11 11
12 /// <summary>Holder for reflection information generated from google/protobuf/ field_mask.proto</summary> 12 /// <summary>Holder for reflection information generated from google/protobuf/ field_mask.proto</summary>
13 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
14 public static partial class FieldMaskReflection { 13 public static partial class FieldMaskReflection {
15 14
16 #region Descriptor 15 #region Descriptor
17 /// <summary>File descriptor for google/protobuf/field_mask.proto</summary> 16 /// <summary>File descriptor for google/protobuf/field_mask.proto</summary>
18 public static pbr::FileDescriptor Descriptor { 17 public static pbr::FileDescriptor Descriptor {
19 get { return descriptor; } 18 get { return descriptor; }
20 } 19 }
21 private static pbr::FileDescriptor descriptor; 20 private static pbr::FileDescriptor descriptor;
22 21
23 static FieldMaskReflection() { 22 static FieldMaskReflection() {
24 byte[] descriptorData = global::System.Convert.FromBase64String( 23 byte[] descriptorData = global::System.Convert.FromBase64String(
25 string.Concat( 24 string.Concat(
26 "CiBnb29nbGUvcHJvdG9idWYvZmllbGRfbWFzay5wcm90bxIPZ29vZ2xlLnBy", 25 "CiBnb29nbGUvcHJvdG9idWYvZmllbGRfbWFzay5wcm90bxIPZ29vZ2xlLnBy",
27 "b3RvYnVmIhoKCUZpZWxkTWFzaxINCgVwYXRocxgBIAMoCUJRChNjb20uZ29v", 26 "b3RvYnVmIhoKCUZpZWxkTWFzaxINCgVwYXRocxgBIAMoCUKJAQoTY29tLmdv",
28 "Z2xlLnByb3RvYnVmQg5GaWVsZE1hc2tQcm90b1ABoAEBogIDR1BCqgIeR29v", 27 "b2dsZS5wcm90b2J1ZkIORmllbGRNYXNrUHJvdG9QAVo5Z29vZ2xlLmdvbGFu",
29 "Z2xlLlByb3RvYnVmLldlbGxLbm93blR5cGVzYgZwcm90bzM=")); 28 "Zy5vcmcvZ2VucHJvdG8vcHJvdG9idWYvZmllbGRfbWFzaztmaWVsZF9tYXNr",
29 "ogIDR1BCqgIeR29vZ2xlLlByb3RvYnVmLldlbGxLbm93blR5cGVzYgZwcm90",
30 "bzM="));
30 descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, 31 descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData,
31 new pbr::FileDescriptor[] { }, 32 new pbr::FileDescriptor[] { },
32 new pbr::GeneratedClrTypeInfo(null, new pbr::GeneratedClrTypeInfo[] { 33 new pbr::GeneratedClrTypeInfo(null, new pbr::GeneratedClrTypeInfo[] {
33 new pbr::GeneratedClrTypeInfo(typeof(global::Google.Protobuf.WellKno wnTypes.FieldMask), global::Google.Protobuf.WellKnownTypes.FieldMask.Parser, new []{ "Paths" }, null, null, null) 34 new pbr::GeneratedClrTypeInfo(typeof(global::Google.Protobuf.WellKno wnTypes.FieldMask), global::Google.Protobuf.WellKnownTypes.FieldMask.Parser, new []{ "Paths" }, null, null, null)
34 })); 35 }));
35 } 36 }
36 #endregion 37 #endregion
37 38
38 } 39 }
39 #region Messages 40 #region Messages
40 /// <summary> 41 /// <summary>
41 /// `FieldMask` represents a set of symbolic field paths, for example: 42 /// `FieldMask` represents a set of symbolic field paths, for example:
42 /// 43 ///
43 /// paths: "f.a" 44 /// paths: "f.a"
44 /// paths: "f.b.d" 45 /// paths: "f.b.d"
45 /// 46 ///
46 /// Here `f` represents a field in some root message, `a` and `b` 47 /// Here `f` represents a field in some root message, `a` and `b`
47 /// fields in the message found in `f`, and `d` a field found in the 48 /// fields in the message found in `f`, and `d` a field found in the
48 /// message in `f.b`. 49 /// message in `f.b`.
49 /// 50 ///
50 /// Field masks are used to specify a subset of fields that should be 51 /// Field masks are used to specify a subset of fields that should be
51 /// returned by a get operation or modified by an update operation. 52 /// returned by a get operation or modified by an update operation.
52 /// Field masks also have a custom JSON encoding (see below). 53 /// Field masks also have a custom JSON encoding (see below).
53 /// 54 ///
54 /// # Field Masks in Projections 55 /// # Field Masks in Projections
55 /// 56 ///
56 /// When used in the context of a projection, a response message or 57 /// When used in the context of a projection, a response message or
57 /// sub-message is filtered by the API to only contain those fields as 58 /// sub-message is filtered by the API to only contain those fields as
58 /// specified in the mask. For example, if the mask in the previous 59 /// specified in the mask. For example, if the mask in the previous
59 /// example is applied to a response message as follows: 60 /// example is applied to a response message as follows:
60 /// 61 ///
61 /// f { 62 /// f {
62 /// a : 22 63 /// a : 22
63 /// b { 64 /// b {
64 /// d : 1 65 /// d : 1
65 /// x : 2 66 /// x : 2
66 /// } 67 /// }
67 /// y : 13 68 /// y : 13
68 /// } 69 /// }
69 /// z: 8 70 /// z: 8
70 /// 71 ///
71 /// The result will not contain specific values for fields x,y and z 72 /// The result will not contain specific values for fields x,y and z
72 /// (their value will be set to the default, and omitted in proto text 73 /// (their value will be set to the default, and omitted in proto text
73 /// output): 74 /// output):
74 /// 75 ///
75 /// f { 76 /// f {
76 /// a : 22 77 /// a : 22
77 /// b { 78 /// b {
78 /// d : 1 79 /// d : 1
79 /// } 80 /// }
80 /// } 81 /// }
81 /// 82 ///
82 /// A repeated field is not allowed except at the last position of a 83 /// A repeated field is not allowed except at the last position of a
83 /// field mask. 84 /// paths string.
84 /// 85 ///
85 /// If a FieldMask object is not present in a get operation, the 86 /// If a FieldMask object is not present in a get operation, the
86 /// operation applies to all fields (as if a FieldMask of all fields 87 /// operation applies to all fields (as if a FieldMask of all fields
87 /// had been specified). 88 /// had been specified).
88 /// 89 ///
89 /// Note that a field mask does not necessarily apply to the 90 /// Note that a field mask does not necessarily apply to the
90 /// top-level response message. In case of a REST get operation, the 91 /// top-level response message. In case of a REST get operation, the
91 /// field mask applies directly to the response, but in case of a REST 92 /// field mask applies directly to the response, but in case of a REST
92 /// list operation, the mask instead applies to each individual message 93 /// list operation, the mask instead applies to each individual message
93 /// in the returned resource list. In case of a REST custom method, 94 /// in the returned resource list. In case of a REST custom method,
94 /// other definitions may be used. Where the mask applies will be 95 /// other definitions may be used. Where the mask applies will be
95 /// clearly documented together with its declaration in the API. In 96 /// clearly documented together with its declaration in the API. In
96 /// any case, the effect on the returned resource/resources is required 97 /// any case, the effect on the returned resource/resources is required
97 /// behavior for APIs. 98 /// behavior for APIs.
98 /// 99 ///
99 /// # Field Masks in Update Operations 100 /// # Field Masks in Update Operations
100 /// 101 ///
101 /// A field mask in update operations specifies which fields of the 102 /// A field mask in update operations specifies which fields of the
102 /// targeted resource are going to be updated. The API is required 103 /// targeted resource are going to be updated. The API is required
103 /// to only change the values of the fields as specified in the mask 104 /// to only change the values of the fields as specified in the mask
104 /// and leave the others untouched. If a resource is passed in to 105 /// and leave the others untouched. If a resource is passed in to
105 /// describe the updated values, the API ignores the values of all 106 /// describe the updated values, the API ignores the values of all
106 /// fields not covered by the mask. 107 /// fields not covered by the mask.
107 /// 108 ///
108 /// In order to reset a field's value to the default, the field must 109 /// If a repeated field is specified for an update operation, the existing
109 /// be in the mask and set to the default value in the provided resource. 110 /// repeated values in the target resource will be overwritten by the new valu es.
110 /// Hence, in order to reset all fields of a resource, provide a default 111 /// Note that a repeated field is only allowed in the last position of a `path s`
111 /// instance of the resource and set all fields in the mask, or do 112 /// string.
112 /// not provide a mask as described below. 113 ///
113 /// 114 /// If a sub-message is specified in the last position of the field mask for a n
114 /// If a field mask is not present on update, the operation applies to 115 /// update operation, then the existing sub-message in the target resource is
115 /// all fields (as if a field mask of all fields has been specified). 116 /// overwritten. Given the target message:
116 /// Note that in the presence of schema evolution, this may mean that 117 ///
117 /// fields the client does not know and has therefore not filled into 118 /// f {
118 /// the request will be reset to their default. If this is unwanted 119 /// b {
119 /// behavior, a specific service may require a client to always specify 120 /// d : 1
120 /// a field mask, producing an error if not. 121 /// x : 2
121 /// 122 /// }
122 /// As with get operations, the location of the resource which 123 /// c : 1
123 /// describes the updated values in the request message depends on the 124 /// }
124 /// operation kind. In any case, the effect of the field mask is 125 ///
125 /// required to be honored by the API. 126 /// And an update message:
126 /// 127 ///
127 /// ## Considerations for HTTP REST 128 /// f {
128 /// 129 /// b {
129 /// The HTTP kind of an update operation which uses a field mask must 130 /// d : 10
130 /// be set to PATCH instead of PUT in order to satisfy HTTP semantics 131 /// }
131 /// (PUT must only be used for full updates). 132 /// }
132 /// 133 ///
133 /// # JSON Encoding of Field Masks 134 /// then if the field mask is:
134 /// 135 ///
135 /// In JSON, a field mask is encoded as a single string where paths are 136 /// paths: "f.b"
136 /// separated by a comma. Fields name in each path are converted 137 ///
137 /// to/from lower-camel naming conventions. 138 /// then the result will be:
138 /// 139 ///
139 /// As an example, consider the following message declarations: 140 /// f {
140 /// 141 /// b {
141 /// message Profile { 142 /// d : 10
142 /// User user = 1; 143 /// }
143 /// Photo photo = 2; 144 /// c : 1
144 /// } 145 /// }
145 /// message User { 146 ///
146 /// string display_name = 1; 147 /// However, if the update mask was:
147 /// string address = 2; 148 ///
148 /// } 149 /// paths: "f.b.d"
149 /// 150 ///
150 /// In proto a field mask for `Profile` may look as such: 151 /// then the result would be:
151 /// 152 ///
152 /// mask { 153 /// f {
153 /// paths: "user.display_name" 154 /// b {
154 /// paths: "photo" 155 /// d : 10
155 /// } 156 /// x : 2
156 /// 157 /// }
157 /// In JSON, the same mask is represented as below: 158 /// c : 1
158 /// 159 /// }
159 /// { 160 ///
160 /// mask: "user.displayName,photo" 161 /// In order to reset a field's value to the default, the field must
161 /// } 162 /// be in the mask and set to the default value in the provided resource.
162 /// 163 /// Hence, in order to reset all fields of a resource, provide a default
163 /// # Field Masks and Oneof Fields 164 /// instance of the resource and set all fields in the mask, or do
164 /// 165 /// not provide a mask as described below.
165 /// Field masks treat fields in oneofs just as regular fields. Consider the 166 ///
166 /// following message: 167 /// If a field mask is not present on update, the operation applies to
167 /// 168 /// all fields (as if a field mask of all fields has been specified).
168 /// message SampleMessage { 169 /// Note that in the presence of schema evolution, this may mean that
169 /// oneof test_oneof { 170 /// fields the client does not know and has therefore not filled into
170 /// string name = 4; 171 /// the request will be reset to their default. If this is unwanted
171 /// SubMessage sub_message = 9; 172 /// behavior, a specific service may require a client to always specify
172 /// } 173 /// a field mask, producing an error if not.
173 /// } 174 ///
174 /// 175 /// As with get operations, the location of the resource which
175 /// The field mask can be: 176 /// describes the updated values in the request message depends on the
176 /// 177 /// operation kind. In any case, the effect of the field mask is
177 /// mask { 178 /// required to be honored by the API.
178 /// paths: "name" 179 ///
179 /// } 180 /// ## Considerations for HTTP REST
180 /// 181 ///
181 /// Or: 182 /// The HTTP kind of an update operation which uses a field mask must
182 /// 183 /// be set to PATCH instead of PUT in order to satisfy HTTP semantics
183 /// mask { 184 /// (PUT must only be used for full updates).
184 /// paths: "sub_message" 185 ///
185 /// } 186 /// # JSON Encoding of Field Masks
186 /// 187 ///
187 /// Note that oneof type names ("test_oneof" in this case) cannot be used in 188 /// In JSON, a field mask is encoded as a single string where paths are
188 /// paths. 189 /// separated by a comma. Fields name in each path are converted
190 /// to/from lower-camel naming conventions.
191 ///
192 /// As an example, consider the following message declarations:
193 ///
194 /// message Profile {
195 /// User user = 1;
196 /// Photo photo = 2;
197 /// }
198 /// message User {
199 /// string display_name = 1;
200 /// string address = 2;
201 /// }
202 ///
203 /// In proto a field mask for `Profile` may look as such:
204 ///
205 /// mask {
206 /// paths: "user.display_name"
207 /// paths: "photo"
208 /// }
209 ///
210 /// In JSON, the same mask is represented as below:
211 ///
212 /// {
213 /// mask: "user.displayName,photo"
214 /// }
215 ///
216 /// # Field Masks and Oneof Fields
217 ///
218 /// Field masks treat fields in oneofs just as regular fields. Consider the
219 /// following message:
220 ///
221 /// message SampleMessage {
222 /// oneof test_oneof {
223 /// string name = 4;
224 /// SubMessage sub_message = 9;
225 /// }
226 /// }
227 ///
228 /// The field mask can be:
229 ///
230 /// mask {
231 /// paths: "name"
232 /// }
233 ///
234 /// Or:
235 ///
236 /// mask {
237 /// paths: "sub_message"
238 /// }
239 ///
240 /// Note that oneof type names ("test_oneof" in this case) cannot be used in
241 /// paths.
189 /// </summary> 242 /// </summary>
190 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
191 public sealed partial class FieldMask : pb::IMessage<FieldMask> { 243 public sealed partial class FieldMask : pb::IMessage<FieldMask> {
192 private static readonly pb::MessageParser<FieldMask> _parser = new pb::Messa geParser<FieldMask>(() => new FieldMask()); 244 private static readonly pb::MessageParser<FieldMask> _parser = new pb::Messa geParser<FieldMask>(() => new FieldMask());
245 [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
193 public static pb::MessageParser<FieldMask> Parser { get { return _parser; } } 246 public static pb::MessageParser<FieldMask> Parser { get { return _parser; } }
194 247
248 [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
195 public static pbr::MessageDescriptor Descriptor { 249 public static pbr::MessageDescriptor Descriptor {
196 get { return global::Google.Protobuf.WellKnownTypes.FieldMaskReflection.De scriptor.MessageTypes[0]; } 250 get { return global::Google.Protobuf.WellKnownTypes.FieldMaskReflection.De scriptor.MessageTypes[0]; }
197 } 251 }
198 252
253 [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
199 pbr::MessageDescriptor pb::IMessage.Descriptor { 254 pbr::MessageDescriptor pb::IMessage.Descriptor {
200 get { return Descriptor; } 255 get { return Descriptor; }
201 } 256 }
202 257
258 [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
203 public FieldMask() { 259 public FieldMask() {
204 OnConstruction(); 260 OnConstruction();
205 } 261 }
206 262
207 partial void OnConstruction(); 263 partial void OnConstruction();
208 264
265 [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
209 public FieldMask(FieldMask other) : this() { 266 public FieldMask(FieldMask other) : this() {
210 paths_ = other.paths_.Clone(); 267 paths_ = other.paths_.Clone();
211 } 268 }
212 269
270 [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
213 public FieldMask Clone() { 271 public FieldMask Clone() {
214 return new FieldMask(this); 272 return new FieldMask(this);
215 } 273 }
216 274
217 /// <summary>Field number for the "paths" field.</summary> 275 /// <summary>Field number for the "paths" field.</summary>
218 public const int PathsFieldNumber = 1; 276 public const int PathsFieldNumber = 1;
219 private static readonly pb::FieldCodec<string> _repeated_paths_codec 277 private static readonly pb::FieldCodec<string> _repeated_paths_codec
220 = pb::FieldCodec.ForString(10); 278 = pb::FieldCodec.ForString(10);
221 private readonly pbc::RepeatedField<string> paths_ = new pbc::RepeatedField< string>(); 279 private readonly pbc::RepeatedField<string> paths_ = new pbc::RepeatedField< string>();
222 /// <summary> 280 /// <summary>
223 /// The set of field mask paths. 281 /// The set of field mask paths.
224 /// </summary> 282 /// </summary>
283 [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
225 public pbc::RepeatedField<string> Paths { 284 public pbc::RepeatedField<string> Paths {
226 get { return paths_; } 285 get { return paths_; }
227 } 286 }
228 287
288 [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
229 public override bool Equals(object other) { 289 public override bool Equals(object other) {
230 return Equals(other as FieldMask); 290 return Equals(other as FieldMask);
231 } 291 }
232 292
293 [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
233 public bool Equals(FieldMask other) { 294 public bool Equals(FieldMask other) {
234 if (ReferenceEquals(other, null)) { 295 if (ReferenceEquals(other, null)) {
235 return false; 296 return false;
236 } 297 }
237 if (ReferenceEquals(other, this)) { 298 if (ReferenceEquals(other, this)) {
238 return true; 299 return true;
239 } 300 }
240 if(!paths_.Equals(other.paths_)) return false; 301 if(!paths_.Equals(other.paths_)) return false;
241 return true; 302 return true;
242 } 303 }
243 304
305 [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
244 public override int GetHashCode() { 306 public override int GetHashCode() {
245 int hash = 1; 307 int hash = 1;
246 hash ^= paths_.GetHashCode(); 308 hash ^= paths_.GetHashCode();
247 return hash; 309 return hash;
248 } 310 }
249 311
312 [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
250 public override string ToString() { 313 public override string ToString() {
251 return pb::JsonFormatter.ToDiagnosticString(this); 314 return pb::JsonFormatter.ToDiagnosticString(this);
252 } 315 }
253 316
317 [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
254 public void WriteTo(pb::CodedOutputStream output) { 318 public void WriteTo(pb::CodedOutputStream output) {
255 paths_.WriteTo(output, _repeated_paths_codec); 319 paths_.WriteTo(output, _repeated_paths_codec);
256 } 320 }
257 321
322 [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
258 public int CalculateSize() { 323 public int CalculateSize() {
259 int size = 0; 324 int size = 0;
260 size += paths_.CalculateSize(_repeated_paths_codec); 325 size += paths_.CalculateSize(_repeated_paths_codec);
261 return size; 326 return size;
262 } 327 }
263 328
329 [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
264 public void MergeFrom(FieldMask other) { 330 public void MergeFrom(FieldMask other) {
265 if (other == null) { 331 if (other == null) {
266 return; 332 return;
267 } 333 }
268 paths_.Add(other.paths_); 334 paths_.Add(other.paths_);
269 } 335 }
270 336
337 [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
271 public void MergeFrom(pb::CodedInputStream input) { 338 public void MergeFrom(pb::CodedInputStream input) {
272 uint tag; 339 uint tag;
273 while ((tag = input.ReadTag()) != 0) { 340 while ((tag = input.ReadTag()) != 0) {
274 switch(tag) { 341 switch(tag) {
275 default: 342 default:
276 input.SkipLastField(); 343 input.SkipLastField();
277 break; 344 break;
278 case 10: { 345 case 10: {
279 paths_.AddEntriesFrom(input, _repeated_paths_codec); 346 paths_.AddEntriesFrom(input, _repeated_paths_codec);
280 break; 347 break;
281 } 348 }
282 } 349 }
283 } 350 }
284 } 351 }
285 352
286 } 353 }
287 354
288 #endregion 355 #endregion
289 356
290 } 357 }
291 358
292 #endregion Designer generated code 359 #endregion Designer generated code
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698