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