addressbook.proto 1.21 KB
Newer Older
temporal's avatar
temporal committed
1
// See README.txt for information and build instructions.
2 3 4 5 6 7 8 9
//
// Note: START and END tags are used in comments to define sections used in
// tutorials.  They are not part of the syntax for Protocol Buffers.
//
// To get an in-depth walkthrough of this file and the related examples, see:
// https://developers.google.com/protocol-buffers/docs/tutorials

// [START declaration]
10
syntax = "proto3";
temporal's avatar
temporal committed
11
package tutorial;
12 13

import "google/protobuf/timestamp.proto";
14
// [END declaration]
temporal's avatar
temporal committed
15

16
// [START java_declaration]
temporal's avatar
temporal committed
17 18
option java_package = "com.example.tutorial";
option java_outer_classname = "AddressBookProtos";
19 20 21
// [END java_declaration]

// [START csharp_declaration]
22
option csharp_namespace = "Google.Protobuf.Examples.AddressBook";
23
// [END csharp_declaration]
temporal's avatar
temporal committed
24

25
// [START messages]
temporal's avatar
temporal committed
26
message Person {
27
  string name = 1;
28
  int32 id = 2;  // Unique ID number for this person.
29
  string email = 3;
temporal's avatar
temporal committed
30 31 32 33 34 35 36 37

  enum PhoneType {
    MOBILE = 0;
    HOME = 1;
    WORK = 2;
  }

  message PhoneNumber {
38 39
    string number = 1;
    PhoneType type = 2;
temporal's avatar
temporal committed
40 41
  }

42
  repeated PhoneNumber phones = 4;
43 44

  google.protobuf.Timestamp last_updated = 5;
temporal's avatar
temporal committed
45 46 47 48
}

// Our address book file is just one of these.
message AddressBook {
49
  repeated Person people = 1;
temporal's avatar
temporal committed
50
}
51
// [END messages]