from zenslackchat.zendesk_base_webhook import BaseWebHook
from zenslackchat.zendesk_email_to_slack import email_from_zendesk
from zenslackchat.zendesk_comments_to_slack import comments_from_zendesk


class CommentsWebHook(BaseWebHook):
    """Handle Zendesk Comment Events.
    """
    def handle_event(self, event, slack_client, zendesk_client):
        """Handle the comment trigger event we have been POSTed.

        Recover and update the comments with lastest from Zendesk.

        """
        comments_from_zendesk(event, slack_client, zendesk_client)


class EmailWebHook(BaseWebHook):
    """Handle Zendesk Email Events.
    """
    def handle_event(self, event, slack_client, zendesk_client):
        """Handle an email created issue and create it on slack.
        """
        email_from_zendesk(event, slack_client, zendesk_client)

[((15, 8, 15, 66), 'zenslackchat.zendesk_comments_to_slack.comments_from_zendesk', 'comments_from_zendesk', ({(15, 30, 15, 35): 'event', (15, 37, 15, 49): 'slack_client', (15, 51, 15, 65): 'zendesk_client'}, {}), '(event, slack_client, zendesk_client)', False, 'from zenslackchat.zendesk_comments_to_slack import comments_from_zendesk\n'), ((24, 8, 24, 63), 'zenslackchat.zendesk_email_to_slack.email_from_zendesk', 'email_from_zendesk', ({(24, 27, 24, 32): 'event', (24, 34, 24, 46): 'slack_client', (24, 48, 24, 62): 'zendesk_client'}, {}), '(event, slack_client, zendesk_client)', False, 'from zenslackchat.zendesk_email_to_slack import email_from_zendesk\n')]