'''Category========Methods described in this section relate to the category API.These methods can be accessed at ``TenableIE.category``... rst-class:: hide-signature.. autoclass:: CategoryAPI :members:'''fromtypingimportList,Dictfromtenable.ie.category.schemaimportCategorySchemafromtenable.base.endpointimportAPIEndpoint
[docs]deflist(self)->List[Dict]:''' Retrieves the list of categories in the instance. Returns: list: Returns a list of categories. Examples: >>> tie.category.list() '''returnself._schema.load(self._get(),many=True)
[docs]defdetails(self,category_id:str)->Dict:''' Retrieves the details of particlar category bases on category_id. Args: category_id (str): The category instance identifier. Returns: dict: Returns the details of a given ``category_id``. Examples: >>> tie.category.details(category_id='5') '''returnself._schema.load(self._get(f'{category_id}'))