mirror of
https://gitlab.com/fabinfra/fabaccess/fabaccess-api.git
synced 2025-03-12 06:41:51 +01:00
stay backwards compatible
This commit is contained in:
parent
750ae0c34b
commit
93f130873e
@ -39,7 +39,7 @@ struct Fallible(T, E) {
|
|||||||
# In those cases returning an `Optional` doesn't transfer information about the way that the
|
# In those cases returning an `Optional` doesn't transfer information about the way that the
|
||||||
# operation failed. `Fallible` contains this information in the generic `E` type.
|
# operation failed. `Fallible` contains this information in the generic `E` type.
|
||||||
union {
|
union {
|
||||||
successful @0 :T;
|
failed @0 :E;
|
||||||
failed @1 :E;
|
successful @1 :T;
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -27,14 +27,19 @@ struct UserSystem
|
|||||||
interface Manage $CSharp.name("ManageInterface") {
|
interface Manage $CSharp.name("ManageInterface") {
|
||||||
getUserList @0 () -> ( user_list :List(User) );
|
getUserList @0 () -> ( user_list :List(User) );
|
||||||
|
|
||||||
enum AddUserError {
|
addUser @1 (username :Text, password: Text) -> User;
|
||||||
alreadyExists @0;
|
|
||||||
# An user with that username already exists
|
|
||||||
usernameInvalid @1;
|
|
||||||
# The provided username is unusable, e.g. contains invalid characters,
|
|
||||||
# is too long or too short.
|
|
||||||
}
|
|
||||||
addUser @1 (username :Text, password: Text) -> Fallible(User, AddUserError);
|
|
||||||
removeUser @2 (user: User);
|
removeUser @2 (user: User);
|
||||||
|
|
||||||
|
struct AddUserError {
|
||||||
|
enum AddUserError {
|
||||||
|
alreadyExists @0;
|
||||||
|
# An user with that username already exists
|
||||||
|
usernameInvalid @1;
|
||||||
|
# The provided username is unusable, e.g. contains invalid characters,
|
||||||
|
# is too long or too short.
|
||||||
|
}
|
||||||
|
error @0 :AddUserError;
|
||||||
|
}
|
||||||
|
addUserFallible @3 (username :Text, password: Text) -> Fallible(User, AddUserError);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user