• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // <auto-generated>
2 //     Generated by the protocol buffer compiler.  DO NOT EDIT!
3 //     source: addressbook.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.Examples.AddressBook {
13 
14   /// <summary>Holder for reflection information generated from addressbook.proto</summary>
15   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 
AddressbookReflection()24     static AddressbookReflection() {
25       byte[] descriptorData = global::System.Convert.FromBase64String(
26           string.Concat(
27             "ChFhZGRyZXNzYm9vay5wcm90bxIIdHV0b3JpYWwaH2dvb2dsZS9wcm90b2J1",
28             "Zi90aW1lc3RhbXAucHJvdG8ihwIKBlBlcnNvbhIMCgRuYW1lGAEgASgJEgoK",
29             "AmlkGAIgASgFEg0KBWVtYWlsGAMgASgJEiwKBnBob25lcxgEIAMoCzIcLnR1",
30             "dG9yaWFsLlBlcnNvbi5QaG9uZU51bWJlchIwCgxsYXN0X3VwZGF0ZWQYBSAB",
31             "KAsyGi5nb29nbGUucHJvdG9idWYuVGltZXN0YW1wGkcKC1Bob25lTnVtYmVy",
32             "Eg4KBm51bWJlchgBIAEoCRIoCgR0eXBlGAIgASgOMhoudHV0b3JpYWwuUGVy",
33             "c29uLlBob25lVHlwZSIrCglQaG9uZVR5cGUSCgoGTU9CSUxFEAASCAoESE9N",
34             "RRABEggKBFdPUksQAiIvCgtBZGRyZXNzQm9vaxIgCgZwZW9wbGUYASADKAsy",
35             "EC50dXRvcmlhbC5QZXJzb25ClQEKG2NvbS5leGFtcGxlLnR1dG9yaWFsLnBy",
36             "b3Rvc0IRQWRkcmVzc0Jvb2tQcm90b3NQAVo6Z2l0aHViLmNvbS9wcm90b2Nv",
37             "bGJ1ZmZlcnMvcHJvdG9idWYvZXhhbXBsZXMvZ28vdHV0b3JpYWxwYqoCJEdv",
38             "b2dsZS5Qcm90b2J1Zi5FeGFtcGxlcy5BZGRyZXNzQm9va2IGcHJvdG8z"));
39       descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData,
40           new pbr::FileDescriptor[] { global::Google.Protobuf.WellKnownTypes.TimestampReflection.Descriptor, },
41           new pbr::GeneratedClrTypeInfo(null, null, new pbr::GeneratedClrTypeInfo[] {
42             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) }, null, 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, null)}),
43             new pbr::GeneratedClrTypeInfo(typeof(global::Google.Protobuf.Examples.AddressBook.AddressBook), global::Google.Protobuf.Examples.AddressBook.AddressBook.Parser, new[]{ "People" }, null, null, null, null)
44           }));
45     }
46     #endregion
47 
48   }
49   #region Messages
50   /// <summary>
51   /// [START messages]
52   /// </summary>
53   [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")]
54   public sealed partial class Person : pb::IMessage<Person>
55   #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
56       , pb::IBufferMessage
57   #endif
58   {
59     private static readonly pb::MessageParser<Person> _parser = new pb::MessageParser<Person>(() => new Person());
60     private pb::UnknownFieldSet _unknownFields;
61     [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
62     [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
63     public static pb::MessageParser<Person> Parser { get { return _parser; } }
64 
65     [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
66     [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
67     public static pbr::MessageDescriptor Descriptor {
68       get { return global::Google.Protobuf.Examples.AddressBook.AddressbookReflection.Descriptor.MessageTypes[0]; }
69     }
70 
71     [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
72     [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
73     pbr::MessageDescriptor pb::IMessage.Descriptor {
74       get { return Descriptor; }
75     }
76 
77     [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
78     [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
Person()79     public Person() {
80       OnConstruction();
81     }
82 
OnConstruction()83     partial void OnConstruction();
84 
85     [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
86     [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
Person(Person other)87     public Person(Person other) : this() {
88       name_ = other.name_;
89       id_ = other.id_;
90       email_ = other.email_;
91       phones_ = other.phones_.Clone();
92       lastUpdated_ = other.lastUpdated_ != null ? other.lastUpdated_.Clone() : null;
93       _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
94     }
95 
96     [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
97     [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
Clone()98     public Person Clone() {
99       return new Person(this);
100     }
101 
102     /// <summary>Field number for the "name" field.</summary>
103     public const int NameFieldNumber = 1;
104     private string name_ = "";
105     [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
106     [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
107     public string Name {
108       get { return name_; }
109       set {
110         name_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
111       }
112     }
113 
114     /// <summary>Field number for the "id" field.</summary>
115     public const int IdFieldNumber = 2;
116     private int id_;
117     /// <summary>
118     /// Unique ID number for this person.
119     /// </summary>
120     [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
121     [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
122     public int Id {
123       get { return id_; }
124       set {
125         id_ = value;
126       }
127     }
128 
129     /// <summary>Field number for the "email" field.</summary>
130     public const int EmailFieldNumber = 3;
131     private string email_ = "";
132     [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
133     [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
134     public string Email {
135       get { return email_; }
136       set {
137         email_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
138       }
139     }
140 
141     /// <summary>Field number for the "phones" field.</summary>
142     public const int PhonesFieldNumber = 4;
143     private static readonly pb::FieldCodec<global::Google.Protobuf.Examples.AddressBook.Person.Types.PhoneNumber> _repeated_phones_codec
144         = pb::FieldCodec.ForMessage(34, global::Google.Protobuf.Examples.AddressBook.Person.Types.PhoneNumber.Parser);
145     private readonly pbc::RepeatedField<global::Google.Protobuf.Examples.AddressBook.Person.Types.PhoneNumber> phones_ = new pbc::RepeatedField<global::Google.Protobuf.Examples.AddressBook.Person.Types.PhoneNumber>();
146     [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
147     [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
148     public pbc::RepeatedField<global::Google.Protobuf.Examples.AddressBook.Person.Types.PhoneNumber> Phones {
149       get { return phones_; }
150     }
151 
152     /// <summary>Field number for the "last_updated" field.</summary>
153     public const int LastUpdatedFieldNumber = 5;
154     private global::Google.Protobuf.WellKnownTypes.Timestamp lastUpdated_;
155     [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
156     [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
157     public global::Google.Protobuf.WellKnownTypes.Timestamp LastUpdated {
158       get { return lastUpdated_; }
159       set {
160         lastUpdated_ = value;
161       }
162     }
163 
164     [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
165     [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
Equals(object other)166     public override bool Equals(object other) {
167       return Equals(other as Person);
168     }
169 
170     [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
171     [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
Equals(Person other)172     public bool Equals(Person other) {
173       if (ReferenceEquals(other, null)) {
174         return false;
175       }
176       if (ReferenceEquals(other, this)) {
177         return true;
178       }
179       if (Name != other.Name) return false;
180       if (Id != other.Id) return false;
181       if (Email != other.Email) return false;
182       if(!phones_.Equals(other.phones_)) return false;
183       if (!object.Equals(LastUpdated, other.LastUpdated)) return false;
184       return Equals(_unknownFields, other._unknownFields);
185     }
186 
187     [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
188     [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
GetHashCode()189     public override int GetHashCode() {
190       int hash = 1;
191       if (Name.Length != 0) hash ^= Name.GetHashCode();
192       if (Id != 0) hash ^= Id.GetHashCode();
193       if (Email.Length != 0) hash ^= Email.GetHashCode();
194       hash ^= phones_.GetHashCode();
195       if (lastUpdated_ != null) hash ^= LastUpdated.GetHashCode();
196       if (_unknownFields != null) {
197         hash ^= _unknownFields.GetHashCode();
198       }
199       return hash;
200     }
201 
202     [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
203     [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
ToString()204     public override string ToString() {
205       return pb::JsonFormatter.ToDiagnosticString(this);
206     }
207 
208     [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
209     [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
WriteTo(pb::CodedOutputStream output)210     public void WriteTo(pb::CodedOutputStream output) {
211     #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
212       output.WriteRawMessage(this);
213     #else
214       if (Name.Length != 0) {
215         output.WriteRawTag(10);
216         output.WriteString(Name);
217       }
218       if (Id != 0) {
219         output.WriteRawTag(16);
220         output.WriteInt32(Id);
221       }
222       if (Email.Length != 0) {
223         output.WriteRawTag(26);
224         output.WriteString(Email);
225       }
226       phones_.WriteTo(output, _repeated_phones_codec);
227       if (lastUpdated_ != null) {
228         output.WriteRawTag(42);
229         output.WriteMessage(LastUpdated);
230       }
231       if (_unknownFields != null) {
232         _unknownFields.WriteTo(output);
233       }
234     #endif
235     }
236 
237     #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
238     [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
239     [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
IBufferMessage.InternalWriteTo(ref pb::WriteContext output)240     void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) {
241       if (Name.Length != 0) {
242         output.WriteRawTag(10);
243         output.WriteString(Name);
244       }
245       if (Id != 0) {
246         output.WriteRawTag(16);
247         output.WriteInt32(Id);
248       }
249       if (Email.Length != 0) {
250         output.WriteRawTag(26);
251         output.WriteString(Email);
252       }
253       phones_.WriteTo(ref output, _repeated_phones_codec);
254       if (lastUpdated_ != null) {
255         output.WriteRawTag(42);
256         output.WriteMessage(LastUpdated);
257       }
258       if (_unknownFields != null) {
259         _unknownFields.WriteTo(ref output);
260       }
261     }
262     #endif
263 
264     [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
265     [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
CalculateSize()266     public int CalculateSize() {
267       int size = 0;
268       if (Name.Length != 0) {
269         size += 1 + pb::CodedOutputStream.ComputeStringSize(Name);
270       }
271       if (Id != 0) {
272         size += 1 + pb::CodedOutputStream.ComputeInt32Size(Id);
273       }
274       if (Email.Length != 0) {
275         size += 1 + pb::CodedOutputStream.ComputeStringSize(Email);
276       }
277       size += phones_.CalculateSize(_repeated_phones_codec);
278       if (lastUpdated_ != null) {
279         size += 1 + pb::CodedOutputStream.ComputeMessageSize(LastUpdated);
280       }
281       if (_unknownFields != null) {
282         size += _unknownFields.CalculateSize();
283       }
284       return size;
285     }
286 
287     [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
288     [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
MergeFrom(Person other)289     public void MergeFrom(Person other) {
290       if (other == null) {
291         return;
292       }
293       if (other.Name.Length != 0) {
294         Name = other.Name;
295       }
296       if (other.Id != 0) {
297         Id = other.Id;
298       }
299       if (other.Email.Length != 0) {
300         Email = other.Email;
301       }
302       phones_.Add(other.phones_);
303       if (other.lastUpdated_ != null) {
304         if (lastUpdated_ == null) {
305           LastUpdated = new global::Google.Protobuf.WellKnownTypes.Timestamp();
306         }
307         LastUpdated.MergeFrom(other.LastUpdated);
308       }
309       _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
310     }
311 
312     [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
313     [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
MergeFrom(pb::CodedInputStream input)314     public void MergeFrom(pb::CodedInputStream input) {
315     #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
316       input.ReadRawMessage(this);
317     #else
318       uint tag;
319       while ((tag = input.ReadTag()) != 0) {
320       if ((tag & 7) == 4) {
321         // Abort on any end group tag.
322         return;
323       }
324       switch(tag) {
325           default:
326             _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
327             break;
328           case 10: {
329             Name = input.ReadString();
330             break;
331           }
332           case 16: {
333             Id = input.ReadInt32();
334             break;
335           }
336           case 26: {
337             Email = input.ReadString();
338             break;
339           }
340           case 34: {
341             phones_.AddEntriesFrom(input, _repeated_phones_codec);
342             break;
343           }
344           case 42: {
345             if (lastUpdated_ == null) {
346               LastUpdated = new global::Google.Protobuf.WellKnownTypes.Timestamp();
347             }
348             input.ReadMessage(LastUpdated);
349             break;
350           }
351         }
352       }
353     #endif
354     }
355 
356     #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
357     [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
358     [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
IBufferMessage.InternalMergeFrom(ref pb::ParseContext input)359     void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) {
360       uint tag;
361       while ((tag = input.ReadTag()) != 0) {
362       if ((tag & 7) == 4) {
363         // Abort on any end group tag.
364         return;
365       }
366       switch(tag) {
367           default:
368             _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input);
369             break;
370           case 10: {
371             Name = input.ReadString();
372             break;
373           }
374           case 16: {
375             Id = input.ReadInt32();
376             break;
377           }
378           case 26: {
379             Email = input.ReadString();
380             break;
381           }
382           case 34: {
383             phones_.AddEntriesFrom(ref input, _repeated_phones_codec);
384             break;
385           }
386           case 42: {
387             if (lastUpdated_ == null) {
388               LastUpdated = new global::Google.Protobuf.WellKnownTypes.Timestamp();
389             }
390             input.ReadMessage(LastUpdated);
391             break;
392           }
393         }
394       }
395     }
396     #endif
397 
398     #region Nested types
399     /// <summary>Container for nested types declared in the Person message type.</summary>
400     [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
401     [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
402     public static partial class Types {
403       public enum PhoneType {
404         [pbr::OriginalName("MOBILE")] Mobile = 0,
405         [pbr::OriginalName("HOME")] Home = 1,
406         [pbr::OriginalName("WORK")] Work = 2,
407       }
408 
409       [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")]
410       public sealed partial class PhoneNumber : pb::IMessage<PhoneNumber>
411       #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
412           , pb::IBufferMessage
413       #endif
414       {
415         private static readonly pb::MessageParser<PhoneNumber> _parser = new pb::MessageParser<PhoneNumber>(() => new PhoneNumber());
416         private pb::UnknownFieldSet _unknownFields;
417         [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
418         [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
419         public static pb::MessageParser<PhoneNumber> Parser { get { return _parser; } }
420 
421         [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
422         [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
423         public static pbr::MessageDescriptor Descriptor {
424           get { return global::Google.Protobuf.Examples.AddressBook.Person.Descriptor.NestedTypes[0]; }
425         }
426 
427         [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
428         [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
429         pbr::MessageDescriptor pb::IMessage.Descriptor {
430           get { return Descriptor; }
431         }
432 
433         [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
434         [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
PhoneNumber()435         public PhoneNumber() {
436           OnConstruction();
437         }
438 
OnConstruction()439         partial void OnConstruction();
440 
441         [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
442         [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
PhoneNumber(PhoneNumber other)443         public PhoneNumber(PhoneNumber other) : this() {
444           number_ = other.number_;
445           type_ = other.type_;
446           _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
447         }
448 
449         [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
450         [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
Clone()451         public PhoneNumber Clone() {
452           return new PhoneNumber(this);
453         }
454 
455         /// <summary>Field number for the "number" field.</summary>
456         public const int NumberFieldNumber = 1;
457         private string number_ = "";
458         [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
459         [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
460         public string Number {
461           get { return number_; }
462           set {
463             number_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
464           }
465         }
466 
467         /// <summary>Field number for the "type" field.</summary>
468         public const int TypeFieldNumber = 2;
469         private global::Google.Protobuf.Examples.AddressBook.Person.Types.PhoneType type_ = global::Google.Protobuf.Examples.AddressBook.Person.Types.PhoneType.Mobile;
470         [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
471         [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
472         public global::Google.Protobuf.Examples.AddressBook.Person.Types.PhoneType Type {
473           get { return type_; }
474           set {
475             type_ = value;
476           }
477         }
478 
479         [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
480         [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
Equals(object other)481         public override bool Equals(object other) {
482           return Equals(other as PhoneNumber);
483         }
484 
485         [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
486         [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
Equals(PhoneNumber other)487         public bool Equals(PhoneNumber other) {
488           if (ReferenceEquals(other, null)) {
489             return false;
490           }
491           if (ReferenceEquals(other, this)) {
492             return true;
493           }
494           if (Number != other.Number) return false;
495           if (Type != other.Type) return false;
496           return Equals(_unknownFields, other._unknownFields);
497         }
498 
499         [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
500         [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
GetHashCode()501         public override int GetHashCode() {
502           int hash = 1;
503           if (Number.Length != 0) hash ^= Number.GetHashCode();
504           if (Type != global::Google.Protobuf.Examples.AddressBook.Person.Types.PhoneType.Mobile) hash ^= Type.GetHashCode();
505           if (_unknownFields != null) {
506             hash ^= _unknownFields.GetHashCode();
507           }
508           return hash;
509         }
510 
511         [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
512         [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
ToString()513         public override string ToString() {
514           return pb::JsonFormatter.ToDiagnosticString(this);
515         }
516 
517         [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
518         [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
WriteTo(pb::CodedOutputStream output)519         public void WriteTo(pb::CodedOutputStream output) {
520         #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
521           output.WriteRawMessage(this);
522         #else
523           if (Number.Length != 0) {
524             output.WriteRawTag(10);
525             output.WriteString(Number);
526           }
527           if (Type != global::Google.Protobuf.Examples.AddressBook.Person.Types.PhoneType.Mobile) {
528             output.WriteRawTag(16);
529             output.WriteEnum((int) Type);
530           }
531           if (_unknownFields != null) {
532             _unknownFields.WriteTo(output);
533           }
534         #endif
535         }
536 
537         #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
538         [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
539         [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
IBufferMessage.InternalWriteTo(ref pb::WriteContext output)540         void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) {
541           if (Number.Length != 0) {
542             output.WriteRawTag(10);
543             output.WriteString(Number);
544           }
545           if (Type != global::Google.Protobuf.Examples.AddressBook.Person.Types.PhoneType.Mobile) {
546             output.WriteRawTag(16);
547             output.WriteEnum((int) Type);
548           }
549           if (_unknownFields != null) {
550             _unknownFields.WriteTo(ref output);
551           }
552         }
553         #endif
554 
555         [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
556         [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
CalculateSize()557         public int CalculateSize() {
558           int size = 0;
559           if (Number.Length != 0) {
560             size += 1 + pb::CodedOutputStream.ComputeStringSize(Number);
561           }
562           if (Type != global::Google.Protobuf.Examples.AddressBook.Person.Types.PhoneType.Mobile) {
563             size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) Type);
564           }
565           if (_unknownFields != null) {
566             size += _unknownFields.CalculateSize();
567           }
568           return size;
569         }
570 
571         [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
572         [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
MergeFrom(PhoneNumber other)573         public void MergeFrom(PhoneNumber other) {
574           if (other == null) {
575             return;
576           }
577           if (other.Number.Length != 0) {
578             Number = other.Number;
579           }
580           if (other.Type != global::Google.Protobuf.Examples.AddressBook.Person.Types.PhoneType.Mobile) {
581             Type = other.Type;
582           }
583           _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
584         }
585 
586         [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
587         [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
MergeFrom(pb::CodedInputStream input)588         public void MergeFrom(pb::CodedInputStream input) {
589         #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
590           input.ReadRawMessage(this);
591         #else
592           uint tag;
593           while ((tag = input.ReadTag()) != 0) {
594           if ((tag & 7) == 4) {
595             // Abort on any end group tag.
596             return;
597           }
598           switch(tag) {
599               default:
600                 _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
601                 break;
602               case 10: {
603                 Number = input.ReadString();
604                 break;
605               }
606               case 16: {
607                 Type = (global::Google.Protobuf.Examples.AddressBook.Person.Types.PhoneType) input.ReadEnum();
608                 break;
609               }
610             }
611           }
612         #endif
613         }
614 
615         #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
616         [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
617         [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
IBufferMessage.InternalMergeFrom(ref pb::ParseContext input)618         void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) {
619           uint tag;
620           while ((tag = input.ReadTag()) != 0) {
621           if ((tag & 7) == 4) {
622             // Abort on any end group tag.
623             return;
624           }
625           switch(tag) {
626               default:
627                 _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input);
628                 break;
629               case 10: {
630                 Number = input.ReadString();
631                 break;
632               }
633               case 16: {
634                 Type = (global::Google.Protobuf.Examples.AddressBook.Person.Types.PhoneType) input.ReadEnum();
635                 break;
636               }
637             }
638           }
639         }
640         #endif
641 
642       }
643 
644     }
645     #endregion
646 
647   }
648 
649   /// <summary>
650   /// Our address book file is just one of these.
651   /// </summary>
652   [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")]
653   public sealed partial class AddressBook : pb::IMessage<AddressBook>
654   #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
655       , pb::IBufferMessage
656   #endif
657   {
658     private static readonly pb::MessageParser<AddressBook> _parser = new pb::MessageParser<AddressBook>(() => new AddressBook());
659     private pb::UnknownFieldSet _unknownFields;
660     [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
661     [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
662     public static pb::MessageParser<AddressBook> Parser { get { return _parser; } }
663 
664     [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
665     [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
666     public static pbr::MessageDescriptor Descriptor {
667       get { return global::Google.Protobuf.Examples.AddressBook.AddressbookReflection.Descriptor.MessageTypes[1]; }
668     }
669 
670     [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
671     [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
672     pbr::MessageDescriptor pb::IMessage.Descriptor {
673       get { return Descriptor; }
674     }
675 
676     [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
677     [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
AddressBook()678     public AddressBook() {
679       OnConstruction();
680     }
681 
OnConstruction()682     partial void OnConstruction();
683 
684     [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
685     [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
AddressBook(AddressBook other)686     public AddressBook(AddressBook other) : this() {
687       people_ = other.people_.Clone();
688       _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
689     }
690 
691     [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
692     [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
Clone()693     public AddressBook Clone() {
694       return new AddressBook(this);
695     }
696 
697     /// <summary>Field number for the "people" field.</summary>
698     public const int PeopleFieldNumber = 1;
699     private static readonly pb::FieldCodec<global::Google.Protobuf.Examples.AddressBook.Person> _repeated_people_codec
700         = pb::FieldCodec.ForMessage(10, global::Google.Protobuf.Examples.AddressBook.Person.Parser);
701     private readonly pbc::RepeatedField<global::Google.Protobuf.Examples.AddressBook.Person> people_ = new pbc::RepeatedField<global::Google.Protobuf.Examples.AddressBook.Person>();
702     [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
703     [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
704     public pbc::RepeatedField<global::Google.Protobuf.Examples.AddressBook.Person> People {
705       get { return people_; }
706     }
707 
708     [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
709     [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
Equals(object other)710     public override bool Equals(object other) {
711       return Equals(other as AddressBook);
712     }
713 
714     [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
715     [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
Equals(AddressBook other)716     public bool Equals(AddressBook other) {
717       if (ReferenceEquals(other, null)) {
718         return false;
719       }
720       if (ReferenceEquals(other, this)) {
721         return true;
722       }
723       if(!people_.Equals(other.people_)) return false;
724       return Equals(_unknownFields, other._unknownFields);
725     }
726 
727     [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
728     [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
GetHashCode()729     public override int GetHashCode() {
730       int hash = 1;
731       hash ^= people_.GetHashCode();
732       if (_unknownFields != null) {
733         hash ^= _unknownFields.GetHashCode();
734       }
735       return hash;
736     }
737 
738     [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
739     [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
ToString()740     public override string ToString() {
741       return pb::JsonFormatter.ToDiagnosticString(this);
742     }
743 
744     [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
745     [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
WriteTo(pb::CodedOutputStream output)746     public void WriteTo(pb::CodedOutputStream output) {
747     #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
748       output.WriteRawMessage(this);
749     #else
750       people_.WriteTo(output, _repeated_people_codec);
751       if (_unknownFields != null) {
752         _unknownFields.WriteTo(output);
753       }
754     #endif
755     }
756 
757     #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
758     [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
759     [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
IBufferMessage.InternalWriteTo(ref pb::WriteContext output)760     void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) {
761       people_.WriteTo(ref output, _repeated_people_codec);
762       if (_unknownFields != null) {
763         _unknownFields.WriteTo(ref output);
764       }
765     }
766     #endif
767 
768     [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
769     [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
CalculateSize()770     public int CalculateSize() {
771       int size = 0;
772       size += people_.CalculateSize(_repeated_people_codec);
773       if (_unknownFields != null) {
774         size += _unknownFields.CalculateSize();
775       }
776       return size;
777     }
778 
779     [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
780     [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
MergeFrom(AddressBook other)781     public void MergeFrom(AddressBook other) {
782       if (other == null) {
783         return;
784       }
785       people_.Add(other.people_);
786       _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
787     }
788 
789     [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
790     [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
MergeFrom(pb::CodedInputStream input)791     public void MergeFrom(pb::CodedInputStream input) {
792     #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
793       input.ReadRawMessage(this);
794     #else
795       uint tag;
796       while ((tag = input.ReadTag()) != 0) {
797       if ((tag & 7) == 4) {
798         // Abort on any end group tag.
799         return;
800       }
801       switch(tag) {
802           default:
803             _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
804             break;
805           case 10: {
806             people_.AddEntriesFrom(input, _repeated_people_codec);
807             break;
808           }
809         }
810       }
811     #endif
812     }
813 
814     #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
815     [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
816     [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
IBufferMessage.InternalMergeFrom(ref pb::ParseContext input)817     void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) {
818       uint tag;
819       while ((tag = input.ReadTag()) != 0) {
820       if ((tag & 7) == 4) {
821         // Abort on any end group tag.
822         return;
823       }
824       switch(tag) {
825           default:
826             _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input);
827             break;
828           case 10: {
829             people_.AddEntriesFrom(ref input, _repeated_people_codec);
830             break;
831           }
832         }
833       }
834     }
835     #endif
836 
837   }
838 
839   #endregion
840 
841 }
842 
843 #endregion Designer generated code
844