Module aiogithubapi.models.git_tree

GitHub git data class.

Expand source code
"""GitHub git data class."""
from __future__ import annotations

from typing import Any, Dict

from .base import GitHubDataModelBase


class GitHubGitTreeEntryModel(GitHubDataModelBase):
    """GitHub git tree entry model."""

    mode: str | None = None
    path: str | None = None
    sha: str | None = None
    size: int | None = None
    type: str | None = None
    url: str | None = None


class GitHubGitTreeModel(GitHubDataModelBase):
    """GitHub git data class."""

    sha: str | None = None
    tree: list[GitHubGitTreeEntryModel] | None = None
    truncated: bool | None = None
    url: str | None = None

    def _generate_tree(self, data: list[Dict[str, Any]]) -> list:
        """Generate tree entries."""
        return [GitHubGitTreeEntryModel(entry) for entry in data or []]

Classes

class GitHubGitTreeEntryModel (data: Dict[str, Any])

GitHub git tree entry model.

Init.

Expand source code
class GitHubGitTreeEntryModel(GitHubDataModelBase):
    """GitHub git tree entry model."""

    mode: str | None = None
    path: str | None = None
    sha: str | None = None
    size: int | None = None
    type: str | None = None
    url: str | None = None

Ancestors

Class variables

var mode : str | None
var path : str | None
var sha : str | None
var size : int | None
var type : str | None
var url : str | None

Inherited members

class GitHubGitTreeModel (data: Dict[str, Any])

GitHub git data class.

Init.

Expand source code
class GitHubGitTreeModel(GitHubDataModelBase):
    """GitHub git data class."""

    sha: str | None = None
    tree: list[GitHubGitTreeEntryModel] | None = None
    truncated: bool | None = None
    url: str | None = None

    def _generate_tree(self, data: list[Dict[str, Any]]) -> list:
        """Generate tree entries."""
        return [GitHubGitTreeEntryModel(entry) for entry in data or []]

Ancestors

Class variables

var sha : str | None
var tree : list[GitHubGitTreeEntryModel] | None
var truncated : bool | None
var url : str | None

Inherited members