namespace user { enum UserState { Active, Inactive, Banned } struct UserRequest { email: String, } struct Name { prefix: String (length=0..50), first_name: String (length=0..100), middle_name: String (length=0..100), last_name: String (length=0..100, help="aka. family name"), suffix: String (length=0..50), full_name: String } fieldset NameUpdate for Name { prefix?, first_name?, middle_name?, last_name?, suffix? } struct User { id: UUID, email: String, name: Name, password: String (length=5..64), is_admin: Boolean, } fieldset UserRead for User { id, email, is_admin, name } fieldset UserWrite for User { id, email?, is_admin?, name?, password?, } struct UserListRequest { offset?: Integer (size=32, range=0..), limit?: Integer (range=1..200) } struct UserList { count: Integer ( range=0..0xFFFF, help="Count of objects returned" ), users: [UserRead] (length=0..128), permissions: {UUID: String} } enum GetError { PermissionDenied, DoesNotExist } enum ListError { PermissionDenied } service ExampleService { get_version: None -> String, user_get: UserRequest -> Result, user_list: UserListRequest -> Result, } }