diff --git a/github/GistHistoryState.py b/github/GistHistoryState.py index 3b16168d..976d8f34 100644 --- a/github/GistHistoryState.py +++ b/github/GistHistoryState.py @@ -26,212 +26,153 @@ # along with PyGithub. If not, see . # # # ################################################################################ +from __future__ import annotations -from typing import Any, Dict +from datetime import datetime +from typing import Any import github.CommitStats import github.Gist import github.GithubObject import github.NamedUser +from github.GistFile import GistFile +from github.GithubObject import Attribute, CompletableGithubObject, NotSet -class GistHistoryState(github.GithubObject.CompletableGithubObject): +class GistHistoryState(CompletableGithubObject): """ This class represents GistHistoryStates """ + def _initAttributes(self) -> None: + self._change_status: Attribute[github.CommitStats.CommitStats] = NotSet + self._comments: Attribute[int] = NotSet + self._comments_url: Attribute[str] = NotSet + self._commits_url: Attribute[str] = NotSet + self._committed_at: Attribute[datetime] = NotSet + self._created_at: Attribute[datetime] = NotSet + self._description: Attribute[str] = NotSet + self._files: Attribute[dict[str, GistFile]] = NotSet + self._forks: Attribute[list[github.Gist.Gist]] = NotSet + self._forks_url: Attribute[str] = NotSet + self._git_pull_url: Attribute[str] = NotSet + self._git_push_url: Attribute[str] = NotSet + self._history: Attribute[list[GistHistoryState]] = NotSet + self._html_url: Attribute[str] = NotSet + self._id: Attribute[str] = NotSet + self._owner: Attribute[github.NamedUser.NamedUser] = NotSet + self._public: Attribute[bool] = NotSet + self._updated_at: Attribute[datetime] = NotSet + self._url: Attribute[str] = NotSet + self._user: Attribute[github.NamedUser.NamedUser] = NotSet + self._version: Attribute[str] = NotSet + @property - def change_status(self): - """ - :type: :class:`github.CommitStats.CommitStats` - """ + def change_status(self) -> github.CommitStats.CommitStats: self._completeIfNotSet(self._change_status) return self._change_status.value @property - def comments(self): - """ - :type: integer - """ + def comments(self) -> int: self._completeIfNotSet(self._comments) return self._comments.value @property - def comments_url(self): - """ - :type: string - """ + def comments_url(self) -> str: self._completeIfNotSet(self._comments_url) return self._comments_url.value @property - def commits_url(self): - """ - :type: string - """ + def commits_url(self) -> str: self._completeIfNotSet(self._commits_url) return self._commits_url.value @property - def committed_at(self): - """ - :type: datetime.datetime - """ + def committed_at(self) -> datetime: self._completeIfNotSet(self._committed_at) return self._committed_at.value @property - def created_at(self): - """ - :type: datetime.datetime - """ + def created_at(self) -> datetime: self._completeIfNotSet(self._created_at) return self._created_at.value @property - def description(self): - """ - :type: string - """ + def description(self) -> str: self._completeIfNotSet(self._description) return self._description.value @property - def files(self): - """ - :type: dict of string to :class:`github.GistFile.GistFile` - """ + def files(self) -> dict[str, GistFile]: self._completeIfNotSet(self._files) return self._files.value @property - def forks(self): - """ - :type: list of :class:`github.Gist.Gist` - """ + def forks(self) -> list[github.Gist.Gist]: self._completeIfNotSet(self._forks) return self._forks.value @property - def forks_url(self): - """ - :type: string - """ + def forks_url(self) -> str: self._completeIfNotSet(self._forks_url) return self._forks_url.value @property - def git_pull_url(self): - """ - :type: string - """ + def git_pull_url(self) -> str: self._completeIfNotSet(self._git_pull_url) return self._git_pull_url.value @property - def git_push_url(self): - """ - :type: string - """ + def git_push_url(self) -> str: self._completeIfNotSet(self._git_push_url) return self._git_push_url.value @property - def history(self): - """ - :type: list of :class:`GistHistoryState` - """ + def history(self) -> list[GistHistoryState]: self._completeIfNotSet(self._history) return self._history.value @property - def html_url(self): - """ - :type: string - """ + def html_url(self) -> str: self._completeIfNotSet(self._html_url) return self._html_url.value @property - def id(self): - """ - :type: string - """ + def id(self) -> str: self._completeIfNotSet(self._id) return self._id.value @property - def owner(self): - """ - :type: :class:`github.NamedUser.NamedUser` - """ + def owner(self) -> github.NamedUser.NamedUser: self._completeIfNotSet(self._owner) return self._owner.value @property - def public(self): - """ - :type: bool - """ + def public(self) -> bool: self._completeIfNotSet(self._public) return self._public.value @property - def updated_at(self): - """ - :type: datetime.datetime - """ + def updated_at(self) -> datetime: self._completeIfNotSet(self._updated_at) return self._updated_at.value @property - def url(self): - """ - :type: string - """ + def url(self) -> str: self._completeIfNotSet(self._url) return self._url.value @property - def user(self): - """ - :type: :class:`github.NamedUser.NamedUser` - """ + def user(self) -> github.NamedUser.NamedUser: self._completeIfNotSet(self._user) return self._user.value @property - def version(self): - """ - :type: string - """ + def version(self) -> str: self._completeIfNotSet(self._version) return self._version.value - def _initAttributes(self) -> None: - self._change_status = github.GithubObject.NotSet - self._comments = github.GithubObject.NotSet - self._comments_url = github.GithubObject.NotSet - self._commits_url = github.GithubObject.NotSet - self._committed_at = github.GithubObject.NotSet - self._created_at = github.GithubObject.NotSet - self._description = github.GithubObject.NotSet - self._files = github.GithubObject.NotSet - self._forks = github.GithubObject.NotSet - self._forks_url = github.GithubObject.NotSet - self._git_pull_url = github.GithubObject.NotSet - self._git_push_url = github.GithubObject.NotSet - self._history = github.GithubObject.NotSet - self._html_url = github.GithubObject.NotSet - self._id = github.GithubObject.NotSet - self._owner = github.GithubObject.NotSet - self._public = github.GithubObject.NotSet - self._updated_at = github.GithubObject.NotSet - self._url = github.GithubObject.NotSet - self._user = github.GithubObject.NotSet - self._version = github.GithubObject.NotSet - - def _useAttributes(self, attributes: Dict[str, Any]) -> None: + def _useAttributes(self, attributes: dict[str, Any]) -> None: if "change_status" in attributes: # pragma no branch self._change_status = self._makeClassAttribute(github.CommitStats.CommitStats, attributes["change_status"]) if "comments" in attributes: # pragma no branch diff --git a/github/GistHistoryState.pyi b/github/GistHistoryState.pyi deleted file mode 100644 index cdae6623..00000000 --- a/github/GistHistoryState.pyi +++ /dev/null @@ -1,54 +0,0 @@ -from datetime import datetime -from typing import Any, Dict, List, Optional - -from github.CommitStats import CommitStats -from github.Gist import Gist -from github.GistFile import GistFile -from github.GithubObject import CompletableGithubObject -from github.NamedUser import NamedUser - -class GistHistoryState(CompletableGithubObject): - def _initAttributes(self) -> None: ... - def _useAttributes(self, attributes: Dict[str, Any]) -> None: ... - @property - def change_status(self) -> CommitStats: ... - @property - def comments(self) -> int: ... - @property - def comments_url(self) -> str: ... - @property - def commits_url(self) -> str: ... - @property - def committed_at(self) -> datetime: ... - @property - def created_at(self) -> datetime: ... - @property - def description(self) -> str: ... - @property - def files(self) -> Dict[str, GistFile]: ... - @property - def forks(self) -> List[Gist]: ... - @property - def forks_url(self) -> str: ... - @property - def git_pull_url(self) -> str: ... - @property - def git_push_url(self) -> str: ... - @property - def history(self) -> List[GistHistoryState]: ... - @property - def html_url(self) -> str: ... - @property - def id(self) -> str: ... - @property - def owner(self) -> NamedUser: ... - @property - def public(self) -> bool: ... - @property - def updated_at(self) -> datetime: ... - @property - def url(self) -> str: ... - @property - def user(self) -> Optional[NamedUser]: ... - @property - def version(self) -> str: ...