-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconstants.py
More file actions
38 lines (30 loc) · 991 Bytes
/
constants.py
File metadata and controls
38 lines (30 loc) · 991 Bytes
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
class Constants:
def __init__(self):
pass
k_user_id = 'userID'
k_event_id = 'eventID'
k_is_removed = 'isRemoved'
k_user_token = 'userToken'
k_time_stamp = 'time_stamp'
k_internal_id = 'internalID'
@staticmethod
def error_token_not_valid():
return {'status': 'token_not_valid'}, 401
@staticmethod
def error_token_expired():
return {'status': 'token_expired'}, 401
@staticmethod
def error_no_user_id():
return {'status': 'no_user_id'}, 401
@staticmethod
def error_wrong_json_format():
return {'status': 'wrong_json_not_valid'}, 401
@staticmethod
def error_wrong_json_structure():
return {'status': 'wrong_json_structure'}, 401
@staticmethod
def error_missed_parameter(parameter):
return {'status': 'missed_parameter ' + parameter}, 401
@staticmethod
def error_with_message_and_status(message, status):
return {'status': message}, status