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