blob: b4b33b4c658924f0321ab4e7a9dc9cf8da1acec3 [file] [log] [blame]
Brian Silverman9c614bc2016-02-15 20:20:02 -05001// 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
9// [START declaration]
10syntax = "proto3";
11package tutorial;
Austin Schuh40c16522018-10-28 20:27:54 -070012
13import "google/protobuf/timestamp.proto";
Brian Silverman9c614bc2016-02-15 20:20:02 -050014// [END declaration]
15
16// [START java_declaration]
17option java_package = "com.example.tutorial";
18option java_outer_classname = "AddressBookProtos";
19// [END java_declaration]
20
21// [START csharp_declaration]
22option csharp_namespace = "Google.Protobuf.Examples.AddressBook";
23// [END csharp_declaration]
24
25// [START messages]
26message Person {
27 string name = 1;
28 int32 id = 2; // Unique ID number for this person.
29 string email = 3;
30
31 enum PhoneType {
32 MOBILE = 0;
33 HOME = 1;
34 WORK = 2;
35 }
36
37 message PhoneNumber {
38 string number = 1;
39 PhoneType type = 2;
40 }
41
42 repeated PhoneNumber phones = 4;
Austin Schuh40c16522018-10-28 20:27:54 -070043
44 google.protobuf.Timestamp last_updated = 5;
Brian Silverman9c614bc2016-02-15 20:20:02 -050045}
46
47// Our address book file is just one of these.
48message AddressBook {
49 repeated Person people = 1;
50}
51// [END messages]