2023-07-08 23:19:16 -04:00
|
|
|
syntax = "proto2";
|
|
|
|
|
2008-08-22 22:15:42 +00:00
|
|
|
package foo;
|
|
|
|
|
2021-03-21 19:46:21 -07:00
|
|
|
import "protobuf-c/protobuf-c.proto";
|
|
|
|
|
|
|
|
option (pb_c_file).c_package = "foo";
|
|
|
|
|
2008-08-22 22:15:42 +00:00
|
|
|
message Person {
|
|
|
|
required string name = 1;
|
|
|
|
required int32 id = 2;
|
|
|
|
optional string email = 3;
|
|
|
|
|
|
|
|
enum PhoneType {
|
|
|
|
MOBILE = 0;
|
|
|
|
HOME = 1;
|
|
|
|
WORK = 2;
|
|
|
|
}
|
|
|
|
|
|
|
|
message PhoneNumber {
|
2017-04-08 14:27:37 +02:00
|
|
|
message Comment {
|
|
|
|
required string comment = 1;
|
|
|
|
}
|
|
|
|
|
2008-08-22 22:15:42 +00:00
|
|
|
required string number = 1;
|
|
|
|
optional PhoneType type = 2 [default = HOME];
|
2017-04-08 14:27:37 +02:00
|
|
|
optional Comment comment = 3;
|
2008-08-22 22:15:42 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
repeated PhoneNumber phone = 4;
|
|
|
|
}
|
|
|
|
|
2009-01-28 04:57:49 +00:00
|
|
|
message LookupResult
|
|
|
|
{
|
|
|
|
optional Person person = 1;
|
|
|
|
}
|
|
|
|
|
2008-08-22 22:15:42 +00:00
|
|
|
message Name {
|
|
|
|
optional string name = 1;
|
|
|
|
};
|
|
|
|
|
|
|
|
service DirLookup {
|
2009-01-28 04:57:49 +00:00
|
|
|
rpc ByName (Name) returns (LookupResult);
|
2008-08-22 22:15:42 +00:00
|
|
|
}
|