addressbook.proto 515 B

123456789101112131415161718192021222324252627
  1. package tutorial;
  2. option optimize_for = SPEED;
  3. message Person {
  4. required string name = 1;
  5. required int32 id = 2; // Unique ID number for this person.
  6. optional string email = 3;
  7. enum PhoneType {
  8. MOBILE = 0;
  9. HOME = 1;
  10. WORK = 2;
  11. }
  12. message PhoneNumber {
  13. required string number = 1;
  14. optional PhoneType type = 2 [default = HOME];
  15. }
  16. repeated PhoneNumber phone = 4;
  17. }
  18. // Our address book file is just one of these.
  19. message AddressBook {
  20. repeated Person person = 1;
  21. }