from typing import Optional
from typing import List


def parse_lsblk(lsblk_output) -> Optional[List]:
    """Parse output of lsblk command with name, size, and ssd status of attached disks.
    @param lsblk_output: text output of lsblk command

    @return: python data structure: array of dictionaries with keys NAME, SIZE, ROTA
    """
    lines = lsblk_output.splitlines()
    result = []

    if len(lines) < 1:
        return None

    if lines[0].split() != ["NAME", "SIZE", "ROTA"]:
        return None

    for line in lines[1:]:
        fields = line.split()
        result.append({"NAME": fields[0], "SIZE": fields[1],
                       "SSD": "True" if fields[2] == "0" else "False"})

    return result