def check_response_codes(self, response, mimecast_endpoint):
        """Checking all response codes from Mimecast documentation and logging errors."""
        self.mimecast_endpoint = mimecast_endpoint
        if response.status_code == MimecastResponseCodes.success:
            return response
        elif response.status_code == MimecastResponseCodes.bad_request:
            logging.error("Request cannot be processed because it is either malformed or not correct.")
        elif response.status_code == MimecastResponseCodes.unauthorized:
            logging.error("Authorization information is either missing, incomplete or incorrect.")
        elif response.status_code == MimecastResponseCodes.forbidden:
            logging.error("Access is denied to the requested resource."
                          "The user may not have enough permission to perform the action.")
        elif response.status_code == MimecastResponseCodes.not_found:
            logging.error("The requested resource does not exist.")
        elif response.status_code == MimecastResponseCodes.conflict:
            logging.error("The current status of the relying data does not match what is defined in the request.")
        elif response.status_code == MimecastResponseCodes.internal_server_error:
            logging.error("The request was not processed successfully or an issue has occurred on the Mimecast side.")
        else:
            logging.error("Unknown error.Please contact API administrator.")
Checking all response codes from Mimecast documentation and logging errors.
Solutions/MimecastSEG/Data Connectors/Helpers/siem_response_helper.py