From e8ceaba5a0ea3af7f8c85e55939d979c8025f772 Mon Sep 17 00:00:00 2001 From: John Keyes Date: Sat, 19 Nov 2016 00:06:47 +0000 Subject: [PATCH] Removing unused Reply extended operation. The reply methods are all directly implemented in the conversation service. --- intercom/extended_api_operations/reply.py | 43 ----------------------- 1 file changed, 43 deletions(-) delete mode 100644 intercom/extended_api_operations/reply.py diff --git a/intercom/extended_api_operations/reply.py b/intercom/extended_api_operations/reply.py deleted file mode 100644 index 18f47087..00000000 --- a/intercom/extended_api_operations/reply.py +++ /dev/null @@ -1,43 +0,0 @@ -# -*- coding: utf-8 -*- -"""Operations to manage conversations.""" - -from intercom import utils - - -class Reply(object): - """A mixin that provides methods to manage a conversation. - - This includes opening and closing them, assigning them to users, and - replying them. - """ - - def reply(self, **reply_data): - """Add a reply, created from the supplied paramters, to the conversation.""" - return self.__reply(reply_data) - - def close_conversation(self, **reply_data): - """Close the conversation.""" - reply_data['type'] = 'admin' - reply_data['message_type'] = 'close' - return self.__reply(reply_data) - - def open_conversation(self, **reply_data): - """Open the conversation.""" - reply_data['type'] = 'admin' - reply_data['message_type'] = 'open' - return self.__reply(reply_data) - - def assign(self, **reply_data): - """Assign the conversation to an admin user.""" - reply_data['type'] = 'admin' - reply_data['message_type'] = 'assignment' - return self.__reply(reply_data) - - def __reply(self, reply_data): - """Send the Conversation requests to Intercom and handl the responses.""" - from intercom import Intercom - collection = utils.resource_class_to_collection_name(self.__class__) - url = "/%s/%s/reply" % (collection, self.id) - reply_data['conversation_id'] = self.id - response = Intercom.post(url, **reply_data) - return self.from_response(response)