addressbook.proto 754 B

12345678910111213141516171819202122232425262728293031
  1. package tutorial;
  2. import "google/protobuf/csharp_options.proto";
  3. option (google.protobuf.csharp_file_options).namespace = "Google.ProtocolBuffers.Examples.AddressBook";
  4. option (google.protobuf.csharp_file_options).umbrella_classname = "AddressBookProtos";
  5. option optimize_for = SPEED;
  6. message Person {
  7. required string name = 1;
  8. required int32 id = 2; // Unique ID number for this person.
  9. optional string email = 3;
  10. enum PhoneType {
  11. MOBILE = 0;
  12. HOME = 1;
  13. WORK = 2;
  14. }
  15. message PhoneNumber {
  16. required string number = 1;
  17. optional PhoneType type = 2 [default = HOME];
  18. }
  19. repeated PhoneNumber phone = 4;
  20. }
  21. // Our address book file is just one of these.
  22. message AddressBook {
  23. repeated Person person = 1;
  24. }