# Path: tenable_io/api/base.py
# class BaseApi(object):
# 
#     def __init__(self, client):
#         self._client = client
# 
# class BaseRequest(object):
# 
#     def as_payload(self, filter_=None):
#         return payload_filter(self.__dict__, filter_)
# 
# Path: tenable_io/api/models.py
# class AgentExclusion(BaseModel):
#     def __init__(
#             self,
#             id=None,
#             name=None,
#             description=None,
#             schedule=None,
#             creation_date=None,
#             last_modification_date=None,
#     ):
#         self._schedule = None
# 
#         self.id = id
#         self.name = name
#         self.description = description
#         self.schedule = schedule
#         self.creation_date = creation_date
#         self.last_modification_date = last_modification_date
# 
#     @property
#     def schedule(self):
#         return self._schedule
# 
#     @schedule.setter
#     @BaseModel._model(AgentExclusionSchedule)
#     def schedule(self, schedule):
#         self._schedule = schedule
# 
# class AgentExclusionList(BaseModel):
#     def __init__(
#             self,
#             exclusions=None
#     ):
#         self._exclusions = None
#         self.exclusions = exclusions
# 
#     @property
#     def exclusions(self):
#         return self._exclusions
# 
#     @exclusions.setter
#     @BaseModel._model_list(AgentExclusion)
#     def exclusions(self, exclusions):
#         self._exclusions = exclusions
# 
# class AgentExclusionSchedule(BaseModel):
# 
#     def __init__(
#             self,
#             enabled=None,
#             starttime=None,
#             endtime=None,
#             timezone=None,
#             rrules=None
#     ):
#         self._rrules = None
# 
#         self.enabled = enabled
#         self.starttime = starttime
#         self.endtime = endtime
#         self.timezone = timezone
#         self.rrules = rrules
# 
#     @property
#     def rrules(self):
#         return self._rrules
# 
#     @rrules.setter
#     @BaseModel._model(AgentExclusionRrules)
#     def rrules(self, rrules):
#         self._rrules = rrules
# 
#     def as_payload(self, filter_=None):
#         payload = super(AgentExclusionSchedule, self).as_payload(True)
#         if isinstance(self.rrules, AgentExclusionRrules):
#             payload.__setitem__('rrules', self.rrules.as_payload(True))
#         else:
#             payload.pop('rrules', None)
#         payload.pop('_rrules', None)
#         return payload


from tenable_io.api.base import BaseApi, BaseRequest
from tenable_io.api.models import AgentExclusion, AgentExclusionList, AgentExclusionSchedule
        return AgentExclusion.from_json(response.text)

    def delete(self, exclusion_id, scanner_id=1):
        """Delete an exclusion

        :param exclusion_id: The exclusion ID.
        :param scanner_id: The scanner ID.
        :raise TenableIOApiException:  When API error is encountered.
        :return: True if successful.
        """
        self._client.delete('scanners/%(scanner_id)s/agents/exclusions/%(exclusion_id)s',
                            path_params={
                                'scanner_id': scanner_id,
                                'exclusion_id': exclusion_id
                            })
        return True

    def details(self, exclusion_id, scanner_id=1):
        """Return details of given exclusion

        :param exclusion_id: The exclusion ID.
        :param scanner_id: The scanner ID.
        :raise TenableIOApiException:  When API error is encountered.
        :return: An instance of :class:`tenable_io.api.models.AgentExclusion`.
        """
        response = self._client.get('scanners/%(scanner_id)s/agents/exclusions/%(exclusion_id)s',
                                    path_params={
                                        'scanner_id': scanner_id,
                                        'exclusion_id': exclusion_id
                                    })

# Path: tenable_io/api/base.py
# class BaseApi(object):
# 
#     def __init__(self, client):
#         self._client = client
# 
# class BaseRequest(object):
# 
#     def as_payload(self, filter_=None):
#         return payload_filter(self.__dict__, filter_)
# 
# Path: tenable_io/api/models.py
# class AgentExclusion(BaseModel):
#     def __init__(
#             self,
#             id=None,
#             name=None,
#             description=None,
#             schedule=None,
#             creation_date=None,
#             last_modification_date=None,
#     ):
#         self._schedule = None
# 
#         self.id = id
#         self.name = name
#         self.description = description
#         self.schedule = schedule
#         self.creation_date = creation_date
#         self.last_modification_date = last_modification_date
# 
#     @property
#     def schedule(self):
#         return self._schedule
# 
#     @schedule.setter
#     @BaseModel._model(AgentExclusionSchedule)
#     def schedule(self, schedule):
#         self._schedule = schedule
# 
# class AgentExclusionList(BaseModel):
#     def __init__(
#             self,
#             exclusions=None
#     ):
#         self._exclusions = None
#         self.exclusions = exclusions
# 
#     @property
#     def exclusions(self):
#         return self._exclusions
# 
#     @exclusions.setter
#     @BaseModel._model_list(AgentExclusion)
#     def exclusions(self, exclusions):
#         self._exclusions = exclusions
# 
# class AgentExclusionSchedule(BaseModel):
# 
#     def __init__(
#             self,
#             enabled=None,
#             starttime=None,
#             endtime=None,
#             timezone=None,
#             rrules=None
#     ):
#         self._rrules = None
# 
#         self.enabled = enabled
#         self.starttime = starttime
#         self.endtime = endtime
#         self.timezone = timezone
#         self.rrules = rrules
# 
#     @property
#     def rrules(self):
#         return self._rrules
# 
#     @rrules.setter
#     @BaseModel._model(AgentExclusionRrules)
#     def rrules(self, rrules):
#         self._rrules = rrules
# 
#     def as_payload(self, filter_=None):
#         payload = super(AgentExclusionSchedule, self).as_payload(True)
#         if isinstance(self.rrules, AgentExclusionRrules):
#             payload.__setitem__('rrules', self.rrules.as_payload(True))
#         else:
#             payload.pop('rrules', None)
#         payload.pop('_rrules', None)
#         return payload


# Path: tenable_io/api/agent_exclusions.py
from tenable_io.api.base import BaseApi, BaseRequest
from tenable_io.api.models import AgentExclusion, AgentExclusionList, AgentExclusionSchedule

        return AgentExclusion.from_json(response.text)

    def delete(self, exclusion_id, scanner_id=1):
        """Delete an exclusion

        :param exclusion_id: The exclusion ID.
        :param scanner_id: The scanner ID.
        :raise TenableIOApiException:  When API error is encountered.
        :return: True if successful.
        """
        self._client.delete('scanners/%(scanner_id)s/agents/exclusions/%(exclusion_id)s',
                            path_params={
                                'scanner_id': scanner_id,
                                'exclusion_id': exclusion_id
                            })
        return True

    def details(self, exclusion_id, scanner_id=1):
        """Return details of given exclusion

        :param exclusion_id: The exclusion ID.
        :param scanner_id: The scanner ID.
        :raise TenableIOApiException:  When API error is encountered.
        :return: An instance of :class:`tenable_io.api.models.AgentExclusion`.
        """
        response = self._client.get('scanners/%(scanner_id)s/agents/exclusions/%(exclusion_id)s',
                                    path_params={
                                        'scanner_id': scanner_id,
                                        'exclusion_id': exclusion_id
                                    })

        return AgentExclusion.from_json(response.text)