Jon Skeet | 62a4aa5 | 2015-07-14 14:26:49 +0100 | [diff] [blame] | 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 | |
Jon Skeet | 284bb45 | 2015-11-05 09:13:53 +0000 | [diff] [blame] | 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 { |
Jon Skeet | 62a4aa5 | 2015-07-14 14:26:49 +0100 | [diff] [blame] | 15 | |
Jon Skeet | 284bb45 | 2015-11-05 09:13:53 +0000 | [diff] [blame] | 16 | #region Descriptor |
| 17 | /// <summary>File descriptor for google/protobuf/field_mask.proto</summary> |
| 18 | public static pbr::FileDescriptor Descriptor { |
| 19 | get { return descriptor; } |
Jon Skeet | 62a4aa5 | 2015-07-14 14:26:49 +0100 | [diff] [blame] | 20 | } |
Jon Skeet | 284bb45 | 2015-11-05 09:13:53 +0000 | [diff] [blame] | 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=")); |
Jon Skeet | a2667aa | 2015-11-19 17:14:23 +0000 | [diff] [blame] | 30 | descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, |
Jon Skeet | 284bb45 | 2015-11-05 09:13:53 +0000 | [diff] [blame] | 31 | new pbr::FileDescriptor[] { }, |
Jon Skeet | b615996 | 2016-02-04 07:08:55 +0000 | [diff] [blame] | 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) |
Jon Skeet | 284bb45 | 2015-11-05 09:13:53 +0000 | [diff] [blame] | 34 | })); |
| 35 | } |
| 36 | #endregion |
| 37 | |
Jon Skeet | 62a4aa5 | 2015-07-14 14:26:49 +0100 | [diff] [blame] | 38 | } |
| 39 | #region Messages |
Jon Skeet | 18e0a2e | 2015-10-01 10:38:01 +0100 | [diff] [blame] | 40 | /// <summary> |
| 41 | /// `FieldMask` represents a set of symbolic field paths, for example: |
Jon Skeet | cff900e | 2015-11-06 18:38:31 +0000 | [diff] [blame] | 42 | /// |
Jon Skeet | 18e0a2e | 2015-10-01 10:38:01 +0100 | [diff] [blame] | 43 | /// paths: "f.a" |
| 44 | /// paths: "f.b.d" |
Jon Skeet | cff900e | 2015-11-06 18:38:31 +0000 | [diff] [blame] | 45 | /// |
Jon Skeet | 18e0a2e | 2015-10-01 10:38:01 +0100 | [diff] [blame] | 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`. |
Jon Skeet | cff900e | 2015-11-06 18:38:31 +0000 | [diff] [blame] | 49 | /// |
Jon Skeet | 18e0a2e | 2015-10-01 10:38:01 +0100 | [diff] [blame] | 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). |
Jon Skeet | cff900e | 2015-11-06 18:38:31 +0000 | [diff] [blame] | 53 | /// |
Jon Skeet | 18e0a2e | 2015-10-01 10:38:01 +0100 | [diff] [blame] | 54 | /// # Field Masks in Projections |
Jon Skeet | cff900e | 2015-11-06 18:38:31 +0000 | [diff] [blame] | 55 | /// |
Jon Skeet | 18e0a2e | 2015-10-01 10:38:01 +0100 | [diff] [blame] | 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: |
Jon Skeet | cff900e | 2015-11-06 18:38:31 +0000 | [diff] [blame] | 60 | /// |
Jon Skeet | 18e0a2e | 2015-10-01 10:38:01 +0100 | [diff] [blame] | 61 | /// f { |
| 62 | /// a : 22 |
| 63 | /// b { |
| 64 | /// d : 1 |
| 65 | /// x : 2 |
| 66 | /// } |
| 67 | /// y : 13 |
| 68 | /// } |
| 69 | /// z: 8 |
Jon Skeet | cff900e | 2015-11-06 18:38:31 +0000 | [diff] [blame] | 70 | /// |
Jon Skeet | 18e0a2e | 2015-10-01 10:38:01 +0100 | [diff] [blame] | 71 | /// The result will not contain specific values for fields x,y and z |
Jon Skeet | 9e4f354 | 2016-01-04 14:03:01 +0000 | [diff] [blame] | 72 | /// (their value will be set to the default, and omitted in proto text |
Jon Skeet | 18e0a2e | 2015-10-01 10:38:01 +0100 | [diff] [blame] | 73 | /// output): |
Jon Skeet | cff900e | 2015-11-06 18:38:31 +0000 | [diff] [blame] | 74 | /// |
Jon Skeet | 18e0a2e | 2015-10-01 10:38:01 +0100 | [diff] [blame] | 75 | /// f { |
| 76 | /// a : 22 |
| 77 | /// b { |
| 78 | /// d : 1 |
| 79 | /// } |
| 80 | /// } |
Jon Skeet | cff900e | 2015-11-06 18:38:31 +0000 | [diff] [blame] | 81 | /// |
Jon Skeet | 18e0a2e | 2015-10-01 10:38:01 +0100 | [diff] [blame] | 82 | /// A repeated field is not allowed except at the last position of a |
| 83 | /// field mask. |
Jon Skeet | cff900e | 2015-11-06 18:38:31 +0000 | [diff] [blame] | 84 | /// |
Jon Skeet | 18e0a2e | 2015-10-01 10:38:01 +0100 | [diff] [blame] | 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). |
Jon Skeet | cff900e | 2015-11-06 18:38:31 +0000 | [diff] [blame] | 88 | /// |
Jon Skeet | 18e0a2e | 2015-10-01 10:38:01 +0100 | [diff] [blame] | 89 | /// 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 Skeet | cff900e | 2015-11-06 18:38:31 +0000 | [diff] [blame] | 98 | /// |
Jon Skeet | 18e0a2e | 2015-10-01 10:38:01 +0100 | [diff] [blame] | 99 | /// # Field Masks in Update Operations |
Jon Skeet | cff900e | 2015-11-06 18:38:31 +0000 | [diff] [blame] | 100 | /// |
Jon Skeet | 18e0a2e | 2015-10-01 10:38:01 +0100 | [diff] [blame] | 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. |
Jon Skeet | cff900e | 2015-11-06 18:38:31 +0000 | [diff] [blame] | 107 | /// |
Jon Skeet | 18e0a2e | 2015-10-01 10:38:01 +0100 | [diff] [blame] | 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. |
Jon Skeet | cff900e | 2015-11-06 18:38:31 +0000 | [diff] [blame] | 113 | /// |
Jon Skeet | 18e0a2e | 2015-10-01 10:38:01 +0100 | [diff] [blame] | 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. |
Jon Skeet | cff900e | 2015-11-06 18:38:31 +0000 | [diff] [blame] | 121 | /// |
Jon Skeet | 18e0a2e | 2015-10-01 10:38:01 +0100 | [diff] [blame] | 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. |
Jon Skeet | cff900e | 2015-11-06 18:38:31 +0000 | [diff] [blame] | 126 | /// |
Jon Skeet | 18e0a2e | 2015-10-01 10:38:01 +0100 | [diff] [blame] | 127 | /// ## Considerations for HTTP REST |
Jon Skeet | cff900e | 2015-11-06 18:38:31 +0000 | [diff] [blame] | 128 | /// |
Jon Skeet | 18e0a2e | 2015-10-01 10:38:01 +0100 | [diff] [blame] | 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). |
Jon Skeet | cff900e | 2015-11-06 18:38:31 +0000 | [diff] [blame] | 132 | /// |
Jon Skeet | 18e0a2e | 2015-10-01 10:38:01 +0100 | [diff] [blame] | 133 | /// # JSON Encoding of Field Masks |
Jon Skeet | cff900e | 2015-11-06 18:38:31 +0000 | [diff] [blame] | 134 | /// |
Jon Skeet | 18e0a2e | 2015-10-01 10:38:01 +0100 | [diff] [blame] | 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. |
Jon Skeet | cff900e | 2015-11-06 18:38:31 +0000 | [diff] [blame] | 138 | /// |
Jon Skeet | 18e0a2e | 2015-10-01 10:38:01 +0100 | [diff] [blame] | 139 | /// As an example, consider the following message declarations: |
Jon Skeet | cff900e | 2015-11-06 18:38:31 +0000 | [diff] [blame] | 140 | /// |
Jon Skeet | 18e0a2e | 2015-10-01 10:38:01 +0100 | [diff] [blame] | 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 | /// } |
Jon Skeet | cff900e | 2015-11-06 18:38:31 +0000 | [diff] [blame] | 149 | /// |
Jon Skeet | 18e0a2e | 2015-10-01 10:38:01 +0100 | [diff] [blame] | 150 | /// In proto a field mask for `Profile` may look as such: |
Jon Skeet | cff900e | 2015-11-06 18:38:31 +0000 | [diff] [blame] | 151 | /// |
Jon Skeet | 18e0a2e | 2015-10-01 10:38:01 +0100 | [diff] [blame] | 152 | /// mask { |
| 153 | /// paths: "user.display_name" |
| 154 | /// paths: "photo" |
| 155 | /// } |
Jon Skeet | cff900e | 2015-11-06 18:38:31 +0000 | [diff] [blame] | 156 | /// |
Jon Skeet | 18e0a2e | 2015-10-01 10:38:01 +0100 | [diff] [blame] | 157 | /// In JSON, the same mask is represented as below: |
Jon Skeet | cff900e | 2015-11-06 18:38:31 +0000 | [diff] [blame] | 158 | /// |
Jon Skeet | 18e0a2e | 2015-10-01 10:38:01 +0100 | [diff] [blame] | 159 | /// { |
| 160 | /// mask: "user.displayName,photo" |
| 161 | /// } |
| 162 | /// </summary> |
Jon Skeet | 62a4aa5 | 2015-07-14 14:26:49 +0100 | [diff] [blame] | 163 | [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 Skeet | 62a4aa5 | 2015-07-14 14:26:49 +0100 | [diff] [blame] | 168 | public static pbr::MessageDescriptor Descriptor { |
Jon Skeet | 284bb45 | 2015-11-05 09:13:53 +0000 | [diff] [blame] | 169 | get { return global::Google.Protobuf.WellKnownTypes.FieldMaskReflection.Descriptor.MessageTypes[0]; } |
Jon Skeet | 62a4aa5 | 2015-07-14 14:26:49 +0100 | [diff] [blame] | 170 | } |
| 171 | |
Jon Skeet | 96cffaa | 2015-07-20 19:25:07 +0100 | [diff] [blame] | 172 | pbr::MessageDescriptor pb::IMessage.Descriptor { |
| 173 | get { return Descriptor; } |
Jon Skeet | 62a4aa5 | 2015-07-14 14:26:49 +0100 | [diff] [blame] | 174 | } |
| 175 | |
Jon Skeet | 62a4aa5 | 2015-07-14 14:26:49 +0100 | [diff] [blame] | 176 | 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 Skeet | 18e0a2e | 2015-10-01 10:38:01 +0100 | [diff] [blame] | 190 | /// <summary>Field number for the "paths" field.</summary> |
Jon Skeet | 62a4aa5 | 2015-07-14 14:26:49 +0100 | [diff] [blame] | 191 | 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 Skeet | 18e0a2e | 2015-10-01 10:38:01 +0100 | [diff] [blame] | 195 | /// <summary> |
| 196 | /// The set of field mask paths. |
| 197 | /// </summary> |
Jon Skeet | 62a4aa5 | 2015-07-14 14:26:49 +0100 | [diff] [blame] | 198 | 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 Skeet | adee6fe | 2015-12-15 09:24:04 +0000 | [diff] [blame] | 224 | return pb::JsonFormatter.ToDiagnosticString(this); |
Jon Skeet | 62a4aa5 | 2015-07-14 14:26:49 +0100 | [diff] [blame] | 225 | } |
| 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 Skeet | 1a57ad8 | 2015-08-05 11:23:52 +0100 | [diff] [blame] | 246 | while ((tag = input.ReadTag()) != 0) { |
Jon Skeet | 62a4aa5 | 2015-07-14 14:26:49 +0100 | [diff] [blame] | 247 | switch(tag) { |
Jon Skeet | 62a4aa5 | 2015-07-14 14:26:49 +0100 | [diff] [blame] | 248 | default: |
Jon Skeet | 5bdc572 | 2015-08-06 11:40:43 +0100 | [diff] [blame] | 249 | input.SkipLastField(); |
Jon Skeet | 62a4aa5 | 2015-07-14 14:26:49 +0100 | [diff] [blame] | 250 | 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 |