# This file was auto-generated by Fern from our API Definition.

from ...common.types.common_properties import CommonProperties
import typing
import pydantic
from ...open_vocab.types.malware_type_ov import MalwareTypeOv
from ...common.types.kill_chain_phase import KillChainPhase
import datetime as dt
from ...common.types.software import Software
from ...open_vocab.types.processor_architecture_ov import ProcessorArchitectureOv
from ...open_vocab.types.implementation_language_ov import ImplementationLanguageOv
from ...open_vocab.types.malware_capabilities_ov import MalwareCapabilitiesOv
from ....core.pydantic_utilities import IS_PYDANTIC_V2


class Malware(CommonProperties):
    type: typing.Literal["malware"] = "malware"
    description: typing.Optional[str] = pydantic.Field(default=None)
    """
    A description that provides more details and context about the Malware, potentially including its purpose and its key characteristics.
    """

    malware_types: typing.Optional[typing.List[MalwareTypeOv]] = pydantic.Field(
        default=None
    )
    """
    A set of categorizations for this malware.
    """

    is_family: bool = pydantic.Field()
    """
    Whether the object represents a malware family (if true) or a malware instance (if false).
    """

    aliases: typing.Optional[typing.List[str]] = pydantic.Field(default=None)
    """
    Alternative names used to identify this malware or malware family.
    """

    kill_chain_phases: typing.Optional[typing.List[KillChainPhase]] = None
    first_seen: typing.Optional[dt.datetime] = None
    last_seen: typing.Optional[dt.datetime] = None
    operating_system_refs: typing.Optional[typing.List[Software]] = pydantic.Field(
        default=None
    )
    """
    The operating systems that the malware family or malware instance is executable on. This applies to virtualized operating systems as well as those running on bare metal.
    """

    architecture_execution_envs: typing.Optional[
        typing.List[ProcessorArchitectureOv]
    ] = None
    implementation_languages: typing.Optional[typing.List[ImplementationLanguageOv]] = (
        None
    )
    capabilities: typing.Optional[typing.List[MalwareCapabilitiesOv]] = None

    if IS_PYDANTIC_V2:
        model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(
            extra="allow"
        )  # type: ignore # Pydantic v2
    else:

        class Config:
            smart_union = True
            extra = pydantic.Extra.allow
