Adding in an endpoint for super user messages.

This commit is contained in:
charltonaustin 2016-10-06 17:33:15 -04:00
parent 343d293001
commit 5264b64999

View file

@ -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,
}