blob: 21a8ce02d15e7a6ee7c6f8f8c9ce3c60ae3f0240 [file] [log] [blame]
Austin Schuh40c16522018-10-28 20:27:54 -07001// <auto-generated>
2// Generated by the protocol buffer compiler. DO NOT EDIT!
3// source: addressbook.proto
4// </auto-generated>
Brian Silverman9c614bc2016-02-15 20:20:02 -05005#pragma warning disable 1591, 0612, 3021
6#region Designer generated code
7
8using pb = global::Google.Protobuf;
9using pbc = global::Google.Protobuf.Collections;
10using pbr = global::Google.Protobuf.Reflection;
11using scg = global::System.Collections.Generic;
12namespace Google.Protobuf.Examples.AddressBook {
13
14 /// <summary>Holder for reflection information generated from addressbook.proto</summary>
Brian Silverman9c614bc2016-02-15 20:20:02 -050015 public static partial class AddressbookReflection {
16
17 #region Descriptor
18 /// <summary>File descriptor for addressbook.proto</summary>
19 public static pbr::FileDescriptor Descriptor {
20 get { return descriptor; }
21 }
22 private static pbr::FileDescriptor descriptor;
23
24 static AddressbookReflection() {
25 byte[] descriptorData = global::System.Convert.FromBase64String(
26 string.Concat(
Austin Schuh40c16522018-10-28 20:27:54 -070027 "ChFhZGRyZXNzYm9vay5wcm90bxIIdHV0b3JpYWwaH2dvb2dsZS9wcm90b2J1",
28 "Zi90aW1lc3RhbXAucHJvdG8ihwIKBlBlcnNvbhIMCgRuYW1lGAEgASgJEgoK",
29 "AmlkGAIgASgFEg0KBWVtYWlsGAMgASgJEiwKBnBob25lcxgEIAMoCzIcLnR1",
30 "dG9yaWFsLlBlcnNvbi5QaG9uZU51bWJlchIwCgxsYXN0X3VwZGF0ZWQYBSAB",
31 "KAsyGi5nb29nbGUucHJvdG9idWYuVGltZXN0YW1wGkcKC1Bob25lTnVtYmVy",
32 "Eg4KBm51bWJlchgBIAEoCRIoCgR0eXBlGAIgASgOMhoudHV0b3JpYWwuUGVy",
33 "c29uLlBob25lVHlwZSIrCglQaG9uZVR5cGUSCgoGTU9CSUxFEAASCAoESE9N",
34 "RRABEggKBFdPUksQAiIvCgtBZGRyZXNzQm9vaxIgCgZwZW9wbGUYASADKAsy",
35 "EC50dXRvcmlhbC5QZXJzb25CUAoUY29tLmV4YW1wbGUudHV0b3JpYWxCEUFk",
36 "ZHJlc3NCb29rUHJvdG9zqgIkR29vZ2xlLlByb3RvYnVmLkV4YW1wbGVzLkFk",
37 "ZHJlc3NCb29rYgZwcm90bzM="));
Brian Silverman9c614bc2016-02-15 20:20:02 -050038 descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData,
Austin Schuh40c16522018-10-28 20:27:54 -070039 new pbr::FileDescriptor[] { global::Google.Protobuf.WellKnownTypes.TimestampReflection.Descriptor, },
Brian Silverman9c614bc2016-02-15 20:20:02 -050040 new pbr::GeneratedClrTypeInfo(null, new pbr::GeneratedClrTypeInfo[] {
Austin Schuh40c16522018-10-28 20:27:54 -070041 new pbr::GeneratedClrTypeInfo(typeof(global::Google.Protobuf.Examples.AddressBook.Person), global::Google.Protobuf.Examples.AddressBook.Person.Parser, new[]{ "Name", "Id", "Email", "Phones", "LastUpdated" }, null, new[]{ typeof(global::Google.Protobuf.Examples.AddressBook.Person.Types.PhoneType) }, new pbr::GeneratedClrTypeInfo[] { new pbr::GeneratedClrTypeInfo(typeof(global::Google.Protobuf.Examples.AddressBook.Person.Types.PhoneNumber), global::Google.Protobuf.Examples.AddressBook.Person.Types.PhoneNumber.Parser, new[]{ "Number", "Type" }, null, null, null)}),
Brian Silverman9c614bc2016-02-15 20:20:02 -050042 new pbr::GeneratedClrTypeInfo(typeof(global::Google.Protobuf.Examples.AddressBook.AddressBook), global::Google.Protobuf.Examples.AddressBook.AddressBook.Parser, new[]{ "People" }, null, null, null)
43 }));
44 }
45 #endregion
46
47 }
48 #region Messages
49 /// <summary>
Austin Schuh40c16522018-10-28 20:27:54 -070050 /// [START messages]
Brian Silverman9c614bc2016-02-15 20:20:02 -050051 /// </summary>
Brian Silverman9c614bc2016-02-15 20:20:02 -050052 public sealed partial class Person : pb::IMessage<Person> {
53 private static readonly pb::MessageParser<Person> _parser = new pb::MessageParser<Person>(() => new Person());
Austin Schuh40c16522018-10-28 20:27:54 -070054 private pb::UnknownFieldSet _unknownFields;
55 [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
Brian Silverman9c614bc2016-02-15 20:20:02 -050056 public static pb::MessageParser<Person> Parser { get { return _parser; } }
57
Austin Schuh40c16522018-10-28 20:27:54 -070058 [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
Brian Silverman9c614bc2016-02-15 20:20:02 -050059 public static pbr::MessageDescriptor Descriptor {
60 get { return global::Google.Protobuf.Examples.AddressBook.AddressbookReflection.Descriptor.MessageTypes[0]; }
61 }
62
Austin Schuh40c16522018-10-28 20:27:54 -070063 [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
Brian Silverman9c614bc2016-02-15 20:20:02 -050064 pbr::MessageDescriptor pb::IMessage.Descriptor {
65 get { return Descriptor; }
66 }
67
Austin Schuh40c16522018-10-28 20:27:54 -070068 [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
Brian Silverman9c614bc2016-02-15 20:20:02 -050069 public Person() {
70 OnConstruction();
71 }
72
73 partial void OnConstruction();
74
Austin Schuh40c16522018-10-28 20:27:54 -070075 [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
Brian Silverman9c614bc2016-02-15 20:20:02 -050076 public Person(Person other) : this() {
77 name_ = other.name_;
78 id_ = other.id_;
79 email_ = other.email_;
80 phones_ = other.phones_.Clone();
Austin Schuh40c16522018-10-28 20:27:54 -070081 lastUpdated_ = other.lastUpdated_ != null ? other.lastUpdated_.Clone() : null;
82 _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
Brian Silverman9c614bc2016-02-15 20:20:02 -050083 }
84
Austin Schuh40c16522018-10-28 20:27:54 -070085 [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
Brian Silverman9c614bc2016-02-15 20:20:02 -050086 public Person Clone() {
87 return new Person(this);
88 }
89
90 /// <summary>Field number for the "name" field.</summary>
91 public const int NameFieldNumber = 1;
92 private string name_ = "";
Austin Schuh40c16522018-10-28 20:27:54 -070093 [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
Brian Silverman9c614bc2016-02-15 20:20:02 -050094 public string Name {
95 get { return name_; }
96 set {
97 name_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
98 }
99 }
100
101 /// <summary>Field number for the "id" field.</summary>
102 public const int IdFieldNumber = 2;
103 private int id_;
104 /// <summary>
Austin Schuh40c16522018-10-28 20:27:54 -0700105 /// Unique ID number for this person.
Brian Silverman9c614bc2016-02-15 20:20:02 -0500106 /// </summary>
Austin Schuh40c16522018-10-28 20:27:54 -0700107 [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
Brian Silverman9c614bc2016-02-15 20:20:02 -0500108 public int Id {
109 get { return id_; }
110 set {
111 id_ = value;
112 }
113 }
114
115 /// <summary>Field number for the "email" field.</summary>
116 public const int EmailFieldNumber = 3;
117 private string email_ = "";
Austin Schuh40c16522018-10-28 20:27:54 -0700118 [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
Brian Silverman9c614bc2016-02-15 20:20:02 -0500119 public string Email {
120 get { return email_; }
121 set {
122 email_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
123 }
124 }
125
126 /// <summary>Field number for the "phones" field.</summary>
127 public const int PhonesFieldNumber = 4;
128 private static readonly pb::FieldCodec<global::Google.Protobuf.Examples.AddressBook.Person.Types.PhoneNumber> _repeated_phones_codec
129 = pb::FieldCodec.ForMessage(34, global::Google.Protobuf.Examples.AddressBook.Person.Types.PhoneNumber.Parser);
130 private readonly pbc::RepeatedField<global::Google.Protobuf.Examples.AddressBook.Person.Types.PhoneNumber> phones_ = new pbc::RepeatedField<global::Google.Protobuf.Examples.AddressBook.Person.Types.PhoneNumber>();
Austin Schuh40c16522018-10-28 20:27:54 -0700131 [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
Brian Silverman9c614bc2016-02-15 20:20:02 -0500132 public pbc::RepeatedField<global::Google.Protobuf.Examples.AddressBook.Person.Types.PhoneNumber> Phones {
133 get { return phones_; }
134 }
135
Austin Schuh40c16522018-10-28 20:27:54 -0700136 /// <summary>Field number for the "last_updated" field.</summary>
137 public const int LastUpdatedFieldNumber = 5;
138 private global::Google.Protobuf.WellKnownTypes.Timestamp lastUpdated_;
139 [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
140 public global::Google.Protobuf.WellKnownTypes.Timestamp LastUpdated {
141 get { return lastUpdated_; }
142 set {
143 lastUpdated_ = value;
144 }
145 }
146
147 [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
Brian Silverman9c614bc2016-02-15 20:20:02 -0500148 public override bool Equals(object other) {
149 return Equals(other as Person);
150 }
151
Austin Schuh40c16522018-10-28 20:27:54 -0700152 [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
Brian Silverman9c614bc2016-02-15 20:20:02 -0500153 public bool Equals(Person other) {
154 if (ReferenceEquals(other, null)) {
155 return false;
156 }
157 if (ReferenceEquals(other, this)) {
158 return true;
159 }
160 if (Name != other.Name) return false;
161 if (Id != other.Id) return false;
162 if (Email != other.Email) return false;
163 if(!phones_.Equals(other.phones_)) return false;
Austin Schuh40c16522018-10-28 20:27:54 -0700164 if (!object.Equals(LastUpdated, other.LastUpdated)) return false;
165 return Equals(_unknownFields, other._unknownFields);
Brian Silverman9c614bc2016-02-15 20:20:02 -0500166 }
167
Austin Schuh40c16522018-10-28 20:27:54 -0700168 [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
Brian Silverman9c614bc2016-02-15 20:20:02 -0500169 public override int GetHashCode() {
170 int hash = 1;
171 if (Name.Length != 0) hash ^= Name.GetHashCode();
172 if (Id != 0) hash ^= Id.GetHashCode();
173 if (Email.Length != 0) hash ^= Email.GetHashCode();
174 hash ^= phones_.GetHashCode();
Austin Schuh40c16522018-10-28 20:27:54 -0700175 if (lastUpdated_ != null) hash ^= LastUpdated.GetHashCode();
176 if (_unknownFields != null) {
177 hash ^= _unknownFields.GetHashCode();
178 }
Brian Silverman9c614bc2016-02-15 20:20:02 -0500179 return hash;
180 }
181
Austin Schuh40c16522018-10-28 20:27:54 -0700182 [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
Brian Silverman9c614bc2016-02-15 20:20:02 -0500183 public override string ToString() {
184 return pb::JsonFormatter.ToDiagnosticString(this);
185 }
186
Austin Schuh40c16522018-10-28 20:27:54 -0700187 [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
Brian Silverman9c614bc2016-02-15 20:20:02 -0500188 public void WriteTo(pb::CodedOutputStream output) {
189 if (Name.Length != 0) {
190 output.WriteRawTag(10);
191 output.WriteString(Name);
192 }
193 if (Id != 0) {
194 output.WriteRawTag(16);
195 output.WriteInt32(Id);
196 }
197 if (Email.Length != 0) {
198 output.WriteRawTag(26);
199 output.WriteString(Email);
200 }
201 phones_.WriteTo(output, _repeated_phones_codec);
Austin Schuh40c16522018-10-28 20:27:54 -0700202 if (lastUpdated_ != null) {
203 output.WriteRawTag(42);
204 output.WriteMessage(LastUpdated);
205 }
206 if (_unknownFields != null) {
207 _unknownFields.WriteTo(output);
208 }
Brian Silverman9c614bc2016-02-15 20:20:02 -0500209 }
210
Austin Schuh40c16522018-10-28 20:27:54 -0700211 [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
Brian Silverman9c614bc2016-02-15 20:20:02 -0500212 public int CalculateSize() {
213 int size = 0;
214 if (Name.Length != 0) {
215 size += 1 + pb::CodedOutputStream.ComputeStringSize(Name);
216 }
217 if (Id != 0) {
218 size += 1 + pb::CodedOutputStream.ComputeInt32Size(Id);
219 }
220 if (Email.Length != 0) {
221 size += 1 + pb::CodedOutputStream.ComputeStringSize(Email);
222 }
223 size += phones_.CalculateSize(_repeated_phones_codec);
Austin Schuh40c16522018-10-28 20:27:54 -0700224 if (lastUpdated_ != null) {
225 size += 1 + pb::CodedOutputStream.ComputeMessageSize(LastUpdated);
226 }
227 if (_unknownFields != null) {
228 size += _unknownFields.CalculateSize();
229 }
Brian Silverman9c614bc2016-02-15 20:20:02 -0500230 return size;
231 }
232
Austin Schuh40c16522018-10-28 20:27:54 -0700233 [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
Brian Silverman9c614bc2016-02-15 20:20:02 -0500234 public void MergeFrom(Person other) {
235 if (other == null) {
236 return;
237 }
238 if (other.Name.Length != 0) {
239 Name = other.Name;
240 }
241 if (other.Id != 0) {
242 Id = other.Id;
243 }
244 if (other.Email.Length != 0) {
245 Email = other.Email;
246 }
247 phones_.Add(other.phones_);
Austin Schuh40c16522018-10-28 20:27:54 -0700248 if (other.lastUpdated_ != null) {
249 if (lastUpdated_ == null) {
250 lastUpdated_ = new global::Google.Protobuf.WellKnownTypes.Timestamp();
251 }
252 LastUpdated.MergeFrom(other.LastUpdated);
253 }
254 _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
Brian Silverman9c614bc2016-02-15 20:20:02 -0500255 }
256
Austin Schuh40c16522018-10-28 20:27:54 -0700257 [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
Brian Silverman9c614bc2016-02-15 20:20:02 -0500258 public void MergeFrom(pb::CodedInputStream input) {
259 uint tag;
260 while ((tag = input.ReadTag()) != 0) {
261 switch(tag) {
262 default:
Austin Schuh40c16522018-10-28 20:27:54 -0700263 _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
Brian Silverman9c614bc2016-02-15 20:20:02 -0500264 break;
265 case 10: {
266 Name = input.ReadString();
267 break;
268 }
269 case 16: {
270 Id = input.ReadInt32();
271 break;
272 }
273 case 26: {
274 Email = input.ReadString();
275 break;
276 }
277 case 34: {
278 phones_.AddEntriesFrom(input, _repeated_phones_codec);
279 break;
280 }
Austin Schuh40c16522018-10-28 20:27:54 -0700281 case 42: {
282 if (lastUpdated_ == null) {
283 lastUpdated_ = new global::Google.Protobuf.WellKnownTypes.Timestamp();
284 }
285 input.ReadMessage(lastUpdated_);
286 break;
287 }
Brian Silverman9c614bc2016-02-15 20:20:02 -0500288 }
289 }
290 }
291
292 #region Nested types
293 /// <summary>Container for nested types declared in the Person message type.</summary>
Austin Schuh40c16522018-10-28 20:27:54 -0700294 [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
Brian Silverman9c614bc2016-02-15 20:20:02 -0500295 public static partial class Types {
296 public enum PhoneType {
Austin Schuh40c16522018-10-28 20:27:54 -0700297 [pbr::OriginalName("MOBILE")] Mobile = 0,
298 [pbr::OriginalName("HOME")] Home = 1,
299 [pbr::OriginalName("WORK")] Work = 2,
Brian Silverman9c614bc2016-02-15 20:20:02 -0500300 }
301
Brian Silverman9c614bc2016-02-15 20:20:02 -0500302 public sealed partial class PhoneNumber : pb::IMessage<PhoneNumber> {
303 private static readonly pb::MessageParser<PhoneNumber> _parser = new pb::MessageParser<PhoneNumber>(() => new PhoneNumber());
Austin Schuh40c16522018-10-28 20:27:54 -0700304 private pb::UnknownFieldSet _unknownFields;
305 [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
Brian Silverman9c614bc2016-02-15 20:20:02 -0500306 public static pb::MessageParser<PhoneNumber> Parser { get { return _parser; } }
307
Austin Schuh40c16522018-10-28 20:27:54 -0700308 [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
Brian Silverman9c614bc2016-02-15 20:20:02 -0500309 public static pbr::MessageDescriptor Descriptor {
310 get { return global::Google.Protobuf.Examples.AddressBook.Person.Descriptor.NestedTypes[0]; }
311 }
312
Austin Schuh40c16522018-10-28 20:27:54 -0700313 [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
Brian Silverman9c614bc2016-02-15 20:20:02 -0500314 pbr::MessageDescriptor pb::IMessage.Descriptor {
315 get { return Descriptor; }
316 }
317
Austin Schuh40c16522018-10-28 20:27:54 -0700318 [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
Brian Silverman9c614bc2016-02-15 20:20:02 -0500319 public PhoneNumber() {
320 OnConstruction();
321 }
322
323 partial void OnConstruction();
324
Austin Schuh40c16522018-10-28 20:27:54 -0700325 [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
Brian Silverman9c614bc2016-02-15 20:20:02 -0500326 public PhoneNumber(PhoneNumber other) : this() {
327 number_ = other.number_;
328 type_ = other.type_;
Austin Schuh40c16522018-10-28 20:27:54 -0700329 _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
Brian Silverman9c614bc2016-02-15 20:20:02 -0500330 }
331
Austin Schuh40c16522018-10-28 20:27:54 -0700332 [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
Brian Silverman9c614bc2016-02-15 20:20:02 -0500333 public PhoneNumber Clone() {
334 return new PhoneNumber(this);
335 }
336
337 /// <summary>Field number for the "number" field.</summary>
338 public const int NumberFieldNumber = 1;
339 private string number_ = "";
Austin Schuh40c16522018-10-28 20:27:54 -0700340 [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
Brian Silverman9c614bc2016-02-15 20:20:02 -0500341 public string Number {
342 get { return number_; }
343 set {
344 number_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
345 }
346 }
347
348 /// <summary>Field number for the "type" field.</summary>
349 public const int TypeFieldNumber = 2;
Austin Schuh40c16522018-10-28 20:27:54 -0700350 private global::Google.Protobuf.Examples.AddressBook.Person.Types.PhoneType type_ = 0;
351 [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
Brian Silverman9c614bc2016-02-15 20:20:02 -0500352 public global::Google.Protobuf.Examples.AddressBook.Person.Types.PhoneType Type {
353 get { return type_; }
354 set {
355 type_ = value;
356 }
357 }
358
Austin Schuh40c16522018-10-28 20:27:54 -0700359 [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
Brian Silverman9c614bc2016-02-15 20:20:02 -0500360 public override bool Equals(object other) {
361 return Equals(other as PhoneNumber);
362 }
363
Austin Schuh40c16522018-10-28 20:27:54 -0700364 [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
Brian Silverman9c614bc2016-02-15 20:20:02 -0500365 public bool Equals(PhoneNumber other) {
366 if (ReferenceEquals(other, null)) {
367 return false;
368 }
369 if (ReferenceEquals(other, this)) {
370 return true;
371 }
372 if (Number != other.Number) return false;
373 if (Type != other.Type) return false;
Austin Schuh40c16522018-10-28 20:27:54 -0700374 return Equals(_unknownFields, other._unknownFields);
Brian Silverman9c614bc2016-02-15 20:20:02 -0500375 }
376
Austin Schuh40c16522018-10-28 20:27:54 -0700377 [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
Brian Silverman9c614bc2016-02-15 20:20:02 -0500378 public override int GetHashCode() {
379 int hash = 1;
380 if (Number.Length != 0) hash ^= Number.GetHashCode();
Austin Schuh40c16522018-10-28 20:27:54 -0700381 if (Type != 0) hash ^= Type.GetHashCode();
382 if (_unknownFields != null) {
383 hash ^= _unknownFields.GetHashCode();
384 }
Brian Silverman9c614bc2016-02-15 20:20:02 -0500385 return hash;
386 }
387
Austin Schuh40c16522018-10-28 20:27:54 -0700388 [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
Brian Silverman9c614bc2016-02-15 20:20:02 -0500389 public override string ToString() {
390 return pb::JsonFormatter.ToDiagnosticString(this);
391 }
392
Austin Schuh40c16522018-10-28 20:27:54 -0700393 [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
Brian Silverman9c614bc2016-02-15 20:20:02 -0500394 public void WriteTo(pb::CodedOutputStream output) {
395 if (Number.Length != 0) {
396 output.WriteRawTag(10);
397 output.WriteString(Number);
398 }
Austin Schuh40c16522018-10-28 20:27:54 -0700399 if (Type != 0) {
Brian Silverman9c614bc2016-02-15 20:20:02 -0500400 output.WriteRawTag(16);
401 output.WriteEnum((int) Type);
402 }
Austin Schuh40c16522018-10-28 20:27:54 -0700403 if (_unknownFields != null) {
404 _unknownFields.WriteTo(output);
405 }
Brian Silverman9c614bc2016-02-15 20:20:02 -0500406 }
407
Austin Schuh40c16522018-10-28 20:27:54 -0700408 [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
Brian Silverman9c614bc2016-02-15 20:20:02 -0500409 public int CalculateSize() {
410 int size = 0;
411 if (Number.Length != 0) {
412 size += 1 + pb::CodedOutputStream.ComputeStringSize(Number);
413 }
Austin Schuh40c16522018-10-28 20:27:54 -0700414 if (Type != 0) {
Brian Silverman9c614bc2016-02-15 20:20:02 -0500415 size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) Type);
416 }
Austin Schuh40c16522018-10-28 20:27:54 -0700417 if (_unknownFields != null) {
418 size += _unknownFields.CalculateSize();
419 }
Brian Silverman9c614bc2016-02-15 20:20:02 -0500420 return size;
421 }
422
Austin Schuh40c16522018-10-28 20:27:54 -0700423 [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
Brian Silverman9c614bc2016-02-15 20:20:02 -0500424 public void MergeFrom(PhoneNumber other) {
425 if (other == null) {
426 return;
427 }
428 if (other.Number.Length != 0) {
429 Number = other.Number;
430 }
Austin Schuh40c16522018-10-28 20:27:54 -0700431 if (other.Type != 0) {
Brian Silverman9c614bc2016-02-15 20:20:02 -0500432 Type = other.Type;
433 }
Austin Schuh40c16522018-10-28 20:27:54 -0700434 _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
Brian Silverman9c614bc2016-02-15 20:20:02 -0500435 }
436
Austin Schuh40c16522018-10-28 20:27:54 -0700437 [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
Brian Silverman9c614bc2016-02-15 20:20:02 -0500438 public void MergeFrom(pb::CodedInputStream input) {
439 uint tag;
440 while ((tag = input.ReadTag()) != 0) {
441 switch(tag) {
442 default:
Austin Schuh40c16522018-10-28 20:27:54 -0700443 _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
Brian Silverman9c614bc2016-02-15 20:20:02 -0500444 break;
445 case 10: {
446 Number = input.ReadString();
447 break;
448 }
449 case 16: {
450 type_ = (global::Google.Protobuf.Examples.AddressBook.Person.Types.PhoneType) input.ReadEnum();
451 break;
452 }
453 }
454 }
455 }
456
457 }
458
459 }
460 #endregion
461
462 }
463
464 /// <summary>
Austin Schuh40c16522018-10-28 20:27:54 -0700465 /// Our address book file is just one of these.
Brian Silverman9c614bc2016-02-15 20:20:02 -0500466 /// </summary>
Brian Silverman9c614bc2016-02-15 20:20:02 -0500467 public sealed partial class AddressBook : pb::IMessage<AddressBook> {
468 private static readonly pb::MessageParser<AddressBook> _parser = new pb::MessageParser<AddressBook>(() => new AddressBook());
Austin Schuh40c16522018-10-28 20:27:54 -0700469 private pb::UnknownFieldSet _unknownFields;
470 [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
Brian Silverman9c614bc2016-02-15 20:20:02 -0500471 public static pb::MessageParser<AddressBook> Parser { get { return _parser; } }
472
Austin Schuh40c16522018-10-28 20:27:54 -0700473 [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
Brian Silverman9c614bc2016-02-15 20:20:02 -0500474 public static pbr::MessageDescriptor Descriptor {
475 get { return global::Google.Protobuf.Examples.AddressBook.AddressbookReflection.Descriptor.MessageTypes[1]; }
476 }
477
Austin Schuh40c16522018-10-28 20:27:54 -0700478 [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
Brian Silverman9c614bc2016-02-15 20:20:02 -0500479 pbr::MessageDescriptor pb::IMessage.Descriptor {
480 get { return Descriptor; }
481 }
482
Austin Schuh40c16522018-10-28 20:27:54 -0700483 [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
Brian Silverman9c614bc2016-02-15 20:20:02 -0500484 public AddressBook() {
485 OnConstruction();
486 }
487
488 partial void OnConstruction();
489
Austin Schuh40c16522018-10-28 20:27:54 -0700490 [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
Brian Silverman9c614bc2016-02-15 20:20:02 -0500491 public AddressBook(AddressBook other) : this() {
492 people_ = other.people_.Clone();
Austin Schuh40c16522018-10-28 20:27:54 -0700493 _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
Brian Silverman9c614bc2016-02-15 20:20:02 -0500494 }
495
Austin Schuh40c16522018-10-28 20:27:54 -0700496 [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
Brian Silverman9c614bc2016-02-15 20:20:02 -0500497 public AddressBook Clone() {
498 return new AddressBook(this);
499 }
500
501 /// <summary>Field number for the "people" field.</summary>
502 public const int PeopleFieldNumber = 1;
503 private static readonly pb::FieldCodec<global::Google.Protobuf.Examples.AddressBook.Person> _repeated_people_codec
504 = pb::FieldCodec.ForMessage(10, global::Google.Protobuf.Examples.AddressBook.Person.Parser);
505 private readonly pbc::RepeatedField<global::Google.Protobuf.Examples.AddressBook.Person> people_ = new pbc::RepeatedField<global::Google.Protobuf.Examples.AddressBook.Person>();
Austin Schuh40c16522018-10-28 20:27:54 -0700506 [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
Brian Silverman9c614bc2016-02-15 20:20:02 -0500507 public pbc::RepeatedField<global::Google.Protobuf.Examples.AddressBook.Person> People {
508 get { return people_; }
509 }
510
Austin Schuh40c16522018-10-28 20:27:54 -0700511 [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
Brian Silverman9c614bc2016-02-15 20:20:02 -0500512 public override bool Equals(object other) {
513 return Equals(other as AddressBook);
514 }
515
Austin Schuh40c16522018-10-28 20:27:54 -0700516 [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
Brian Silverman9c614bc2016-02-15 20:20:02 -0500517 public bool Equals(AddressBook other) {
518 if (ReferenceEquals(other, null)) {
519 return false;
520 }
521 if (ReferenceEquals(other, this)) {
522 return true;
523 }
524 if(!people_.Equals(other.people_)) return false;
Austin Schuh40c16522018-10-28 20:27:54 -0700525 return Equals(_unknownFields, other._unknownFields);
Brian Silverman9c614bc2016-02-15 20:20:02 -0500526 }
527
Austin Schuh40c16522018-10-28 20:27:54 -0700528 [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
Brian Silverman9c614bc2016-02-15 20:20:02 -0500529 public override int GetHashCode() {
530 int hash = 1;
531 hash ^= people_.GetHashCode();
Austin Schuh40c16522018-10-28 20:27:54 -0700532 if (_unknownFields != null) {
533 hash ^= _unknownFields.GetHashCode();
534 }
Brian Silverman9c614bc2016-02-15 20:20:02 -0500535 return hash;
536 }
537
Austin Schuh40c16522018-10-28 20:27:54 -0700538 [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
Brian Silverman9c614bc2016-02-15 20:20:02 -0500539 public override string ToString() {
540 return pb::JsonFormatter.ToDiagnosticString(this);
541 }
542
Austin Schuh40c16522018-10-28 20:27:54 -0700543 [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
Brian Silverman9c614bc2016-02-15 20:20:02 -0500544 public void WriteTo(pb::CodedOutputStream output) {
545 people_.WriteTo(output, _repeated_people_codec);
Austin Schuh40c16522018-10-28 20:27:54 -0700546 if (_unknownFields != null) {
547 _unknownFields.WriteTo(output);
548 }
Brian Silverman9c614bc2016-02-15 20:20:02 -0500549 }
550
Austin Schuh40c16522018-10-28 20:27:54 -0700551 [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
Brian Silverman9c614bc2016-02-15 20:20:02 -0500552 public int CalculateSize() {
553 int size = 0;
554 size += people_.CalculateSize(_repeated_people_codec);
Austin Schuh40c16522018-10-28 20:27:54 -0700555 if (_unknownFields != null) {
556 size += _unknownFields.CalculateSize();
557 }
Brian Silverman9c614bc2016-02-15 20:20:02 -0500558 return size;
559 }
560
Austin Schuh40c16522018-10-28 20:27:54 -0700561 [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
Brian Silverman9c614bc2016-02-15 20:20:02 -0500562 public void MergeFrom(AddressBook other) {
563 if (other == null) {
564 return;
565 }
566 people_.Add(other.people_);
Austin Schuh40c16522018-10-28 20:27:54 -0700567 _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
Brian Silverman9c614bc2016-02-15 20:20:02 -0500568 }
569
Austin Schuh40c16522018-10-28 20:27:54 -0700570 [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
Brian Silverman9c614bc2016-02-15 20:20:02 -0500571 public void MergeFrom(pb::CodedInputStream input) {
572 uint tag;
573 while ((tag = input.ReadTag()) != 0) {
574 switch(tag) {
575 default:
Austin Schuh40c16522018-10-28 20:27:54 -0700576 _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
Brian Silverman9c614bc2016-02-15 20:20:02 -0500577 break;
578 case 10: {
579 people_.AddEntriesFrom(input, _repeated_people_codec);
580 break;
581 }
582 }
583 }
584 }
585
586 }
587
588 #endregion
589
590}
591
592#endregion Designer generated code