# Path: tenable_io/exceptions.py
# class TenableIOException(Exception):
# 
#     def __init__(self, message=None, code=None):
#         self.code = code if code else TenableIOErrorCode.GENERIC
#         self.message = message if message else self.code.description
# 
#     def __str__(self):
#         return self.message
# 
# Path: tenable_io/util.py
# def payload_filter(payload, filter_):
#     if callable(filter_):
#         payload = {k: v for k, v in payload.items() if filter_(v, k)}
#     elif filter:
#         payload = {k: v for k, v in payload.items() if v is not None}
#     return payload


from json import loads
from tenable_io.exceptions import TenableIOException
from tenable_io.util import payload_filter



class BaseModel(object):

    @classmethod
    def from_json(cls, json):
        return cls.from_dict(loads(json))

    @classmethod
    def from_dict(cls, dict_):
        instance = cls()
        for key in dict_:

# Path: tenable_io/exceptions.py
# class TenableIOException(Exception):
# 
#     def __init__(self, message=None, code=None):
#         self.code = code if code else TenableIOErrorCode.GENERIC
#         self.message = message if message else self.code.description
# 
#     def __str__(self):
#         return self.message
# 
# Path: tenable_io/util.py
# def payload_filter(payload, filter_):
#     if callable(filter_):
#         payload = {k: v for k, v in payload.items() if filter_(v, k)}
#     elif filter:
#         payload = {k: v for k, v in payload.items() if v is not None}
#     return payload


# Path: tenable_io/api/models.py
from json import loads
from tenable_io.exceptions import TenableIOException
from tenable_io.util import payload_filter




class BaseModel(object):

    @classmethod
    def from_json(cls, json):
        return cls.from_dict(loads(json))

    @classmethod
    def from_dict(cls, dict_):
        instance = cls()
        for key in dict_:

            setattr(instance, key, dict_[key])