27 lines
485 B
Protocol Buffer
27 lines
485 B
Protocol Buffer
syntax = "proto2";
|
|
|
|
package tutorial;
|
|
|
|
message Person {
|
|
optional string name = 1;
|
|
optional int32 id = 2;
|
|
optional string email = 3;
|
|
|
|
enum PhoneType {
|
|
PHONE_TYPE_UNSPECIFIED = 0;
|
|
PHONE_TYPE_MOBILE = 1;
|
|
PHONE_TYPE_HOME = 2;
|
|
PHONE_TYPE_WORK = 3;
|
|
}
|
|
|
|
message PhoneNumber {
|
|
optional string number = 1;
|
|
optional PhoneType type = 2 [default = PHONE_TYPE_HOME];
|
|
}
|
|
|
|
repeated PhoneNumber phones = 4;
|
|
}
|
|
|
|
message AddressBook {
|
|
repeated Person people = 1;
|
|
} |