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,315 @@
1
+ # FILE AUTO GENERATED DO NOT TOUCH
2
+ ############################ Copyrights and license ############################
3
+ # #
4
+ # Copyright 2020 Dhruv Manilawala <dhruvmanila@gmail.com> #
5
+ # Copyright 2020 Steve Kowalik <steven@wedontsleep.org> #
6
+ # Copyright 2021 Steve Kowalik <steven@wedontsleep.org> #
7
+ # Copyright 2021 majorvin <majorvin.tan@outlook.com> #
8
+ # Copyright 2023 Enrico Minack <github@enrico.minack.dev> #
9
+ # Copyright 2023 Jirka Borovec <6035284+Borda@users.noreply.github.com> #
10
+ # Copyright 2023 Trim21 <trim21.me@gmail.com> #
11
+ # Copyright 2024 Enrico Minack <github@enrico.minack.dev> #
12
+ # Copyright 2024 Jirka Borovec <6035284+Borda@users.noreply.github.com> #
13
+ # Copyright 2025 Alexander Todorov <atodorov@otb.bg> #
14
+ # Copyright 2025 Christoph Reiter <reiter.christoph@gmail.com> #
15
+ # Copyright 2025 Enrico Minack <github@enrico.minack.dev> #
16
+ # Copyright 2026 Enrico Minack <github@enrico.minack.dev> #
17
+ # #
18
+ # This file is part of PyGithub. #
19
+ # http://pygithub.readthedocs.io/ #
20
+ # #
21
+ # PyGithub is free software: you can redistribute it and/or modify it under #
22
+ # the terms of the GNU Lesser General Public License as published by the Free #
23
+ # Software Foundation, either version 3 of the License, or (at your option) #
24
+ # any later version. #
25
+ # #
26
+ # PyGithub is distributed in the hope that it will be useful, but WITHOUT ANY #
27
+ # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS #
28
+ # FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more #
29
+ # details. #
30
+ # #
31
+ # You should have received a copy of the GNU Lesser General Public License #
32
+ # along with PyGithub. If not, see <http://www.gnu.org/licenses/>. #
33
+ # #
34
+ ################################################################################
35
+
36
+ from __future__ import annotations
37
+
38
+ from datetime import datetime
39
+ from typing import TYPE_CHECKING, Any
40
+
41
+ import githubasyncio.CheckRunAnnotation
42
+ import githubasyncio.CheckRunOutput
43
+ import githubasyncio.CheckSuite
44
+ import githubasyncio.Deployment
45
+ import githubasyncio.GithubApp
46
+ import githubasyncio.GithubObject
47
+ import githubasyncio.PullRequest
48
+ from githubasyncio.compat import deprecated
49
+ from githubasyncio.GithubObject import (
50
+ Attribute,
51
+ CompletableGithubObject,
52
+ NotSet,
53
+ Opt,
54
+ is_defined,
55
+ is_optional,
56
+ is_optional_list,
57
+ )
58
+ from githubasyncio.PaginatedList import PaginatedList
59
+
60
+ if TYPE_CHECKING:
61
+ from githubasyncio.CheckRunAnnotation import CheckRunAnnotation
62
+ from githubasyncio.CheckRunOutput import CheckRunOutput
63
+ from githubasyncio.CheckSuite import CheckSuite
64
+ from githubasyncio.Deployment import Deployment
65
+ from githubasyncio.GithubApp import GithubApp
66
+ from githubasyncio.PullRequest import PullRequest
67
+
68
+
69
+ class CheckRun(CompletableGithubObject):
70
+ """
71
+ This class represents check runs.
72
+
73
+ The reference can be found here
74
+ https://docs.github.com/en/rest/reference/checks#check-runs
75
+
76
+ The OpenAPI schema can be found at
77
+
78
+ - /components/schemas/check-run
79
+
80
+ .. warning::
81
+
82
+ As of Feb 2025 according to GitHub Support
83
+ "The Checks API does not support Fine-Grained PATs or classic PATs,
84
+ only GitHub Apps can use the Checks API". Because of this you may see
85
+ empty ``.output.*`` attributes. See
86
+ https://github.com/PyGithub/PyGithub/issues/3227
87
+
88
+ """
89
+
90
+ def _initAttributes(self) -> None:
91
+ self._app: Attribute[GithubApp] = NotSet
92
+ self._check_suite: Attribute[CheckSuite] = NotSet
93
+ self._check_suite_id: Attribute[int] = NotSet
94
+ self._completed_at: Attribute[datetime | None] = NotSet
95
+ self._conclusion: Attribute[str] = NotSet
96
+ self._deployment: Attribute[Deployment] = NotSet
97
+ self._details_url: Attribute[str] = NotSet
98
+ self._external_id: Attribute[str] = NotSet
99
+ self._head_sha: Attribute[str] = NotSet
100
+ self._html_url: Attribute[str] = NotSet
101
+ self._id: Attribute[int] = NotSet
102
+ self._name: Attribute[str] = NotSet
103
+ self._node_id: Attribute[str] = NotSet
104
+ self._output: Attribute[CheckRunOutput] = NotSet
105
+ self._pull_requests: Attribute[list[PullRequest]] = NotSet
106
+ self._started_at: Attribute[datetime] = NotSet
107
+ self._status: Attribute[str] = NotSet
108
+ self._url: Attribute[str] = NotSet
109
+
110
+ def __repr__(self) -> str:
111
+ return self.get__repr__({"id": self._id.value, "conclusion": self._conclusion.value})
112
+
113
+ @property
114
+ async def app(self) -> GithubApp:
115
+ await self._completeIfNotSet(self._app)
116
+ return self._app.value
117
+
118
+ @property
119
+ async def check_suite(self) -> CheckSuite:
120
+ await self._completeIfNotSet(self._check_suite)
121
+ return self._check_suite.value
122
+
123
+ @property
124
+ @deprecated("Use property check_suite.id instead")
125
+ async def check_suite_id(self) -> int:
126
+ await self._completeIfNotSet(self._check_suite_id)
127
+ return self._check_suite_id.value
128
+
129
+ @property
130
+ async def completed_at(self) -> datetime | None:
131
+ await self._completeIfNotSet(self._completed_at)
132
+ return self._completed_at.value
133
+
134
+ @property
135
+ async def conclusion(self) -> str:
136
+ await self._completeIfNotSet(self._conclusion)
137
+ return self._conclusion.value
138
+
139
+ @property
140
+ async def deployment(self) -> Deployment:
141
+ await self._completeIfNotSet(self._deployment)
142
+ return self._deployment.value
143
+
144
+ @property
145
+ async def details_url(self) -> str:
146
+ await self._completeIfNotSet(self._details_url)
147
+ return self._details_url.value
148
+
149
+ @property
150
+ async def external_id(self) -> str:
151
+ await self._completeIfNotSet(self._external_id)
152
+ return self._external_id.value
153
+
154
+ @property
155
+ async def head_sha(self) -> str:
156
+ await self._completeIfNotSet(self._head_sha)
157
+ return self._head_sha.value
158
+
159
+ @property
160
+ async def html_url(self) -> str:
161
+ await self._completeIfNotSet(self._html_url)
162
+ return self._html_url.value
163
+
164
+ @property
165
+ async def id(self) -> int:
166
+ await self._completeIfNotSet(self._id)
167
+ return self._id.value
168
+
169
+ @property
170
+ async def name(self) -> str:
171
+ await self._completeIfNotSet(self._name)
172
+ return self._name.value
173
+
174
+ @property
175
+ async def node_id(self) -> str:
176
+ await self._completeIfNotSet(self._node_id)
177
+ return self._node_id.value
178
+
179
+ @property
180
+ async def output(self) -> CheckRunOutput:
181
+ await self._completeIfNotSet(self._output)
182
+ return self._output.value
183
+
184
+ @property
185
+ async def pull_requests(self) -> list[PullRequest]:
186
+ await self._completeIfNotSet(self._pull_requests)
187
+ return self._pull_requests.value
188
+
189
+ @property
190
+ async def started_at(self) -> datetime:
191
+ await self._completeIfNotSet(self._started_at)
192
+ return self._started_at.value
193
+
194
+ @property
195
+ async def status(self) -> str:
196
+ await self._completeIfNotSet(self._status)
197
+ return self._status.value
198
+
199
+ @property
200
+ def url(self) -> str: # type: ignore[override]
201
+ return self._url.value
202
+
203
+ async def get_annotations(self) -> PaginatedList[CheckRunAnnotation]:
204
+ """
205
+ :calls: `GET /repos/{owner}/{repo}/check-runs/{check_run_id}/annotations <https://docs.github.com/en/rest/reference/checks#list-check-run-annotations>`_
206
+ """
207
+ return PaginatedList(
208
+ githubasyncio.CheckRunAnnotation.CheckRunAnnotation,
209
+ self._requester,
210
+ f"{self.url}/annotations",
211
+ None,
212
+ headers={"Accept": "application/vnd.github.v3+json"},
213
+ )
214
+
215
+ async def edit(
216
+ self,
217
+ name: Opt[str] = NotSet,
218
+ head_sha: Opt[str] = NotSet,
219
+ details_url: Opt[str] = NotSet,
220
+ external_id: Opt[str] = NotSet,
221
+ status: Opt[str] = NotSet,
222
+ started_at: Opt[datetime] = NotSet,
223
+ conclusion: Opt[str] = NotSet,
224
+ completed_at: Opt[datetime] = NotSet,
225
+ output: Opt[dict] = NotSet,
226
+ actions: Opt[list[dict]] = NotSet,
227
+ ) -> None:
228
+ """
229
+ :calls: `PATCH /repos/{owner}/{repo}/check-runs/{check_run_id} <https://docs.github.com/en/rest/reference/checks#update-a-check-run>`_
230
+ """
231
+ assert is_optional(name, str), name
232
+ assert is_optional(head_sha, str), head_sha
233
+ assert is_optional(details_url, str), details_url
234
+ assert is_optional(external_id, str), external_id
235
+ assert is_optional(status, str), status
236
+ assert is_optional(started_at, datetime), started_at
237
+ assert is_optional(conclusion, str), conclusion
238
+ assert is_optional(completed_at, datetime), completed_at
239
+ assert is_optional(output, dict), output
240
+ assert is_optional_list(actions, dict), actions
241
+
242
+ post_parameters: dict[str, Any] = {}
243
+ if is_defined(name):
244
+ post_parameters["name"] = name
245
+ if is_defined(head_sha):
246
+ post_parameters["head_sha"] = head_sha
247
+ if is_defined(details_url):
248
+ post_parameters["details_url"] = details_url
249
+ if is_defined(external_id):
250
+ post_parameters["external_id"] = external_id
251
+ if is_defined(status):
252
+ post_parameters["status"] = status
253
+ if is_defined(started_at):
254
+ post_parameters["started_at"] = started_at.strftime("%Y-%m-%dT%H:%M:%SZ")
255
+ if is_defined(completed_at):
256
+ post_parameters["completed_at"] = completed_at.strftime("%Y-%m-%dT%H:%M:%SZ")
257
+ if is_defined(conclusion):
258
+ post_parameters["conclusion"] = conclusion
259
+ if is_defined(output):
260
+ post_parameters["output"] = output
261
+ if is_defined(actions):
262
+ post_parameters["actions"] = actions
263
+
264
+ headers, data = await self._requester.requestJsonAndCheck("PATCH", self.url, input=post_parameters)
265
+ self._useAttributes(data)
266
+ self._set_complete()
267
+
268
+ def _useAttributes(self, attributes: dict[str, Any]) -> None:
269
+ if "app" in attributes: # pragma no branch
270
+ self._app = self._makeClassAttribute(githubasyncio.GithubApp.GithubApp, attributes["app"])
271
+ # This only gives us a dictionary with `id` attribute of `check_suite`
272
+ if "check_suite" in attributes and "id" in attributes["check_suite"]: # pragma no branch
273
+ id = attributes["check_suite"]["id"]
274
+ if "url" not in attributes["check_suite"] and "url" in attributes:
275
+ url = attributes["url"].split("/")[:-2] + ["check-suites", str(id)]
276
+ attributes["check_suite"]["url"] = "/".join(url)
277
+ self._check_suite = self._makeClassAttribute(githubasyncio.CheckSuite.CheckSuite, attributes["check_suite"])
278
+ # deprecated check suite id property
279
+ self._check_suite_id = self._makeIntAttribute(id)
280
+ if "completed_at" in attributes: # pragma no branch
281
+ self._completed_at = self._makeDatetimeAttribute(attributes["completed_at"])
282
+ if "conclusion" in attributes: # pragma no branch
283
+ self._conclusion = self._makeStringAttribute(attributes["conclusion"])
284
+ if "deployment" in attributes: # pragma no branch
285
+ self._deployment = self._makeClassAttribute(githubasyncio.Deployment.Deployment, attributes["deployment"])
286
+ if "details_url" in attributes: # pragma no branch
287
+ self._details_url = self._makeStringAttribute(attributes["details_url"])
288
+ if "external_id" in attributes: # pragma no branch
289
+ self._external_id = self._makeStringAttribute(attributes["external_id"])
290
+ if "head_sha" in attributes: # pragma no branch
291
+ self._head_sha = self._makeStringAttribute(attributes["head_sha"])
292
+ if "html_url" in attributes: # pragma no branch
293
+ self._html_url = self._makeStringAttribute(attributes["html_url"])
294
+ if "id" in attributes: # pragma no branch
295
+ self._id = self._makeIntAttribute(attributes["id"])
296
+ elif "url" in attributes and attributes["url"]:
297
+ id = attributes["url"].split("/")[-1]
298
+ if id.isnumeric():
299
+ self._id = self._makeIntAttribute(int(id))
300
+ if "name" in attributes: # pragma no branch
301
+ self._name = self._makeStringAttribute(attributes["name"])
302
+ if "node_id" in attributes: # pragma no branch
303
+ self._node_id = self._makeStringAttribute(attributes["node_id"])
304
+ if "output" in attributes: # pragma no branch
305
+ self._output = self._makeClassAttribute(githubasyncio.CheckRunOutput.CheckRunOutput, attributes["output"])
306
+ if "pull_requests" in attributes: # pragma no branch
307
+ self._pull_requests = self._makeListOfClassesAttribute(
308
+ githubasyncio.PullRequest.PullRequest, attributes["pull_requests"]
309
+ )
310
+ if "started_at" in attributes: # pragma no branch
311
+ self._started_at = self._makeDatetimeAttribute(attributes["started_at"])
312
+ if "status" in attributes: # pragma no branch
313
+ self._status = self._makeStringAttribute(attributes["status"])
314
+ if "url" in attributes: # pragma no branch
315
+ self._url = self._makeStringAttribute(attributes["url"])
@@ -0,0 +1,134 @@
1
+ # FILE AUTO GENERATED DO NOT TOUCH
2
+ ############################ Copyrights and license ############################
3
+ # #
4
+ # Copyright 2020 Dhruv Manilawala <dhruvmanila@gmail.com> #
5
+ # Copyright 2020 Steve Kowalik <steven@wedontsleep.org> #
6
+ # Copyright 2023 Enrico Minack <github@enrico.minack.dev> #
7
+ # Copyright 2023 Jirka Borovec <6035284+Borda@users.noreply.github.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 Alexander Todorov <atodorov@otb.bg> #
12
+ # Copyright 2025 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 Any
35
+
36
+ from githubasyncio.GithubObject import Attribute, NonCompletableGithubObject, NotSet
37
+
38
+
39
+ class CheckRunAnnotation(NonCompletableGithubObject):
40
+ """
41
+ This class represents check run annotations.
42
+
43
+ The reference can be found here: https://docs.github.com/en/rest/reference/checks#list-check-run-annotations
44
+
45
+ The OpenAPI schema can be found at
46
+
47
+ - /components/schemas/check-annotation
48
+
49
+ .. warning::
50
+
51
+ As of Feb 2025 according to GitHub Support
52
+ "The Checks API does not support Fine-Grained PATs or classic PATs,
53
+ only GitHub Apps can use the Checks API". Because of this you may see
54
+ empty ``.title`` attribute. See
55
+ https://github.com/PyGithub/PyGithub/issues/3227
56
+
57
+ """
58
+
59
+ def _initAttributes(self) -> None:
60
+ self._annotation_level: Attribute[str] = NotSet
61
+ self._blob_href: Attribute[str] = NotSet
62
+ self._end_column: Attribute[int] = NotSet
63
+ self._end_line: Attribute[int] = NotSet
64
+ self._message: Attribute[str] = NotSet
65
+ self._path: Attribute[str] = NotSet
66
+ self._raw_details: Attribute[str] = NotSet
67
+ self._start_column: Attribute[int] = NotSet
68
+ self._start_line: Attribute[int] = NotSet
69
+ self._title: Attribute[str] = NotSet
70
+
71
+ def __repr__(self) -> str:
72
+ return self.get__repr__({"title": self._title.value})
73
+
74
+ @property
75
+ def annotation_level(self) -> str:
76
+ return self._annotation_level.value
77
+
78
+ @property
79
+ def blob_href(self) -> str:
80
+ return self._blob_href.value
81
+
82
+ @property
83
+ def end_column(self) -> int:
84
+ return self._end_column.value
85
+
86
+ @property
87
+ def end_line(self) -> int:
88
+ return self._end_line.value
89
+
90
+ @property
91
+ def message(self) -> str:
92
+ return self._message.value
93
+
94
+ @property
95
+ def path(self) -> str:
96
+ return self._path.value
97
+
98
+ @property
99
+ def raw_details(self) -> str:
100
+ return self._raw_details.value
101
+
102
+ @property
103
+ def start_column(self) -> int:
104
+ return self._start_column.value
105
+
106
+ @property
107
+ def start_line(self) -> int:
108
+ return self._start_line.value
109
+
110
+ @property
111
+ def title(self) -> str:
112
+ return self._title.value
113
+
114
+ def _useAttributes(self, attributes: dict[str, Any]) -> None:
115
+ if "annotation_level" in attributes: # pragma no branch
116
+ self._annotation_level = self._makeStringAttribute(attributes["annotation_level"])
117
+ if "blob_href" in attributes: # pragma no branch
118
+ self._blob_href = self._makeStringAttribute(attributes["blob_href"])
119
+ if "end_column" in attributes: # pragma no branch
120
+ self._end_column = self._makeIntAttribute(attributes["end_column"])
121
+ if "end_line" in attributes: # pragma no branch
122
+ self._end_line = self._makeIntAttribute(attributes["end_line"])
123
+ if "message" in attributes: # pragma no branch
124
+ self._message = self._makeStringAttribute(attributes["message"])
125
+ if "path" in attributes: # pragma no branch
126
+ self._path = self._makeStringAttribute(attributes["path"])
127
+ if "raw_details" in attributes: # pragma no branch
128
+ self._raw_details = self._makeStringAttribute(attributes["raw_details"])
129
+ if "start_column" in attributes: # pragma no branch
130
+ self._start_column = self._makeIntAttribute(attributes["start_column"])
131
+ if "start_line" in attributes: # pragma no branch
132
+ self._start_line = self._makeIntAttribute(attributes["start_line"])
133
+ if "title" in attributes: # pragma no branch
134
+ self._title = self._makeStringAttribute(attributes["title"])
@@ -0,0 +1,108 @@
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 AKFish <akfish@gmail.com> #
7
+ # Copyright 2013 Vincent Jacques <vincent@vincent-jacques.net> #
8
+ # Copyright 2014 Vincent Jacques <vincent@vincent-jacques.net> #
9
+ # Copyright 2016 Jannis Gebauer <ja.geb@me.com> #
10
+ # Copyright 2016 Peter Buckley <dx-pbuckley@users.noreply.github.com> #
11
+ # Copyright 2018 Wan Liuyang <tsfdye@gmail.com> #
12
+ # Copyright 2018 sfdye <tsfdye@gmail.com> #
13
+ # Copyright 2019 Steve Kowalik <steven@wedontsleep.org> #
14
+ # Copyright 2019 Wan Liuyang <tsfdye@gmail.com> #
15
+ # Copyright 2020 Dhruv Manilawala <dhruvmanila@gmail.com> #
16
+ # Copyright 2020 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 Trim21 <trim21.me@gmail.com> #
20
+ # Copyright 2024 Enrico Minack <github@enrico.minack.dev> #
21
+ # Copyright 2024 Jirka Borovec <6035284+Borda@users.noreply.github.com> #
22
+ # Copyright 2025 Alexander Todorov <atodorov@otb.bg> #
23
+ # Copyright 2025 Enrico Minack <github@enrico.minack.dev> #
24
+ # #
25
+ # This file is part of PyGithub. #
26
+ # http://pygithub.readthedocs.io/ #
27
+ # #
28
+ # PyGithub is free software: you can redistribute it and/or modify it under #
29
+ # the terms of the GNU Lesser General Public License as published by the Free #
30
+ # Software Foundation, either version 3 of the License, or (at your option) #
31
+ # any later version. #
32
+ # #
33
+ # PyGithub is distributed in the hope that it will be useful, but WITHOUT ANY #
34
+ # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS #
35
+ # FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more #
36
+ # details. #
37
+ # #
38
+ # You should have received a copy of the GNU Lesser General Public License #
39
+ # along with PyGithub. If not, see <http://www.gnu.org/licenses/>. #
40
+ # #
41
+ ################################################################################
42
+
43
+ from __future__ import annotations
44
+
45
+ from typing import Any
46
+
47
+ from githubasyncio.GithubObject import Attribute, NonCompletableGithubObject, NotSet
48
+
49
+
50
+ class CheckRunOutput(NonCompletableGithubObject):
51
+ """
52
+ This class represents the output of check run.
53
+
54
+ The OpenAPI schema can be found at
55
+
56
+ - /components/schemas/check-run/properties/output
57
+
58
+ .. warning::
59
+
60
+ As of Feb 2025 according to GitHub Support
61
+ "The Checks API does not support Fine-Grained PATs or classic PATs,
62
+ only GitHub Apps can use the Checks API". Because of this you may see
63
+ empty ``.summary``, ``.text`` or ``.title`` attributes. See
64
+ https://github.com/PyGithub/PyGithub/issues/3227
65
+
66
+ """
67
+
68
+ def _initAttributes(self) -> None:
69
+ self._annotations_count: Attribute[int] = NotSet
70
+ self._annotations_url: Attribute[str] = NotSet
71
+ self._summary: Attribute[str] = NotSet
72
+ self._text: Attribute[str] = NotSet
73
+ self._title: Attribute[str] = NotSet
74
+
75
+ def __repr__(self) -> str:
76
+ return self.get__repr__({"title": self._title.value})
77
+
78
+ @property
79
+ def annotations_count(self) -> int:
80
+ return self._annotations_count.value
81
+
82
+ @property
83
+ def annotations_url(self) -> str:
84
+ return self._annotations_url.value
85
+
86
+ @property
87
+ def summary(self) -> str:
88
+ return self._summary.value
89
+
90
+ @property
91
+ def text(self) -> str:
92
+ return self._text.value
93
+
94
+ @property
95
+ def title(self) -> str:
96
+ return self._title.value
97
+
98
+ def _useAttributes(self, attributes: dict[str, Any]) -> None:
99
+ if "annotations_count" in attributes: # pragma no branch
100
+ self._annotations_count = self._makeIntAttribute(attributes["annotations_count"])
101
+ if "annotations_url" in attributes: # pragma no branch
102
+ self._annotations_url = self._makeStringAttribute(attributes["annotations_url"])
103
+ if "summary" in attributes: # pragma no branch
104
+ self._summary = self._makeStringAttribute(attributes["summary"])
105
+ if "text" in attributes: # pragma no branch
106
+ self._text = self._makeStringAttribute(attributes["text"])
107
+ if "title" in attributes: # pragma no branch
108
+ self._title = self._makeStringAttribute(attributes["title"])