addressbook.proto 1.1 KB

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