def get(self): try: auth_token = request.headers['EVERGLADE-USER-TOKEN'] except: return get_missing_token_error() return get_user_token_info(auth_token)
def delete(self, user_uid): try: auth_token = request.headers['EVERGLADE-USER-TOKEN'] except: return get_missing_token_error() return remove_friend(auth_token, user_uid)
def delete(self, message_id): try: id_token = request.headers['EVERGLADE-USER-TOKEN'] except: return get_missing_token_error() return delete_message(message_id, id_token)
def put(self, user_uid): try: auth_token = request.headers['EVERGLADE-USER-TOKEN'] except: return get_missing_token_error() return accept_fr(auth_token, user_uid)
def delete(self): try: auth_token = request.headers['EVERGLADE-USER-TOKEN'] except: return get_missing_token_error() return delete_user(user_uid)
def get(self, chat_id): try: id_token = request.headers['EVERGLADE-USER-TOKEN'] except: return get_missing_token_error() return get_simple_chat(chat_id, id_token)
def delete(self, chat_id): try: id_token = request.headers['EVERGLADE-USER-TOKEN'] except: return get_missing_token_error() return decline_chat_request(chat_id, id_token)
def get(self, chat_id): try: id_token = request.headers['EVERGLADE-USER-TOKEN'] except: return get_missing_token_error() message_limit = int(request.args.get('message_limit')) return get_chat(chat_id, id_token, message_limit)
def put(self, chat_id): parser = reqparse.RequestParser() parser.add_argument('receiver', type=str) args = parser.parse_args() try: id_token = request.headers['EVERGLADE-USER-TOKEN'] except: return get_missing_token_error() return send_chat_request(chat_id, args['receiver'], id_token)
def patch(self, message_id): parser = reqparse.RequestParser() parser.add_argument('edit', type=str) args = parser.parse_args() try: id_token = request.headers['EVERGLADE-USER-TOKEN'] except: return get_missing_token_error() return edit_message(message_id, args['edit'], id_token)
def post(self): parser = reqparse.RequestParser() parser.add_argument('chat_name', type=str) args = parser.parse_args() try: id_token = request.headers['EVERGLADE-USER-TOKEN'] except: return get_missing_token_error() return create_chat(args['chat_name'], id_token)
def post(self): try: auth_token = request.headers['EVERGLADE-USER-TOKEN'] except: return get_missing_token_error() parser = reqparse.RequestParser() #Users is now a list of strings parser.add_argument('users', action='append') args = parser.parse_args() return get_users_info(args['users'], auth_token)
def patch(self): try: auth_token = request.headers['EVERGLADE-USER-TOKEN'] except: return get_missing_token_error() parser = reqparse.RequestParser() parser.add_argument('new_display_name', type=str) parser.add_argument('description', type=str) parser.add_argument('picture', type=str) args = parser.parse_args() new_display_name, description = args['new_display_name'], args[ 'description'] return set_user_info(auth_token, new_display_name, description, args['picture'])