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
6using pb = global::Google.Protobuf;
7using pbc = global::Google.Protobuf.Collections;
8using pbr = global::Google.Protobuf.Reflection;
9using scg = global::System.Collections.Generic;
10namespace Google.Protobuf.WellKnownTypes {
11
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 {
15
16    #region Descriptor
17    /// <summary>File descriptor for google/protobuf/field_mask.proto</summary>
18    public static pbr::FileDescriptor Descriptor {
19      get { return descriptor; }
20    }
21    private static pbr::FileDescriptor descriptor;
22
23    static FieldMaskReflection() {
24      byte[] descriptorData = global::System.Convert.FromBase64String(
25          string.Concat(
26            "CiBnb29nbGUvcHJvdG9idWYvZmllbGRfbWFzay5wcm90bxIPZ29vZ2xlLnBy",
27            "b3RvYnVmIhoKCUZpZWxkTWFzaxINCgVwYXRocxgBIAMoCUJRChNjb20uZ29v",
28            "Z2xlLnByb3RvYnVmQg5GaWVsZE1hc2tQcm90b1ABoAEBogIDR1BCqgIeR29v",
29            "Z2xlLlByb3RvYnVmLldlbGxLbm93blR5cGVzYgZwcm90bzM="));
30      descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData,
31          new pbr::FileDescriptor[] { },
32          new pbr::GeneratedClrTypeInfo(null, new pbr::GeneratedClrTypeInfo[] {
33            new pbr::GeneratedClrTypeInfo(typeof(global::Google.Protobuf.WellKnownTypes.FieldMask), global::Google.Protobuf.WellKnownTypes.FieldMask.Parser, new[]{ "Paths" }, null, null, null)
34          }));
35    }
36    #endregion
37
38  }
39  #region Messages
40  /// <summary>
41  ///  `FieldMask` represents a set of symbolic field paths, for example:
42  ///
43  ///      paths: "f.a"
44  ///      paths: "f.b.d"
45  ///
46  ///  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  ///  message in `f.b`.
49  ///
50  ///  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  ///  Field masks also have a custom JSON encoding (see below).
53  ///
54  ///  # Field Masks in Projections
55  ///
56  ///  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  ///  specified in the mask. For example, if the mask in the previous
59  ///  example is applied to a response message as follows:
60  ///
61  ///      f {
62  ///        a : 22
63  ///        b {
64  ///          d : 1
65  ///          x : 2
66  ///        }
67  ///        y : 13
68  ///      }
69  ///      z: 8
70  ///
71  ///  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  ///  output):
74  ///
75  ///      f {
76  ///        a : 22
77  ///        b {
78  ///          d : 1
79  ///        }
80  ///      }
81  ///
82  ///  A repeated field is not allowed except at the last position of a
83  ///  field mask.
84  ///
85  ///  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  ///  had been specified).
88  ///
89  ///  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  ///  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  ///  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  ///  clearly documented together with its declaration in the API.  In
96  ///  any case, the effect on the returned resource/resources is required
97  ///  behavior for APIs.
98  ///
99  ///  # Field Masks in Update Operations
100  ///
101  ///  A field mask in update operations specifies which fields of the
102  ///  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  ///  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  ///  fields not covered by the mask.
107  ///
108  ///  In order to reset a field's value to the default, the field must
109  ///  be in the mask and set to the default value in the provided resource.
110  ///  Hence, in order to reset all fields of a resource, provide a default
111  ///  instance of the resource and set all fields in the mask, or do
112  ///  not provide a mask as described below.
113  ///
114  ///  If a field mask is not present on update, the operation applies to
115  ///  all fields (as if a field mask of all fields has been specified).
116  ///  Note that in the presence of schema evolution, this may mean that
117  ///  fields the client does not know and has therefore not filled into
118  ///  the request will be reset to their default. If this is unwanted
119  ///  behavior, a specific service may require a client to always specify
120  ///  a field mask, producing an error if not.
121  ///
122  ///  As with get operations, the location of the resource which
123  ///  describes the updated values in the request message depends on the
124  ///  operation kind. In any case, the effect of the field mask is
125  ///  required to be honored by the API.
126  ///
127  ///  ## Considerations for HTTP REST
128  ///
129  ///  The HTTP kind of an update operation which uses a field mask must
130  ///  be set to PATCH instead of PUT in order to satisfy HTTP semantics
131  ///  (PUT must only be used for full updates).
132  ///
133  ///  # JSON Encoding of Field Masks
134  ///
135  ///  In JSON, a field mask is encoded as a single string where paths are
136  ///  separated by a comma. Fields name in each path are converted
137  ///  to/from lower-camel naming conventions.
138  ///
139  ///  As an example, consider the following message declarations:
140  ///
141  ///      message Profile {
142  ///        User user = 1;
143  ///        Photo photo = 2;
144  ///      }
145  ///      message User {
146  ///        string display_name = 1;
147  ///        string address = 2;
148  ///      }
149  ///
150  ///  In proto a field mask for `Profile` may look as such:
151  ///
152  ///      mask {
153  ///        paths: "user.display_name"
154  ///        paths: "photo"
155  ///      }
156  ///
157  ///  In JSON, the same mask is represented as below:
158  ///
159  ///      {
160  ///        mask: "user.displayName,photo"
161  ///      }
162  ///
163  ///  # Field Masks and Oneof Fields
164  ///
165  ///  Field masks treat fields in oneofs just as regular fields. Consider the
166  ///  following message:
167  ///
168  ///      message SampleMessage {
169  ///        oneof test_oneof {
170  ///          string name = 4;
171  ///          SubMessage sub_message = 9;
172  ///        }
173  ///      }
174  ///
175  ///  The field mask can be:
176  ///
177  ///      mask {
178  ///        paths: "name"
179  ///      }
180  ///
181  ///  Or:
182  ///
183  ///      mask {
184  ///        paths: "sub_message"
185  ///      }
186  ///
187  ///  Note that oneof type names ("test_oneof" in this case) cannot be used in
188  ///  paths.
189  /// </summary>
190  [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
191  public sealed partial class FieldMask : pb::IMessage<FieldMask> {
192    private static readonly pb::MessageParser<FieldMask> _parser = new pb::MessageParser<FieldMask>(() => new FieldMask());
193    public static pb::MessageParser<FieldMask> Parser { get { return _parser; } }
194
195    public static pbr::MessageDescriptor Descriptor {
196      get { return global::Google.Protobuf.WellKnownTypes.FieldMaskReflection.Descriptor.MessageTypes[0]; }
197    }
198
199    pbr::MessageDescriptor pb::IMessage.Descriptor {
200      get { return Descriptor; }
201    }
202
203    public FieldMask() {
204      OnConstruction();
205    }
206
207    partial void OnConstruction();
208
209    public FieldMask(FieldMask other) : this() {
210      paths_ = other.paths_.Clone();
211    }
212
213    public FieldMask Clone() {
214      return new FieldMask(this);
215    }
216
217    /// <summary>Field number for the "paths" field.</summary>
218    public const int PathsFieldNumber = 1;
219    private static readonly pb::FieldCodec<string> _repeated_paths_codec
220        = pb::FieldCodec.ForString(10);
221    private readonly pbc::RepeatedField<string> paths_ = new pbc::RepeatedField<string>();
222    /// <summary>
223    ///  The set of field mask paths.
224    /// </summary>
225    public pbc::RepeatedField<string> Paths {
226      get { return paths_; }
227    }
228
229    public override bool Equals(object other) {
230      return Equals(other as FieldMask);
231    }
232
233    public bool Equals(FieldMask other) {
234      if (ReferenceEquals(other, null)) {
235        return false;
236      }
237      if (ReferenceEquals(other, this)) {
238        return true;
239      }
240      if(!paths_.Equals(other.paths_)) return false;
241      return true;
242    }
243
244    public override int GetHashCode() {
245      int hash = 1;
246      hash ^= paths_.GetHashCode();
247      return hash;
248    }
249
250    public override string ToString() {
251      return pb::JsonFormatter.ToDiagnosticString(this);
252    }
253
254    public void WriteTo(pb::CodedOutputStream output) {
255      paths_.WriteTo(output, _repeated_paths_codec);
256    }
257
258    public int CalculateSize() {
259      int size = 0;
260      size += paths_.CalculateSize(_repeated_paths_codec);
261      return size;
262    }
263
264    public void MergeFrom(FieldMask other) {
265      if (other == null) {
266        return;
267      }
268      paths_.Add(other.paths_);
269    }
270
271    public void MergeFrom(pb::CodedInputStream input) {
272      uint tag;
273      while ((tag = input.ReadTag()) != 0) {
274        switch(tag) {
275          default:
276            input.SkipLastField();
277            break;
278          case 10: {
279            paths_.AddEntriesFrom(input, _repeated_paths_codec);
280            break;
281          }
282        }
283      }
284    }
285
286  }
287
288  #endregion
289
290}
291
292#endregion Designer generated code
293