addressbook.capnp 560 Bytes
Newer Older
1 2
@0x9eb32e19f86ee174;

3 4 5
using Cxx = import "/capnp/c++.capnp";
$Cxx.namespace("addressbook");

6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
struct Person {
  id @0 :UInt32;
  name @1 :Text;
  email @2 :Text;
  phones @3 :List(PhoneNumber);

  struct PhoneNumber {
    number @0 :Text;
    type @1 :Type;

    enum Type {
      mobile @0;
      home @1;
      work @2;
    }
  }

23 24 25 26 27
  employment :union {
    unemployed @4 :Void;
    employer @5 :Text;
    school @6 :Text;
    selfEmployed @7 :Void;
28 29 30 31 32 33 34 35
    # We assume that a person is only one of these.
  }
}

struct AddressBook {
  people @0 :List(Person);
}