@classmethod
def from_json(cls, value) -> '_GithubTree':
    'Parses a GithubTree from the given JSON.'
    if ((not isinstance(value, dict)) or ('tree' not in value)):
        raise ValueError(f'Github API response not supported: {value}')
    files_per_folder: MutableMapping[(str, Set[str])] = {}
    for element in value['tree']:
        github_element = _GithubElement.from_path(path=pathlib.PurePosixPath(element['path']), is_folder=(element['type'] == 'tree'))
        if (element['type'] in {'blob', 'tree'}):
            files_per_folder.setdefault(github_element.parent_folder, set())
            files_per_folder[github_element.parent_folder].add(github_element)
    return _GithubTree(files_per_folder=files_per_folder)
Parses a GithubTree from the given JSON.
@classmethod
def from_json(cls, value) -> '_GithubTree':
    
    if ((not isinstance(value, dict)) or ('tree' not in value)):
        raise ValueError(f'Github API response not supported: {value}')
    files_per_folder: MutableMapping[(str, Set[str])] = {}
    for element in value['tree']:
        github_element = _GithubElement.from_path(path=pathlib.PurePosixPath(element['path']), is_folder=(element['type'] == 'tree'))
        if (element['type'] in {'blob', 'tree'}):
            files_per_folder.setdefault(github_element.parent_folder, set())
            files_per_folder[github_element.parent_folder].add(github_element)
    return _GithubTree(files_per_folder=files_per_folder)