mirror of
https://github.com/status-im/PyGithub.git
synced 2026-09-01 11:21:16 +00:00
Merge Code* type stub back to source (#2615)
Co-authored-by: Enrico Minack <github@enrico.minack.dev>
This commit is contained in:
@@ -19,19 +19,25 @@
|
||||
# along with PyGithub. If not, see <http://www.gnu.org/licenses/>. #
|
||||
# #
|
||||
################################################################################
|
||||
|
||||
from typing import Any, Dict
|
||||
|
||||
import github.GithubObject
|
||||
from github.GithubObject import Attribute, NonCompletableGithubObject, NotSet
|
||||
|
||||
|
||||
class CodeScanAlertInstanceLocation(github.GithubObject.NonCompletableGithubObject):
|
||||
class CodeScanAlertInstanceLocation(NonCompletableGithubObject):
|
||||
"""
|
||||
This class represents code scanning alert instance locations.
|
||||
The reference can be found here https://docs.github.com/en/rest/reference/code-scanning.
|
||||
"""
|
||||
|
||||
def __str__(self):
|
||||
def _initAttributes(self) -> None:
|
||||
self._path: Attribute[str] = NotSet
|
||||
self._start_line: Attribute[int] = NotSet
|
||||
self._start_column: Attribute[int] = NotSet
|
||||
self._end_line: Attribute[int] = NotSet
|
||||
self._end_column: Attribute[int] = NotSet
|
||||
|
||||
def __str__(self) -> str:
|
||||
return f"{self.path} @ l{self.start_line}:c{self.start_column}-l{self.end_line}:c{self.end_column}"
|
||||
|
||||
def __repr__(self) -> str:
|
||||
@@ -46,47 +52,25 @@ class CodeScanAlertInstanceLocation(github.GithubObject.NonCompletableGithubObje
|
||||
)
|
||||
|
||||
@property
|
||||
def path(self):
|
||||
"""
|
||||
:type: str
|
||||
"""
|
||||
def path(self) -> str:
|
||||
return self._path.value
|
||||
|
||||
@property
|
||||
def start_line(self):
|
||||
"""
|
||||
:type: int
|
||||
"""
|
||||
def start_line(self) -> int:
|
||||
return self._start_line.value
|
||||
|
||||
@property
|
||||
def start_column(self):
|
||||
"""
|
||||
:type: int
|
||||
"""
|
||||
def start_column(self) -> int:
|
||||
return self._start_column.value
|
||||
|
||||
@property
|
||||
def end_line(self):
|
||||
"""
|
||||
:type: int
|
||||
"""
|
||||
def end_line(self) -> int:
|
||||
return self._end_line.value
|
||||
|
||||
@property
|
||||
def end_column(self):
|
||||
"""
|
||||
:type: int
|
||||
"""
|
||||
def end_column(self) -> int:
|
||||
return self._end_column.value
|
||||
|
||||
def _initAttributes(self) -> None:
|
||||
self._path = github.GithubObject.NotSet
|
||||
self._start_line = github.GithubObject.NotSet
|
||||
self._start_column = github.GithubObject.NotSet
|
||||
self._end_line = github.GithubObject.NotSet
|
||||
self._end_column = github.GithubObject.NotSet
|
||||
|
||||
def _useAttributes(self, attributes: Dict[str, Any]) -> None:
|
||||
if "path" in attributes: # pragma no branch
|
||||
self._path = self._makeStringAttribute(attributes["path"])
|
||||
|
||||
Reference in New Issue
Block a user