from typing import Union
from typing import Tuple
from typing import List


def increase_version_number(version_buffer: Union[Tuple[int, int, int], List[int]], semantic_version: str = "patch") \
        -> List[int]:
    """
    Increases the number of the version based on the 'release_type' value in the release_type.yaml

    Args:
        version_buffer: (Union[Tuple[int, int, int], List[int]]) the version to be increased
        semantic_version: (str) the semantic version/release type e.g. patch, minor, major, defaults to patch
                            if not recognised

    Returns: (List[int]) the updated version
    """
    first: int = version_buffer[0]
    second: int = version_buffer[1]
    third: int = version_buffer[2]

    if semantic_version == "patch":
        third += 1
    elif semantic_version == "minor":
        second += 1
        third = 0
    elif semantic_version == "major":
        first += 1
        second = 0
        third = 0
    else:
        third += 1

    return [first, second, third]