blob: 79a0319fe0aa1184e6ecefaafcd1fe8a306f5d6f [file] [log] [blame]
Jon Skeet62a4aa52015-07-14 14:26:49 +01001// 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
Jon Skeet284bb452015-11-05 09:13:53 +000012 /// <summary>Holder for reflection information generated from google/protobuf/field_mask.proto</summary>
13 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
14 public static partial class FieldMaskReflection {
Jon Skeet62a4aa52015-07-14 14:26:49 +010015
Jon Skeet284bb452015-11-05 09:13:53 +000016 #region Descriptor
17 /// <summary>File descriptor for google/protobuf/field_mask.proto</summary>
18 public static pbr::FileDescriptor Descriptor {
19 get { return descriptor; }
Jon Skeet62a4aa52015-07-14 14:26:49 +010020 }
Jon Skeet284bb452015-11-05 09:13:53 +000021 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="));
Jon Skeeta2667aa2015-11-19 17:14:23 +000030 descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData,
Jon Skeet284bb452015-11-05 09:13:53 +000031 new pbr::FileDescriptor[] { },
Jon Skeetb6159962016-02-04 07:08:55 +000032 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)
Jon Skeet284bb452015-11-05 09:13:53 +000034 }));
35 }
36 #endregion
37
Jon Skeet62a4aa52015-07-14 14:26:49 +010038 }
39 #region Messages
Jon Skeet18e0a2e2015-10-01 10:38:01 +010040 /// <summary>
41 /// `FieldMask` represents a set of symbolic field paths, for example:
Jon Skeetcff900e2015-11-06 18:38:31 +000042 ///
Jon Skeet18e0a2e2015-10-01 10:38:01 +010043 /// paths: "f.a"
44 /// paths: "f.b.d"
Jon Skeetcff900e2015-11-06 18:38:31 +000045 ///
Jon Skeet18e0a2e2015-10-01 10:38:01 +010046 /// 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`.
Jon Skeetcff900e2015-11-06 18:38:31 +000049 ///
Jon Skeet18e0a2e2015-10-01 10:38:01 +010050 /// 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).
Jon Skeetcff900e2015-11-06 18:38:31 +000053 ///
Jon Skeet18e0a2e2015-10-01 10:38:01 +010054 /// # Field Masks in Projections
Jon Skeetcff900e2015-11-06 18:38:31 +000055 ///
Jon Skeet18e0a2e2015-10-01 10:38:01 +010056 /// 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:
Jon Skeetcff900e2015-11-06 18:38:31 +000060 ///
Jon Skeet18e0a2e2015-10-01 10:38:01 +010061 /// f {
62 /// a : 22
63 /// b {
64 /// d : 1
65 /// x : 2
66 /// }
67 /// y : 13
68 /// }
69 /// z: 8
Jon Skeetcff900e2015-11-06 18:38:31 +000070 ///
Jon Skeet18e0a2e2015-10-01 10:38:01 +010071 /// The result will not contain specific values for fields x,y and z
Jon Skeet9e4f3542016-01-04 14:03:01 +000072 /// (their value will be set to the default, and omitted in proto text
Jon Skeet18e0a2e2015-10-01 10:38:01 +010073 /// output):
Jon Skeetcff900e2015-11-06 18:38:31 +000074 ///
Jon Skeet18e0a2e2015-10-01 10:38:01 +010075 /// f {
76 /// a : 22
77 /// b {
78 /// d : 1
79 /// }
80 /// }
Jon Skeetcff900e2015-11-06 18:38:31 +000081 ///
Jon Skeet18e0a2e2015-10-01 10:38:01 +010082 /// A repeated field is not allowed except at the last position of a
83 /// field mask.
Jon Skeetcff900e2015-11-06 18:38:31 +000084 ///
Jon Skeet18e0a2e2015-10-01 10:38:01 +010085 /// 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).
Jon Skeetcff900e2015-11-06 18:38:31 +000088 ///
Jon Skeet18e0a2e2015-10-01 10:38:01 +010089 /// Note that a field mask does not necessarily applies 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.
Jon Skeetcff900e2015-11-06 18:38:31 +000098 ///
Jon Skeet18e0a2e2015-10-01 10:38:01 +010099 /// # Field Masks in Update Operations
Jon Skeetcff900e2015-11-06 18:38:31 +0000100 ///
Jon Skeet18e0a2e2015-10-01 10:38:01 +0100101 /// 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.
Jon Skeetcff900e2015-11-06 18:38:31 +0000107 ///
Jon Skeet18e0a2e2015-10-01 10:38:01 +0100108 /// 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.
Jon Skeetcff900e2015-11-06 18:38:31 +0000113 ///
Jon Skeet18e0a2e2015-10-01 10:38:01 +0100114 /// 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.
Jon Skeetcff900e2015-11-06 18:38:31 +0000121 ///
Jon Skeet18e0a2e2015-10-01 10:38:01 +0100122 /// 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.
Jon Skeetcff900e2015-11-06 18:38:31 +0000126 ///
Jon Skeet18e0a2e2015-10-01 10:38:01 +0100127 /// ## Considerations for HTTP REST
Jon Skeetcff900e2015-11-06 18:38:31 +0000128 ///
Jon Skeet18e0a2e2015-10-01 10:38:01 +0100129 /// 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).
Jon Skeetcff900e2015-11-06 18:38:31 +0000132 ///
Jon Skeet18e0a2e2015-10-01 10:38:01 +0100133 /// # JSON Encoding of Field Masks
Jon Skeetcff900e2015-11-06 18:38:31 +0000134 ///
Jon Skeet18e0a2e2015-10-01 10:38:01 +0100135 /// 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.
Jon Skeetcff900e2015-11-06 18:38:31 +0000138 ///
Jon Skeet18e0a2e2015-10-01 10:38:01 +0100139 /// As an example, consider the following message declarations:
Jon Skeetcff900e2015-11-06 18:38:31 +0000140 ///
Jon Skeet18e0a2e2015-10-01 10:38:01 +0100141 /// message Profile {
142 /// User user = 1;
143 /// Photo photo = 2;
144 /// }
145 /// message User {
146 /// string display_name = 1;
147 /// string address = 2;
148 /// }
Jon Skeetcff900e2015-11-06 18:38:31 +0000149 ///
Jon Skeet18e0a2e2015-10-01 10:38:01 +0100150 /// In proto a field mask for `Profile` may look as such:
Jon Skeetcff900e2015-11-06 18:38:31 +0000151 ///
Jon Skeet18e0a2e2015-10-01 10:38:01 +0100152 /// mask {
153 /// paths: "user.display_name"
154 /// paths: "photo"
155 /// }
Jon Skeetcff900e2015-11-06 18:38:31 +0000156 ///
Jon Skeet18e0a2e2015-10-01 10:38:01 +0100157 /// In JSON, the same mask is represented as below:
Jon Skeetcff900e2015-11-06 18:38:31 +0000158 ///
Jon Skeet18e0a2e2015-10-01 10:38:01 +0100159 /// {
160 /// mask: "user.displayName,photo"
161 /// }
Jon Skeetc588ac42016-04-20 17:19:42 +0100162 ///
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.
Jon Skeet18e0a2e2015-10-01 10:38:01 +0100189 /// </summary>
Jon Skeet62a4aa52015-07-14 14:26:49 +0100190 [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
Jon Skeet62a4aa52015-07-14 14:26:49 +0100195 public static pbr::MessageDescriptor Descriptor {
Jon Skeet284bb452015-11-05 09:13:53 +0000196 get { return global::Google.Protobuf.WellKnownTypes.FieldMaskReflection.Descriptor.MessageTypes[0]; }
Jon Skeet62a4aa52015-07-14 14:26:49 +0100197 }
198
Jon Skeet96cffaa2015-07-20 19:25:07 +0100199 pbr::MessageDescriptor pb::IMessage.Descriptor {
200 get { return Descriptor; }
Jon Skeet62a4aa52015-07-14 14:26:49 +0100201 }
202
Jon Skeet62a4aa52015-07-14 14:26:49 +0100203 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
Jon Skeet18e0a2e2015-10-01 10:38:01 +0100217 /// <summary>Field number for the "paths" field.</summary>
Jon Skeet62a4aa52015-07-14 14:26:49 +0100218 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>();
Jon Skeet18e0a2e2015-10-01 10:38:01 +0100222 /// <summary>
223 /// The set of field mask paths.
224 /// </summary>
Jon Skeet62a4aa52015-07-14 14:26:49 +0100225 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() {
Jon Skeetadee6fe2015-12-15 09:24:04 +0000251 return pb::JsonFormatter.ToDiagnosticString(this);
Jon Skeet62a4aa52015-07-14 14:26:49 +0100252 }
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;
Jon Skeet1a57ad82015-08-05 11:23:52 +0100273 while ((tag = input.ReadTag()) != 0) {
Jon Skeet62a4aa52015-07-14 14:26:49 +0100274 switch(tag) {
Jon Skeet62a4aa52015-07-14 14:26:49 +0100275 default:
Jon Skeet5bdc5722015-08-06 11:40:43 +0100276 input.SkipLastField();
Jon Skeet62a4aa52015-07-14 14:26:49 +0100277 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