Adding in an endpoint for super user messages.
This commit is contained in:
parent
343d293001
commit
5264b64999
1 changed files with 38 additions and 0 deletions
|
@ -819,3 +819,41 @@ class SuperUserServiceKeyApproval(ApiResource):
|
|||
return make_response('', 201)
|
||||
|
||||
abort(403)
|
||||
|
||||
@resource('/v1/superuser/messages')
|
||||
@show_if(features.SUPER_USERS)
|
||||
class ListMessages(ApiResource):
|
||||
""" Resource for getting a list of super user messages """
|
||||
|
||||
schemas = {
|
||||
'messages': {
|
||||
'id': 'messages',
|
||||
'type': 'object',
|
||||
'description': 'Messages that a super user has saved in the past',
|
||||
'properties': {
|
||||
'messages': {
|
||||
'type': 'array',
|
||||
'description': 'Array of message',
|
||||
'items': {
|
||||
'type': 'object',
|
||||
'description': 'A single message',
|
||||
'properties': {
|
||||
'content': {
|
||||
'type': 'string',
|
||||
'description': 'The actual message',
|
||||
},
|
||||
},
|
||||
}
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
@nickname('getMessages')
|
||||
@require_scope(scopes.SUPERUSER)
|
||||
def get(self):
|
||||
""" Return a super users messages """
|
||||
messages = []
|
||||
return {
|
||||
'messages': messages,
|
||||
}
|
||||
|
|
Reference in a new issue