From 4d0e30e77f3eaeed9a7b5d7c595cc350f36ead67 Mon Sep 17 00:00:00 2001 From: Trim21 Date: Wed, 30 Aug 2023 18:21:16 +0800 Subject: [PATCH] Merge `DeploymentStatus` type stub back to source (#2665) --- github/DeploymentStatus.py | 106 ++++++++++++------------------------ github/DeploymentStatus.pyi | 36 ------------ 2 files changed, 35 insertions(+), 107 deletions(-) delete mode 100644 github/DeploymentStatus.pyi diff --git a/github/DeploymentStatus.py b/github/DeploymentStatus.py index c36065c0..528d00ee 100644 --- a/github/DeploymentStatus.py +++ b/github/DeploymentStatus.py @@ -20,140 +20,104 @@ # 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.GithubObject +import github.NamedUser +from github.GithubObject import Attribute, CompletableGithubObject, NotSet -class DeploymentStatus(github.GithubObject.CompletableGithubObject): +class DeploymentStatus(CompletableGithubObject): """ This class represents Deployment Statuses. The reference can be found here https://docs.github.com/en/rest/reference/repos#deployments """ + def _initAttributes(self) -> None: + self._created_at: Attribute[datetime] = NotSet + self._creator: Attribute[github.NamedUser.NamedUser] = NotSet + self._deployment_url: Attribute[str] = NotSet + self._description: Attribute[str] = NotSet + self._environment: Attribute[str] = NotSet + self._environment_url: Attribute[str] = NotSet + self._repository_url: Attribute[str] = NotSet + self._state: Attribute[str] = NotSet + self._target_url: Attribute[str] = NotSet + self._updated_at: Attribute[datetime] = NotSet + self._url: Attribute[str] = NotSet + self._id: Attribute[int] = NotSet + self._node_id: Attribute[str] = NotSet + def __repr__(self) -> str: return self.get__repr__({"id": self._id.value, "url": self._url.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 creator(self): - """ - :type: :class:`github.NamedUser.NamedUser` - """ + def creator(self) -> github.NamedUser.NamedUser: self._completeIfNotSet(self._creator) return self._creator.value @property - def deployment_url(self): - """ - :type: string - """ + def deployment_url(self) -> str: self._completeIfNotSet(self._deployment_url) return self._deployment_url.value @property - def description(self): - """ - :type: string - """ + def description(self) -> str: self._completeIfNotSet(self._description) return self._description.value @property - def environment(self): - """ - :type: string - """ + def environment(self) -> str: self._completeIfNotSet(self._environment) return self._environment.value @property - def environment_url(self): - """ - :type: string - """ + def environment_url(self) -> str: self._completeIfNotSet(self._environment_url) return self._environment_url.value @property - def repository_url(self): - """ - :type: string - """ + def repository_url(self) -> str: self._completeIfNotSet(self._repository_url) return self._repository_url.value @property - def state(self): - """ - :type: string - """ + def state(self) -> str: self._completeIfNotSet(self._state) return self._state.value @property - def target_url(self): - """ - :type: string - """ + def target_url(self) -> str: self._completeIfNotSet(self._target_url) return self._target_url.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 id(self): - """ - :type: int - """ + def id(self) -> int: self._completeIfNotSet(self._id) return self._id.value @property - def node_id(self): - """ - :type: string - """ + def node_id(self) -> str: self._completeIfNotSet(self._node_id) return self._node_id.value - def _initAttributes(self) -> None: - self._created_at = github.GithubObject.NotSet - self._creator = github.GithubObject.NotSet - self._deployment_url = github.GithubObject.NotSet - self._description = github.GithubObject.NotSet - self._environment = github.GithubObject.NotSet - self._environment_url = github.GithubObject.NotSet - self._repository_url = github.GithubObject.NotSet - self._state = github.GithubObject.NotSet - self._target_url = github.GithubObject.NotSet - self._updated_at = github.GithubObject.NotSet - self._url = github.GithubObject.NotSet - self._id = github.GithubObject.NotSet - self._node_id = github.GithubObject.NotSet - - def _useAttributes(self, attributes: Dict[str, Any]) -> None: + def _useAttributes(self, attributes: dict[str, Any]) -> None: if "environment_url" in attributes: # pragma no branch self._environment_url = self._makeStringAttribute(attributes["environment_url"]) if "url" in attributes: # pragma no branch diff --git a/github/DeploymentStatus.pyi b/github/DeploymentStatus.pyi deleted file mode 100644 index 98736eac..00000000 --- a/github/DeploymentStatus.pyi +++ /dev/null @@ -1,36 +0,0 @@ -from datetime import datetime -from typing import Any, Dict - -from github.GithubObject import CompletableGithubObject -from github.NamedUser import NamedUser - -class DeploymentStatus(CompletableGithubObject): - def __repr__(self) -> str: ... - def _initAttributes(self) -> None: ... - def _useAttributes(self, attributes: Dict[str, Any]) -> None: ... - @property - def created_at(self) -> datetime: ... - @property - def creator(self) -> NamedUser: ... - @property - def deployment_url(self) -> str: ... - @property - def description(self) -> str: ... - @property - def environment(self) -> str: ... - @property - def environment_url(self) -> str: ... - @property - def repository_url(self) -> str: ... - @property - def state(self) -> str: ... - @property - def target_url(self) -> str: ... - @property - def updated_at(self) -> datetime: ... - @property - def url(self) -> str: ... - @property - def id(self) -> int: ... - @property - def node_id(self) -> str: ...