blob: 2ba2b96fc0f997d130973637af99ff4cf8a47af0 [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 /// }
162 /// </summary>
Jon Skeet62a4aa52015-07-14 14:26:49 +0100163 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
164 public sealed partial class FieldMask : pb::IMessage<FieldMask> {
165 private static readonly pb::MessageParser<FieldMask> _parser = new pb::MessageParser<FieldMask>(() => new FieldMask());
166 public static pb::MessageParser<FieldMask> Parser { get { return _parser; } }
167
Jon Skeet62a4aa52015-07-14 14:26:49 +0100168 public static pbr::MessageDescriptor Descriptor {
Jon Skeet284bb452015-11-05 09:13:53 +0000169 get { return global::Google.Protobuf.WellKnownTypes.FieldMaskReflection.Descriptor.MessageTypes[0]; }
Jon Skeet62a4aa52015-07-14 14:26:49 +0100170 }
171
Jon Skeet96cffaa2015-07-20 19:25:07 +0100172 pbr::MessageDescriptor pb::IMessage.Descriptor {
173 get { return Descriptor; }
Jon Skeet62a4aa52015-07-14 14:26:49 +0100174 }
175
Jon Skeet62a4aa52015-07-14 14:26:49 +0100176 public FieldMask() {
177 OnConstruction();
178 }
179
180 partial void OnConstruction();
181
182 public FieldMask(FieldMask other) : this() {
183 paths_ = other.paths_.Clone();
184 }
185
186 public FieldMask Clone() {
187 return new FieldMask(this);
188 }
189
Jon Skeet18e0a2e2015-10-01 10:38:01 +0100190 /// <summary>Field number for the "paths" field.</summary>
Jon Skeet62a4aa52015-07-14 14:26:49 +0100191 public const int PathsFieldNumber = 1;
192 private static readonly pb::FieldCodec<string> _repeated_paths_codec
193 = pb::FieldCodec.ForString(10);
194 private readonly pbc::RepeatedField<string> paths_ = new pbc::RepeatedField<string>();
Jon Skeet18e0a2e2015-10-01 10:38:01 +0100195 /// <summary>
196 /// The set of field mask paths.
197 /// </summary>
Jon Skeet62a4aa52015-07-14 14:26:49 +0100198 public pbc::RepeatedField<string> Paths {
199 get { return paths_; }
200 }
201
202 public override bool Equals(object other) {
203 return Equals(other as FieldMask);
204 }
205
206 public bool Equals(FieldMask other) {
207 if (ReferenceEquals(other, null)) {
208 return false;
209 }
210 if (ReferenceEquals(other, this)) {
211 return true;
212 }
213 if(!paths_.Equals(other.paths_)) return false;
214 return true;
215 }
216
217 public override int GetHashCode() {
218 int hash = 1;
219 hash ^= paths_.GetHashCode();
220 return hash;
221 }
222
223 public override string ToString() {
Jon Skeetadee6fe2015-12-15 09:24:04 +0000224 return pb::JsonFormatter.ToDiagnosticString(this);
Jon Skeet62a4aa52015-07-14 14:26:49 +0100225 }
226
227 public void WriteTo(pb::CodedOutputStream output) {
228 paths_.WriteTo(output, _repeated_paths_codec);
229 }
230
231 public int CalculateSize() {
232 int size = 0;
233 size += paths_.CalculateSize(_repeated_paths_codec);
234 return size;
235 }
236
237 public void MergeFrom(FieldMask other) {
238 if (other == null) {
239 return;
240 }
241 paths_.Add(other.paths_);
242 }
243
244 public void MergeFrom(pb::CodedInputStream input) {
245 uint tag;
Jon Skeet1a57ad82015-08-05 11:23:52 +0100246 while ((tag = input.ReadTag()) != 0) {
Jon Skeet62a4aa52015-07-14 14:26:49 +0100247 switch(tag) {
Jon Skeet62a4aa52015-07-14 14:26:49 +0100248 default:
Jon Skeet5bdc5722015-08-06 11:40:43 +0100249 input.SkipLastField();
Jon Skeet62a4aa52015-07-14 14:26:49 +0100250 break;
251 case 10: {
252 paths_.AddEntriesFrom(input, _repeated_paths_codec);
253 break;
254 }
255 }
256 }
257 }
258
259 }
260
261 #endregion
262
263}
264
265#endregion Designer generated code