addressbook.proto 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  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_multiple_files = true;
  15. option java_package = "com.example.tutorial.protos";
  16. option java_outer_classname = "AddressBookProtos";
  17. // [END java_declaration]
  18. // [START csharp_declaration]
  19. option csharp_namespace = "Google.Protobuf.Examples.AddressBook";
  20. // [END csharp_declaration]
  21. // [START go_declaration]
  22. option go_package = "../tutorial";
  23. // [END go_declaration]
  24. // [START messages]
  25. message Person {
  26. string name = 1;
  27. int32 id = 2; // Unique ID number for this person.
  28. string email = 3;
  29. enum PhoneType {
  30. MOBILE = 0;
  31. HOME = 1;
  32. WORK = 2;
  33. }
  34. message PhoneNumber {
  35. string number = 1;
  36. PhoneType type = 2;
  37. }
  38. repeated PhoneNumber phones = 4;
  39. google.protobuf.Timestamp last_updated = 5;
  40. }
  41. // Our address book file is just one of these.
  42. message AddressBook {
  43. repeated Person people = 1;
  44. }
  45. // [END messages]