from typing import List


def _add_docstring_to_top_level_class_method(
        line: str, docstring: str) -> str:
    """
    Add docstring to the line string of top-level class's method.

    Parameters
    ----------
    line : str
        Target class's method line string.
        e.g., `    def sample_method(self) -> None:`
    docstring : str
        A doctring to add.

    Returns
    -------
    line : str
        Docstring added line str.
    """
    eight_tabs: str = '        '
    line += f'\n{eight_tabs}"""'
    docstring_lines: List[str] = docstring.splitlines()
    for docstring_line in docstring_lines:
        if docstring_line == '':
            line += '\n'
            continue
        if not docstring_line.startswith(eight_tabs):
            docstring_line = f'{eight_tabs}{docstring_line}'
        line += f'\n{docstring_line}'
    line = line.rstrip()
    line += f'\n{eight_tabs}"""'
    return line