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/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 | |
Jon Skeet | 284bb45 | 2015-11-05 09:13:53 +0000 | [diff] [blame] | 12 | /// <summary>Holder for reflection information generated from google/protobuf/any.proto</summary> |
| 13 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] |
| 14 | public static partial class AnyReflection { |
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/any.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 AnyReflection() { |
| 24 | byte[] descriptorData = global::System.Convert.FromBase64String( |
| 25 | string.Concat( |
| 26 | "Chlnb29nbGUvcHJvdG9idWYvYW55LnByb3RvEg9nb29nbGUucHJvdG9idWYi", |
| 27 | "JgoDQW55EhAKCHR5cGVfdXJsGAEgASgJEg0KBXZhbHVlGAIgASgMQksKE2Nv", |
| 28 | "bS5nb29nbGUucHJvdG9idWZCCEFueVByb3RvUAGgAQGiAgNHUEKqAh5Hb29n", |
| 29 | "bGUuUHJvdG9idWYuV2VsbEtub3duVHlwZXNiBnByb3RvMw==")); |
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.Any), global::Google.Protobuf.WellKnownTypes.Any.Parser, new[]{ "TypeUrl", "Value" }, 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 | /// `Any` contains an arbitrary serialized message along with a URL |
| 42 | /// that describes the type of the serialized message. |
Jon Skeet | cff900e | 2015-11-06 18:38:31 +0000 | [diff] [blame] | 43 | /// |
Jon Skeet | 18e0a2e | 2015-10-01 10:38:01 +0100 | [diff] [blame] | 44 | /// JSON |
| 45 | /// ==== |
| 46 | /// The JSON representation of an `Any` value uses the regular |
| 47 | /// representation of the deserialized, embedded message, with an |
| 48 | /// additional field `@type` which contains the type URL. Example: |
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 | /// package google.profile; |
| 51 | /// message Person { |
| 52 | /// string first_name = 1; |
| 53 | /// string last_name = 2; |
| 54 | /// } |
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 | /// { |
| 57 | /// "@type": "type.googleapis.com/google.profile.Person", |
| 58 | /// "firstName": <string>, |
| 59 | /// "lastName": <string> |
| 60 | /// } |
Jon Skeet | cff900e | 2015-11-06 18:38:31 +0000 | [diff] [blame] | 61 | /// |
Jon Skeet | 18e0a2e | 2015-10-01 10:38:01 +0100 | [diff] [blame] | 62 | /// If the embedded message type is well-known and has a custom JSON |
| 63 | /// representation, that representation will be embedded adding a field |
Jon Skeet | 9e4f354 | 2016-01-04 14:03:01 +0000 | [diff] [blame] | 64 | /// `value` which holds the custom JSON in addition to the `@type` |
| 65 | /// field. Example (for message [google.protobuf.Duration][]): |
Jon Skeet | cff900e | 2015-11-06 18:38:31 +0000 | [diff] [blame] | 66 | /// |
Jon Skeet | 18e0a2e | 2015-10-01 10:38:01 +0100 | [diff] [blame] | 67 | /// { |
| 68 | /// "@type": "type.googleapis.com/google.protobuf.Duration", |
| 69 | /// "value": "1.212s" |
| 70 | /// } |
| 71 | /// </summary> |
Jon Skeet | 62a4aa5 | 2015-07-14 14:26:49 +0100 | [diff] [blame] | 72 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] |
| 73 | public sealed partial class Any : pb::IMessage<Any> { |
| 74 | private static readonly pb::MessageParser<Any> _parser = new pb::MessageParser<Any>(() => new Any()); |
| 75 | public static pb::MessageParser<Any> Parser { get { return _parser; } } |
| 76 | |
Jon Skeet | 62a4aa5 | 2015-07-14 14:26:49 +0100 | [diff] [blame] | 77 | public static pbr::MessageDescriptor Descriptor { |
Jon Skeet | 284bb45 | 2015-11-05 09:13:53 +0000 | [diff] [blame] | 78 | get { return global::Google.Protobuf.WellKnownTypes.AnyReflection.Descriptor.MessageTypes[0]; } |
Jon Skeet | 62a4aa5 | 2015-07-14 14:26:49 +0100 | [diff] [blame] | 79 | } |
| 80 | |
Jon Skeet | 96cffaa | 2015-07-20 19:25:07 +0100 | [diff] [blame] | 81 | pbr::MessageDescriptor pb::IMessage.Descriptor { |
| 82 | get { return Descriptor; } |
Jon Skeet | 62a4aa5 | 2015-07-14 14:26:49 +0100 | [diff] [blame] | 83 | } |
| 84 | |
Jon Skeet | 62a4aa5 | 2015-07-14 14:26:49 +0100 | [diff] [blame] | 85 | public Any() { |
| 86 | OnConstruction(); |
| 87 | } |
| 88 | |
| 89 | partial void OnConstruction(); |
| 90 | |
| 91 | public Any(Any other) : this() { |
| 92 | typeUrl_ = other.typeUrl_; |
| 93 | value_ = other.value_; |
| 94 | } |
| 95 | |
| 96 | public Any Clone() { |
| 97 | return new Any(this); |
| 98 | } |
| 99 | |
Jon Skeet | 18e0a2e | 2015-10-01 10:38:01 +0100 | [diff] [blame] | 100 | /// <summary>Field number for the "type_url" field.</summary> |
Jon Skeet | 62a4aa5 | 2015-07-14 14:26:49 +0100 | [diff] [blame] | 101 | public const int TypeUrlFieldNumber = 1; |
| 102 | private string typeUrl_ = ""; |
Jon Skeet | 18e0a2e | 2015-10-01 10:38:01 +0100 | [diff] [blame] | 103 | /// <summary> |
| 104 | /// A URL/resource name whose content describes the type of the |
| 105 | /// serialized message. |
Jon Skeet | cff900e | 2015-11-06 18:38:31 +0000 | [diff] [blame] | 106 | /// |
Jon Skeet | 18e0a2e | 2015-10-01 10:38:01 +0100 | [diff] [blame] | 107 | /// For URLs which use the schema `http`, `https`, or no schema, the |
| 108 | /// following restrictions and interpretations apply: |
Jon Skeet | cff900e | 2015-11-06 18:38:31 +0000 | [diff] [blame] | 109 | /// |
Jon Skeet | 18e0a2e | 2015-10-01 10:38:01 +0100 | [diff] [blame] | 110 | /// * If no schema is provided, `https` is assumed. |
| 111 | /// * The last segment of the URL's path must represent the fully |
| 112 | /// qualified name of the type (as in `path/google.protobuf.Duration`). |
Jon Skeet | 9e4f354 | 2016-01-04 14:03:01 +0000 | [diff] [blame] | 113 | /// * An HTTP GET on the URL must yield a [google.protobuf.Type][] |
Jon Skeet | 18e0a2e | 2015-10-01 10:38:01 +0100 | [diff] [blame] | 114 | /// value in binary format, or produce an error. |
| 115 | /// * Applications are allowed to cache lookup results based on the |
| 116 | /// URL, or have them precompiled into a binary to avoid any |
| 117 | /// lookup. Therefore, binary compatibility needs to be preserved |
| 118 | /// on changes to types. (Use versioned type names to manage |
| 119 | /// breaking changes.) |
Jon Skeet | cff900e | 2015-11-06 18:38:31 +0000 | [diff] [blame] | 120 | /// |
Jon Skeet | 18e0a2e | 2015-10-01 10:38:01 +0100 | [diff] [blame] | 121 | /// Schemas other than `http`, `https` (or the empty schema) might be |
| 122 | /// used with implementation specific semantics. |
| 123 | /// </summary> |
Jon Skeet | 62a4aa5 | 2015-07-14 14:26:49 +0100 | [diff] [blame] | 124 | public string TypeUrl { |
| 125 | get { return typeUrl_; } |
| 126 | set { |
Jon Skeet | 045b528 | 2016-02-04 15:02:59 +0000 | [diff] [blame] | 127 | typeUrl_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); |
Jon Skeet | 62a4aa5 | 2015-07-14 14:26:49 +0100 | [diff] [blame] | 128 | } |
| 129 | } |
| 130 | |
Jon Skeet | 18e0a2e | 2015-10-01 10:38:01 +0100 | [diff] [blame] | 131 | /// <summary>Field number for the "value" field.</summary> |
Jon Skeet | 62a4aa5 | 2015-07-14 14:26:49 +0100 | [diff] [blame] | 132 | public const int ValueFieldNumber = 2; |
| 133 | private pb::ByteString value_ = pb::ByteString.Empty; |
Jon Skeet | 18e0a2e | 2015-10-01 10:38:01 +0100 | [diff] [blame] | 134 | /// <summary> |
| 135 | /// Must be valid serialized data of the above specified type. |
| 136 | /// </summary> |
Jon Skeet | 62a4aa5 | 2015-07-14 14:26:49 +0100 | [diff] [blame] | 137 | public pb::ByteString Value { |
| 138 | get { return value_; } |
| 139 | set { |
Jon Skeet | 045b528 | 2016-02-04 15:02:59 +0000 | [diff] [blame] | 140 | value_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); |
Jon Skeet | 62a4aa5 | 2015-07-14 14:26:49 +0100 | [diff] [blame] | 141 | } |
| 142 | } |
| 143 | |
| 144 | public override bool Equals(object other) { |
| 145 | return Equals(other as Any); |
| 146 | } |
| 147 | |
| 148 | public bool Equals(Any other) { |
| 149 | if (ReferenceEquals(other, null)) { |
| 150 | return false; |
| 151 | } |
| 152 | if (ReferenceEquals(other, this)) { |
| 153 | return true; |
| 154 | } |
| 155 | if (TypeUrl != other.TypeUrl) return false; |
| 156 | if (Value != other.Value) return false; |
| 157 | return true; |
| 158 | } |
| 159 | |
| 160 | public override int GetHashCode() { |
| 161 | int hash = 1; |
| 162 | if (TypeUrl.Length != 0) hash ^= TypeUrl.GetHashCode(); |
| 163 | if (Value.Length != 0) hash ^= Value.GetHashCode(); |
| 164 | return hash; |
| 165 | } |
| 166 | |
| 167 | public override string ToString() { |
Jon Skeet | adee6fe | 2015-12-15 09:24:04 +0000 | [diff] [blame] | 168 | return pb::JsonFormatter.ToDiagnosticString(this); |
Jon Skeet | 62a4aa5 | 2015-07-14 14:26:49 +0100 | [diff] [blame] | 169 | } |
| 170 | |
| 171 | public void WriteTo(pb::CodedOutputStream output) { |
| 172 | if (TypeUrl.Length != 0) { |
| 173 | output.WriteRawTag(10); |
| 174 | output.WriteString(TypeUrl); |
| 175 | } |
| 176 | if (Value.Length != 0) { |
| 177 | output.WriteRawTag(18); |
| 178 | output.WriteBytes(Value); |
| 179 | } |
| 180 | } |
| 181 | |
| 182 | public int CalculateSize() { |
| 183 | int size = 0; |
| 184 | if (TypeUrl.Length != 0) { |
| 185 | size += 1 + pb::CodedOutputStream.ComputeStringSize(TypeUrl); |
| 186 | } |
| 187 | if (Value.Length != 0) { |
| 188 | size += 1 + pb::CodedOutputStream.ComputeBytesSize(Value); |
| 189 | } |
| 190 | return size; |
| 191 | } |
| 192 | |
| 193 | public void MergeFrom(Any other) { |
| 194 | if (other == null) { |
| 195 | return; |
| 196 | } |
| 197 | if (other.TypeUrl.Length != 0) { |
| 198 | TypeUrl = other.TypeUrl; |
| 199 | } |
| 200 | if (other.Value.Length != 0) { |
| 201 | Value = other.Value; |
| 202 | } |
| 203 | } |
| 204 | |
| 205 | public void MergeFrom(pb::CodedInputStream input) { |
| 206 | uint tag; |
Jon Skeet | 1a57ad8 | 2015-08-05 11:23:52 +0100 | [diff] [blame] | 207 | while ((tag = input.ReadTag()) != 0) { |
Jon Skeet | 62a4aa5 | 2015-07-14 14:26:49 +0100 | [diff] [blame] | 208 | switch(tag) { |
Jon Skeet | 62a4aa5 | 2015-07-14 14:26:49 +0100 | [diff] [blame] | 209 | default: |
Jon Skeet | 5bdc572 | 2015-08-06 11:40:43 +0100 | [diff] [blame] | 210 | input.SkipLastField(); |
Jon Skeet | 62a4aa5 | 2015-07-14 14:26:49 +0100 | [diff] [blame] | 211 | break; |
| 212 | case 10: { |
| 213 | TypeUrl = input.ReadString(); |
| 214 | break; |
| 215 | } |
| 216 | case 18: { |
| 217 | Value = input.ReadBytes(); |
| 218 | break; |
| 219 | } |
| 220 | } |
| 221 | } |
| 222 | } |
| 223 | |
| 224 | } |
| 225 | |
| 226 | #endregion |
| 227 | |
| 228 | } |
| 229 | |
| 230 | #endregion Designer generated code |