blob: 48cd99a136f80639979c6aa0b5a84e13b2cdcea1 [file] [log] [blame]
Jon Skeet62a4aa52015-07-14 14:26:49 +01001// 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
6using pb = global::Google.Protobuf;
7using pbc = global::Google.Protobuf.Collections;
8using pbr = global::Google.Protobuf.Reflection;
9using scg = global::System.Collections.Generic;
10namespace Google.Protobuf.WellKnownTypes {
11
Jon Skeet284bb452015-11-05 09:13:53 +000012 /// <summary>Holder for reflection information generated from google/protobuf/any.proto</summary>
13 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
14 public static partial class AnyReflection {
Jon Skeet62a4aa52015-07-14 14:26:49 +010015
Jon Skeet284bb452015-11-05 09:13:53 +000016 #region Descriptor
17 /// <summary>File descriptor for google/protobuf/any.proto</summary>
18 public static pbr::FileDescriptor Descriptor {
19 get { return descriptor; }
Jon Skeet62a4aa52015-07-14 14:26:49 +010020 }
Jon Skeet284bb452015-11-05 09:13:53 +000021 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 Skeeta2667aa2015-11-19 17:14:23 +000030 descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData,
Jon Skeet284bb452015-11-05 09:13:53 +000031 new pbr::FileDescriptor[] { },
Jon Skeetb6159962016-02-04 07:08:55 +000032 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 Skeet284bb452015-11-05 09:13:53 +000034 }));
35 }
36 #endregion
37
Jon Skeet62a4aa52015-07-14 14:26:49 +010038 }
39 #region Messages
Jon Skeet18e0a2e2015-10-01 10:38:01 +010040 /// <summary>
41 /// `Any` contains an arbitrary serialized message along with a URL
42 /// that describes the type of the serialized message.
Jon Skeetcff900e2015-11-06 18:38:31 +000043 ///
Jon Skeet18e0a2e2015-10-01 10:38:01 +010044 /// 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 Skeetcff900e2015-11-06 18:38:31 +000049 ///
Jon Skeet18e0a2e2015-10-01 10:38:01 +010050 /// package google.profile;
51 /// message Person {
52 /// string first_name = 1;
53 /// string last_name = 2;
54 /// }
Jon Skeetcff900e2015-11-06 18:38:31 +000055 ///
Jon Skeet18e0a2e2015-10-01 10:38:01 +010056 /// {
57 /// "@type": "type.googleapis.com/google.profile.Person",
58 /// "firstName": &lt;string>,
59 /// "lastName": &lt;string>
60 /// }
Jon Skeetcff900e2015-11-06 18:38:31 +000061 ///
Jon Skeet18e0a2e2015-10-01 10:38:01 +010062 /// If the embedded message type is well-known and has a custom JSON
63 /// representation, that representation will be embedded adding a field
Jon Skeet9e4f3542016-01-04 14:03:01 +000064 /// `value` which holds the custom JSON in addition to the `@type`
65 /// field. Example (for message [google.protobuf.Duration][]):
Jon Skeetcff900e2015-11-06 18:38:31 +000066 ///
Jon Skeet18e0a2e2015-10-01 10:38:01 +010067 /// {
68 /// "@type": "type.googleapis.com/google.protobuf.Duration",
69 /// "value": "1.212s"
70 /// }
71 /// </summary>
Jon Skeet62a4aa52015-07-14 14:26:49 +010072 [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 Skeet62a4aa52015-07-14 14:26:49 +010077 public static pbr::MessageDescriptor Descriptor {
Jon Skeet284bb452015-11-05 09:13:53 +000078 get { return global::Google.Protobuf.WellKnownTypes.AnyReflection.Descriptor.MessageTypes[0]; }
Jon Skeet62a4aa52015-07-14 14:26:49 +010079 }
80
Jon Skeet96cffaa2015-07-20 19:25:07 +010081 pbr::MessageDescriptor pb::IMessage.Descriptor {
82 get { return Descriptor; }
Jon Skeet62a4aa52015-07-14 14:26:49 +010083 }
84
Jon Skeet62a4aa52015-07-14 14:26:49 +010085 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 Skeet18e0a2e2015-10-01 10:38:01 +0100100 /// <summary>Field number for the "type_url" field.</summary>
Jon Skeet62a4aa52015-07-14 14:26:49 +0100101 public const int TypeUrlFieldNumber = 1;
102 private string typeUrl_ = "";
Jon Skeet18e0a2e2015-10-01 10:38:01 +0100103 /// <summary>
104 /// A URL/resource name whose content describes the type of the
105 /// serialized message.
Jon Skeetcff900e2015-11-06 18:38:31 +0000106 ///
Jon Skeet18e0a2e2015-10-01 10:38:01 +0100107 /// For URLs which use the schema `http`, `https`, or no schema, the
108 /// following restrictions and interpretations apply:
Jon Skeetcff900e2015-11-06 18:38:31 +0000109 ///
Jon Skeet18e0a2e2015-10-01 10:38:01 +0100110 /// * 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 Skeet9e4f3542016-01-04 14:03:01 +0000113 /// * An HTTP GET on the URL must yield a [google.protobuf.Type][]
Jon Skeet18e0a2e2015-10-01 10:38:01 +0100114 /// 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 Skeetcff900e2015-11-06 18:38:31 +0000120 ///
Jon Skeet18e0a2e2015-10-01 10:38:01 +0100121 /// Schemas other than `http`, `https` (or the empty schema) might be
122 /// used with implementation specific semantics.
123 /// </summary>
Jon Skeet62a4aa52015-07-14 14:26:49 +0100124 public string TypeUrl {
125 get { return typeUrl_; }
126 set {
Jon Skeet045b5282016-02-04 15:02:59 +0000127 typeUrl_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
Jon Skeet62a4aa52015-07-14 14:26:49 +0100128 }
129 }
130
Jon Skeet18e0a2e2015-10-01 10:38:01 +0100131 /// <summary>Field number for the "value" field.</summary>
Jon Skeet62a4aa52015-07-14 14:26:49 +0100132 public const int ValueFieldNumber = 2;
133 private pb::ByteString value_ = pb::ByteString.Empty;
Jon Skeet18e0a2e2015-10-01 10:38:01 +0100134 /// <summary>
135 /// Must be valid serialized data of the above specified type.
136 /// </summary>
Jon Skeet62a4aa52015-07-14 14:26:49 +0100137 public pb::ByteString Value {
138 get { return value_; }
139 set {
Jon Skeet045b5282016-02-04 15:02:59 +0000140 value_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
Jon Skeet62a4aa52015-07-14 14:26:49 +0100141 }
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 Skeetadee6fe2015-12-15 09:24:04 +0000168 return pb::JsonFormatter.ToDiagnosticString(this);
Jon Skeet62a4aa52015-07-14 14:26:49 +0100169 }
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 Skeet1a57ad82015-08-05 11:23:52 +0100207 while ((tag = input.ReadTag()) != 0) {
Jon Skeet62a4aa52015-07-14 14:26:49 +0100208 switch(tag) {
Jon Skeet62a4aa52015-07-14 14:26:49 +0100209 default:
Jon Skeet5bdc5722015-08-06 11:40:43 +0100210 input.SkipLastField();
Jon Skeet62a4aa52015-07-14 14:26:49 +0100211 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