person.proto 461 B

12345678910111213141516171819202122
  1. syntax = "proto2";
  2. import "nanopb.proto";
  3. message Person {
  4. required string name = 1 [(nanopb).max_size = 40];
  5. required int32 id = 2;
  6. optional string email = 3 [(nanopb).max_size = 40];
  7. enum PhoneType {
  8. MOBILE = 0;
  9. HOME = 1;
  10. WORK = 2;
  11. }
  12. message PhoneNumber {
  13. required string number = 1 [(nanopb).max_size = 40];
  14. optional PhoneType type = 2 [default = HOME];
  15. }
  16. repeated PhoneNumber phone = 4 [(nanopb).max_count = 5];
  17. }