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