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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
|
class UserBase:
"""
Base interface implementation for API's to manage users.
"""
# create a user
def create_user(self, request: str) -> str:
"""
:param request: A json string with the user details
{
"name" : "<user_name>",
"display_name" : "<display name>"
}
:return: A json string with the response {"id" : "<user_id>"}
Constraint:
* user name must be unique
* name can be max 64 characters
* display name can be max 64 characters
"""
pass
# list all users
def list_users(self) -> str:
"""
:return: A json list with the response
[
{
"name" : "<user_name>",
"display_name" : "<display name>",
"creation_time" : "<some date:time format>"
}
]
"""
pass
# describe user
def describe_user(self, request: str) -> str:
"""
:param request: A json string with the user details
{
"id" : "<user_id>"
}
:return: A json string with the response
{
"name" : "<user_name>",
"description" : "<some description>",
"creation_time" : "<some date:time format>"
}
"""
pass
# update user
def update_user(self, request: str) -> str:
"""
:param request: A json string with the user details
{
"id" : "<user_id>",
"user" : {
"name" : "<user_name>",
"display_name" : "<display name>"
}
}
:return:
Constraint:
* user name cannot be updated
* name can be max 64 characters
* display name can be max 128 characters
"""
pass
def get_user_teams(self, request: str) -> str:
"""
:param request:
{
"id" : "<user_id>"
}
:return: A json list with the response.
[
{
"name" : "<team_name>",
"description" : "<some description>",
"creation_time" : "<some date:time format>"
}
]
"""
pass
|