from .entity import IntelEntityAPI
from .routing import Router
from .. import urls


class VulnerabilityAPI(IntelEntityAPI):
    """https://private.intel.amp.cisco.com/index.html#/Vulnerability"""

    __router, route = Router.new()

    def __init__(self, request):
        super(VulnerabilityAPI, self).__init__(request, '/ctia/vulnerability')

    @route('cpe_match_strings')
    def _perform(self, **kwargs):
        return self._get(
            urls.join(self._url, 'cpe_match_strings'),
            **kwargs
        )
