from dataclasses import dataclass, field
from datetime import datetime
from typing import List

from py_mdr.ocsf_models.objects.analytic import Analytic
from py_mdr.ocsf_models.objects.base_model import BaseModel
from py_mdr.ocsf_models.objects.kill_chain_phase import KillChainPhase
from py_mdr.ocsf_models.objects.mitre_attack import MITREAttack


@dataclass
class FindingInformation(BaseModel):
    """
    The Finding Information object describes metadata related to a security finding generated by a security tool or system.

    TODO: Document types
    """

    analytic: Analytic = field(default_factory=Analytic)
    created_time: datetime = None
    data_sources: str = None
    desc: str = None
    first_seen_time: datetime = None
    kill_chain: List[KillChainPhase] = field(default_factory=list)
    last_seen_time: datetime = None
    attacks: List[MITREAttack] = field(default_factory=list)
    modified_time: datetime = None
    product_uid: str = None
    related_analytics: List[Analytic] = field(default_factory=list)
    src_url: str = None
    title: str = None
    types: List[str] = field(default_factory=list)
    uid: str = None
