Merge Topic type stub back to source (#2661)

This commit is contained in:
Trim21
2023-08-18 09:23:42 +02:00
committed by GitHub
parent 2c8b596364
commit 42dcc024c4
2 changed files with 27 additions and 91 deletions
+27 -60
View File
@@ -19,110 +19,77 @@
# along with PyGithub. If not, see <http://www.gnu.org/licenses/>. #
# #
################################################################################
from datetime import datetime
from typing import Any, Dict
import github.GithubObject
from github.GithubObject import Attribute, NonCompletableGithubObject, NotSet
class Topic(github.GithubObject.NonCompletableGithubObject):
class Topic(NonCompletableGithubObject):
"""
This class represents topics as used by https://github.com/topics. The object reference can be found here https://docs.github.com/en/rest/reference/search#search-topics
"""
def _initAttributes(self) -> None:
self._name: Attribute[str] = NotSet
self._display_name: Attribute[str] = NotSet
self._short_description: Attribute[str] = NotSet
self._description: Attribute[str] = NotSet
self._created_by: Attribute[str] = NotSet
self._released: Attribute[str] = NotSet
self._created_at: Attribute[datetime] = NotSet
self._updated_at: Attribute[datetime] = NotSet
self._featured: Attribute[bool] = NotSet
self._curated: Attribute[bool] = NotSet
self._score: Attribute[float] = NotSet
def __repr__(self) -> str:
return self.get__repr__({"name": self._name.value})
@property
def name(self):
"""
:type: string
"""
def name(self) -> str:
return self._name.value
@property
def display_name(self):
"""
:type: string
"""
def display_name(self) -> str:
return self._display_name.value
@property
def short_description(self):
"""
:type: string
"""
def short_description(self) -> str:
return self._short_description.value
@property
def description(self):
"""
:type: string
"""
def description(self) -> str:
return self._description.value
@property
def created_by(self):
"""
:type: string
"""
def created_by(self) -> str:
return self._created_by.value
@property
def released(self):
"""
:type: string
"""
def released(self) -> str:
return self._released.value
@property
def created_at(self):
"""
:type: datetime.datetime
"""
def created_at(self) -> datetime:
return self._created_at.value
@property
def updated_at(self):
"""
:type: datetime.datetime
"""
def updated_at(self) -> datetime:
return self._updated_at.value
@property
def featured(self):
"""
:type: bool
"""
def featured(self) -> bool:
return self._featured.value
@property
def curated(self):
"""
:type: bool
"""
def curated(self) -> bool:
return self._curated.value
@property
def score(self):
"""
:type: float
"""
def score(self) -> float:
return self._score.value
def _initAttributes(self) -> None:
self._name = github.GithubObject.NotSet
self._display_name = github.GithubObject.NotSet
self._short_description = github.GithubObject.NotSet
self._description = github.GithubObject.NotSet
self._created_by = github.GithubObject.NotSet
self._released = github.GithubObject.NotSet
self._created_at = github.GithubObject.NotSet
self._updated_at = github.GithubObject.NotSet
self._featured = github.GithubObject.NotSet
self._curated = github.GithubObject.NotSet
self._score = github.GithubObject.NotSet
def _useAttributes(self, attributes: Dict[str, Any]) -> None:
if "name" in attributes: # pragma no branch
self._name = self._makeStringAttribute(attributes["name"])