Line | |
---|
1 | package tutorial;
|
---|
2 |
|
---|
3 | import "google/protobuf/csharp_options.proto";
|
---|
4 |
|
---|
5 | option (google.protobuf.csharp_file_options).namespace = "Google.ProtocolBuffers.Examples.AddressBook";
|
---|
6 | option (google.protobuf.csharp_file_options).umbrella_classname = "AddressBookProtos";
|
---|
7 |
|
---|
8 | option optimize_for = SPEED;
|
---|
9 |
|
---|
10 | message Person {
|
---|
11 | required string name = 1;
|
---|
12 | required int32 id = 2; // Unique ID number for this person.
|
---|
13 | optional string email = 3;
|
---|
14 |
|
---|
15 | enum PhoneType {
|
---|
16 | MOBILE = 0;
|
---|
17 | HOME = 1;
|
---|
18 | WORK = 2;
|
---|
19 | }
|
---|
20 |
|
---|
21 | message PhoneNumber {
|
---|
22 | required string number = 1;
|
---|
23 | optional PhoneType type = 2 [default = HOME];
|
---|
24 | }
|
---|
25 |
|
---|
26 | repeated PhoneNumber phone = 4;
|
---|
27 | }
|
---|
28 |
|
---|
29 | // Our address book file is just one of these.
|
---|
30 | message AddressBook {
|
---|
31 | repeated Person person = 1;
|
---|
32 | }
|
---|
Note: See
TracBrowser
for help on using the repository browser.