# Path: tenable_io/api/exclusions.py
# class ExclusionEditRequest(ExclusionSaveBaseRequest):
# 
#     def __init__(
#             self,
#             name=None,
#             members=None,
#             description=None,
#             schedule=None
#     ):
#         super(ExclusionEditRequest, self).__init__(name, members, description, schedule)
# 
# Path: tenable_io/api/models.py
# class Exclusion(BaseModel):
#     def __init__(
#             self,
#             id=None,
#             name=None,
#             description=None,
#             schedule=None,
#             creation_date=None,
#             last_modification_date=None,
#             members=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
#         self.members = members
# 
#     @property
#     def schedule(self):
#         return self._schedule
# 
#     @schedule.setter
#     @BaseModel._model(ExclusionSchedule)
#     def schedule(self, schedule):
#         self._schedule = schedule
# 
# class ExclusionList(BaseModel):
#     def __init__(
#             self,
#             exclusions=None
#     ):
#         self._exclusions = None
#         self.exclusions = exclusions
# 
#     @property
#     def exclusions(self):
#         return self._exclusions
# 
#     @exclusions.setter
#     @BaseModel._model_list(Exclusion)
#     def exclusions(self, exclusions):
#         self._exclusions = exclusions


import pytest
import os
from tenable_io.api.exclusions import ExclusionEditRequest
from tenable_io.api.models import Exclusion, ExclusionList




@pytest.mark.vcr()
def test_exclusions_create(new_exclusion):
    assert isinstance(new_exclusion, Exclusion), u'The `create` method did not return type `Exclusion`.'


@pytest.mark.vcr()
def test_exclusions_details(client, new_exclusion):
    exclusion = client.exclusions_api.details(new_exclusion.id)
    assert isinstance(exclusion, Exclusion), u'The `create` method did not return type `Exclusion`.'


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

@pytest.mark.vcr()
def test_exclusions_edit(client, new_exclusion):
    exclusion = new_exclusion
    edited_exclusion_name = 'test_exclusion_name_edited'
    edit_request = ExclusionEditRequest(
        edited_exclusion_name,
        exclusion.members
    )
    edited_exclusion = client.exclusions_api.edit(exclusion.id, edit_request)

# Path: tenable_io/api/exclusions.py
# class ExclusionEditRequest(ExclusionSaveBaseRequest):
# 
#     def __init__(
#             self,
#             name=None,
#             members=None,
#             description=None,
#             schedule=None
#     ):
#         super(ExclusionEditRequest, self).__init__(name, members, description, schedule)
# 
# Path: tenable_io/api/models.py
# class Exclusion(BaseModel):
#     def __init__(
#             self,
#             id=None,
#             name=None,
#             description=None,
#             schedule=None,
#             creation_date=None,
#             last_modification_date=None,
#             members=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
#         self.members = members
# 
#     @property
#     def schedule(self):
#         return self._schedule
# 
#     @schedule.setter
#     @BaseModel._model(ExclusionSchedule)
#     def schedule(self, schedule):
#         self._schedule = schedule
# 
# class ExclusionList(BaseModel):
#     def __init__(
#             self,
#             exclusions=None
#     ):
#         self._exclusions = None
#         self.exclusions = exclusions
# 
#     @property
#     def exclusions(self):
#         return self._exclusions
# 
#     @exclusions.setter
#     @BaseModel._model_list(Exclusion)
#     def exclusions(self, exclusions):
#         self._exclusions = exclusions


# Path: tests/integration/api/test_exclusions.py
import pytest
import os
from tenable_io.api.exclusions import ExclusionEditRequest
from tenable_io.api.models import Exclusion, ExclusionList





@pytest.mark.vcr()
def test_exclusions_create(new_exclusion):
    assert isinstance(new_exclusion, Exclusion), u'The `create` method did not return type `Exclusion`.'


@pytest.mark.vcr()
def test_exclusions_details(client, new_exclusion):
    exclusion = client.exclusions_api.details(new_exclusion.id)
    assert isinstance(exclusion, Exclusion), u'The `create` method did not return type `Exclusion`.'


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

@pytest.mark.vcr()
def test_exclusions_edit(client, new_exclusion):
    exclusion = new_exclusion
    edited_exclusion_name = 'test_exclusion_name_edited'
    edit_request = ExclusionEditRequest(
        edited_exclusion_name,
        exclusion.members
    )
    edited_exclusion = client.exclusions_api.edit(exclusion.id, edit_request)

    assert isinstance(edited_exclusion, Exclusion), u'The `edit` method did not return type `Exclusion`.'