# Path: tenable_io/api/agent_exclusions.py
# class AgentExclusionCreateRequest(AgentExclusionSaveBaseRequest):
# 
#     def __init__(
#             self,
#             name,
#             description=None,
#             schedule=None
#     ):
#         """Request for AgentExclusionsApi.create.
# 
#         :param name: The name of the exclusion.
#         :type name: string
#         :param description: The description of the exclusion.
#         :type description: string
#         :param schedule: A time window to limit the exclusion.
#         :type schedule: :class:`tenable_io.api.models.AgentExclusionSchedule`
#         """
#         super(AgentExclusionCreateRequest, self).__init__(name, description, schedule)
# 
# class AgentExclusionEditRequest(AgentExclusionSaveBaseRequest):
# 
#     def __init__(
#             self,
#             name=None,
#             description=None,
#             schedule=None
#     ):
#         """Request for AgentExclusionsApi.edit.
# 
#         :param name: The name of the exclusion.
#         :type name: string
#         :param description: The description of the exclusion.
#         :type description: string
#         :param schedule: A time window to limit the exclusion.
#         :type schedule: :class:`tenable_io.api.models.AgentExclusionSchedule`
#         """
#         super(AgentExclusionEditRequest, self).__init__(name, description, schedule)
# 
# 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
# 
# class AgentExclusionRrules(BaseModel):
# 
#     def __init__(
#             self,
#             freq=None,
#             interval=None,
#             byweekday=None,
#             bymonthday=None
#     ):
#         self.freq = freq
#         self.interval = interval
#         self.byweekday = byweekday
#         self.bymonthday = bymonthday


import pytest
from datetime import datetime, timedelta
from random import randint
from tenable_io.api.agent_exclusions import AgentExclusionCreateRequest, AgentExclusionEditRequest
from tenable_io.api.models import AgentExclusion, AgentExclusionList, AgentExclusionSchedule, AgentExclusionRrules
        AgentExclusionCreateRequest(
            'test_agent_exclusion_name_{}'.format(randint(0, 100)),
            u'test description',
            schedule_once()
        )
    )

@pytest.mark.vcr()
def test_agent_exclusions_create(client):
    exclusion = create_agent_exclusion(client)
    assert isinstance(exclusion, AgentExclusion), u'The `create` method did not return type `AgentExclusion`.'

@pytest.mark.vcr()
def test_agent_exclusions_details(client):
    exclusion_details = client.agent_exclusions_api.details(create_agent_exclusion(client).id)
    assert isinstance(exclusion_details, AgentExclusion), u'The `details` method did not return type `AgentExclusion`.'

@pytest.mark.vcr()
def test_agent_exclusions_list(client):
    exclusion_list = client.agent_exclusions_api.list()
    assert isinstance(exclusion_list, AgentExclusionList), u'The `list` method did not return type `AgentExclusionList`.'

@pytest.mark.vcr()
def test_agent_exclusions_edit(client):
    exclusion = create_agent_exclusion(client)
    edited_name = 'test_agent_exclusion_name_edit_{}'.format(randint(0, 100))
    edit_request = AgentExclusionEditRequest(
        edited_name
    )
    edited_exclusion = client.agent_exclusions_api.edit(exclusion.id, edit_request)

# Path: tenable_io/api/agent_exclusions.py
# class AgentExclusionCreateRequest(AgentExclusionSaveBaseRequest):
# 
#     def __init__(
#             self,
#             name,
#             description=None,
#             schedule=None
#     ):
#         """Request for AgentExclusionsApi.create.
# 
#         :param name: The name of the exclusion.
#         :type name: string
#         :param description: The description of the exclusion.
#         :type description: string
#         :param schedule: A time window to limit the exclusion.
#         :type schedule: :class:`tenable_io.api.models.AgentExclusionSchedule`
#         """
#         super(AgentExclusionCreateRequest, self).__init__(name, description, schedule)
# 
# class AgentExclusionEditRequest(AgentExclusionSaveBaseRequest):
# 
#     def __init__(
#             self,
#             name=None,
#             description=None,
#             schedule=None
#     ):
#         """Request for AgentExclusionsApi.edit.
# 
#         :param name: The name of the exclusion.
#         :type name: string
#         :param description: The description of the exclusion.
#         :type description: string
#         :param schedule: A time window to limit the exclusion.
#         :type schedule: :class:`tenable_io.api.models.AgentExclusionSchedule`
#         """
#         super(AgentExclusionEditRequest, self).__init__(name, description, schedule)
# 
# 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
# 
# class AgentExclusionRrules(BaseModel):
# 
#     def __init__(
#             self,
#             freq=None,
#             interval=None,
#             byweekday=None,
#             bymonthday=None
#     ):
#         self.freq = freq
#         self.interval = interval
#         self.byweekday = byweekday
#         self.bymonthday = bymonthday


# Path: tests/integration/api/test_agent_exclusions.py
import pytest
from datetime import datetime, timedelta
from random import randint
from tenable_io.api.agent_exclusions import AgentExclusionCreateRequest, AgentExclusionEditRequest
from tenable_io.api.models import AgentExclusion, AgentExclusionList, AgentExclusionSchedule, AgentExclusionRrules

        AgentExclusionCreateRequest(
            'test_agent_exclusion_name_{}'.format(randint(0, 100)),
            u'test description',
            schedule_once()
        )
    )

@pytest.mark.vcr()
def test_agent_exclusions_create(client):
    exclusion = create_agent_exclusion(client)
    assert isinstance(exclusion, AgentExclusion), u'The `create` method did not return type `AgentExclusion`.'

@pytest.mark.vcr()
def test_agent_exclusions_details(client):
    exclusion_details = client.agent_exclusions_api.details(create_agent_exclusion(client).id)
    assert isinstance(exclusion_details, AgentExclusion), u'The `details` method did not return type `AgentExclusion`.'

@pytest.mark.vcr()
def test_agent_exclusions_list(client):
    exclusion_list = client.agent_exclusions_api.list()
    assert isinstance(exclusion_list, AgentExclusionList), u'The `list` method did not return type `AgentExclusionList`.'

@pytest.mark.vcr()
def test_agent_exclusions_edit(client):
    exclusion = create_agent_exclusion(client)
    edited_name = 'test_agent_exclusion_name_edit_{}'.format(randint(0, 100))
    edit_request = AgentExclusionEditRequest(
        edited_name
    )
    edited_exclusion = client.agent_exclusions_api.edit(exclusion.id, edit_request)

    assert isinstance(edited_exclusion, AgentExclusion), u'The `edit` method returns type.'