Merge Code* type stub back to source (#2615)

Co-authored-by: Enrico Minack <github@enrico.minack.dev>
This commit is contained in:
Trim21
2023-07-18 16:37:39 +02:00
committed by GitHub
co-authored by Enrico Minack
parent 0779bf33c6
commit 80ae3f398b
11 changed files with 104 additions and 428 deletions
+10 -19
View File
@@ -22,15 +22,20 @@
from typing import Any, Dict
import github.GithubObject
from github.GithubObject import Attribute, NonCompletableGithubObject, NotSet
class CodeScanTool(github.GithubObject.NonCompletableGithubObject):
class CodeScanTool(NonCompletableGithubObject):
"""
This class represents code scanning tools.
The reference can be found here https://docs.github.com/en/rest/reference/code-scanning.
"""
def _initAttributes(self) -> None:
self._name: Attribute[str] = NotSet
self._version: Attribute[str] = NotSet
self._guid: Attribute[str] = NotSet
def __repr__(self) -> str:
return self.get__repr__(
{
@@ -41,31 +46,17 @@ class CodeScanTool(github.GithubObject.NonCompletableGithubObject):
)
@property
def name(self):
"""
:type: str
"""
def name(self) -> str:
return self._name.value
@property
def version(self):
"""
:type: str
"""
def version(self) -> str:
return self._version.value
@property
def guid(self):
"""
:type: str
"""
def guid(self) -> str:
return self._guid.value
def _initAttributes(self) -> None:
self._name = github.GithubObject.NotSet
self._version = github.GithubObject.NotSet
self._guid = github.GithubObject.NotSet
def _useAttributes(self, attributes: Dict[str, Any]) -> None:
if "name" in attributes: # pragma no branch
self._name = self._makeStringAttribute(attributes["name"])