Austin Schuh | 40c1652 | 2018-10-28 20:27:54 -0700 | [diff] [blame^] | 1 | // <auto-generated> |
| 2 | // Generated by the protocol buffer compiler. DO NOT EDIT! |
| 3 | // source: addressbook.proto |
| 4 | // </auto-generated> |
Brian Silverman | 9c614bc | 2016-02-15 20:20:02 -0500 | [diff] [blame] | 5 | #pragma warning disable 1591, 0612, 3021 |
| 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> |
Brian Silverman | 9c614bc | 2016-02-15 20:20:02 -0500 | [diff] [blame] | 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 | |
| 24 | static AddressbookReflection() { |
| 25 | byte[] descriptorData = global::System.Convert.FromBase64String( |
| 26 | string.Concat( |
Austin Schuh | 40c1652 | 2018-10-28 20:27:54 -0700 | [diff] [blame^] | 27 | "ChFhZGRyZXNzYm9vay5wcm90bxIIdHV0b3JpYWwaH2dvb2dsZS9wcm90b2J1", |
| 28 | "Zi90aW1lc3RhbXAucHJvdG8ihwIKBlBlcnNvbhIMCgRuYW1lGAEgASgJEgoK", |
| 29 | "AmlkGAIgASgFEg0KBWVtYWlsGAMgASgJEiwKBnBob25lcxgEIAMoCzIcLnR1", |
| 30 | "dG9yaWFsLlBlcnNvbi5QaG9uZU51bWJlchIwCgxsYXN0X3VwZGF0ZWQYBSAB", |
| 31 | "KAsyGi5nb29nbGUucHJvdG9idWYuVGltZXN0YW1wGkcKC1Bob25lTnVtYmVy", |
| 32 | "Eg4KBm51bWJlchgBIAEoCRIoCgR0eXBlGAIgASgOMhoudHV0b3JpYWwuUGVy", |
| 33 | "c29uLlBob25lVHlwZSIrCglQaG9uZVR5cGUSCgoGTU9CSUxFEAASCAoESE9N", |
| 34 | "RRABEggKBFdPUksQAiIvCgtBZGRyZXNzQm9vaxIgCgZwZW9wbGUYASADKAsy", |
| 35 | "EC50dXRvcmlhbC5QZXJzb25CUAoUY29tLmV4YW1wbGUudHV0b3JpYWxCEUFk", |
| 36 | "ZHJlc3NCb29rUHJvdG9zqgIkR29vZ2xlLlByb3RvYnVmLkV4YW1wbGVzLkFk", |
| 37 | "ZHJlc3NCb29rYgZwcm90bzM=")); |
Brian Silverman | 9c614bc | 2016-02-15 20:20:02 -0500 | [diff] [blame] | 38 | descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, |
Austin Schuh | 40c1652 | 2018-10-28 20:27:54 -0700 | [diff] [blame^] | 39 | new pbr::FileDescriptor[] { global::Google.Protobuf.WellKnownTypes.TimestampReflection.Descriptor, }, |
Brian Silverman | 9c614bc | 2016-02-15 20:20:02 -0500 | [diff] [blame] | 40 | new pbr::GeneratedClrTypeInfo(null, new pbr::GeneratedClrTypeInfo[] { |
Austin Schuh | 40c1652 | 2018-10-28 20:27:54 -0700 | [diff] [blame^] | 41 | 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 Silverman | 9c614bc | 2016-02-15 20:20:02 -0500 | [diff] [blame] | 42 | 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 Schuh | 40c1652 | 2018-10-28 20:27:54 -0700 | [diff] [blame^] | 50 | /// [START messages] |
Brian Silverman | 9c614bc | 2016-02-15 20:20:02 -0500 | [diff] [blame] | 51 | /// </summary> |
Brian Silverman | 9c614bc | 2016-02-15 20:20:02 -0500 | [diff] [blame] | 52 | public sealed partial class Person : pb::IMessage<Person> { |
| 53 | private static readonly pb::MessageParser<Person> _parser = new pb::MessageParser<Person>(() => new Person()); |
Austin Schuh | 40c1652 | 2018-10-28 20:27:54 -0700 | [diff] [blame^] | 54 | private pb::UnknownFieldSet _unknownFields; |
| 55 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] |
Brian Silverman | 9c614bc | 2016-02-15 20:20:02 -0500 | [diff] [blame] | 56 | public static pb::MessageParser<Person> Parser { get { return _parser; } } |
| 57 | |
Austin Schuh | 40c1652 | 2018-10-28 20:27:54 -0700 | [diff] [blame^] | 58 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] |
Brian Silverman | 9c614bc | 2016-02-15 20:20:02 -0500 | [diff] [blame] | 59 | public static pbr::MessageDescriptor Descriptor { |
| 60 | get { return global::Google.Protobuf.Examples.AddressBook.AddressbookReflection.Descriptor.MessageTypes[0]; } |
| 61 | } |
| 62 | |
Austin Schuh | 40c1652 | 2018-10-28 20:27:54 -0700 | [diff] [blame^] | 63 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] |
Brian Silverman | 9c614bc | 2016-02-15 20:20:02 -0500 | [diff] [blame] | 64 | pbr::MessageDescriptor pb::IMessage.Descriptor { |
| 65 | get { return Descriptor; } |
| 66 | } |
| 67 | |
Austin Schuh | 40c1652 | 2018-10-28 20:27:54 -0700 | [diff] [blame^] | 68 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] |
Brian Silverman | 9c614bc | 2016-02-15 20:20:02 -0500 | [diff] [blame] | 69 | public Person() { |
| 70 | OnConstruction(); |
| 71 | } |
| 72 | |
| 73 | partial void OnConstruction(); |
| 74 | |
Austin Schuh | 40c1652 | 2018-10-28 20:27:54 -0700 | [diff] [blame^] | 75 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] |
Brian Silverman | 9c614bc | 2016-02-15 20:20:02 -0500 | [diff] [blame] | 76 | public Person(Person other) : this() { |
| 77 | name_ = other.name_; |
| 78 | id_ = other.id_; |
| 79 | email_ = other.email_; |
| 80 | phones_ = other.phones_.Clone(); |
Austin Schuh | 40c1652 | 2018-10-28 20:27:54 -0700 | [diff] [blame^] | 81 | lastUpdated_ = other.lastUpdated_ != null ? other.lastUpdated_.Clone() : null; |
| 82 | _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); |
Brian Silverman | 9c614bc | 2016-02-15 20:20:02 -0500 | [diff] [blame] | 83 | } |
| 84 | |
Austin Schuh | 40c1652 | 2018-10-28 20:27:54 -0700 | [diff] [blame^] | 85 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] |
Brian Silverman | 9c614bc | 2016-02-15 20:20:02 -0500 | [diff] [blame] | 86 | 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 Schuh | 40c1652 | 2018-10-28 20:27:54 -0700 | [diff] [blame^] | 93 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] |
Brian Silverman | 9c614bc | 2016-02-15 20:20:02 -0500 | [diff] [blame] | 94 | 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 Schuh | 40c1652 | 2018-10-28 20:27:54 -0700 | [diff] [blame^] | 105 | /// Unique ID number for this person. |
Brian Silverman | 9c614bc | 2016-02-15 20:20:02 -0500 | [diff] [blame] | 106 | /// </summary> |
Austin Schuh | 40c1652 | 2018-10-28 20:27:54 -0700 | [diff] [blame^] | 107 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] |
Brian Silverman | 9c614bc | 2016-02-15 20:20:02 -0500 | [diff] [blame] | 108 | 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 Schuh | 40c1652 | 2018-10-28 20:27:54 -0700 | [diff] [blame^] | 118 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] |
Brian Silverman | 9c614bc | 2016-02-15 20:20:02 -0500 | [diff] [blame] | 119 | 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 Schuh | 40c1652 | 2018-10-28 20:27:54 -0700 | [diff] [blame^] | 131 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] |
Brian Silverman | 9c614bc | 2016-02-15 20:20:02 -0500 | [diff] [blame] | 132 | public pbc::RepeatedField<global::Google.Protobuf.Examples.AddressBook.Person.Types.PhoneNumber> Phones { |
| 133 | get { return phones_; } |
| 134 | } |
| 135 | |
Austin Schuh | 40c1652 | 2018-10-28 20:27:54 -0700 | [diff] [blame^] | 136 | /// <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 Silverman | 9c614bc | 2016-02-15 20:20:02 -0500 | [diff] [blame] | 148 | public override bool Equals(object other) { |
| 149 | return Equals(other as Person); |
| 150 | } |
| 151 | |
Austin Schuh | 40c1652 | 2018-10-28 20:27:54 -0700 | [diff] [blame^] | 152 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] |
Brian Silverman | 9c614bc | 2016-02-15 20:20:02 -0500 | [diff] [blame] | 153 | 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 Schuh | 40c1652 | 2018-10-28 20:27:54 -0700 | [diff] [blame^] | 164 | if (!object.Equals(LastUpdated, other.LastUpdated)) return false; |
| 165 | return Equals(_unknownFields, other._unknownFields); |
Brian Silverman | 9c614bc | 2016-02-15 20:20:02 -0500 | [diff] [blame] | 166 | } |
| 167 | |
Austin Schuh | 40c1652 | 2018-10-28 20:27:54 -0700 | [diff] [blame^] | 168 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] |
Brian Silverman | 9c614bc | 2016-02-15 20:20:02 -0500 | [diff] [blame] | 169 | 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 Schuh | 40c1652 | 2018-10-28 20:27:54 -0700 | [diff] [blame^] | 175 | if (lastUpdated_ != null) hash ^= LastUpdated.GetHashCode(); |
| 176 | if (_unknownFields != null) { |
| 177 | hash ^= _unknownFields.GetHashCode(); |
| 178 | } |
Brian Silverman | 9c614bc | 2016-02-15 20:20:02 -0500 | [diff] [blame] | 179 | return hash; |
| 180 | } |
| 181 | |
Austin Schuh | 40c1652 | 2018-10-28 20:27:54 -0700 | [diff] [blame^] | 182 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] |
Brian Silverman | 9c614bc | 2016-02-15 20:20:02 -0500 | [diff] [blame] | 183 | public override string ToString() { |
| 184 | return pb::JsonFormatter.ToDiagnosticString(this); |
| 185 | } |
| 186 | |
Austin Schuh | 40c1652 | 2018-10-28 20:27:54 -0700 | [diff] [blame^] | 187 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] |
Brian Silverman | 9c614bc | 2016-02-15 20:20:02 -0500 | [diff] [blame] | 188 | 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 Schuh | 40c1652 | 2018-10-28 20:27:54 -0700 | [diff] [blame^] | 202 | if (lastUpdated_ != null) { |
| 203 | output.WriteRawTag(42); |
| 204 | output.WriteMessage(LastUpdated); |
| 205 | } |
| 206 | if (_unknownFields != null) { |
| 207 | _unknownFields.WriteTo(output); |
| 208 | } |
Brian Silverman | 9c614bc | 2016-02-15 20:20:02 -0500 | [diff] [blame] | 209 | } |
| 210 | |
Austin Schuh | 40c1652 | 2018-10-28 20:27:54 -0700 | [diff] [blame^] | 211 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] |
Brian Silverman | 9c614bc | 2016-02-15 20:20:02 -0500 | [diff] [blame] | 212 | 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 Schuh | 40c1652 | 2018-10-28 20:27:54 -0700 | [diff] [blame^] | 224 | if (lastUpdated_ != null) { |
| 225 | size += 1 + pb::CodedOutputStream.ComputeMessageSize(LastUpdated); |
| 226 | } |
| 227 | if (_unknownFields != null) { |
| 228 | size += _unknownFields.CalculateSize(); |
| 229 | } |
Brian Silverman | 9c614bc | 2016-02-15 20:20:02 -0500 | [diff] [blame] | 230 | return size; |
| 231 | } |
| 232 | |
Austin Schuh | 40c1652 | 2018-10-28 20:27:54 -0700 | [diff] [blame^] | 233 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] |
Brian Silverman | 9c614bc | 2016-02-15 20:20:02 -0500 | [diff] [blame] | 234 | 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 Schuh | 40c1652 | 2018-10-28 20:27:54 -0700 | [diff] [blame^] | 248 | 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 Silverman | 9c614bc | 2016-02-15 20:20:02 -0500 | [diff] [blame] | 255 | } |
| 256 | |
Austin Schuh | 40c1652 | 2018-10-28 20:27:54 -0700 | [diff] [blame^] | 257 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] |
Brian Silverman | 9c614bc | 2016-02-15 20:20:02 -0500 | [diff] [blame] | 258 | public void MergeFrom(pb::CodedInputStream input) { |
| 259 | uint tag; |
| 260 | while ((tag = input.ReadTag()) != 0) { |
| 261 | switch(tag) { |
| 262 | default: |
Austin Schuh | 40c1652 | 2018-10-28 20:27:54 -0700 | [diff] [blame^] | 263 | _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); |
Brian Silverman | 9c614bc | 2016-02-15 20:20:02 -0500 | [diff] [blame] | 264 | 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 Schuh | 40c1652 | 2018-10-28 20:27:54 -0700 | [diff] [blame^] | 281 | case 42: { |
| 282 | if (lastUpdated_ == null) { |
| 283 | lastUpdated_ = new global::Google.Protobuf.WellKnownTypes.Timestamp(); |
| 284 | } |
| 285 | input.ReadMessage(lastUpdated_); |
| 286 | break; |
| 287 | } |
Brian Silverman | 9c614bc | 2016-02-15 20:20:02 -0500 | [diff] [blame] | 288 | } |
| 289 | } |
| 290 | } |
| 291 | |
| 292 | #region Nested types |
| 293 | /// <summary>Container for nested types declared in the Person message type.</summary> |
Austin Schuh | 40c1652 | 2018-10-28 20:27:54 -0700 | [diff] [blame^] | 294 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] |
Brian Silverman | 9c614bc | 2016-02-15 20:20:02 -0500 | [diff] [blame] | 295 | public static partial class Types { |
| 296 | public enum PhoneType { |
Austin Schuh | 40c1652 | 2018-10-28 20:27:54 -0700 | [diff] [blame^] | 297 | [pbr::OriginalName("MOBILE")] Mobile = 0, |
| 298 | [pbr::OriginalName("HOME")] Home = 1, |
| 299 | [pbr::OriginalName("WORK")] Work = 2, |
Brian Silverman | 9c614bc | 2016-02-15 20:20:02 -0500 | [diff] [blame] | 300 | } |
| 301 | |
Brian Silverman | 9c614bc | 2016-02-15 20:20:02 -0500 | [diff] [blame] | 302 | public sealed partial class PhoneNumber : pb::IMessage<PhoneNumber> { |
| 303 | private static readonly pb::MessageParser<PhoneNumber> _parser = new pb::MessageParser<PhoneNumber>(() => new PhoneNumber()); |
Austin Schuh | 40c1652 | 2018-10-28 20:27:54 -0700 | [diff] [blame^] | 304 | private pb::UnknownFieldSet _unknownFields; |
| 305 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] |
Brian Silverman | 9c614bc | 2016-02-15 20:20:02 -0500 | [diff] [blame] | 306 | public static pb::MessageParser<PhoneNumber> Parser { get { return _parser; } } |
| 307 | |
Austin Schuh | 40c1652 | 2018-10-28 20:27:54 -0700 | [diff] [blame^] | 308 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] |
Brian Silverman | 9c614bc | 2016-02-15 20:20:02 -0500 | [diff] [blame] | 309 | public static pbr::MessageDescriptor Descriptor { |
| 310 | get { return global::Google.Protobuf.Examples.AddressBook.Person.Descriptor.NestedTypes[0]; } |
| 311 | } |
| 312 | |
Austin Schuh | 40c1652 | 2018-10-28 20:27:54 -0700 | [diff] [blame^] | 313 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] |
Brian Silverman | 9c614bc | 2016-02-15 20:20:02 -0500 | [diff] [blame] | 314 | pbr::MessageDescriptor pb::IMessage.Descriptor { |
| 315 | get { return Descriptor; } |
| 316 | } |
| 317 | |
Austin Schuh | 40c1652 | 2018-10-28 20:27:54 -0700 | [diff] [blame^] | 318 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] |
Brian Silverman | 9c614bc | 2016-02-15 20:20:02 -0500 | [diff] [blame] | 319 | public PhoneNumber() { |
| 320 | OnConstruction(); |
| 321 | } |
| 322 | |
| 323 | partial void OnConstruction(); |
| 324 | |
Austin Schuh | 40c1652 | 2018-10-28 20:27:54 -0700 | [diff] [blame^] | 325 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] |
Brian Silverman | 9c614bc | 2016-02-15 20:20:02 -0500 | [diff] [blame] | 326 | public PhoneNumber(PhoneNumber other) : this() { |
| 327 | number_ = other.number_; |
| 328 | type_ = other.type_; |
Austin Schuh | 40c1652 | 2018-10-28 20:27:54 -0700 | [diff] [blame^] | 329 | _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); |
Brian Silverman | 9c614bc | 2016-02-15 20:20:02 -0500 | [diff] [blame] | 330 | } |
| 331 | |
Austin Schuh | 40c1652 | 2018-10-28 20:27:54 -0700 | [diff] [blame^] | 332 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] |
Brian Silverman | 9c614bc | 2016-02-15 20:20:02 -0500 | [diff] [blame] | 333 | 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 Schuh | 40c1652 | 2018-10-28 20:27:54 -0700 | [diff] [blame^] | 340 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] |
Brian Silverman | 9c614bc | 2016-02-15 20:20:02 -0500 | [diff] [blame] | 341 | 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 Schuh | 40c1652 | 2018-10-28 20:27:54 -0700 | [diff] [blame^] | 350 | private global::Google.Protobuf.Examples.AddressBook.Person.Types.PhoneType type_ = 0; |
| 351 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] |
Brian Silverman | 9c614bc | 2016-02-15 20:20:02 -0500 | [diff] [blame] | 352 | public global::Google.Protobuf.Examples.AddressBook.Person.Types.PhoneType Type { |
| 353 | get { return type_; } |
| 354 | set { |
| 355 | type_ = value; |
| 356 | } |
| 357 | } |
| 358 | |
Austin Schuh | 40c1652 | 2018-10-28 20:27:54 -0700 | [diff] [blame^] | 359 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] |
Brian Silverman | 9c614bc | 2016-02-15 20:20:02 -0500 | [diff] [blame] | 360 | public override bool Equals(object other) { |
| 361 | return Equals(other as PhoneNumber); |
| 362 | } |
| 363 | |
Austin Schuh | 40c1652 | 2018-10-28 20:27:54 -0700 | [diff] [blame^] | 364 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] |
Brian Silverman | 9c614bc | 2016-02-15 20:20:02 -0500 | [diff] [blame] | 365 | 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 Schuh | 40c1652 | 2018-10-28 20:27:54 -0700 | [diff] [blame^] | 374 | return Equals(_unknownFields, other._unknownFields); |
Brian Silverman | 9c614bc | 2016-02-15 20:20:02 -0500 | [diff] [blame] | 375 | } |
| 376 | |
Austin Schuh | 40c1652 | 2018-10-28 20:27:54 -0700 | [diff] [blame^] | 377 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] |
Brian Silverman | 9c614bc | 2016-02-15 20:20:02 -0500 | [diff] [blame] | 378 | public override int GetHashCode() { |
| 379 | int hash = 1; |
| 380 | if (Number.Length != 0) hash ^= Number.GetHashCode(); |
Austin Schuh | 40c1652 | 2018-10-28 20:27:54 -0700 | [diff] [blame^] | 381 | if (Type != 0) hash ^= Type.GetHashCode(); |
| 382 | if (_unknownFields != null) { |
| 383 | hash ^= _unknownFields.GetHashCode(); |
| 384 | } |
Brian Silverman | 9c614bc | 2016-02-15 20:20:02 -0500 | [diff] [blame] | 385 | return hash; |
| 386 | } |
| 387 | |
Austin Schuh | 40c1652 | 2018-10-28 20:27:54 -0700 | [diff] [blame^] | 388 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] |
Brian Silverman | 9c614bc | 2016-02-15 20:20:02 -0500 | [diff] [blame] | 389 | public override string ToString() { |
| 390 | return pb::JsonFormatter.ToDiagnosticString(this); |
| 391 | } |
| 392 | |
Austin Schuh | 40c1652 | 2018-10-28 20:27:54 -0700 | [diff] [blame^] | 393 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] |
Brian Silverman | 9c614bc | 2016-02-15 20:20:02 -0500 | [diff] [blame] | 394 | public void WriteTo(pb::CodedOutputStream output) { |
| 395 | if (Number.Length != 0) { |
| 396 | output.WriteRawTag(10); |
| 397 | output.WriteString(Number); |
| 398 | } |
Austin Schuh | 40c1652 | 2018-10-28 20:27:54 -0700 | [diff] [blame^] | 399 | if (Type != 0) { |
Brian Silverman | 9c614bc | 2016-02-15 20:20:02 -0500 | [diff] [blame] | 400 | output.WriteRawTag(16); |
| 401 | output.WriteEnum((int) Type); |
| 402 | } |
Austin Schuh | 40c1652 | 2018-10-28 20:27:54 -0700 | [diff] [blame^] | 403 | if (_unknownFields != null) { |
| 404 | _unknownFields.WriteTo(output); |
| 405 | } |
Brian Silverman | 9c614bc | 2016-02-15 20:20:02 -0500 | [diff] [blame] | 406 | } |
| 407 | |
Austin Schuh | 40c1652 | 2018-10-28 20:27:54 -0700 | [diff] [blame^] | 408 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] |
Brian Silverman | 9c614bc | 2016-02-15 20:20:02 -0500 | [diff] [blame] | 409 | public int CalculateSize() { |
| 410 | int size = 0; |
| 411 | if (Number.Length != 0) { |
| 412 | size += 1 + pb::CodedOutputStream.ComputeStringSize(Number); |
| 413 | } |
Austin Schuh | 40c1652 | 2018-10-28 20:27:54 -0700 | [diff] [blame^] | 414 | if (Type != 0) { |
Brian Silverman | 9c614bc | 2016-02-15 20:20:02 -0500 | [diff] [blame] | 415 | size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) Type); |
| 416 | } |
Austin Schuh | 40c1652 | 2018-10-28 20:27:54 -0700 | [diff] [blame^] | 417 | if (_unknownFields != null) { |
| 418 | size += _unknownFields.CalculateSize(); |
| 419 | } |
Brian Silverman | 9c614bc | 2016-02-15 20:20:02 -0500 | [diff] [blame] | 420 | return size; |
| 421 | } |
| 422 | |
Austin Schuh | 40c1652 | 2018-10-28 20:27:54 -0700 | [diff] [blame^] | 423 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] |
Brian Silverman | 9c614bc | 2016-02-15 20:20:02 -0500 | [diff] [blame] | 424 | public void MergeFrom(PhoneNumber other) { |
| 425 | if (other == null) { |
| 426 | return; |
| 427 | } |
| 428 | if (other.Number.Length != 0) { |
| 429 | Number = other.Number; |
| 430 | } |
Austin Schuh | 40c1652 | 2018-10-28 20:27:54 -0700 | [diff] [blame^] | 431 | if (other.Type != 0) { |
Brian Silverman | 9c614bc | 2016-02-15 20:20:02 -0500 | [diff] [blame] | 432 | Type = other.Type; |
| 433 | } |
Austin Schuh | 40c1652 | 2018-10-28 20:27:54 -0700 | [diff] [blame^] | 434 | _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); |
Brian Silverman | 9c614bc | 2016-02-15 20:20:02 -0500 | [diff] [blame] | 435 | } |
| 436 | |
Austin Schuh | 40c1652 | 2018-10-28 20:27:54 -0700 | [diff] [blame^] | 437 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] |
Brian Silverman | 9c614bc | 2016-02-15 20:20:02 -0500 | [diff] [blame] | 438 | public void MergeFrom(pb::CodedInputStream input) { |
| 439 | uint tag; |
| 440 | while ((tag = input.ReadTag()) != 0) { |
| 441 | switch(tag) { |
| 442 | default: |
Austin Schuh | 40c1652 | 2018-10-28 20:27:54 -0700 | [diff] [blame^] | 443 | _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); |
Brian Silverman | 9c614bc | 2016-02-15 20:20:02 -0500 | [diff] [blame] | 444 | 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 Schuh | 40c1652 | 2018-10-28 20:27:54 -0700 | [diff] [blame^] | 465 | /// Our address book file is just one of these. |
Brian Silverman | 9c614bc | 2016-02-15 20:20:02 -0500 | [diff] [blame] | 466 | /// </summary> |
Brian Silverman | 9c614bc | 2016-02-15 20:20:02 -0500 | [diff] [blame] | 467 | public sealed partial class AddressBook : pb::IMessage<AddressBook> { |
| 468 | private static readonly pb::MessageParser<AddressBook> _parser = new pb::MessageParser<AddressBook>(() => new AddressBook()); |
Austin Schuh | 40c1652 | 2018-10-28 20:27:54 -0700 | [diff] [blame^] | 469 | private pb::UnknownFieldSet _unknownFields; |
| 470 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] |
Brian Silverman | 9c614bc | 2016-02-15 20:20:02 -0500 | [diff] [blame] | 471 | public static pb::MessageParser<AddressBook> Parser { get { return _parser; } } |
| 472 | |
Austin Schuh | 40c1652 | 2018-10-28 20:27:54 -0700 | [diff] [blame^] | 473 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] |
Brian Silverman | 9c614bc | 2016-02-15 20:20:02 -0500 | [diff] [blame] | 474 | public static pbr::MessageDescriptor Descriptor { |
| 475 | get { return global::Google.Protobuf.Examples.AddressBook.AddressbookReflection.Descriptor.MessageTypes[1]; } |
| 476 | } |
| 477 | |
Austin Schuh | 40c1652 | 2018-10-28 20:27:54 -0700 | [diff] [blame^] | 478 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] |
Brian Silverman | 9c614bc | 2016-02-15 20:20:02 -0500 | [diff] [blame] | 479 | pbr::MessageDescriptor pb::IMessage.Descriptor { |
| 480 | get { return Descriptor; } |
| 481 | } |
| 482 | |
Austin Schuh | 40c1652 | 2018-10-28 20:27:54 -0700 | [diff] [blame^] | 483 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] |
Brian Silverman | 9c614bc | 2016-02-15 20:20:02 -0500 | [diff] [blame] | 484 | public AddressBook() { |
| 485 | OnConstruction(); |
| 486 | } |
| 487 | |
| 488 | partial void OnConstruction(); |
| 489 | |
Austin Schuh | 40c1652 | 2018-10-28 20:27:54 -0700 | [diff] [blame^] | 490 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] |
Brian Silverman | 9c614bc | 2016-02-15 20:20:02 -0500 | [diff] [blame] | 491 | public AddressBook(AddressBook other) : this() { |
| 492 | people_ = other.people_.Clone(); |
Austin Schuh | 40c1652 | 2018-10-28 20:27:54 -0700 | [diff] [blame^] | 493 | _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); |
Brian Silverman | 9c614bc | 2016-02-15 20:20:02 -0500 | [diff] [blame] | 494 | } |
| 495 | |
Austin Schuh | 40c1652 | 2018-10-28 20:27:54 -0700 | [diff] [blame^] | 496 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] |
Brian Silverman | 9c614bc | 2016-02-15 20:20:02 -0500 | [diff] [blame] | 497 | 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 Schuh | 40c1652 | 2018-10-28 20:27:54 -0700 | [diff] [blame^] | 506 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] |
Brian Silverman | 9c614bc | 2016-02-15 20:20:02 -0500 | [diff] [blame] | 507 | public pbc::RepeatedField<global::Google.Protobuf.Examples.AddressBook.Person> People { |
| 508 | get { return people_; } |
| 509 | } |
| 510 | |
Austin Schuh | 40c1652 | 2018-10-28 20:27:54 -0700 | [diff] [blame^] | 511 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] |
Brian Silverman | 9c614bc | 2016-02-15 20:20:02 -0500 | [diff] [blame] | 512 | public override bool Equals(object other) { |
| 513 | return Equals(other as AddressBook); |
| 514 | } |
| 515 | |
Austin Schuh | 40c1652 | 2018-10-28 20:27:54 -0700 | [diff] [blame^] | 516 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] |
Brian Silverman | 9c614bc | 2016-02-15 20:20:02 -0500 | [diff] [blame] | 517 | 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 Schuh | 40c1652 | 2018-10-28 20:27:54 -0700 | [diff] [blame^] | 525 | return Equals(_unknownFields, other._unknownFields); |
Brian Silverman | 9c614bc | 2016-02-15 20:20:02 -0500 | [diff] [blame] | 526 | } |
| 527 | |
Austin Schuh | 40c1652 | 2018-10-28 20:27:54 -0700 | [diff] [blame^] | 528 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] |
Brian Silverman | 9c614bc | 2016-02-15 20:20:02 -0500 | [diff] [blame] | 529 | public override int GetHashCode() { |
| 530 | int hash = 1; |
| 531 | hash ^= people_.GetHashCode(); |
Austin Schuh | 40c1652 | 2018-10-28 20:27:54 -0700 | [diff] [blame^] | 532 | if (_unknownFields != null) { |
| 533 | hash ^= _unknownFields.GetHashCode(); |
| 534 | } |
Brian Silverman | 9c614bc | 2016-02-15 20:20:02 -0500 | [diff] [blame] | 535 | return hash; |
| 536 | } |
| 537 | |
Austin Schuh | 40c1652 | 2018-10-28 20:27:54 -0700 | [diff] [blame^] | 538 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] |
Brian Silverman | 9c614bc | 2016-02-15 20:20:02 -0500 | [diff] [blame] | 539 | public override string ToString() { |
| 540 | return pb::JsonFormatter.ToDiagnosticString(this); |
| 541 | } |
| 542 | |
Austin Schuh | 40c1652 | 2018-10-28 20:27:54 -0700 | [diff] [blame^] | 543 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] |
Brian Silverman | 9c614bc | 2016-02-15 20:20:02 -0500 | [diff] [blame] | 544 | public void WriteTo(pb::CodedOutputStream output) { |
| 545 | people_.WriteTo(output, _repeated_people_codec); |
Austin Schuh | 40c1652 | 2018-10-28 20:27:54 -0700 | [diff] [blame^] | 546 | if (_unknownFields != null) { |
| 547 | _unknownFields.WriteTo(output); |
| 548 | } |
Brian Silverman | 9c614bc | 2016-02-15 20:20:02 -0500 | [diff] [blame] | 549 | } |
| 550 | |
Austin Schuh | 40c1652 | 2018-10-28 20:27:54 -0700 | [diff] [blame^] | 551 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] |
Brian Silverman | 9c614bc | 2016-02-15 20:20:02 -0500 | [diff] [blame] | 552 | public int CalculateSize() { |
| 553 | int size = 0; |
| 554 | size += people_.CalculateSize(_repeated_people_codec); |
Austin Schuh | 40c1652 | 2018-10-28 20:27:54 -0700 | [diff] [blame^] | 555 | if (_unknownFields != null) { |
| 556 | size += _unknownFields.CalculateSize(); |
| 557 | } |
Brian Silverman | 9c614bc | 2016-02-15 20:20:02 -0500 | [diff] [blame] | 558 | return size; |
| 559 | } |
| 560 | |
Austin Schuh | 40c1652 | 2018-10-28 20:27:54 -0700 | [diff] [blame^] | 561 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] |
Brian Silverman | 9c614bc | 2016-02-15 20:20:02 -0500 | [diff] [blame] | 562 | public void MergeFrom(AddressBook other) { |
| 563 | if (other == null) { |
| 564 | return; |
| 565 | } |
| 566 | people_.Add(other.people_); |
Austin Schuh | 40c1652 | 2018-10-28 20:27:54 -0700 | [diff] [blame^] | 567 | _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); |
Brian Silverman | 9c614bc | 2016-02-15 20:20:02 -0500 | [diff] [blame] | 568 | } |
| 569 | |
Austin Schuh | 40c1652 | 2018-10-28 20:27:54 -0700 | [diff] [blame^] | 570 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute] |
Brian Silverman | 9c614bc | 2016-02-15 20:20:02 -0500 | [diff] [blame] | 571 | public void MergeFrom(pb::CodedInputStream input) { |
| 572 | uint tag; |
| 573 | while ((tag = input.ReadTag()) != 0) { |
| 574 | switch(tag) { |
| 575 | default: |
Austin Schuh | 40c1652 | 2018-10-28 20:27:54 -0700 | [diff] [blame^] | 576 | _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); |
Brian Silverman | 9c614bc | 2016-02-15 20:20:02 -0500 | [diff] [blame] | 577 | 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 |