# Path: smc/base/model.py
# @exception
# def prepared_request(*exception, **kwargs):  # @UnusedVariable
#     """
#     Prepared request is a wrapper to allow an exception to
#     be thrown to wrap the SMCResult. Exception is optional.
#     If not provided, the SMCResult object is returned,
#     otherwise it is only thrown if SMC reports an error.
#     """
#     return SMCRequest(**kwargs)
# 
# Path: smc/api/exceptions.py
# class DeleteElementFailed(SMCException):
#     """
#     Used when deletion fails, typically due to dependencies
#     for the target element
#     """


from smc_monitoring.models.query import Query
from smc_monitoring.models.formats import TextFormat, CombinedFormat,\
    DetailedFormat
from smc_monitoring.models.constants import LogField
from smc.base.model import prepared_request
from smc.api.exceptions import DeleteElementFailed
    def dest_ports(self):
        """
        Destination ports for this blacklist entry. If no ports are specified,
        'ANY' is returned.
        
        :rtype: str
        """
        start_port = self.blacklist.get('BlacklistEntryDestinationPort')
        if start_port is not None:
            return '{}-{}'.format(
                start_port, self.blacklist.get('BlacklistEntryDestinationPortRange'))
        return 'ANY'  

    @property
    def duration(self):
        """
        Duration for the blacklist entry.
        
        :rtype: int
        """
        return int(self.blacklist.get('BlacklistEntryDuration'))

    def delete(self):
        """
        Delete the entry from the engine where the entry is applied.
        
        :raises: DeleteElementFailed
        :return: None
        """
        return prepared_request(

# Path: smc/base/model.py
# @exception
# def prepared_request(*exception, **kwargs):  # @UnusedVariable
#     """
#     Prepared request is a wrapper to allow an exception to
#     be thrown to wrap the SMCResult. Exception is optional.
#     If not provided, the SMCResult object is returned,
#     otherwise it is only thrown if SMC reports an error.
#     """
#     return SMCRequest(**kwargs)
# 
# Path: smc/api/exceptions.py
# class DeleteElementFailed(SMCException):
#     """
#     Used when deletion fails, typically due to dependencies
#     for the target element
#     """


# Path: smc-monitoring/smc_monitoring/monitors/blacklist.py
from smc_monitoring.models.query import Query
from smc_monitoring.models.formats import TextFormat, CombinedFormat,\
    DetailedFormat
from smc_monitoring.models.constants import LogField
from smc.base.model import prepared_request
from smc.api.exceptions import DeleteElementFailed

    def dest_ports(self):
        """
        Destination ports for this blacklist entry. If no ports are specified,
        'ANY' is returned.
        
        :rtype: str
        """
        start_port = self.blacklist.get('BlacklistEntryDestinationPort')
        if start_port is not None:
            return '{}-{}'.format(
                start_port, self.blacklist.get('BlacklistEntryDestinationPortRange'))
        return 'ANY'  

    @property
    def duration(self):
        """
        Duration for the blacklist entry.
        
        :rtype: int
        """
        return int(self.blacklist.get('BlacklistEntryDuration'))

    def delete(self):
        """
        Delete the entry from the engine where the entry is applied.
        
        :raises: DeleteElementFailed
        :return: None
        """
        return prepared_request(

            DeleteElementFailed,