addressbook.proto 730 B

123456789101112131415161718192021222324252627282930313233
  1. // See README.txt for information and build instructions.
  2. syntax = "proto2";
  3. package tutorial;
  4. option java_package = "com.example.tutorial";
  5. option java_outer_classname = "AddressBookProtos";
  6. option csharp_namespace = "Google.ProtocolBuffers.Examples.AddressBook";
  7. message Person {
  8. required string name = 1;
  9. required int32 id = 2; // Unique ID number for this person.
  10. optional string email = 3;
  11. enum PhoneType {
  12. MOBILE = 0;
  13. HOME = 1;
  14. WORK = 2;
  15. }
  16. message PhoneNumber {
  17. required string number = 1;
  18. optional PhoneType type = 2 [default = HOME];
  19. }
  20. repeated PhoneNumber phone = 4;
  21. }
  22. // Our address book file is just one of these.
  23. message AddressBook {
  24. repeated Person person = 1;
  25. }