1 // Generated by the protocol buffer compiler. DO NOT EDIT! 2 // source: google/protobuf/any.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 12 /// <summary>Holder for reflection information generated from google/protobuf/any.proto</summary> 13 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 14 public static partial class AnyReflection { 15 16 #region Descriptor 17 /// <summary>File descriptor for google/protobuf/any.proto</summary> 18 public static pbr::FileDescriptor Descriptor { 19 get { return descriptor; } 20 } 21 private static pbr::FileDescriptor descriptor; 22 AnyReflection()23 static AnyReflection() { 24 byte[] descriptorData = global::System.Convert.FromBase64String( 25 string.Concat( 26 "Chlnb29nbGUvcHJvdG9idWYvYW55LnByb3RvEg9nb29nbGUucHJvdG9idWYi", 27 "JgoDQW55EhAKCHR5cGVfdXJsGAEgASgJEg0KBXZhbHVlGAIgASgMQnIKE2Nv", 28 "bS5nb29nbGUucHJvdG9idWZCCEFueVByb3RvUAFaJWdpdGh1Yi5jb20vZ29s", 29 "YW5nL3Byb3RvYnVmL3B0eXBlcy9hbnmgAQGiAgNHUEKqAh5Hb29nbGUuUHJv", 30 "dG9idWYuV2VsbEtub3duVHlwZXNiBnByb3RvMw==")); 31 descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, 32 new pbr::FileDescriptor[] { }, 33 new pbr::GeneratedClrTypeInfo(null, new pbr::GeneratedClrTypeInfo[] { 34 new pbr::GeneratedClrTypeInfo(typeof(global::Google.Protobuf.WellKnownTypes.Any), global::Google.Protobuf.WellKnownTypes.Any.Parser, new[]{ "TypeUrl", "Value" }, null, null, null) 35 })); 36 } 37 #endregion 38 39 } 40 #region Messages 41 /// <summary> 42 /// `Any` contains an arbitrary serialized protocol buffer message along with a 43 /// URL that describes the type of the serialized message. 44 /// 45 /// Protobuf library provides support to pack/unpack Any values in the form 46 /// of utility functions or additional generated methods of the Any type. 47 /// 48 /// Example 1: Pack and unpack a message in C++. 49 /// 50 /// Foo foo = ...; 51 /// Any any; 52 /// any.PackFrom(foo); 53 /// ... 54 /// if (any.UnpackTo(&foo)) { 55 /// ... 56 /// } 57 /// 58 /// Example 2: Pack and unpack a message in Java. 59 /// 60 /// Foo foo = ...; 61 /// Any any = Any.pack(foo); 62 /// ... 63 /// if (any.is(Foo.class)) { 64 /// foo = any.unpack(Foo.class); 65 /// } 66 /// 67 /// The pack methods provided by protobuf library will by default use 68 /// 'type.googleapis.com/full.type.name' as the type URL and the unpack 69 /// methods only use the fully qualified type name after the last '/' 70 /// in the type URL, for example "foo.bar.com/x/y.z" will yield type 71 /// name "y.z". 72 /// 73 /// JSON 74 /// ==== 75 /// The JSON representation of an `Any` value uses the regular 76 /// representation of the deserialized, embedded message, with an 77 /// additional field `@type` which contains the type URL. Example: 78 /// 79 /// package google.profile; 80 /// message Person { 81 /// string first_name = 1; 82 /// string last_name = 2; 83 /// } 84 /// 85 /// { 86 /// "@type": "type.googleapis.com/google.profile.Person", 87 /// "firstName": <string>, 88 /// "lastName": <string> 89 /// } 90 /// 91 /// If the embedded message type is well-known and has a custom JSON 92 /// representation, that representation will be embedded adding a field 93 /// `value` which holds the custom JSON in addition to the `@type` 94 /// field. Example (for message [google.protobuf.Duration][]): 95 /// 96 /// { 97 /// "@type": "type.googleapis.com/google.protobuf.Duration", 98 /// "value": "1.212s" 99 /// } 100 /// </summary> 101 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 102 public sealed partial class Any : pb::IMessage<Any> { 103 private static readonly pb::MessageParser<Any> _parser = new pb::MessageParser<Any>(() => new Any()); 104 public static pb::MessageParser<Any> Parser { get { return _parser; } } 105 106 public static pbr::MessageDescriptor Descriptor { 107 get { return global::Google.Protobuf.WellKnownTypes.AnyReflection.Descriptor.MessageTypes[0]; } 108 } 109 110 pbr::MessageDescriptor pb::IMessage.Descriptor { 111 get { return Descriptor; } 112 } 113 Any()114 public Any() { 115 OnConstruction(); 116 } 117 OnConstruction()118 partial void OnConstruction(); 119 Any(Any other)120 public Any(Any other) : this() { 121 typeUrl_ = other.typeUrl_; 122 value_ = other.value_; 123 } 124 Clone()125 public Any Clone() { 126 return new Any(this); 127 } 128 129 /// <summary>Field number for the "type_url" field.</summary> 130 public const int TypeUrlFieldNumber = 1; 131 private string typeUrl_ = ""; 132 /// <summary> 133 /// A URL/resource name whose content describes the type of the 134 /// serialized protocol buffer message. 135 /// 136 /// For URLs which use the schema `http`, `https`, or no schema, the 137 /// following restrictions and interpretations apply: 138 /// 139 /// * If no schema is provided, `https` is assumed. 140 /// * The last segment of the URL's path must represent the fully 141 /// qualified name of the type (as in `path/google.protobuf.Duration`). 142 /// The name should be in a canonical form (e.g., leading "." is 143 /// not accepted). 144 /// * An HTTP GET on the URL must yield a [google.protobuf.Type][] 145 /// value in binary format, or produce an error. 146 /// * Applications are allowed to cache lookup results based on the 147 /// URL, or have them precompiled into a binary to avoid any 148 /// lookup. Therefore, binary compatibility needs to be preserved 149 /// on changes to types. (Use versioned type names to manage 150 /// breaking changes.) 151 /// 152 /// Schemas other than `http`, `https` (or the empty schema) might be 153 /// used with implementation specific semantics. 154 /// </summary> 155 public string TypeUrl { 156 get { return typeUrl_; } 157 set { 158 typeUrl_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); 159 } 160 } 161 162 /// <summary>Field number for the "value" field.</summary> 163 public const int ValueFieldNumber = 2; 164 private pb::ByteString value_ = pb::ByteString.Empty; 165 /// <summary> 166 /// Must be a valid serialized protocol buffer of the above specified type. 167 /// </summary> 168 public pb::ByteString Value { 169 get { return value_; } 170 set { 171 value_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); 172 } 173 } 174 Equals(object other)175 public override bool Equals(object other) { 176 return Equals(other as Any); 177 } 178 Equals(Any other)179 public bool Equals(Any other) { 180 if (ReferenceEquals(other, null)) { 181 return false; 182 } 183 if (ReferenceEquals(other, this)) { 184 return true; 185 } 186 if (TypeUrl != other.TypeUrl) return false; 187 if (Value != other.Value) return false; 188 return true; 189 } 190 GetHashCode()191 public override int GetHashCode() { 192 int hash = 1; 193 if (TypeUrl.Length != 0) hash ^= TypeUrl.GetHashCode(); 194 if (Value.Length != 0) hash ^= Value.GetHashCode(); 195 return hash; 196 } 197 ToString()198 public override string ToString() { 199 return pb::JsonFormatter.ToDiagnosticString(this); 200 } 201 WriteTo(pb::CodedOutputStream output)202 public void WriteTo(pb::CodedOutputStream output) { 203 if (TypeUrl.Length != 0) { 204 output.WriteRawTag(10); 205 output.WriteString(TypeUrl); 206 } 207 if (Value.Length != 0) { 208 output.WriteRawTag(18); 209 output.WriteBytes(Value); 210 } 211 } 212 CalculateSize()213 public int CalculateSize() { 214 int size = 0; 215 if (TypeUrl.Length != 0) { 216 size += 1 + pb::CodedOutputStream.ComputeStringSize(TypeUrl); 217 } 218 if (Value.Length != 0) { 219 size += 1 + pb::CodedOutputStream.ComputeBytesSize(Value); 220 } 221 return size; 222 } 223 MergeFrom(Any other)224 public void MergeFrom(Any other) { 225 if (other == null) { 226 return; 227 } 228 if (other.TypeUrl.Length != 0) { 229 TypeUrl = other.TypeUrl; 230 } 231 if (other.Value.Length != 0) { 232 Value = other.Value; 233 } 234 } 235 MergeFrom(pb::CodedInputStream input)236 public void MergeFrom(pb::CodedInputStream input) { 237 uint tag; 238 while ((tag = input.ReadTag()) != 0) { 239 switch(tag) { 240 default: 241 input.SkipLastField(); 242 break; 243 case 10: { 244 TypeUrl = input.ReadString(); 245 break; 246 } 247 case 18: { 248 Value = input.ReadBytes(); 249 break; 250 } 251 } 252 } 253 } 254 255 } 256 257 #endregion 258 259 } 260 261 #endregion Designer generated code 262