Remove stubs in OutgoingWebhookServiceInterface.

If we omit methods in subclasses, they're likely to
be caught by linters or unit tests, and even if they
aren't, raising NotImplementedError doesn't actually
prevent user problems.

I've been fighting these in refactoring, and it's
just been a bunch of busy work, plus comments are
highly likely to bitrot.
This commit is contained in:
Steve Howell
2018-10-11 11:57:09 +00:00
committed by Tim Abbott
parent 31597cf33e
commit 8f74d99b6c

View File

@@ -27,18 +27,6 @@ class OutgoingWebhookServiceInterface:
self.user_profile = user_profile # type: UserProfile
self.service_name = service_name # type: str
def build_bot_request(self, event: Dict[str, Any]) -> Optional[Any]:
raise NotImplementedError()
# Given a successful outgoing webhook REST operation, return
# a dictionary with `content` and other relevant fields.
# The main use case for this function is to massage data from
# various APIs to have similar data structures.
# It also allows bots to explictly set response_not_required.
def process_success(self, response_json: Dict[str, Any],
event: Dict[str, Any]) -> Optional[Dict[str, Any]]:
raise NotImplementedError()
class GenericOutgoingWebhookService(OutgoingWebhookServiceInterface):
def build_bot_request(self, event: Dict[str, Any]) -> Optional[Any]: