From 5264b649993cfaebb91f9e7f06cabeccd073c2be Mon Sep 17 00:00:00 2001 From: charltonaustin Date: Thu, 6 Oct 2016 17:33:15 -0400 Subject: [PATCH] Adding in an endpoint for super user messages. --- endpoints/api/superuser.py | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/endpoints/api/superuser.py b/endpoints/api/superuser.py index baa5b1a86..cde035723 100644 --- a/endpoints/api/superuser.py +++ b/endpoints/api/superuser.py @@ -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, + }