cannam@133: # Copyright (c) 2013-2014 Sandstorm Development Group, Inc. and contributors cannam@133: # Licensed under the MIT License: cannam@133: # cannam@133: # Permission is hereby granted, free of charge, to any person obtaining a copy cannam@133: # of this software and associated documentation files (the "Software"), to deal cannam@133: # in the Software without restriction, including without limitation the rights cannam@133: # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell cannam@133: # copies of the Software, and to permit persons to whom the Software is cannam@133: # furnished to do so, subject to the following conditions: cannam@133: # cannam@133: # The above copyright notice and this permission notice shall be included in cannam@133: # all copies or substantial portions of the Software. cannam@133: # cannam@133: # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR cannam@133: # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, cannam@133: # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE cannam@133: # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER cannam@133: # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, cannam@133: # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN cannam@133: # THE SOFTWARE. cannam@133: cannam@133: @0x9eb32e19f86ee174; cannam@133: cannam@133: using Cxx = import "/capnp/c++.capnp"; cannam@133: $Cxx.namespace("addressbook"); cannam@133: cannam@133: struct Person { cannam@133: id @0 :UInt32; cannam@133: name @1 :Text; cannam@133: email @2 :Text; cannam@133: phones @3 :List(PhoneNumber); cannam@133: cannam@133: struct PhoneNumber { cannam@133: number @0 :Text; cannam@133: type @1 :Type; cannam@133: cannam@133: enum Type { cannam@133: mobile @0; cannam@133: home @1; cannam@133: work @2; cannam@133: } cannam@133: } cannam@133: cannam@133: employment :union { cannam@133: unemployed @4 :Void; cannam@133: employer @5 :Text; cannam@133: school @6 :Text; cannam@133: selfEmployed @7 :Void; cannam@133: # We assume that a person is only one of these. cannam@133: } cannam@133: } cannam@133: cannam@133: struct AddressBook { cannam@133: people @0 :List(Person); cannam@133: } cannam@133: