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