from typing import Dict
from typing import Any
from typing import Tuple
from typing import Optional


def deconstruct_entry(ServiceNowCMDBContext: Dict[str, Any]) -> Tuple[str,
                                                                      Optional[str],
                                                                      Optional[str],
                                                                      Optional[str],
                                                                      Optional[str],
                                                                      Optional[str]]:
    """
    deconstruct_entry
    Extracts device relevant fields from a log entry.

    :type ServiceNowCMDBContext: ``Dict[str, Any]``
    :param ServiceNowCMDBContext: ServiceNowCMDB.Record

    :return: Tuple where the first element is the name or None, the second element is the
        sys class name or None, the third element is the sys_id or None, the fourth element is the
        asset display value or None, the fifth element is the asset link or None, and the final element
        is the asset value or None.
    :rtype: ``Tuple[Optional[str], Optional[str], Optional[str], Optional[int], Optional[str], Optional[str]]``
    """
    name = ServiceNowCMDBContext.get("Attributes", {}).get("name")
    sys_class_name = ServiceNowCMDBContext.get("Attributes", {}).get("sys_class_name")
    sys_id = ServiceNowCMDBContext.get("Attributes", {}).get("sys_id", "Unknown")
    asset_display_value = ServiceNowCMDBContext.get("Attributes", {}).get("asset", {}).get("display_value")
    asset_link = ServiceNowCMDBContext.get("Attributes", {}).get("asset", {}).get("link")
    asset_value = ServiceNowCMDBContext.get("Attributes", {}).get("asset", {}).get("value")

    return sys_id, name, sys_class_name, asset_display_value, asset_link, asset_value