blob: 23cc2f97e76a0d23ac14b1fe9b9bfcd6364764cb [file] [log] [blame]
temporal40ee5512008-07-10 02:12:20 +00001// See README.txt for information and build instructions.
Tim Swastbc472342015-12-01 17:07:18 -08002//
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
temporal40ee5512008-07-10 02:12:20 +00008
Tim Swastbc472342015-12-01 17:07:18 -08009// [START declaration]
Jan Tattermusch69c14072015-07-20 14:32:57 -070010syntax = "proto3";
temporal40ee5512008-07-10 02:12:20 +000011package tutorial;
Tim Swastbc472342015-12-01 17:07:18 -080012// [END declaration]
temporal40ee5512008-07-10 02:12:20 +000013
Tim Swastbc472342015-12-01 17:07:18 -080014// [START java_declaration]
temporal40ee5512008-07-10 02:12:20 +000015option java_package = "com.example.tutorial";
16option java_outer_classname = "AddressBookProtos";
Tim Swastbc472342015-12-01 17:07:18 -080017// [END java_declaration]
temporal40ee5512008-07-10 02:12:20 +000018
Tim Swastbc472342015-12-01 17:07:18 -080019// [START csharp_declaration]
20option csharp_namespace = "Google.Protobuf.Examples.AddressBook";
21// [END csharp_declaration]
22
23// [START messages]
temporal40ee5512008-07-10 02:12:20 +000024message Person {
Jan Tattermusch69c14072015-07-20 14:32:57 -070025 string name = 1;
Tim Swastbc472342015-12-01 17:07:18 -080026 int32 id = 2; // Unique ID number for this person.
Jan Tattermusch69c14072015-07-20 14:32:57 -070027 string email = 3;
temporal40ee5512008-07-10 02:12:20 +000028
29 enum PhoneType {
30 MOBILE = 0;
31 HOME = 1;
32 WORK = 2;
33 }
34
35 message PhoneNumber {
Jan Tattermusch69c14072015-07-20 14:32:57 -070036 string number = 1;
37 PhoneType type = 2;
temporal40ee5512008-07-10 02:12:20 +000038 }
39
Jan Tattermusch69c14072015-07-20 14:32:57 -070040 repeated PhoneNumber phones = 4;
temporal40ee5512008-07-10 02:12:20 +000041}
42
43// Our address book file is just one of these.
44message AddressBook {
Jan Tattermuschb0e5ba62015-07-20 15:24:08 -070045 repeated Person people = 1;
temporal40ee5512008-07-10 02:12:20 +000046}
Tim Swastbc472342015-12-01 17:07:18 -080047// [END messages]