addressbook.proto 888 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. // See README.txt for information and build instructions.
  2. package tutorial;
  3. option java_package = "com.example.tutorial";
  4. option java_outer_classname = "AddressBookProtos";
  5. message Profile {
  6. optional string nick_name = 1;
  7. optional string icon = 2;
  8. }
  9. message Person {
  10. required string name = 1;
  11. required int32 id = 2; // Unique ID number for this person.
  12. optional string email = 3;
  13. enum PhoneType {
  14. MOBILE = 0;
  15. HOME = 1;
  16. WORK = 2;
  17. }
  18. message PhoneNumber {
  19. required string number = 1;
  20. optional PhoneType type = 2 [default = HOME];
  21. }
  22. repeated PhoneNumber phone = 4;
  23. repeated int32 test = 5 [packed=true];
  24. optional Profile profile = 6;
  25. extensions 10 to max;
  26. }
  27. message Ext {
  28. extend Person {
  29. optional int32 test = 10;
  30. }
  31. }
  32. // Our address book file is just one of these.
  33. message AddressBook {
  34. repeated Person person = 1;
  35. }