• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // <auto-generated>
2 //     Generated by the protocol buffer compiler.  DO NOT EDIT!
3 //     source: google/protobuf/field_mask.proto
4 // </auto-generated>
5 #pragma warning disable 1591, 0612, 3021
6 #region Designer generated code
7 
8 using pb = global::Google.Protobuf;
9 using pbc = global::Google.Protobuf.Collections;
10 using pbr = global::Google.Protobuf.Reflection;
11 using scg = global::System.Collections.Generic;
12 namespace Google.Protobuf.WellKnownTypes {
13 
14   /// <summary>Holder for reflection information generated from google/protobuf/field_mask.proto</summary>
15   public static partial class FieldMaskReflection {
16 
17     #region Descriptor
18     /// <summary>File descriptor for google/protobuf/field_mask.proto</summary>
19     public static pbr::FileDescriptor Descriptor {
20       get { return descriptor; }
21     }
22     private static pbr::FileDescriptor descriptor;
23 
FieldMaskReflection()24     static FieldMaskReflection() {
25       byte[] descriptorData = global::System.Convert.FromBase64String(
26           string.Concat(
27             "CiBnb29nbGUvcHJvdG9idWYvZmllbGRfbWFzay5wcm90bxIPZ29vZ2xlLnBy",
28             "b3RvYnVmIhoKCUZpZWxkTWFzaxINCgVwYXRocxgBIAMoCUKMAQoTY29tLmdv",
29             "b2dsZS5wcm90b2J1ZkIORmllbGRNYXNrUHJvdG9QAVo5Z29vZ2xlLmdvbGFu",
30             "Zy5vcmcvZ2VucHJvdG8vcHJvdG9idWYvZmllbGRfbWFzaztmaWVsZF9tYXNr",
31             "+AEBogIDR1BCqgIeR29vZ2xlLlByb3RvYnVmLldlbGxLbm93blR5cGVzYgZw",
32             "cm90bzM="));
33       descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData,
34           new pbr::FileDescriptor[] { },
35           new pbr::GeneratedClrTypeInfo(null, null, new pbr::GeneratedClrTypeInfo[] {
36             new pbr::GeneratedClrTypeInfo(typeof(global::Google.Protobuf.WellKnownTypes.FieldMask), global::Google.Protobuf.WellKnownTypes.FieldMask.Parser, new[]{ "Paths" }, null, null, null, null)
37           }));
38     }
39     #endregion
40 
41   }
42   #region Messages
43   /// <summary>
44   /// `FieldMask` represents a set of symbolic field paths, for example:
45   ///
46   ///     paths: "f.a"
47   ///     paths: "f.b.d"
48   ///
49   /// Here `f` represents a field in some root message, `a` and `b`
50   /// fields in the message found in `f`, and `d` a field found in the
51   /// message in `f.b`.
52   ///
53   /// Field masks are used to specify a subset of fields that should be
54   /// returned by a get operation or modified by an update operation.
55   /// Field masks also have a custom JSON encoding (see below).
56   ///
57   /// # Field Masks in Projections
58   ///
59   /// When used in the context of a projection, a response message or
60   /// sub-message is filtered by the API to only contain those fields as
61   /// specified in the mask. For example, if the mask in the previous
62   /// example is applied to a response message as follows:
63   ///
64   ///     f {
65   ///       a : 22
66   ///       b {
67   ///         d : 1
68   ///         x : 2
69   ///       }
70   ///       y : 13
71   ///     }
72   ///     z: 8
73   ///
74   /// The result will not contain specific values for fields x,y and z
75   /// (their value will be set to the default, and omitted in proto text
76   /// output):
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   /// </summary>
243   public sealed partial class FieldMask : pb::IMessage<FieldMask>
244   #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
245       , pb::IBufferMessage
246   #endif
247   {
248     private static readonly pb::MessageParser<FieldMask> _parser = new pb::MessageParser<FieldMask>(() => new FieldMask());
249     private pb::UnknownFieldSet _unknownFields;
250     [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
251     public static pb::MessageParser<FieldMask> Parser { get { return _parser; } }
252 
253     [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
254     public static pbr::MessageDescriptor Descriptor {
255       get { return global::Google.Protobuf.WellKnownTypes.FieldMaskReflection.Descriptor.MessageTypes[0]; }
256     }
257 
258     [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
259     pbr::MessageDescriptor pb::IMessage.Descriptor {
260       get { return Descriptor; }
261     }
262 
263     [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
FieldMask()264     public FieldMask() {
265       OnConstruction();
266     }
267 
OnConstruction()268     partial void OnConstruction();
269 
270     [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
FieldMask(FieldMask other)271     public FieldMask(FieldMask other) : this() {
272       paths_ = other.paths_.Clone();
273       _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
274     }
275 
276     [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
Clone()277     public FieldMask Clone() {
278       return new FieldMask(this);
279     }
280 
281     /// <summary>Field number for the "paths" field.</summary>
282     public const int PathsFieldNumber = 1;
283     private static readonly pb::FieldCodec<string> _repeated_paths_codec
284         = pb::FieldCodec.ForString(10);
285     private readonly pbc::RepeatedField<string> paths_ = new pbc::RepeatedField<string>();
286     /// <summary>
287     /// The set of field mask paths.
288     /// </summary>
289     [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
290     public pbc::RepeatedField<string> Paths {
291       get { return paths_; }
292     }
293 
294     [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
Equals(object other)295     public override bool Equals(object other) {
296       return Equals(other as FieldMask);
297     }
298 
299     [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
Equals(FieldMask other)300     public bool Equals(FieldMask other) {
301       if (ReferenceEquals(other, null)) {
302         return false;
303       }
304       if (ReferenceEquals(other, this)) {
305         return true;
306       }
307       if(!paths_.Equals(other.paths_)) return false;
308       return Equals(_unknownFields, other._unknownFields);
309     }
310 
311     [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
GetHashCode()312     public override int GetHashCode() {
313       int hash = 1;
314       hash ^= paths_.GetHashCode();
315       if (_unknownFields != null) {
316         hash ^= _unknownFields.GetHashCode();
317       }
318       return hash;
319     }
320 
321     [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
ToString()322     public override string ToString() {
323       return pb::JsonFormatter.ToDiagnosticString(this);
324     }
325 
326     [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
WriteTo(pb::CodedOutputStream output)327     public void WriteTo(pb::CodedOutputStream output) {
328     #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
329       output.WriteRawMessage(this);
330     #else
331       paths_.WriteTo(output, _repeated_paths_codec);
332       if (_unknownFields != null) {
333         _unknownFields.WriteTo(output);
334       }
335     #endif
336     }
337 
338     #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
339     [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
IBufferMessage.InternalWriteTo(ref pb::WriteContext output)340     void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) {
341       paths_.WriteTo(ref output, _repeated_paths_codec);
342       if (_unknownFields != null) {
343         _unknownFields.WriteTo(ref output);
344       }
345     }
346     #endif
347 
348     [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
CalculateSize()349     public int CalculateSize() {
350       int size = 0;
351       size += paths_.CalculateSize(_repeated_paths_codec);
352       if (_unknownFields != null) {
353         size += _unknownFields.CalculateSize();
354       }
355       return size;
356     }
357 
358     [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
MergeFrom(FieldMask other)359     public void MergeFrom(FieldMask other) {
360       if (other == null) {
361         return;
362       }
363       paths_.Add(other.paths_);
364       _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
365     }
366 
367     [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
MergeFrom(pb::CodedInputStream input)368     public void MergeFrom(pb::CodedInputStream input) {
369     #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
370       input.ReadRawMessage(this);
371     #else
372       uint tag;
373       while ((tag = input.ReadTag()) != 0) {
374         switch(tag) {
375           default:
376             _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
377             break;
378           case 10: {
379             paths_.AddEntriesFrom(input, _repeated_paths_codec);
380             break;
381           }
382         }
383       }
384     #endif
385     }
386 
387     #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
388     [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
IBufferMessage.InternalMergeFrom(ref pb::ParseContext input)389     void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) {
390       uint tag;
391       while ((tag = input.ReadTag()) != 0) {
392         switch(tag) {
393           default:
394             _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input);
395             break;
396           case 10: {
397             paths_.AddEntriesFrom(ref input, _repeated_paths_codec);
398             break;
399           }
400         }
401       }
402     }
403     #endif
404 
405   }
406 
407   #endregion
408 
409 }
410 
411 #endregion Designer generated code
412