PyGithub-asyncio 3.0.0b1__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (188) hide show
  1. githubasyncio/AccessToken.py +159 -0
  2. githubasyncio/AdvisoryBase.py +163 -0
  3. githubasyncio/AdvisoryCredit.py +131 -0
  4. githubasyncio/AdvisoryCreditDetailed.py +110 -0
  5. githubasyncio/AdvisoryVulnerability.py +191 -0
  6. githubasyncio/AdvisoryVulnerabilityPackage.py +93 -0
  7. githubasyncio/AppAuthentication.py +58 -0
  8. githubasyncio/ApplicationOAuth.py +200 -0
  9. githubasyncio/Artifact.py +183 -0
  10. githubasyncio/Auth.py +560 -0
  11. githubasyncio/AuthenticatedUser.py +1251 -0
  12. githubasyncio/Authorization.py +192 -0
  13. githubasyncio/AuthorizationApplication.py +73 -0
  14. githubasyncio/Autolink.py +104 -0
  15. githubasyncio/Branch.py +689 -0
  16. githubasyncio/BranchProtection.py +224 -0
  17. githubasyncio/CVSS.py +83 -0
  18. githubasyncio/CWE.py +75 -0
  19. githubasyncio/CheckRun.py +315 -0
  20. githubasyncio/CheckRunAnnotation.py +134 -0
  21. githubasyncio/CheckRunOutput.py +108 -0
  22. githubasyncio/CheckSuite.py +319 -0
  23. githubasyncio/Clones.py +97 -0
  24. githubasyncio/CodeScanAlert.py +215 -0
  25. githubasyncio/CodeScanAlertInstance.py +134 -0
  26. githubasyncio/CodeScanAlertInstanceLocation.py +102 -0
  27. githubasyncio/CodeScanRule.py +134 -0
  28. githubasyncio/CodeScanTool.py +94 -0
  29. githubasyncio/CodeSecurityConfig.py +301 -0
  30. githubasyncio/CodeSecurityConfigRepository.py +70 -0
  31. githubasyncio/Commit.py +442 -0
  32. githubasyncio/CommitCombinedStatus.py +126 -0
  33. githubasyncio/CommitComment.py +270 -0
  34. githubasyncio/CommitStats.py +78 -0
  35. githubasyncio/CommitStatus.py +169 -0
  36. githubasyncio/Comparison.py +219 -0
  37. githubasyncio/Consts.py +197 -0
  38. githubasyncio/ContentFile.py +304 -0
  39. githubasyncio/Copilot.py +97 -0
  40. githubasyncio/CopilotSeat.py +132 -0
  41. githubasyncio/DefaultCodeSecurityConfig.py +93 -0
  42. githubasyncio/DependabotAlert.py +184 -0
  43. githubasyncio/DependabotAlertAdvisory.py +82 -0
  44. githubasyncio/DependabotAlertDependency.py +100 -0
  45. githubasyncio/DependabotAlertVulnerability.py +85 -0
  46. githubasyncio/Deployment.py +314 -0
  47. githubasyncio/DeploymentBranchPolicy.py +102 -0
  48. githubasyncio/DeploymentStatus.py +201 -0
  49. githubasyncio/DiscussionBase.py +140 -0
  50. githubasyncio/DiscussionCommentBase.py +140 -0
  51. githubasyncio/Download.py +256 -0
  52. githubasyncio/Enterprise.py +175 -0
  53. githubasyncio/EnterpriseConsumedLicenses.py +138 -0
  54. githubasyncio/Environment.py +354 -0
  55. githubasyncio/EnvironmentDeploymentBranchPolicy.py +87 -0
  56. githubasyncio/EnvironmentProtectionRule.py +117 -0
  57. githubasyncio/EnvironmentProtectionRuleReviewer.py +110 -0
  58. githubasyncio/Event.py +134 -0
  59. githubasyncio/File.py +142 -0
  60. githubasyncio/GeneratedReleaseNotes.py +68 -0
  61. githubasyncio/Gist.py +373 -0
  62. githubasyncio/GistComment.py +162 -0
  63. githubasyncio/GistFile.py +106 -0
  64. githubasyncio/GistHistoryState.py +245 -0
  65. githubasyncio/GitAuthor.py +94 -0
  66. githubasyncio/GitBlob.py +123 -0
  67. githubasyncio/GitCommit.py +208 -0
  68. githubasyncio/GitCommitVerification.py +103 -0
  69. githubasyncio/GitObject.py +84 -0
  70. githubasyncio/GitRef.py +122 -0
  71. githubasyncio/GitRelease.py +476 -0
  72. githubasyncio/GitReleaseAsset.py +232 -0
  73. githubasyncio/GitTag.py +143 -0
  74. githubasyncio/GitTree.py +113 -0
  75. githubasyncio/GitTreeElement.py +104 -0
  76. githubasyncio/GithubApp.py +236 -0
  77. githubasyncio/GithubException.py +226 -0
  78. githubasyncio/GithubIntegration.py +365 -0
  79. githubasyncio/GithubObject.py +910 -0
  80. githubasyncio/GithubRetry.py +253 -0
  81. githubasyncio/GitignoreTemplate.py +88 -0
  82. githubasyncio/GlobalAdvisory.py +141 -0
  83. githubasyncio/Hook.py +238 -0
  84. githubasyncio/HookDelivery.py +243 -0
  85. githubasyncio/HookDescription.py +85 -0
  86. githubasyncio/HookResponse.py +83 -0
  87. githubasyncio/InputFileContent.py +63 -0
  88. githubasyncio/InputGitAuthor.py +71 -0
  89. githubasyncio/InputGitTreeElement.py +79 -0
  90. githubasyncio/Installation.py +298 -0
  91. githubasyncio/InstallationAuthorization.py +138 -0
  92. githubasyncio/Invitation.py +171 -0
  93. githubasyncio/Issue.py +955 -0
  94. githubasyncio/IssueComment.py +309 -0
  95. githubasyncio/IssueDependenciesSummary.py +77 -0
  96. githubasyncio/IssueEvent.py +296 -0
  97. githubasyncio/IssuePullRequest.py +97 -0
  98. githubasyncio/IssueType.py +123 -0
  99. githubasyncio/Label.py +186 -0
  100. githubasyncio/License.py +169 -0
  101. githubasyncio/MainClass.py +1142 -0
  102. githubasyncio/Membership.py +154 -0
  103. githubasyncio/MergedUpstream.py +71 -0
  104. githubasyncio/Migration.py +281 -0
  105. githubasyncio/Milestone.py +255 -0
  106. githubasyncio/NamedEnterpriseUser.py +207 -0
  107. githubasyncio/NamedUser.py +841 -0
  108. githubasyncio/Notification.py +182 -0
  109. githubasyncio/NotificationSubject.py +96 -0
  110. githubasyncio/Organization.py +2462 -0
  111. githubasyncio/OrganizationCodeScanAlert.py +65 -0
  112. githubasyncio/OrganizationCustomProperty.py +215 -0
  113. githubasyncio/OrganizationDependabotAlert.py +75 -0
  114. githubasyncio/OrganizationSecret.py +191 -0
  115. githubasyncio/OrganizationSecretScanAlert.py +112 -0
  116. githubasyncio/OrganizationVariable.py +141 -0
  117. githubasyncio/PaginatedList.py +652 -0
  118. githubasyncio/Path.py +102 -0
  119. githubasyncio/Permissions.py +113 -0
  120. githubasyncio/Plan.py +108 -0
  121. githubasyncio/Project.py +286 -0
  122. githubasyncio/ProjectCard.py +257 -0
  123. githubasyncio/ProjectColumn.py +227 -0
  124. githubasyncio/PublicKey.py +138 -0
  125. githubasyncio/PullRequest.py +1202 -0
  126. githubasyncio/PullRequestComment.py +401 -0
  127. githubasyncio/PullRequestMergeStatus.py +89 -0
  128. githubasyncio/PullRequestPart.py +110 -0
  129. githubasyncio/PullRequestReview.py +214 -0
  130. githubasyncio/Rate.py +123 -0
  131. githubasyncio/RateLimit.py +210 -0
  132. githubasyncio/RateLimitOverview.py +104 -0
  133. githubasyncio/Reaction.py +128 -0
  134. githubasyncio/Referrer.py +94 -0
  135. githubasyncio/RepoCodeSecurityConfig.py +93 -0
  136. githubasyncio/Repository.py +5211 -0
  137. githubasyncio/RepositoryAdvisory.py +431 -0
  138. githubasyncio/RepositoryDiscussion.py +221 -0
  139. githubasyncio/RepositoryDiscussionCategory.py +150 -0
  140. githubasyncio/RepositoryDiscussionComment.py +159 -0
  141. githubasyncio/RepositoryKey.py +166 -0
  142. githubasyncio/RepositoryPreferences.py +82 -0
  143. githubasyncio/RepositoryRulesetBypassActor.py +75 -0
  144. githubasyncio/Requester.py +1518 -0
  145. githubasyncio/RequiredPullRequestReviews.py +269 -0
  146. githubasyncio/RequiredStatusChecks.py +153 -0
  147. githubasyncio/Rule.py +134 -0
  148. githubasyncio/Ruleset.py +292 -0
  149. githubasyncio/Secret.py +139 -0
  150. githubasyncio/SecretScanAlert.py +317 -0
  151. githubasyncio/SecretScanAlertInstance.py +128 -0
  152. githubasyncio/SecurityAndAnalysis.py +188 -0
  153. githubasyncio/SecurityAndAnalysisFeature.py +79 -0
  154. githubasyncio/SelfHostedActionsRunner.py +129 -0
  155. githubasyncio/SelfHostedActionsRunnerApplication.py +92 -0
  156. githubasyncio/SelfHostedActionsRunnerJitConfig.py +74 -0
  157. githubasyncio/SelfHostedActionsRunnerToken.py +118 -0
  158. githubasyncio/SourceImport.py +260 -0
  159. githubasyncio/Stargazer.py +88 -0
  160. githubasyncio/StatsCodeFrequency.py +81 -0
  161. githubasyncio/StatsCommitActivity.py +86 -0
  162. githubasyncio/StatsContributor.py +138 -0
  163. githubasyncio/StatsParticipation.py +78 -0
  164. githubasyncio/StatsPunchCard.py +76 -0
  165. githubasyncio/SubIssueSummary.py +70 -0
  166. githubasyncio/Tag.py +108 -0
  167. githubasyncio/Team.py +618 -0
  168. githubasyncio/TeamDiscussion.py +137 -0
  169. githubasyncio/TimelineEvent.py +164 -0
  170. githubasyncio/TimelineEventSource.py +81 -0
  171. githubasyncio/Topic.py +177 -0
  172. githubasyncio/Traffic.py +95 -0
  173. githubasyncio/UserKey.py +141 -0
  174. githubasyncio/Variable.py +155 -0
  175. githubasyncio/View.py +97 -0
  176. githubasyncio/Workflow.py +335 -0
  177. githubasyncio/WorkflowJob.py +253 -0
  178. githubasyncio/WorkflowRun.py +480 -0
  179. githubasyncio/WorkflowStep.py +118 -0
  180. githubasyncio/__init__.py +38 -0
  181. githubasyncio/compat/__init__.py +52 -0
  182. githubasyncio/requestlib/__init__.py +29 -0
  183. pygithub_asyncio-3.0.0b1.dist-info/METADATA +102 -0
  184. pygithub_asyncio-3.0.0b1.dist-info/RECORD +188 -0
  185. pygithub_asyncio-3.0.0b1.dist-info/WHEEL +5 -0
  186. pygithub_asyncio-3.0.0b1.dist-info/licenses/COPYING +674 -0
  187. pygithub_asyncio-3.0.0b1.dist-info/licenses/COPYING.LESSER +165 -0
  188. pygithub_asyncio-3.0.0b1.dist-info/top_level.txt +1 -0
@@ -0,0 +1,159 @@
1
+ # FILE AUTO GENERATED DO NOT TOUCH
2
+ ############################ Copyrights and license ############################
3
+ # #
4
+ # Copyright 2012 Vincent Jacques <vincent@vincent-jacques.net> #
5
+ # Copyright 2012 Zearin <zearin@gonk.net> #
6
+ # Copyright 2013 Vincent Jacques <vincent@vincent-jacques.net> #
7
+ # Copyright 2014 Vincent Jacques <vincent@vincent-jacques.net> #
8
+ # Copyright 2016 Peter Buckley <dx-pbuckley@users.noreply.github.com> #
9
+ # Copyright 2018 Wan Liuyang <tsfdye@gmail.com> #
10
+ # Copyright 2018 sfdye <tsfdye@gmail.com> #
11
+ # Copyright 2019 Adam Baratz <adam.baratz@gmail.com> #
12
+ # Copyright 2019 Nick Campbell <nicholas.j.campbell@gmail.com> #
13
+ # Copyright 2019 Rigas Papathanasopoulos <rigaspapas@gmail.com> #
14
+ # Copyright 2019 Steve Kowalik <steven@wedontsleep.org> #
15
+ # Copyright 2019 Wan Liuyang <tsfdye@gmail.com> #
16
+ # Copyright 2020 Steve Kowalik <steven@wedontsleep.org> #
17
+ # Copyright 2022 Liuyang Wan <tsfdye@gmail.com> #
18
+ # Copyright 2023 Enrico Minack <github@enrico.minack.dev> #
19
+ # Copyright 2023 Jirka Borovec <6035284+Borda@users.noreply.github.com> #
20
+ # Copyright 2023 Trim21 <trim21.me@gmail.com> #
21
+ # Copyright 2023 chantra <chantra@users.noreply.github.com> #
22
+ # Copyright 2025 Enrico Minack <github@enrico.minack.dev> #
23
+ # #
24
+ # This file is part of PyGithub. #
25
+ # http://pygithub.readthedocs.io/ #
26
+ # #
27
+ # PyGithub is free software: you can redistribute it and/or modify it under #
28
+ # the terms of the GNU Lesser General Public License as published by the Free #
29
+ # Software Foundation, either version 3 of the License, or (at your option) #
30
+ # any later version. #
31
+ # #
32
+ # PyGithub is distributed in the hope that it will be useful, but WITHOUT ANY #
33
+ # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS #
34
+ # FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more #
35
+ # details. #
36
+ # #
37
+ # You should have received a copy of the GNU Lesser General Public License #
38
+ # along with PyGithub. If not, see <http://www.gnu.org/licenses/>. #
39
+ # #
40
+ ################################################################################
41
+
42
+ from __future__ import annotations
43
+
44
+ from datetime import datetime, timedelta, timezone
45
+ from typing import Any
46
+
47
+ from githubasyncio.GithubObject import Attribute, NonCompletableGithubObject, NotSet
48
+
49
+
50
+ class AccessToken(NonCompletableGithubObject):
51
+ """
52
+ This class represents access tokens.
53
+ """
54
+
55
+ _created: datetime
56
+
57
+ def _initAttributes(self) -> None:
58
+ self._expires_in: Attribute[int | None] = NotSet
59
+ self._refresh_expires_in: Attribute[int | None] = NotSet
60
+ self._refresh_token: Attribute[str] = NotSet
61
+ self._scope: Attribute[str] = NotSet
62
+ self._token: Attribute[str] = NotSet
63
+ self._type: Attribute[str] = NotSet
64
+
65
+ def __repr__(self) -> str:
66
+ return self.get__repr__(
67
+ {
68
+ "token": f"{self._token.value[:5]}...",
69
+ "scope": self.scope,
70
+ "type": self._type.value,
71
+ "expires_in": self.expires_in,
72
+ "refresh_token": (f"{self.refresh_token[:5]}..." if self.refresh_token else None),
73
+ "refresh_token_expires_in": self.refresh_expires_in,
74
+ }
75
+ )
76
+
77
+ @property
78
+ def created(self) -> datetime:
79
+ """
80
+ :type: datetime
81
+ """
82
+ return self._created
83
+
84
+ @property
85
+ def expires_at(self) -> datetime | None:
86
+ """
87
+ :type: Optional[datetime]
88
+ """
89
+ seconds = self.expires_in
90
+ if seconds is not None:
91
+ return self._created + timedelta(seconds=seconds)
92
+ return None
93
+
94
+ @property
95
+ def expires_in(self) -> int | None:
96
+ """
97
+ :type: Optional[int]
98
+ """
99
+ return self._expires_in.value
100
+
101
+ @property
102
+ def refresh_expires_at(self) -> datetime | None:
103
+ """
104
+ :type: Optional[datetime]
105
+ """
106
+ seconds = self.refresh_expires_in
107
+ if seconds is not None:
108
+ return self._created + timedelta(seconds=seconds)
109
+ return None
110
+
111
+ @property
112
+ def refresh_expires_in(self) -> int | None:
113
+ """
114
+ :type: Optional[int]
115
+ """
116
+ return self._refresh_expires_in.value
117
+
118
+ @property
119
+ def refresh_token(self) -> str | None:
120
+ """
121
+ :type: Optional[string]
122
+ """
123
+ return self._refresh_token.value
124
+
125
+ @property
126
+ def scope(self) -> str:
127
+ """
128
+ :type: string
129
+ """
130
+ return self._scope.value
131
+
132
+ @property
133
+ def token(self) -> str:
134
+ """
135
+ :type: string
136
+ """
137
+ return self._token.value
138
+
139
+ @property
140
+ def type(self) -> str:
141
+ """
142
+ :type: string
143
+ """
144
+ return self._type.value
145
+
146
+ def _useAttributes(self, attributes: dict[str, Any]) -> None:
147
+ self._created = datetime.now(timezone.utc)
148
+ if "access_token" in attributes: # pragma no branch
149
+ self._token = self._makeStringAttribute(attributes["access_token"])
150
+ if "expires_in" in attributes: # pragma no branch
151
+ self._expires_in = self._makeIntAttribute(attributes["expires_in"])
152
+ if "refresh_token" in attributes: # pragma no branch
153
+ self._refresh_token = self._makeStringAttribute(attributes["refresh_token"])
154
+ if "refresh_token_expires_in" in attributes: # pragma no branch
155
+ self._refresh_expires_in = self._makeIntAttribute(attributes["refresh_token_expires_in"])
156
+ if "scope" in attributes: # pragma no branch
157
+ self._scope = self._makeStringAttribute(attributes["scope"])
158
+ if "token_type" in attributes: # pragma no branch
159
+ self._type = self._makeStringAttribute(attributes["token_type"])
@@ -0,0 +1,163 @@
1
+ # FILE AUTO GENERATED DO NOT TOUCH
2
+ ############################ Copyrights and license ############################
3
+ # #
4
+ # Copyright 2023 Enrico Minack <github@enrico.minack.dev> #
5
+ # Copyright 2023 Joseph Henrich <crimsonknave@gmail.com> #
6
+ # Copyright 2024 Enrico Minack <github@enrico.minack.dev> #
7
+ # Copyright 2024 Thomas Cooper <coopernetes@proton.me> #
8
+ # Copyright 2025 Enrico Minack <github@enrico.minack.dev> #
9
+ # Copyright 2026 Enrico Minack <github@enrico.minack.dev> #
10
+ # #
11
+ # This file is part of PyGithub. #
12
+ # http://pygithub.readthedocs.io/ #
13
+ # #
14
+ # PyGithub is free software: you can redistribute it and/or modify it under #
15
+ # the terms of the GNU Lesser General Public License as published by the Free #
16
+ # Software Foundation, either version 3 of the License, or (at your option) #
17
+ # any later version. #
18
+ # #
19
+ # PyGithub is distributed in the hope that it will be useful, but WITHOUT ANY #
20
+ # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS #
21
+ # FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more #
22
+ # details. #
23
+ # #
24
+ # You should have received a copy of the GNU Lesser General Public License #
25
+ # along with PyGithub. If not, see <http://www.gnu.org/licenses/>. #
26
+ # #
27
+ ################################################################################
28
+
29
+ from __future__ import annotations
30
+
31
+ from datetime import datetime
32
+ from typing import TYPE_CHECKING, Any
33
+
34
+ import githubasyncio.CVSS
35
+ import githubasyncio.CWE
36
+ from githubasyncio.GithubObject import Attribute, NonCompletableGithubObject, NotSet
37
+
38
+ if TYPE_CHECKING:
39
+ from githubasyncio.CVSS import CVSS
40
+ from githubasyncio.CWE import CWE
41
+
42
+
43
+ class AdvisoryBase(NonCompletableGithubObject):
44
+ """
45
+ This class represents the shared attributes between GlobalAdvisory, RepositoryAdvisory and DependabotAdvisory
46
+ https://docs.github.com/en/rest/security-advisories/global-advisories
47
+ https://docs.github.com/en/rest/security-advisories/repository-advisories
48
+ https://docs.github.com/en/rest/dependabot/alerts
49
+ """
50
+
51
+ def _initAttributes(self) -> None:
52
+ self._cve_id: Attribute[str] = NotSet
53
+ self._cvss: Attribute[CVSS] = NotSet
54
+ self._cvss_severities: Attribute[dict[str, Any]] = NotSet
55
+ self._cwes: Attribute[list[CWE]] = NotSet
56
+ self._description: Attribute[str] = NotSet
57
+ self._ghsa_id: Attribute[str] = NotSet
58
+ self._html_url: Attribute[str] = NotSet
59
+ self._identifiers: Attribute[list[dict]] = NotSet
60
+ self._published_at: Attribute[datetime] = NotSet
61
+ self._severity: Attribute[str] = NotSet
62
+ self._summary: Attribute[str] = NotSet
63
+ self._updated_at: Attribute[datetime] = NotSet
64
+ self._url: Attribute[str] = NotSet
65
+ self._withdrawn_at: Attribute[datetime] = NotSet
66
+
67
+ def __repr__(self) -> str:
68
+ return self.get__repr__({"ghsa_id": self.ghsa_id, "summary": self.summary})
69
+
70
+ @property
71
+ def cve_id(self) -> str:
72
+ return self._cve_id.value
73
+
74
+ @property
75
+ def cvss(self) -> CVSS:
76
+ return self._cvss.value
77
+
78
+ @property
79
+ def cvss_severities(self) -> dict[str, Any]:
80
+ return self._cvss_severities.value
81
+
82
+ @property
83
+ def cwes(self) -> list[CWE]:
84
+ return self._cwes.value
85
+
86
+ @property
87
+ def description(self) -> str:
88
+ return self._description.value
89
+
90
+ @property
91
+ def ghsa_id(self) -> str:
92
+ return self._ghsa_id.value
93
+
94
+ @property
95
+ def html_url(self) -> str:
96
+ return self._html_url.value
97
+
98
+ @property
99
+ def identifiers(self) -> list[dict]:
100
+ return self._identifiers.value
101
+
102
+ @property
103
+ def published_at(self) -> datetime:
104
+ return self._published_at.value
105
+
106
+ @property
107
+ def severity(self) -> str:
108
+ return self._severity.value
109
+
110
+ @property
111
+ def summary(self) -> str:
112
+ return self._summary.value
113
+
114
+ @property
115
+ def updated_at(self) -> datetime:
116
+ return self._updated_at.value
117
+
118
+ @property
119
+ def url(self) -> str:
120
+ return self._url.value
121
+
122
+ @property
123
+ def withdrawn_at(self) -> datetime:
124
+ return self._withdrawn_at.value
125
+
126
+ def _useAttributes(self, attributes: dict[str, Any]) -> None:
127
+ if "cve_id" in attributes: # pragma no branch
128
+ self._cve_id = self._makeStringAttribute(attributes["cve_id"])
129
+ if "cvss" in attributes: # pragma no branch
130
+ self._cvss = self._makeClassAttribute(githubasyncio.CVSS.CVSS, attributes["cvss"])
131
+ if "cvss_severities" in attributes: # pragma no branch
132
+ self._cvss_severities = self._makeDictAttribute(attributes["cvss_severities"])
133
+ if "cwes" in attributes: # pragma no branch
134
+ self._cwes = self._makeListOfClassesAttribute(githubasyncio.CWE.CWE, attributes["cwes"])
135
+ if "description" in attributes: # pragma no branch
136
+ self._description = self._makeStringAttribute(attributes["description"])
137
+ if "ghsa_id" in attributes: # pragma no branch
138
+ self._ghsa_id = self._makeStringAttribute(attributes["ghsa_id"])
139
+ if "html_url" in attributes: # pragma no branch
140
+ self._html_url = self._makeStringAttribute(attributes["html_url"])
141
+ if "identifiers" in attributes: # pragma no branch
142
+ self._identifiers = self._makeListOfDictsAttribute(attributes["identifiers"])
143
+ if "published_at" in attributes: # pragma no branch
144
+ assert attributes["published_at"] is None or isinstance(attributes["published_at"], str), attributes[
145
+ "published_at"
146
+ ]
147
+ self._published_at = self._makeDatetimeAttribute(attributes["published_at"])
148
+ if "severity" in attributes: # pragma no branch
149
+ self._severity = self._makeStringAttribute(attributes["severity"])
150
+ if "summary" in attributes: # pragma no branch
151
+ self._summary = self._makeStringAttribute(attributes["summary"])
152
+ if "updated_at" in attributes: # pragma no branch
153
+ assert attributes["updated_at"] is None or isinstance(attributes["updated_at"], str), attributes[
154
+ "updated_at"
155
+ ]
156
+ self._updated_at = self._makeDatetimeAttribute(attributes["updated_at"])
157
+ if "url" in attributes: # pragma no branch
158
+ self._url = self._makeStringAttribute(attributes["url"])
159
+ if "withdrawn_at" in attributes: # pragma no branch
160
+ assert attributes["withdrawn_at"] is None or isinstance(attributes["withdrawn_at"], str), attributes[
161
+ "withdrawn_at"
162
+ ]
163
+ self._withdrawn_at = self._makeDatetimeAttribute(attributes["withdrawn_at"])
@@ -0,0 +1,131 @@
1
+ # FILE AUTO GENERATED DO NOT TOUCH
2
+ ############################ Copyrights and license ############################
3
+ # #
4
+ # Copyright 2023 Enrico Minack <github@enrico.minack.dev> #
5
+ # Copyright 2023 Jirka Borovec <6035284+Borda@users.noreply.github.com> #
6
+ # Copyright 2023 Jonathan Leitschuh <jonathan.leitschuh@gmail.com> #
7
+ # Copyright 2023 Joseph Henrich <crimsonknave@gmail.com> #
8
+ # Copyright 2023 Trim21 <trim21.me@gmail.com> #
9
+ # Copyright 2024 Enrico Minack <github@enrico.minack.dev> #
10
+ # Copyright 2024 Jirka Borovec <6035284+Borda@users.noreply.github.com> #
11
+ # Copyright 2025 Enrico Minack <github@enrico.minack.dev> #
12
+ # Copyright 2026 Enrico Minack <github@enrico.minack.dev> #
13
+ # #
14
+ # This file is part of PyGithub. #
15
+ # http://pygithub.readthedocs.io/ #
16
+ # #
17
+ # PyGithub is free software: you can redistribute it and/or modify it under #
18
+ # the terms of the GNU Lesser General Public License as published by the Free #
19
+ # Software Foundation, either version 3 of the License, or (at your option) #
20
+ # any later version. #
21
+ # #
22
+ # PyGithub is distributed in the hope that it will be useful, but WITHOUT ANY #
23
+ # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS #
24
+ # FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more #
25
+ # details. #
26
+ # #
27
+ # You should have received a copy of the GNU Lesser General Public License #
28
+ # along with PyGithub. If not, see <http://www.gnu.org/licenses/>. #
29
+ # #
30
+ ################################################################################
31
+
32
+ from __future__ import annotations
33
+
34
+ from typing import TYPE_CHECKING, Any, Union
35
+
36
+ import githubasyncio.NamedUser
37
+ from githubasyncio.compat import TypedDict
38
+ from githubasyncio.GithubObject import Attribute, NonCompletableGithubObject, NotSet
39
+
40
+ if TYPE_CHECKING:
41
+ from githubasyncio.NamedUser import NamedUser
42
+
43
+
44
+ class SimpleCredit(TypedDict):
45
+ """
46
+ A simple credit for a security advisory.
47
+ """
48
+
49
+ login: str | NamedUser
50
+ type: str
51
+
52
+
53
+ Credit = Union[SimpleCredit, "AdvisoryCredit"]
54
+
55
+
56
+ class AdvisoryCredit(NonCompletableGithubObject):
57
+ """
58
+ This class represents a credit that is assigned to a SecurityAdvisory.
59
+
60
+ The reference can be found here
61
+ https://docs.github.com/en/rest/security-advisories/repository-advisories
62
+
63
+ The OpenAPI schema can be found at
64
+
65
+ - /components/schemas/repository-advisory/properties/credits/items
66
+
67
+ """
68
+
69
+ def _initAttributes(self) -> None:
70
+ self._login: Attribute[str] = NotSet
71
+ self._type: Attribute[str] = NotSet
72
+
73
+ def __repr__(self) -> str:
74
+ return self.get__repr__(
75
+ {
76
+ "login": self._login.value,
77
+ "type": self._type.value,
78
+ }
79
+ )
80
+
81
+ @property
82
+ def login(self) -> str:
83
+ """
84
+ :type: string
85
+ """
86
+ return self._login.value
87
+
88
+ @property
89
+ def type(self) -> str:
90
+ """
91
+ :type: string
92
+ """
93
+ return self._type.value
94
+
95
+ @staticmethod
96
+ def _validate_credit(credit: Credit) -> None:
97
+ assert isinstance(credit, (dict, AdvisoryCredit)), credit
98
+ if isinstance(credit, dict):
99
+ assert "login" in credit, credit
100
+ assert "type" in credit, credit
101
+ assert isinstance(credit["login"], (str, githubasyncio.NamedUser.NamedUser)), credit["login"]
102
+ assert isinstance(credit["type"], str), credit["type"]
103
+ else:
104
+ assert isinstance(credit.login, str), credit.login
105
+ assert isinstance(credit.type, str), credit.type
106
+
107
+ @staticmethod
108
+ async def _to_github_dict(credit: Credit) -> SimpleCredit:
109
+ assert isinstance(credit, (dict, AdvisoryCredit)), credit
110
+ if isinstance(credit, dict):
111
+ assert "login" in credit, credit
112
+ assert "type" in credit, credit
113
+ assert isinstance(credit["login"], (str, githubasyncio.NamedUser.NamedUser)), credit["login"]
114
+ login = credit["login"]
115
+ if isinstance(login, githubasyncio.NamedUser.NamedUser):
116
+ login = await login.login
117
+ return {
118
+ "login": login,
119
+ "type": credit["type"],
120
+ }
121
+ else:
122
+ return {
123
+ "login": credit.login,
124
+ "type": credit.type,
125
+ }
126
+
127
+ def _useAttributes(self, attributes: dict[str, Any]) -> None:
128
+ if "login" in attributes: # pragma no branch
129
+ self._login = self._makeStringAttribute(attributes["login"])
130
+ if "type" in attributes: # pragma no branch
131
+ self._type = self._makeStringAttribute(attributes["type"])
@@ -0,0 +1,110 @@
1
+ # FILE AUTO GENERATED DO NOT TOUCH
2
+ ############################ Copyrights and license ############################
3
+ # #
4
+ # Copyright 2012 Vincent Jacques <vincent@vincent-jacques.net> #
5
+ # Copyright 2012 Zearin <zearin@gonk.net> #
6
+ # Copyright 2013 Vincent Jacques <vincent@vincent-jacques.net> #
7
+ # Copyright 2014 Vincent Jacques <vincent@vincent-jacques.net> #
8
+ # Copyright 2016 Peter Buckley <dx-pbuckley@users.noreply.github.com> #
9
+ # Copyright 2018 Wan Liuyang <tsfdye@gmail.com> #
10
+ # Copyright 2018 sfdye <tsfdye@gmail.com> #
11
+ # Copyright 2019 Adam Baratz <adam.baratz@gmail.com> #
12
+ # Copyright 2019 Nick Campbell <nicholas.j.campbell@gmail.com> #
13
+ # Copyright 2019 Steve Kowalik <steven@wedontsleep.org> #
14
+ # Copyright 2019 Wan Liuyang <tsfdye@gmail.com> #
15
+ # Copyright 2020 Steve Kowalik <steven@wedontsleep.org> #
16
+ # Copyright 2021 Steve Kowalik <steven@wedontsleep.org> #
17
+ # Copyright 2023 Enrico Minack <github@enrico.minack.dev> #
18
+ # Copyright 2023 Jirka Borovec <6035284+Borda@users.noreply.github.com> #
19
+ # Copyright 2023 Jonathan Leitschuh <jonathan.leitschuh@gmail.com> #
20
+ # Copyright 2023 Joseph Henrich <crimsonknave@gmail.com> #
21
+ # Copyright 2023 Trim21 <trim21.me@gmail.com> #
22
+ # Copyright 2024 Enrico Minack <github@enrico.minack.dev> #
23
+ # Copyright 2024 Jirka Borovec <6035284+Borda@users.noreply.github.com> #
24
+ # Copyright 2025 Enrico Minack <github@enrico.minack.dev> #
25
+ # Copyright 2026 Enrico Minack <github@enrico.minack.dev> #
26
+ # #
27
+ # This file is part of PyGithub. #
28
+ # http://pygithub.readthedocs.io/ #
29
+ # #
30
+ # PyGithub is free software: you can redistribute it and/or modify it under #
31
+ # the terms of the GNU Lesser General Public License as published by the Free #
32
+ # Software Foundation, either version 3 of the License, or (at your option) #
33
+ # any later version. #
34
+ # #
35
+ # PyGithub is distributed in the hope that it will be useful, but WITHOUT ANY #
36
+ # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS #
37
+ # FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more #
38
+ # details. #
39
+ # #
40
+ # You should have received a copy of the GNU Lesser General Public License #
41
+ # along with PyGithub. If not, see <http://www.gnu.org/licenses/>. #
42
+ # #
43
+ ################################################################################
44
+
45
+ from __future__ import annotations
46
+
47
+ from typing import TYPE_CHECKING, Any
48
+
49
+ import githubasyncio.NamedUser
50
+ from githubasyncio.GithubObject import Attribute, NonCompletableGithubObject, NotSet
51
+
52
+ if TYPE_CHECKING:
53
+ from githubasyncio.NamedUser import NamedUser
54
+
55
+
56
+ class AdvisoryCreditDetailed(NonCompletableGithubObject):
57
+ """
58
+ This class represents a credit that is assigned to a SecurityAdvisory.
59
+
60
+ The reference can be found here
61
+ https://docs.github.com/en/rest/security-advisories/repository-advisories
62
+
63
+ The OpenAPI schema can be found at
64
+
65
+ - /components/schemas/global-advisory/properties/credits/items
66
+ - /components/schemas/repository-advisory-credit
67
+
68
+ """
69
+
70
+ def _initAttributes(self) -> None:
71
+ self._state: Attribute[str] = NotSet
72
+ self._type: Attribute[str] = NotSet
73
+ self._user: Attribute[NamedUser] = NotSet
74
+
75
+ def __repr__(self) -> str:
76
+ return self.get__repr__(
77
+ {
78
+ "user": self._user.value,
79
+ "type": self._type.value,
80
+ }
81
+ )
82
+
83
+ @property
84
+ def state(self) -> str:
85
+ """
86
+ :type: string
87
+ """
88
+ return self._state.value
89
+
90
+ @property
91
+ def type(self) -> str:
92
+ """
93
+ :type: string
94
+ """
95
+ return self._type.value
96
+
97
+ @property
98
+ def user(self) -> NamedUser:
99
+ """
100
+ :type: :class:`githubasyncio.NamedUser.NamedUser`
101
+ """
102
+ return self._user.value
103
+
104
+ def _useAttributes(self, attributes: dict[str, Any]) -> None:
105
+ if "state" in attributes: # pragma no branch
106
+ self._state = self._makeStringAttribute(attributes["state"])
107
+ if "type" in attributes: # pragma no branch
108
+ self._type = self._makeStringAttribute(attributes["type"])
109
+ if "user" in attributes: # pragma no branch
110
+ self._user = self._makeClassAttribute(githubasyncio.NamedUser.NamedUser, attributes["user"])