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