-
Notifications
You must be signed in to change notification settings - Fork 6
/
UserProfile.spec
71 lines (51 loc) · 2.24 KB
/
UserProfile.spec
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
module UserProfile {
/* @range [0,1] */
typedef int bool;
typedef string username;
typedef string realname;
typedef structure {
username username;
realname realname;
string thumbnail;
} User;
typedef structure {
User user;
UnspecifiedObject profile;
} UserProfile;
funcdef ver() returns (string);
typedef structure {
string filter;
} FilterParams;
/*
Returns a list of users matching the filter. If the 'filter' field
is empty or null, then this will return all Users. The filter will
match substrings in usernames and realnames.
*/
funcdef filter_users(FilterParams p) returns (list<User> users);
/*
Given a list of usernames, returns a list of UserProfiles in the same order.
If no UserProfile was found for a username, the UserProfile at that position will
be null.
*/
funcdef get_user_profile(list <username> usernames) returns (list<UserProfile> profiles);
typedef structure {
UserProfile profile;
} SetUserProfileParams;
/*
Set the UserProfile for the user indicated in the User field of the UserProfile
object. This operation can only be performed if authenticated as the user in
the UserProfile or as the admin account of this service.
If the profile does not exist, one will be created. If it does already exist,
then the entire user profile will be replaced with the new profile.
*/
funcdef set_user_profile(SetUserProfileParams p) returns () authentication required;
/*
Update the UserProfile for the user indicated in the User field of the UserProfile
object. This operation can only be performed if authenticated as the user in
the UserProfile or as the admin account of this service.
If the profile does not exist, one will be created. If it does already exist,
then the specified top-level fields in profile will be updated.
todo: add some way to remove fields. Fields in profile can only be modified or added.
*/
funcdef update_user_profile(SetUserProfileParams p) returns () authentication required;
};