1 // <auto-generated> 2 // Generated by the protocol buffer compiler. DO NOT EDIT! 3 // source: google/protobuf/any.proto 4 // </auto-generated> 5 #pragma warning disable 1591, 0612, 3021 6 #region Designer generated code 7 8 using pb = global::Google.Protobuf; 9 using pbc = global::Google.Protobuf.Collections; 10 using pbr = global::Google.Protobuf.Reflection; 11 using scg = global::System.Collections.Generic; 12 namespace Google.Protobuf.WellKnownTypes { 13 14 /// <summary>Holder for reflection information generated from google/protobuf/any.proto</summary> 15 public static partial class AnyReflection { 16 17 #region Descriptor 18 /// <summary>File descriptor for google/protobuf/any.proto</summary> 19 public static pbr::FileDescriptor Descriptor { 20 get { return descriptor; } 21 } 22 private static pbr::FileDescriptor descriptor; 23 AnyReflection()24 static AnyReflection() { 25 byte[] descriptorData = global::System.Convert.FromBase64String( 26 string.Concat( 27 "Chlnb29nbGUvcHJvdG9idWYvYW55LnByb3RvEg9nb29nbGUucHJvdG9idWYi", 28 "JgoDQW55EhAKCHR5cGVfdXJsGAEgASgJEg0KBXZhbHVlGAIgASgMQm8KE2Nv", 29 "bS5nb29nbGUucHJvdG9idWZCCEFueVByb3RvUAFaJWdpdGh1Yi5jb20vZ29s", 30 "YW5nL3Byb3RvYnVmL3B0eXBlcy9hbnmiAgNHUEKqAh5Hb29nbGUuUHJvdG9i", 31 "dWYuV2VsbEtub3duVHlwZXNiBnByb3RvMw==")); 32 descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, 33 new pbr::FileDescriptor[] { }, 34 new pbr::GeneratedClrTypeInfo(null, null, new pbr::GeneratedClrTypeInfo[] { 35 new pbr::GeneratedClrTypeInfo(typeof(global::Google.Protobuf.WellKnownTypes.Any), global::Google.Protobuf.WellKnownTypes.Any.Parser, new[]{ "TypeUrl", "Value" }, null, null, null, null) 36 })); 37 } 38 #endregion 39 40 } 41 #region Messages 42 /// <summary> 43 /// `Any` contains an arbitrary serialized protocol buffer message along with a 44 /// URL that describes the type of the serialized message. 45 /// 46 /// Protobuf library provides support to pack/unpack Any values in the form 47 /// of utility functions or additional generated methods of the Any type. 48 /// 49 /// Example 1: Pack and unpack a message in C++. 50 /// 51 /// Foo foo = ...; 52 /// Any any; 53 /// any.PackFrom(foo); 54 /// ... 55 /// if (any.UnpackTo(&foo)) { 56 /// ... 57 /// } 58 /// 59 /// Example 2: Pack and unpack a message in Java. 60 /// 61 /// Foo foo = ...; 62 /// Any any = Any.pack(foo); 63 /// ... 64 /// if (any.is(Foo.class)) { 65 /// foo = any.unpack(Foo.class); 66 /// } 67 /// 68 /// Example 3: Pack and unpack a message in Python. 69 /// 70 /// foo = Foo(...) 71 /// any = Any() 72 /// any.Pack(foo) 73 /// ... 74 /// if any.Is(Foo.DESCRIPTOR): 75 /// any.Unpack(foo) 76 /// ... 77 /// 78 /// Example 4: Pack and unpack a message in Go 79 /// 80 /// foo := &pb.Foo{...} 81 /// any, err := ptypes.MarshalAny(foo) 82 /// ... 83 /// foo := &pb.Foo{} 84 /// if err := ptypes.UnmarshalAny(any, foo); err != nil { 85 /// ... 86 /// } 87 /// 88 /// The pack methods provided by protobuf library will by default use 89 /// 'type.googleapis.com/full.type.name' as the type URL and the unpack 90 /// methods only use the fully qualified type name after the last '/' 91 /// in the type URL, for example "foo.bar.com/x/y.z" will yield type 92 /// name "y.z". 93 /// 94 /// JSON 95 /// ==== 96 /// The JSON representation of an `Any` value uses the regular 97 /// representation of the deserialized, embedded message, with an 98 /// additional field `@type` which contains the type URL. Example: 99 /// 100 /// package google.profile; 101 /// message Person { 102 /// string first_name = 1; 103 /// string last_name = 2; 104 /// } 105 /// 106 /// { 107 /// "@type": "type.googleapis.com/google.profile.Person", 108 /// "firstName": <string>, 109 /// "lastName": <string> 110 /// } 111 /// 112 /// If the embedded message type is well-known and has a custom JSON 113 /// representation, that representation will be embedded adding a field 114 /// `value` which holds the custom JSON in addition to the `@type` 115 /// field. Example (for message [google.protobuf.Duration][]): 116 /// 117 /// { 118 /// "@type": "type.googleapis.com/google.protobuf.Duration", 119 /// "value": "1.212s" 120 /// } 121 /// </summary> 122 public sealed partial class Any : pb::IMessage<Any> 123 #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE 124 , pb::IBufferMessage 125 #endif 126 { 127 private static readonly pb::MessageParser<Any> _parser = new pb::MessageParser<Any>(() => new Any()); 128 private pb::UnknownFieldSet _unknownFields; 129 [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 130 public static pb::MessageParser<Any> Parser { get { return _parser; } } 131 132 [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 133 public static pbr::MessageDescriptor Descriptor { 134 get { return global::Google.Protobuf.WellKnownTypes.AnyReflection.Descriptor.MessageTypes[0]; } 135 } 136 137 [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 138 pbr::MessageDescriptor pb::IMessage.Descriptor { 139 get { return Descriptor; } 140 } 141 142 [global::System.Diagnostics.DebuggerNonUserCodeAttribute] Any()143 public Any() { 144 OnConstruction(); 145 } 146 OnConstruction()147 partial void OnConstruction(); 148 149 [global::System.Diagnostics.DebuggerNonUserCodeAttribute] Any(Any other)150 public Any(Any other) : this() { 151 typeUrl_ = other.typeUrl_; 152 value_ = other.value_; 153 _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); 154 } 155 156 [global::System.Diagnostics.DebuggerNonUserCodeAttribute] Clone()157 public Any Clone() { 158 return new Any(this); 159 } 160 161 /// <summary>Field number for the "type_url" field.</summary> 162 public const int TypeUrlFieldNumber = 1; 163 private string typeUrl_ = ""; 164 /// <summary> 165 /// A URL/resource name that uniquely identifies the type of the serialized 166 /// protocol buffer message. This string must contain at least 167 /// one "/" character. The last segment of the URL's path must represent 168 /// the fully qualified name of the type (as in 169 /// `path/google.protobuf.Duration`). The name should be in a canonical form 170 /// (e.g., leading "." is not accepted). 171 /// 172 /// In practice, teams usually precompile into the binary all types that they 173 /// expect it to use in the context of Any. However, for URLs which use the 174 /// scheme `http`, `https`, or no scheme, one can optionally set up a type 175 /// server that maps type URLs to message definitions as follows: 176 /// 177 /// * If no scheme is provided, `https` is assumed. 178 /// * An HTTP GET on the URL must yield a [google.protobuf.Type][] 179 /// value in binary format, or produce an error. 180 /// * Applications are allowed to cache lookup results based on the 181 /// URL, or have them precompiled into a binary to avoid any 182 /// lookup. Therefore, binary compatibility needs to be preserved 183 /// on changes to types. (Use versioned type names to manage 184 /// breaking changes.) 185 /// 186 /// Note: this functionality is not currently available in the official 187 /// protobuf release, and it is not used for type URLs beginning with 188 /// type.googleapis.com. 189 /// 190 /// Schemes other than `http`, `https` (or the empty scheme) might be 191 /// used with implementation specific semantics. 192 /// </summary> 193 [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 194 public string TypeUrl { 195 get { return typeUrl_; } 196 set { 197 typeUrl_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); 198 } 199 } 200 201 /// <summary>Field number for the "value" field.</summary> 202 public const int ValueFieldNumber = 2; 203 private pb::ByteString value_ = pb::ByteString.Empty; 204 /// <summary> 205 /// Must be a valid serialized protocol buffer of the above specified type. 206 /// </summary> 207 [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 208 public pb::ByteString Value { 209 get { return value_; } 210 set { 211 value_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); 212 } 213 } 214 215 [global::System.Diagnostics.DebuggerNonUserCodeAttribute] Equals(object other)216 public override bool Equals(object other) { 217 return Equals(other as Any); 218 } 219 220 [global::System.Diagnostics.DebuggerNonUserCodeAttribute] Equals(Any other)221 public bool Equals(Any other) { 222 if (ReferenceEquals(other, null)) { 223 return false; 224 } 225 if (ReferenceEquals(other, this)) { 226 return true; 227 } 228 if (TypeUrl != other.TypeUrl) return false; 229 if (Value != other.Value) return false; 230 return Equals(_unknownFields, other._unknownFields); 231 } 232 233 [global::System.Diagnostics.DebuggerNonUserCodeAttribute] GetHashCode()234 public override int GetHashCode() { 235 int hash = 1; 236 if (TypeUrl.Length != 0) hash ^= TypeUrl.GetHashCode(); 237 if (Value.Length != 0) hash ^= Value.GetHashCode(); 238 if (_unknownFields != null) { 239 hash ^= _unknownFields.GetHashCode(); 240 } 241 return hash; 242 } 243 244 [global::System.Diagnostics.DebuggerNonUserCodeAttribute] ToString()245 public override string ToString() { 246 return pb::JsonFormatter.ToDiagnosticString(this); 247 } 248 249 [global::System.Diagnostics.DebuggerNonUserCodeAttribute] WriteTo(pb::CodedOutputStream output)250 public void WriteTo(pb::CodedOutputStream output) { 251 #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE 252 output.WriteRawMessage(this); 253 #else 254 if (TypeUrl.Length != 0) { 255 output.WriteRawTag(10); 256 output.WriteString(TypeUrl); 257 } 258 if (Value.Length != 0) { 259 output.WriteRawTag(18); 260 output.WriteBytes(Value); 261 } 262 if (_unknownFields != null) { 263 _unknownFields.WriteTo(output); 264 } 265 #endif 266 } 267 268 #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE 269 [global::System.Diagnostics.DebuggerNonUserCodeAttribute] IBufferMessage.InternalWriteTo(ref pb::WriteContext output)270 void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { 271 if (TypeUrl.Length != 0) { 272 output.WriteRawTag(10); 273 output.WriteString(TypeUrl); 274 } 275 if (Value.Length != 0) { 276 output.WriteRawTag(18); 277 output.WriteBytes(Value); 278 } 279 if (_unknownFields != null) { 280 _unknownFields.WriteTo(ref output); 281 } 282 } 283 #endif 284 285 [global::System.Diagnostics.DebuggerNonUserCodeAttribute] CalculateSize()286 public int CalculateSize() { 287 int size = 0; 288 if (TypeUrl.Length != 0) { 289 size += 1 + pb::CodedOutputStream.ComputeStringSize(TypeUrl); 290 } 291 if (Value.Length != 0) { 292 size += 1 + pb::CodedOutputStream.ComputeBytesSize(Value); 293 } 294 if (_unknownFields != null) { 295 size += _unknownFields.CalculateSize(); 296 } 297 return size; 298 } 299 300 [global::System.Diagnostics.DebuggerNonUserCodeAttribute] MergeFrom(Any other)301 public void MergeFrom(Any other) { 302 if (other == null) { 303 return; 304 } 305 if (other.TypeUrl.Length != 0) { 306 TypeUrl = other.TypeUrl; 307 } 308 if (other.Value.Length != 0) { 309 Value = other.Value; 310 } 311 _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); 312 } 313 314 [global::System.Diagnostics.DebuggerNonUserCodeAttribute] MergeFrom(pb::CodedInputStream input)315 public void MergeFrom(pb::CodedInputStream input) { 316 #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE 317 input.ReadRawMessage(this); 318 #else 319 uint tag; 320 while ((tag = input.ReadTag()) != 0) { 321 switch(tag) { 322 default: 323 _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); 324 break; 325 case 10: { 326 TypeUrl = input.ReadString(); 327 break; 328 } 329 case 18: { 330 Value = input.ReadBytes(); 331 break; 332 } 333 } 334 } 335 #endif 336 } 337 338 #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE 339 [global::System.Diagnostics.DebuggerNonUserCodeAttribute] IBufferMessage.InternalMergeFrom(ref pb::ParseContext input)340 void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { 341 uint tag; 342 while ((tag = input.ReadTag()) != 0) { 343 switch(tag) { 344 default: 345 _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); 346 break; 347 case 10: { 348 TypeUrl = input.ReadString(); 349 break; 350 } 351 case 18: { 352 Value = input.ReadBytes(); 353 break; 354 } 355 } 356 } 357 } 358 #endif 359 360 } 361 362 #endregion 363 364 } 365 366 #endregion Designer generated code 367