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