from typing import Optional
from pydantic import BaseModel


class VulnerabilityAttributes(BaseModel):
    """
        Represents the details of a vulnerability description. For more information, see the CVE program's Key Phrasing
        Details: https://www.cve.org/Resources/General/Key-Details-Phrasing.pdf
    """
    weakness: Optional[str] = None
    configuration: Optional[str] = None
    component: Optional[str] = None
    attacker: Optional[str] = None
    vector: Optional[str] = None
    impact: Optional[str] = None

    def any(self) -> bool:
        return any([self.weakness, self.configuration, self.attacker, self.vector, self.impact, self.component])
