CheckRunOutput.py
1 ############################ Copyrights and license ############################ 2 # # 3 # Copyright 2020 Dhruv Manilawala <dhruvmanila@gmail.com> # 4 # # 5 # This file is part of PyGithub. # 6 # http://pygithub.readthedocs.io/ # 7 # # 8 # PyGithub is free software: you can redistribute it and/or modify it under # 9 # the terms of the GNU Lesser General Public License as published by the Free # 10 # Software Foundation, either version 3 of the License, or (at your option) # 11 # any later version. # 12 # # 13 # PyGithub is distributed in the hope that it will be useful, but WITHOUT ANY # 14 # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS # 15 # FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more # 16 # details. # 17 # # 18 # You should have received a copy of the GNU Lesser General Public License # 19 # along with PyGithub. If not, see <http://www.gnu.org/licenses/>. # 20 # # 21 ################################################################################ 22 23 from typing import Any, Dict 24 25 from github.GithubObject import Attribute, NonCompletableGithubObject, NotSet 26 27 28 class CheckRunOutput(NonCompletableGithubObject): 29 """This class represents the output of check run.""" 30 31 def _initAttributes(self) -> None: 32 self._annotations_count: Attribute[int] = NotSet 33 self._annotations_url: Attribute[str] = NotSet 34 self._summary: Attribute[str] = NotSet 35 self._text: Attribute[str] = NotSet 36 self._title: Attribute[str] = NotSet 37 38 def __repr__(self) -> str: 39 return self.get__repr__({"title": self._title.value}) 40 41 @property 42 def annotations_count(self) -> int: 43 return self._annotations_count.value 44 45 @property 46 def annotations_url(self) -> str: 47 return self._annotations_url.value 48 49 @property 50 def summary(self) -> str: 51 return self._summary.value 52 53 @property 54 def text(self) -> str: 55 return self._text.value 56 57 @property 58 def title(self) -> str: 59 return self._title.value 60 61 def _useAttributes(self, attributes: Dict[str, Any]) -> None: 62 if "annotations_count" in attributes: # pragma no branch 63 self._annotations_count = self._makeIntAttribute(attributes["annotations_count"]) 64 if "annotations_url" in attributes: # pragma no branch 65 self._annotations_url = self._makeStringAttribute(attributes["annotations_url"]) 66 if "summary" in attributes: # pragma no branch 67 self._summary = self._makeStringAttribute(attributes["summary"]) 68 if "text" in attributes: # pragma no branch 69 self._text = self._makeStringAttribute(attributes["text"]) 70 if "title" in attributes: # pragma no branch 71 self._title = self._makeStringAttribute(attributes["title"])