|
| 1 | +############################ Copyrights and license ############################ |
| 2 | +# # |
| 3 | +# # |
| 4 | +# This file is part of PyGithub. # |
| 5 | +# http://pygithub.readthedocs.io/ # |
| 6 | +# # |
| 7 | +# PyGithub is free software: you can redistribute it and/or modify it under # |
| 8 | +# the terms of the GNU Lesser General Public License as published by the Free # |
| 9 | +# Software Foundation, either version 3 of the License, or (at your option) # |
| 10 | +# any later version. # |
| 11 | +# # |
| 12 | +# PyGithub is distributed in the hope that it will be useful, but WITHOUT ANY # |
| 13 | +# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS # |
| 14 | +# FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more # |
| 15 | +# details. # |
| 16 | +# # |
| 17 | +# You should have received a copy of the GNU Lesser General Public License # |
| 18 | +# along with PyGithub. If not, see <http://www.gnu.org/licenses/>. # |
| 19 | +# # |
| 20 | +################################################################################ |
| 21 | + |
| 22 | +from __future__ import annotations |
| 23 | + |
| 24 | +from typing import TYPE_CHECKING, Any |
| 25 | + |
| 26 | +import github.Repository |
| 27 | +from github.GithubObject import Attribute, NonCompletableGithubObject, NotSet |
| 28 | + |
| 29 | +if TYPE_CHECKING: |
| 30 | + from github.Repository import Repository |
| 31 | + |
| 32 | + |
| 33 | +class CodeSecurityConfigRepository(NonCompletableGithubObject): |
| 34 | + """ |
| 35 | + This class represents CodeSecurityConfigRepository. |
| 36 | +
|
| 37 | + The reference can be found here |
| 38 | + https://docs.github.com/en/rest/code-security/configurations |
| 39 | +
|
| 40 | + The OpenAPI schema can be found at |
| 41 | + - /components/schemas/code-security-configuration-repositories |
| 42 | +
|
| 43 | + """ |
| 44 | + |
| 45 | + def _initAttributes(self) -> None: |
| 46 | + self._repository: Attribute[Repository] = NotSet |
| 47 | + self._status: Attribute[str] = NotSet |
| 48 | + |
| 49 | + def __repr__(self) -> str: |
| 50 | + return self.repository.__repr__() |
| 51 | + |
| 52 | + @property |
| 53 | + def repository(self) -> Repository: |
| 54 | + return self._repository.value |
| 55 | + |
| 56 | + @property |
| 57 | + def status(self) -> str: |
| 58 | + return self._status.value |
| 59 | + |
| 60 | + def _useAttributes(self, attributes: dict[str, Any]) -> None: |
| 61 | + if "repository" in attributes: # pragma no branch |
| 62 | + self._repository = self._makeClassAttribute(github.Repository.Repository, attributes["repository"]) |
| 63 | + if "status" in attributes: # pragma no branch |
| 64 | + self._status = self._makeStringAttribute(attributes["status"]) |
0 commit comments