• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // <auto-generated>
2 //     Generated by the protocol buffer compiler.  DO NOT EDIT!
3 //     source: google/protobuf/any.proto
4 // </auto-generated>
5 #pragma warning disable 1591, 0612, 3021, 8981
6 #region Designer generated code
7 
8 using pb = global::Google.Protobuf;
9 using pbc = global::Google.Protobuf.Collections;
10 using pbr = global::Google.Protobuf.Reflection;
11 using scg = global::System.Collections.Generic;
12 namespace Google.Protobuf.WellKnownTypes {
13 
14   /// <summary>Holder for reflection information generated from google/protobuf/any.proto</summary>
15   public static partial class AnyReflection {
16 
17     #region Descriptor
18     /// <summary>File descriptor for google/protobuf/any.proto</summary>
19     public static pbr::FileDescriptor Descriptor {
20       get { return descriptor; }
21     }
22     private static pbr::FileDescriptor descriptor;
23 
AnyReflection()24     static AnyReflection() {
25       byte[] descriptorData = global::System.Convert.FromBase64String(
26           string.Concat(
27             "Chlnb29nbGUvcHJvdG9idWYvYW55LnByb3RvEg9nb29nbGUucHJvdG9idWYi",
28             "JgoDQW55EhAKCHR5cGVfdXJsGAEgASgJEg0KBXZhbHVlGAIgASgMQnYKE2Nv",
29             "bS5nb29nbGUucHJvdG9idWZCCEFueVByb3RvUAFaLGdvb2dsZS5nb2xhbmcu",
30             "b3JnL3Byb3RvYnVmL3R5cGVzL2tub3duL2FueXBiogIDR1BCqgIeR29vZ2xl",
31             "LlByb3RvYnVmLldlbGxLbm93blR5cGVzYgZwcm90bzM="));
32       descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData,
33           new pbr::FileDescriptor[] { },
34           new pbr::GeneratedClrTypeInfo(null, null, new pbr::GeneratedClrTypeInfo[] {
35             new pbr::GeneratedClrTypeInfo(typeof(global::Google.Protobuf.WellKnownTypes.Any), global::Google.Protobuf.WellKnownTypes.Any.Parser, new[]{ "TypeUrl", "Value" }, null, null, null, null)
36           }));
37     }
38     #endregion
39 
40   }
41   #region Messages
42   /// <summary>
43   /// `Any` contains an arbitrary serialized protocol buffer message along with a
44   /// URL that describes the type of the serialized message.
45   ///
46   /// Protobuf library provides support to pack/unpack Any values in the form
47   /// of utility functions or additional generated methods of the Any type.
48   ///
49   /// Example 1: Pack and unpack a message in C++.
50   ///
51   ///     Foo foo = ...;
52   ///     Any any;
53   ///     any.PackFrom(foo);
54   ///     ...
55   ///     if (any.UnpackTo(&amp;foo)) {
56   ///       ...
57   ///     }
58   ///
59   /// Example 2: Pack and unpack a message in Java.
60   ///
61   ///     Foo foo = ...;
62   ///     Any any = Any.pack(foo);
63   ///     ...
64   ///     if (any.is(Foo.class)) {
65   ///       foo = any.unpack(Foo.class);
66   ///     }
67   ///     // or ...
68   ///     if (any.isSameTypeAs(Foo.getDefaultInstance())) {
69   ///       foo = any.unpack(Foo.getDefaultInstance());
70   ///     }
71   ///
72   ///  Example 3: Pack and unpack a message in Python.
73   ///
74   ///     foo = Foo(...)
75   ///     any = Any()
76   ///     any.Pack(foo)
77   ///     ...
78   ///     if any.Is(Foo.DESCRIPTOR):
79   ///       any.Unpack(foo)
80   ///       ...
81   ///
82   ///  Example 4: Pack and unpack a message in Go
83   ///
84   ///      foo := &amp;pb.Foo{...}
85   ///      any, err := anypb.New(foo)
86   ///      if err != nil {
87   ///        ...
88   ///      }
89   ///      ...
90   ///      foo := &amp;pb.Foo{}
91   ///      if err := any.UnmarshalTo(foo); err != nil {
92   ///        ...
93   ///      }
94   ///
95   /// The pack methods provided by protobuf library will by default use
96   /// 'type.googleapis.com/full.type.name' as the type URL and the unpack
97   /// methods only use the fully qualified type name after the last '/'
98   /// in the type URL, for example "foo.bar.com/x/y.z" will yield type
99   /// name "y.z".
100   ///
101   /// JSON
102   /// ====
103   /// The JSON representation of an `Any` value uses the regular
104   /// representation of the deserialized, embedded message, with an
105   /// additional field `@type` which contains the type URL. Example:
106   ///
107   ///     package google.profile;
108   ///     message Person {
109   ///       string first_name = 1;
110   ///       string last_name = 2;
111   ///     }
112   ///
113   ///     {
114   ///       "@type": "type.googleapis.com/google.profile.Person",
115   ///       "firstName": &lt;string>,
116   ///       "lastName": &lt;string>
117   ///     }
118   ///
119   /// If the embedded message type is well-known and has a custom JSON
120   /// representation, that representation will be embedded adding a field
121   /// `value` which holds the custom JSON in addition to the `@type`
122   /// field. Example (for message [google.protobuf.Duration][]):
123   ///
124   ///     {
125   ///       "@type": "type.googleapis.com/google.protobuf.Duration",
126   ///       "value": "1.212s"
127   ///     }
128   /// </summary>
129   [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")]
130   public sealed partial class Any : pb::IMessage<Any>
131   #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
132       , pb::IBufferMessage
133   #endif
134   {
135     private static readonly pb::MessageParser<Any> _parser = new pb::MessageParser<Any>(() => new Any());
136     private pb::UnknownFieldSet _unknownFields;
137     [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
138     [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
139     public static pb::MessageParser<Any> Parser { get { return _parser; } }
140 
141     [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
142     [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
143     public static pbr::MessageDescriptor Descriptor {
144       get { return global::Google.Protobuf.WellKnownTypes.AnyReflection.Descriptor.MessageTypes[0]; }
145     }
146 
147     [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
148     [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
149     pbr::MessageDescriptor pb::IMessage.Descriptor {
150       get { return Descriptor; }
151     }
152 
153     [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
154     [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
Any()155     public Any() {
156       OnConstruction();
157     }
158 
OnConstruction()159     partial void OnConstruction();
160 
161     [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
162     [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
Any(Any other)163     public Any(Any other) : this() {
164       typeUrl_ = other.typeUrl_;
165       value_ = other.value_;
166       _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
167     }
168 
169     [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
170     [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
Clone()171     public Any Clone() {
172       return new Any(this);
173     }
174 
175     /// <summary>Field number for the "type_url" field.</summary>
176     public const int TypeUrlFieldNumber = 1;
177     private string typeUrl_ = "";
178     /// <summary>
179     /// A URL/resource name that uniquely identifies the type of the serialized
180     /// protocol buffer message. This string must contain at least
181     /// one "/" character. The last segment of the URL's path must represent
182     /// the fully qualified name of the type (as in
183     /// `path/google.protobuf.Duration`). The name should be in a canonical form
184     /// (e.g., leading "." is not accepted).
185     ///
186     /// In practice, teams usually precompile into the binary all types that they
187     /// expect it to use in the context of Any. However, for URLs which use the
188     /// scheme `http`, `https`, or no scheme, one can optionally set up a type
189     /// server that maps type URLs to message definitions as follows:
190     ///
191     /// * If no scheme is provided, `https` is assumed.
192     /// * An HTTP GET on the URL must yield a [google.protobuf.Type][]
193     ///   value in binary format, or produce an error.
194     /// * Applications are allowed to cache lookup results based on the
195     ///   URL, or have them precompiled into a binary to avoid any
196     ///   lookup. Therefore, binary compatibility needs to be preserved
197     ///   on changes to types. (Use versioned type names to manage
198     ///   breaking changes.)
199     ///
200     /// Note: this functionality is not currently available in the official
201     /// protobuf release, and it is not used for type URLs beginning with
202     /// type.googleapis.com. As of May 2023, there are no widely used type server
203     /// implementations and no plans to implement one.
204     ///
205     /// Schemes other than `http`, `https` (or the empty scheme) might be
206     /// used with implementation specific semantics.
207     /// </summary>
208     [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
209     [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
210     public string TypeUrl {
211       get { return typeUrl_; }
212       set {
213         typeUrl_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
214       }
215     }
216 
217     /// <summary>Field number for the "value" field.</summary>
218     public const int ValueFieldNumber = 2;
219     private pb::ByteString value_ = pb::ByteString.Empty;
220     /// <summary>
221     /// Must be a valid serialized protocol buffer of the above specified type.
222     /// </summary>
223     [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
224     [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
225     public pb::ByteString Value {
226       get { return value_; }
227       set {
228         value_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
229       }
230     }
231 
232     [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
233     [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
Equals(object other)234     public override bool Equals(object other) {
235       return Equals(other as Any);
236     }
237 
238     [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
239     [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
Equals(Any other)240     public bool Equals(Any other) {
241       if (ReferenceEquals(other, null)) {
242         return false;
243       }
244       if (ReferenceEquals(other, this)) {
245         return true;
246       }
247       if (TypeUrl != other.TypeUrl) return false;
248       if (Value != other.Value) return false;
249       return Equals(_unknownFields, other._unknownFields);
250     }
251 
252     [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
253     [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
GetHashCode()254     public override int GetHashCode() {
255       int hash = 1;
256       if (TypeUrl.Length != 0) hash ^= TypeUrl.GetHashCode();
257       if (Value.Length != 0) hash ^= Value.GetHashCode();
258       if (_unknownFields != null) {
259         hash ^= _unknownFields.GetHashCode();
260       }
261       return hash;
262     }
263 
264     [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
265     [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
ToString()266     public override string ToString() {
267       return pb::JsonFormatter.ToDiagnosticString(this);
268     }
269 
270     [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
271     [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
WriteTo(pb::CodedOutputStream output)272     public void WriteTo(pb::CodedOutputStream output) {
273     #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
274       output.WriteRawMessage(this);
275     #else
276       if (TypeUrl.Length != 0) {
277         output.WriteRawTag(10);
278         output.WriteString(TypeUrl);
279       }
280       if (Value.Length != 0) {
281         output.WriteRawTag(18);
282         output.WriteBytes(Value);
283       }
284       if (_unknownFields != null) {
285         _unknownFields.WriteTo(output);
286       }
287     #endif
288     }
289 
290     #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
291     [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
292     [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
IBufferMessage.InternalWriteTo(ref pb::WriteContext output)293     void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) {
294       if (TypeUrl.Length != 0) {
295         output.WriteRawTag(10);
296         output.WriteString(TypeUrl);
297       }
298       if (Value.Length != 0) {
299         output.WriteRawTag(18);
300         output.WriteBytes(Value);
301       }
302       if (_unknownFields != null) {
303         _unknownFields.WriteTo(ref output);
304       }
305     }
306     #endif
307 
308     [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
309     [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
CalculateSize()310     public int CalculateSize() {
311       int size = 0;
312       if (TypeUrl.Length != 0) {
313         size += 1 + pb::CodedOutputStream.ComputeStringSize(TypeUrl);
314       }
315       if (Value.Length != 0) {
316         size += 1 + pb::CodedOutputStream.ComputeBytesSize(Value);
317       }
318       if (_unknownFields != null) {
319         size += _unknownFields.CalculateSize();
320       }
321       return size;
322     }
323 
324     [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
325     [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
MergeFrom(Any other)326     public void MergeFrom(Any other) {
327       if (other == null) {
328         return;
329       }
330       if (other.TypeUrl.Length != 0) {
331         TypeUrl = other.TypeUrl;
332       }
333       if (other.Value.Length != 0) {
334         Value = other.Value;
335       }
336       _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
337     }
338 
339     [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
340     [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
MergeFrom(pb::CodedInputStream input)341     public void MergeFrom(pb::CodedInputStream input) {
342     #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
343       input.ReadRawMessage(this);
344     #else
345       uint tag;
346       while ((tag = input.ReadTag()) != 0) {
347       if ((tag & 7) == 4) {
348         // Abort on any end group tag.
349         return;
350       }
351       switch(tag) {
352           default:
353             _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
354             break;
355           case 10: {
356             TypeUrl = input.ReadString();
357             break;
358           }
359           case 18: {
360             Value = input.ReadBytes();
361             break;
362           }
363         }
364       }
365     #endif
366     }
367 
368     #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
369     [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
370     [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
IBufferMessage.InternalMergeFrom(ref pb::ParseContext input)371     void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) {
372       uint tag;
373       while ((tag = input.ReadTag()) != 0) {
374       if ((tag & 7) == 4) {
375         // Abort on any end group tag.
376         return;
377       }
378       switch(tag) {
379           default:
380             _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input);
381             break;
382           case 10: {
383             TypeUrl = input.ReadString();
384             break;
385           }
386           case 18: {
387             Value = input.ReadBytes();
388             break;
389           }
390         }
391       }
392     }
393     #endif
394 
395   }
396 
397   #endregion
398 
399 }
400 
401 #endregion Designer generated code
402