addressbook.proto 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. // See README.txt for information and build instructions.
  2. //
  3. // Note: START and END tags are used in comments to define sections used in
  4. // tutorials. They are not part of the syntax for Protocol Buffers.
  5. //
  6. // To get an in-depth walkthrough of this file and the related examples, see:
  7. // https://developers.google.com/protocol-buffers/docs/tutorials
  8. // [START declaration]
  9. syntax = "proto3";
  10. package tutorial;
  11. import "google/protobuf/timestamp.proto";
  12. // [END declaration]
  13. // [START java_declaration]
  14. option java_package = "com.example.tutorial";
  15. option java_outer_classname = "AddressBookProtos";
  16. // [END java_declaration]
  17. // [START csharp_declaration]
  18. option csharp_namespace = "Google.Protobuf.Examples.AddressBook";
  19. // [END csharp_declaration]
  20. // [START messages]
  21. message Person {
  22. string name = 1;
  23. int32 id = 2; // Unique ID number for this person.
  24. string email = 3;
  25. enum PhoneType {
  26. MOBILE = 0;
  27. HOME = 1;
  28. WORK = 2;
  29. }
  30. message PhoneNumber {
  31. string number = 1;
  32. PhoneType type = 2;
  33. }
  34. repeated PhoneNumber phones = 4;
  35. google.protobuf.Timestamp last_updated = 5;
  36. }
  37. // Our address book file is just one of these.
  38. message AddressBook {
  39. repeated Person people = 1;
  40. }
  41. // [END messages]