blob: 204b37cf094ee4c553565ec59d7b3a7b6ed68df1 [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
12 namespace Proto {
13
14 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
15 public static partial class Any {
16
Jon Skeet62a4aa52015-07-14 14:26:49 +010017 #region Descriptor
18 public static pbr::FileDescriptor Descriptor {
19 get { return descriptor; }
20 }
21 private static pbr::FileDescriptor descriptor;
22
23 static Any() {
24 byte[] descriptorData = global::System.Convert.FromBase64String(
25 string.Concat(
26 "Chlnb29nbGUvcHJvdG9idWYvYW55LnByb3RvEg9nb29nbGUucHJvdG9idWYi",
27 "JgoDQW55EhAKCHR5cGVfdXJsGAEgASgJEg0KBXZhbHVlGAIgASgMQksKE2Nv",
28 "bS5nb29nbGUucHJvdG9idWZCCEFueVByb3RvUAGgAQGiAgNHUEKqAh5Hb29n",
Jon Skeet47bf49b2015-07-22 11:39:38 +010029 "bGUuUHJvdG9idWYuV2VsbEtub3duVHlwZXNiBnByb3RvMw=="));
Jon Skeet62a4aa52015-07-14 14:26:49 +010030 descriptor = pbr::FileDescriptor.InternalBuildGeneratedFileFrom(descriptorData,
Jon Skeet96cffaa2015-07-20 19:25:07 +010031 new pbr::FileDescriptor[] { },
Jon Skeet47bf49b2015-07-22 11:39:38 +010032 new pbr::GeneratedCodeInfo(null, new pbr::GeneratedCodeInfo[] {
33 new pbr::GeneratedCodeInfo(typeof(global::Google.Protobuf.WellKnownTypes.Any), new[]{ "TypeUrl", "Value" }, null, null, null)
34 }));
Jon Skeet62a4aa52015-07-14 14:26:49 +010035 }
36 #endregion
37
38 }
39 }
40 #region Messages
41 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
42 public sealed partial class Any : pb::IMessage<Any> {
43 private static readonly pb::MessageParser<Any> _parser = new pb::MessageParser<Any>(() => new Any());
44 public static pb::MessageParser<Any> Parser { get { return _parser; } }
45
Jon Skeet62a4aa52015-07-14 14:26:49 +010046 public static pbr::MessageDescriptor Descriptor {
47 get { return global::Google.Protobuf.WellKnownTypes.Proto.Any.Descriptor.MessageTypes[0]; }
48 }
49
Jon Skeet96cffaa2015-07-20 19:25:07 +010050 pbr::MessageDescriptor pb::IMessage.Descriptor {
51 get { return Descriptor; }
Jon Skeet62a4aa52015-07-14 14:26:49 +010052 }
53
Jon Skeet62a4aa52015-07-14 14:26:49 +010054 public Any() {
55 OnConstruction();
56 }
57
58 partial void OnConstruction();
59
60 public Any(Any other) : this() {
61 typeUrl_ = other.typeUrl_;
62 value_ = other.value_;
63 }
64
65 public Any Clone() {
66 return new Any(this);
67 }
68
Jon Skeet62a4aa52015-07-14 14:26:49 +010069 public const int TypeUrlFieldNumber = 1;
70 private string typeUrl_ = "";
71 public string TypeUrl {
72 get { return typeUrl_; }
73 set {
Jon Skeetd18cc082015-07-30 13:50:02 +010074 typeUrl_ = pb::Preconditions.CheckNotNull(value, "value");
Jon Skeet62a4aa52015-07-14 14:26:49 +010075 }
76 }
77
78 public const int ValueFieldNumber = 2;
79 private pb::ByteString value_ = pb::ByteString.Empty;
Jon Skeet62a4aa52015-07-14 14:26:49 +010080 public pb::ByteString Value {
81 get { return value_; }
82 set {
Jon Skeetd18cc082015-07-30 13:50:02 +010083 value_ = pb::Preconditions.CheckNotNull(value, "value");
Jon Skeet62a4aa52015-07-14 14:26:49 +010084 }
85 }
86
87 public override bool Equals(object other) {
88 return Equals(other as Any);
89 }
90
91 public bool Equals(Any other) {
92 if (ReferenceEquals(other, null)) {
93 return false;
94 }
95 if (ReferenceEquals(other, this)) {
96 return true;
97 }
98 if (TypeUrl != other.TypeUrl) return false;
99 if (Value != other.Value) return false;
100 return true;
101 }
102
103 public override int GetHashCode() {
104 int hash = 1;
105 if (TypeUrl.Length != 0) hash ^= TypeUrl.GetHashCode();
106 if (Value.Length != 0) hash ^= Value.GetHashCode();
107 return hash;
108 }
109
110 public override string ToString() {
111 return pb::JsonFormatter.Default.Format(this);
112 }
113
114 public void WriteTo(pb::CodedOutputStream output) {
115 if (TypeUrl.Length != 0) {
116 output.WriteRawTag(10);
117 output.WriteString(TypeUrl);
118 }
119 if (Value.Length != 0) {
120 output.WriteRawTag(18);
121 output.WriteBytes(Value);
122 }
123 }
124
125 public int CalculateSize() {
126 int size = 0;
127 if (TypeUrl.Length != 0) {
128 size += 1 + pb::CodedOutputStream.ComputeStringSize(TypeUrl);
129 }
130 if (Value.Length != 0) {
131 size += 1 + pb::CodedOutputStream.ComputeBytesSize(Value);
132 }
133 return size;
134 }
135
136 public void MergeFrom(Any other) {
137 if (other == null) {
138 return;
139 }
140 if (other.TypeUrl.Length != 0) {
141 TypeUrl = other.TypeUrl;
142 }
143 if (other.Value.Length != 0) {
144 Value = other.Value;
145 }
146 }
147
148 public void MergeFrom(pb::CodedInputStream input) {
149 uint tag;
Jon Skeet1a57ad82015-08-05 11:23:52 +0100150 while ((tag = input.ReadTag()) != 0) {
Jon Skeet62a4aa52015-07-14 14:26:49 +0100151 switch(tag) {
Jon Skeet62a4aa52015-07-14 14:26:49 +0100152 default:
Jon Skeet5bdc5722015-08-06 11:40:43 +0100153 input.SkipLastField();
Jon Skeet62a4aa52015-07-14 14:26:49 +0100154 break;
155 case 10: {
156 TypeUrl = input.ReadString();
157 break;
158 }
159 case 18: {
160 Value = input.ReadBytes();
161 break;
162 }
163 }
164 }
165 }
166
167 }
168
169 #endregion
170
171}
172
173#endregion Designer generated code