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.
- githubasyncio/AccessToken.py +159 -0
- githubasyncio/AdvisoryBase.py +163 -0
- githubasyncio/AdvisoryCredit.py +131 -0
- githubasyncio/AdvisoryCreditDetailed.py +110 -0
- githubasyncio/AdvisoryVulnerability.py +191 -0
- githubasyncio/AdvisoryVulnerabilityPackage.py +93 -0
- githubasyncio/AppAuthentication.py +58 -0
- githubasyncio/ApplicationOAuth.py +200 -0
- githubasyncio/Artifact.py +183 -0
- githubasyncio/Auth.py +560 -0
- githubasyncio/AuthenticatedUser.py +1251 -0
- githubasyncio/Authorization.py +192 -0
- githubasyncio/AuthorizationApplication.py +73 -0
- githubasyncio/Autolink.py +104 -0
- githubasyncio/Branch.py +689 -0
- githubasyncio/BranchProtection.py +224 -0
- githubasyncio/CVSS.py +83 -0
- githubasyncio/CWE.py +75 -0
- githubasyncio/CheckRun.py +315 -0
- githubasyncio/CheckRunAnnotation.py +134 -0
- githubasyncio/CheckRunOutput.py +108 -0
- githubasyncio/CheckSuite.py +319 -0
- githubasyncio/Clones.py +97 -0
- githubasyncio/CodeScanAlert.py +215 -0
- githubasyncio/CodeScanAlertInstance.py +134 -0
- githubasyncio/CodeScanAlertInstanceLocation.py +102 -0
- githubasyncio/CodeScanRule.py +134 -0
- githubasyncio/CodeScanTool.py +94 -0
- githubasyncio/CodeSecurityConfig.py +301 -0
- githubasyncio/CodeSecurityConfigRepository.py +70 -0
- githubasyncio/Commit.py +442 -0
- githubasyncio/CommitCombinedStatus.py +126 -0
- githubasyncio/CommitComment.py +270 -0
- githubasyncio/CommitStats.py +78 -0
- githubasyncio/CommitStatus.py +169 -0
- githubasyncio/Comparison.py +219 -0
- githubasyncio/Consts.py +197 -0
- githubasyncio/ContentFile.py +304 -0
- githubasyncio/Copilot.py +97 -0
- githubasyncio/CopilotSeat.py +132 -0
- githubasyncio/DefaultCodeSecurityConfig.py +93 -0
- githubasyncio/DependabotAlert.py +184 -0
- githubasyncio/DependabotAlertAdvisory.py +82 -0
- githubasyncio/DependabotAlertDependency.py +100 -0
- githubasyncio/DependabotAlertVulnerability.py +85 -0
- githubasyncio/Deployment.py +314 -0
- githubasyncio/DeploymentBranchPolicy.py +102 -0
- githubasyncio/DeploymentStatus.py +201 -0
- githubasyncio/DiscussionBase.py +140 -0
- githubasyncio/DiscussionCommentBase.py +140 -0
- githubasyncio/Download.py +256 -0
- githubasyncio/Enterprise.py +175 -0
- githubasyncio/EnterpriseConsumedLicenses.py +138 -0
- githubasyncio/Environment.py +354 -0
- githubasyncio/EnvironmentDeploymentBranchPolicy.py +87 -0
- githubasyncio/EnvironmentProtectionRule.py +117 -0
- githubasyncio/EnvironmentProtectionRuleReviewer.py +110 -0
- githubasyncio/Event.py +134 -0
- githubasyncio/File.py +142 -0
- githubasyncio/GeneratedReleaseNotes.py +68 -0
- githubasyncio/Gist.py +373 -0
- githubasyncio/GistComment.py +162 -0
- githubasyncio/GistFile.py +106 -0
- githubasyncio/GistHistoryState.py +245 -0
- githubasyncio/GitAuthor.py +94 -0
- githubasyncio/GitBlob.py +123 -0
- githubasyncio/GitCommit.py +208 -0
- githubasyncio/GitCommitVerification.py +103 -0
- githubasyncio/GitObject.py +84 -0
- githubasyncio/GitRef.py +122 -0
- githubasyncio/GitRelease.py +476 -0
- githubasyncio/GitReleaseAsset.py +232 -0
- githubasyncio/GitTag.py +143 -0
- githubasyncio/GitTree.py +113 -0
- githubasyncio/GitTreeElement.py +104 -0
- githubasyncio/GithubApp.py +236 -0
- githubasyncio/GithubException.py +226 -0
- githubasyncio/GithubIntegration.py +365 -0
- githubasyncio/GithubObject.py +910 -0
- githubasyncio/GithubRetry.py +253 -0
- githubasyncio/GitignoreTemplate.py +88 -0
- githubasyncio/GlobalAdvisory.py +141 -0
- githubasyncio/Hook.py +238 -0
- githubasyncio/HookDelivery.py +243 -0
- githubasyncio/HookDescription.py +85 -0
- githubasyncio/HookResponse.py +83 -0
- githubasyncio/InputFileContent.py +63 -0
- githubasyncio/InputGitAuthor.py +71 -0
- githubasyncio/InputGitTreeElement.py +79 -0
- githubasyncio/Installation.py +298 -0
- githubasyncio/InstallationAuthorization.py +138 -0
- githubasyncio/Invitation.py +171 -0
- githubasyncio/Issue.py +955 -0
- githubasyncio/IssueComment.py +309 -0
- githubasyncio/IssueDependenciesSummary.py +77 -0
- githubasyncio/IssueEvent.py +296 -0
- githubasyncio/IssuePullRequest.py +97 -0
- githubasyncio/IssueType.py +123 -0
- githubasyncio/Label.py +186 -0
- githubasyncio/License.py +169 -0
- githubasyncio/MainClass.py +1142 -0
- githubasyncio/Membership.py +154 -0
- githubasyncio/MergedUpstream.py +71 -0
- githubasyncio/Migration.py +281 -0
- githubasyncio/Milestone.py +255 -0
- githubasyncio/NamedEnterpriseUser.py +207 -0
- githubasyncio/NamedUser.py +841 -0
- githubasyncio/Notification.py +182 -0
- githubasyncio/NotificationSubject.py +96 -0
- githubasyncio/Organization.py +2462 -0
- githubasyncio/OrganizationCodeScanAlert.py +65 -0
- githubasyncio/OrganizationCustomProperty.py +215 -0
- githubasyncio/OrganizationDependabotAlert.py +75 -0
- githubasyncio/OrganizationSecret.py +191 -0
- githubasyncio/OrganizationSecretScanAlert.py +112 -0
- githubasyncio/OrganizationVariable.py +141 -0
- githubasyncio/PaginatedList.py +652 -0
- githubasyncio/Path.py +102 -0
- githubasyncio/Permissions.py +113 -0
- githubasyncio/Plan.py +108 -0
- githubasyncio/Project.py +286 -0
- githubasyncio/ProjectCard.py +257 -0
- githubasyncio/ProjectColumn.py +227 -0
- githubasyncio/PublicKey.py +138 -0
- githubasyncio/PullRequest.py +1202 -0
- githubasyncio/PullRequestComment.py +401 -0
- githubasyncio/PullRequestMergeStatus.py +89 -0
- githubasyncio/PullRequestPart.py +110 -0
- githubasyncio/PullRequestReview.py +214 -0
- githubasyncio/Rate.py +123 -0
- githubasyncio/RateLimit.py +210 -0
- githubasyncio/RateLimitOverview.py +104 -0
- githubasyncio/Reaction.py +128 -0
- githubasyncio/Referrer.py +94 -0
- githubasyncio/RepoCodeSecurityConfig.py +93 -0
- githubasyncio/Repository.py +5211 -0
- githubasyncio/RepositoryAdvisory.py +431 -0
- githubasyncio/RepositoryDiscussion.py +221 -0
- githubasyncio/RepositoryDiscussionCategory.py +150 -0
- githubasyncio/RepositoryDiscussionComment.py +159 -0
- githubasyncio/RepositoryKey.py +166 -0
- githubasyncio/RepositoryPreferences.py +82 -0
- githubasyncio/RepositoryRulesetBypassActor.py +75 -0
- githubasyncio/Requester.py +1518 -0
- githubasyncio/RequiredPullRequestReviews.py +269 -0
- githubasyncio/RequiredStatusChecks.py +153 -0
- githubasyncio/Rule.py +134 -0
- githubasyncio/Ruleset.py +292 -0
- githubasyncio/Secret.py +139 -0
- githubasyncio/SecretScanAlert.py +317 -0
- githubasyncio/SecretScanAlertInstance.py +128 -0
- githubasyncio/SecurityAndAnalysis.py +188 -0
- githubasyncio/SecurityAndAnalysisFeature.py +79 -0
- githubasyncio/SelfHostedActionsRunner.py +129 -0
- githubasyncio/SelfHostedActionsRunnerApplication.py +92 -0
- githubasyncio/SelfHostedActionsRunnerJitConfig.py +74 -0
- githubasyncio/SelfHostedActionsRunnerToken.py +118 -0
- githubasyncio/SourceImport.py +260 -0
- githubasyncio/Stargazer.py +88 -0
- githubasyncio/StatsCodeFrequency.py +81 -0
- githubasyncio/StatsCommitActivity.py +86 -0
- githubasyncio/StatsContributor.py +138 -0
- githubasyncio/StatsParticipation.py +78 -0
- githubasyncio/StatsPunchCard.py +76 -0
- githubasyncio/SubIssueSummary.py +70 -0
- githubasyncio/Tag.py +108 -0
- githubasyncio/Team.py +618 -0
- githubasyncio/TeamDiscussion.py +137 -0
- githubasyncio/TimelineEvent.py +164 -0
- githubasyncio/TimelineEventSource.py +81 -0
- githubasyncio/Topic.py +177 -0
- githubasyncio/Traffic.py +95 -0
- githubasyncio/UserKey.py +141 -0
- githubasyncio/Variable.py +155 -0
- githubasyncio/View.py +97 -0
- githubasyncio/Workflow.py +335 -0
- githubasyncio/WorkflowJob.py +253 -0
- githubasyncio/WorkflowRun.py +480 -0
- githubasyncio/WorkflowStep.py +118 -0
- githubasyncio/__init__.py +38 -0
- githubasyncio/compat/__init__.py +52 -0
- githubasyncio/requestlib/__init__.py +29 -0
- pygithub_asyncio-3.0.0b1.dist-info/METADATA +102 -0
- pygithub_asyncio-3.0.0b1.dist-info/RECORD +188 -0
- pygithub_asyncio-3.0.0b1.dist-info/WHEEL +5 -0
- pygithub_asyncio-3.0.0b1.dist-info/licenses/COPYING +674 -0
- pygithub_asyncio-3.0.0b1.dist-info/licenses/COPYING.LESSER +165 -0
- pygithub_asyncio-3.0.0b1.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,319 @@
|
|
|
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 2020 Yannick Jadoul <yannick.jadoul@belgacom.net> #
|
|
7
|
+
# Copyright 2021 Steve Kowalik <steven@wedontsleep.org> #
|
|
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 Enrico Minack <github@enrico.minack.dev> #
|
|
14
|
+
# #
|
|
15
|
+
# This file is part of PyGithub. #
|
|
16
|
+
# http://pygithub.readthedocs.io/ #
|
|
17
|
+
# #
|
|
18
|
+
# PyGithub is free software: you can redistribute it and/or modify it under #
|
|
19
|
+
# the terms of the GNU Lesser General Public License as published by the Free #
|
|
20
|
+
# Software Foundation, either version 3 of the License, or (at your option) #
|
|
21
|
+
# any later version. #
|
|
22
|
+
# #
|
|
23
|
+
# PyGithub is distributed in the hope that it will be useful, but WITHOUT ANY #
|
|
24
|
+
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS #
|
|
25
|
+
# FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more #
|
|
26
|
+
# details. #
|
|
27
|
+
# #
|
|
28
|
+
# You should have received a copy of the GNU Lesser General Public License #
|
|
29
|
+
# along with PyGithub. If not, see <http://www.gnu.org/licenses/>. #
|
|
30
|
+
# #
|
|
31
|
+
################################################################################
|
|
32
|
+
|
|
33
|
+
from __future__ import annotations
|
|
34
|
+
|
|
35
|
+
from datetime import datetime
|
|
36
|
+
from typing import TYPE_CHECKING, Any
|
|
37
|
+
|
|
38
|
+
import githubasyncio.CheckRun
|
|
39
|
+
import githubasyncio.GitCommit
|
|
40
|
+
import githubasyncio.GithubApp
|
|
41
|
+
import githubasyncio.PullRequest
|
|
42
|
+
import githubasyncio.Repository
|
|
43
|
+
from githubasyncio.GithubObject import Attribute, CompletableGithubObject, NotSet, Opt, is_defined, is_optional
|
|
44
|
+
from githubasyncio.PaginatedList import PaginatedList
|
|
45
|
+
|
|
46
|
+
if TYPE_CHECKING:
|
|
47
|
+
from githubasyncio.CheckRun import CheckRun
|
|
48
|
+
from githubasyncio.GitCommit import GitCommit
|
|
49
|
+
from githubasyncio.GithubApp import GithubApp
|
|
50
|
+
from githubasyncio.PullRequest import PullRequest
|
|
51
|
+
from githubasyncio.Repository import Repository
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
class CheckSuite(CompletableGithubObject):
|
|
55
|
+
"""
|
|
56
|
+
This class represents check suites.
|
|
57
|
+
|
|
58
|
+
The reference can be found here
|
|
59
|
+
https://docs.github.com/en/rest/reference/checks#check-suites
|
|
60
|
+
|
|
61
|
+
The OpenAPI schema can be found at
|
|
62
|
+
|
|
63
|
+
- /components/schemas/check-run/properties/check_suite
|
|
64
|
+
- /components/schemas/check-suite
|
|
65
|
+
|
|
66
|
+
"""
|
|
67
|
+
|
|
68
|
+
def _initAttributes(self) -> None:
|
|
69
|
+
self._after: Attribute[str] = NotSet
|
|
70
|
+
self._app: Attribute[GithubApp] = NotSet
|
|
71
|
+
self._before: Attribute[str] = NotSet
|
|
72
|
+
self._check_runs_url: Attribute[str] = NotSet
|
|
73
|
+
self._conclusion: Attribute[str] = NotSet
|
|
74
|
+
self._created_at: Attribute[datetime] = NotSet
|
|
75
|
+
self._head_branch: Attribute[str] = NotSet
|
|
76
|
+
self._head_commit: Attribute[GitCommit] = NotSet
|
|
77
|
+
self._head_sha: Attribute[str] = NotSet
|
|
78
|
+
self._id: Attribute[int] = NotSet
|
|
79
|
+
self._latest_check_runs_count: Attribute[int] = NotSet
|
|
80
|
+
self._node_id: Attribute[str] = NotSet
|
|
81
|
+
self._pull_requests: Attribute[list[PullRequest]] = NotSet
|
|
82
|
+
self._repository: Attribute[Repository] = NotSet
|
|
83
|
+
self._rerequestable: Attribute[bool] = NotSet
|
|
84
|
+
self._runs_rerequestable: Attribute[bool] = NotSet
|
|
85
|
+
self._status: Attribute[str] = NotSet
|
|
86
|
+
self._updated_at: Attribute[datetime] = NotSet
|
|
87
|
+
self._url: Attribute[str] = NotSet
|
|
88
|
+
|
|
89
|
+
def __repr__(self) -> str:
|
|
90
|
+
return self.get__repr__({"id": self._id.value, "url": self._url.value})
|
|
91
|
+
|
|
92
|
+
@property
|
|
93
|
+
async def after(self) -> str:
|
|
94
|
+
"""
|
|
95
|
+
:type: string
|
|
96
|
+
"""
|
|
97
|
+
await self._completeIfNotSet(self._after)
|
|
98
|
+
return self._after.value
|
|
99
|
+
|
|
100
|
+
@property
|
|
101
|
+
async def app(self) -> GithubApp:
|
|
102
|
+
"""
|
|
103
|
+
:type: :class:`githubasyncio.GithubApp.GithubApp`
|
|
104
|
+
"""
|
|
105
|
+
await self._completeIfNotSet(self._app)
|
|
106
|
+
return self._app.value
|
|
107
|
+
|
|
108
|
+
@property
|
|
109
|
+
async def before(self) -> str:
|
|
110
|
+
"""
|
|
111
|
+
:type: string
|
|
112
|
+
"""
|
|
113
|
+
await self._completeIfNotSet(self._before)
|
|
114
|
+
return self._before.value
|
|
115
|
+
|
|
116
|
+
@property
|
|
117
|
+
async def check_runs_url(self) -> str:
|
|
118
|
+
"""
|
|
119
|
+
:type: string
|
|
120
|
+
"""
|
|
121
|
+
await self._completeIfNotSet(self._check_runs_url)
|
|
122
|
+
return self._check_runs_url.value
|
|
123
|
+
|
|
124
|
+
@property
|
|
125
|
+
async def conclusion(self) -> str:
|
|
126
|
+
"""
|
|
127
|
+
:type: string
|
|
128
|
+
"""
|
|
129
|
+
await self._completeIfNotSet(self._conclusion)
|
|
130
|
+
return self._conclusion.value
|
|
131
|
+
|
|
132
|
+
@property
|
|
133
|
+
async def created_at(self) -> datetime:
|
|
134
|
+
"""
|
|
135
|
+
:type: datetime.datetime
|
|
136
|
+
"""
|
|
137
|
+
await self._completeIfNotSet(self._created_at)
|
|
138
|
+
return self._created_at.value
|
|
139
|
+
|
|
140
|
+
@property
|
|
141
|
+
async def head_branch(self) -> str:
|
|
142
|
+
"""
|
|
143
|
+
:type: string
|
|
144
|
+
"""
|
|
145
|
+
await self._completeIfNotSet(self._head_branch)
|
|
146
|
+
return self._head_branch.value
|
|
147
|
+
|
|
148
|
+
@property
|
|
149
|
+
async def head_commit(self) -> GitCommit:
|
|
150
|
+
"""
|
|
151
|
+
:type: :class:`githubasyncio.GitCommit.GitCommit`
|
|
152
|
+
"""
|
|
153
|
+
await self._completeIfNotSet(self._head_commit)
|
|
154
|
+
return self._head_commit.value
|
|
155
|
+
|
|
156
|
+
@property
|
|
157
|
+
async def head_sha(self) -> str:
|
|
158
|
+
"""
|
|
159
|
+
:type: string
|
|
160
|
+
"""
|
|
161
|
+
await self._completeIfNotSet(self._head_sha)
|
|
162
|
+
return self._head_sha.value
|
|
163
|
+
|
|
164
|
+
@property
|
|
165
|
+
async def id(self) -> int:
|
|
166
|
+
"""
|
|
167
|
+
:type: int
|
|
168
|
+
"""
|
|
169
|
+
await self._completeIfNotSet(self._id)
|
|
170
|
+
return self._id.value
|
|
171
|
+
|
|
172
|
+
@property
|
|
173
|
+
async def latest_check_runs_count(self) -> int:
|
|
174
|
+
"""
|
|
175
|
+
:type: int
|
|
176
|
+
"""
|
|
177
|
+
await self._completeIfNotSet(self._latest_check_runs_count)
|
|
178
|
+
return self._latest_check_runs_count.value
|
|
179
|
+
|
|
180
|
+
@property
|
|
181
|
+
async def node_id(self) -> str:
|
|
182
|
+
await self._completeIfNotSet(self._node_id)
|
|
183
|
+
return self._node_id.value
|
|
184
|
+
|
|
185
|
+
@property
|
|
186
|
+
async def pull_requests(self) -> list[PullRequest]:
|
|
187
|
+
"""
|
|
188
|
+
:type: list of :class:`githubasyncio.PullRequest.PullRequest`
|
|
189
|
+
"""
|
|
190
|
+
await self._completeIfNotSet(self._pull_requests)
|
|
191
|
+
return self._pull_requests.value
|
|
192
|
+
|
|
193
|
+
@property
|
|
194
|
+
async def repository(self) -> Repository:
|
|
195
|
+
"""
|
|
196
|
+
:type: :class:`githubasyncio.Repository.Repository`
|
|
197
|
+
"""
|
|
198
|
+
await self._completeIfNotSet(self._repository)
|
|
199
|
+
return self._repository.value
|
|
200
|
+
|
|
201
|
+
@property
|
|
202
|
+
async def rerequestable(self) -> bool:
|
|
203
|
+
await self._completeIfNotSet(self._rerequestable)
|
|
204
|
+
return self._rerequestable.value
|
|
205
|
+
|
|
206
|
+
@property
|
|
207
|
+
async def runs_rerequestable(self) -> bool:
|
|
208
|
+
await self._completeIfNotSet(self._runs_rerequestable)
|
|
209
|
+
return self._runs_rerequestable.value
|
|
210
|
+
|
|
211
|
+
@property
|
|
212
|
+
async def status(self) -> str:
|
|
213
|
+
"""
|
|
214
|
+
:type: string
|
|
215
|
+
"""
|
|
216
|
+
await self._completeIfNotSet(self._status)
|
|
217
|
+
return self._status.value
|
|
218
|
+
|
|
219
|
+
@property
|
|
220
|
+
async def updated_at(self) -> datetime:
|
|
221
|
+
"""
|
|
222
|
+
:type: datetime.datetime
|
|
223
|
+
"""
|
|
224
|
+
await self._completeIfNotSet(self._updated_at)
|
|
225
|
+
return self._updated_at.value
|
|
226
|
+
|
|
227
|
+
@property
|
|
228
|
+
def url(self) -> str: # type: ignore[override]
|
|
229
|
+
"""
|
|
230
|
+
:type: string
|
|
231
|
+
"""
|
|
232
|
+
return self._url.value
|
|
233
|
+
|
|
234
|
+
async def rerequest(self) -> bool:
|
|
235
|
+
"""
|
|
236
|
+
:calls: `POST /repos/{owner}/{repo}/check-suites/{check_suite_id}/rerequest <https://docs.github.com/en/rest/reference/checks#rerequest-a-check-suite>`_
|
|
237
|
+
:rtype: bool
|
|
238
|
+
"""
|
|
239
|
+
request_headers = {"Accept": "application/vnd.github.v3+json"}
|
|
240
|
+
status, _, _ = await self._requester.requestJson("POST", f"{self.url}/rerequest", headers=request_headers)
|
|
241
|
+
return status == 201
|
|
242
|
+
|
|
243
|
+
async def get_check_runs(
|
|
244
|
+
self,
|
|
245
|
+
check_name: Opt[str] = NotSet,
|
|
246
|
+
status: Opt[str] = NotSet,
|
|
247
|
+
filter: Opt[str] = NotSet,
|
|
248
|
+
) -> PaginatedList[CheckRun]:
|
|
249
|
+
"""
|
|
250
|
+
:calls: `GET /repos/{owner}/{repo}/check-suites/{check_suite_id}/check-runs <https://docs.github.com/en/rest/reference/checks#list-check-runs-in-a-check-suite>`_
|
|
251
|
+
"""
|
|
252
|
+
assert is_optional(check_name, str), check_name
|
|
253
|
+
assert is_optional(status, str), status
|
|
254
|
+
assert is_optional(filter, str), filter
|
|
255
|
+
url_parameters: dict[str, Any] = {}
|
|
256
|
+
if is_defined(check_name):
|
|
257
|
+
url_parameters["check_name"] = check_name
|
|
258
|
+
if is_defined(status):
|
|
259
|
+
url_parameters["status"] = status
|
|
260
|
+
if is_defined(filter):
|
|
261
|
+
url_parameters["filter"] = filter
|
|
262
|
+
return PaginatedList(
|
|
263
|
+
githubasyncio.CheckRun.CheckRun,
|
|
264
|
+
self._requester,
|
|
265
|
+
f"{self.url}/check-runs",
|
|
266
|
+
url_parameters,
|
|
267
|
+
headers={"Accept": "application/vnd.github.v3+json"},
|
|
268
|
+
list_item="check_runs",
|
|
269
|
+
)
|
|
270
|
+
|
|
271
|
+
def _useAttributes(self, attributes: dict[str, Any]) -> None:
|
|
272
|
+
if "after" in attributes: # pragma no branch
|
|
273
|
+
self._after = self._makeStringAttribute(attributes["after"])
|
|
274
|
+
if "app" in attributes: # pragma no branch
|
|
275
|
+
self._app = self._makeClassAttribute(githubasyncio.GithubApp.GithubApp, attributes["app"])
|
|
276
|
+
if "before" in attributes: # pragma no branch
|
|
277
|
+
self._before = self._makeStringAttribute(attributes["before"])
|
|
278
|
+
if "check_runs_url" in attributes: # pragma no branch
|
|
279
|
+
self._check_runs_url = self._makeStringAttribute(attributes["check_runs_url"])
|
|
280
|
+
if "conclusion" in attributes: # pragma no branch
|
|
281
|
+
self._conclusion = self._makeStringAttribute(attributes["conclusion"])
|
|
282
|
+
if "created_at" in attributes: # pragma no branch
|
|
283
|
+
self._created_at = self._makeDatetimeAttribute(attributes["created_at"])
|
|
284
|
+
if "head_branch" in attributes: # pragma no branch
|
|
285
|
+
self._head_branch = self._makeStringAttribute(attributes["head_branch"])
|
|
286
|
+
if "head_commit" in attributes: # pragma no branch
|
|
287
|
+
# This JSON swaps the 'sha' attribute for an 'id' attribute.
|
|
288
|
+
# The GitCommit object only looks for 'sha'
|
|
289
|
+
if "id" in attributes["head_commit"]:
|
|
290
|
+
attributes["head_commit"]["sha"] = attributes["head_commit"]["id"]
|
|
291
|
+
self._head_commit = self._makeClassAttribute(githubasyncio.GitCommit.GitCommit, attributes["head_commit"])
|
|
292
|
+
if "head_sha" in attributes: # pragma no branch
|
|
293
|
+
self._head_sha = self._makeStringAttribute(attributes["head_sha"])
|
|
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 "latest_check_runs_count" in attributes: # pragma no branch
|
|
301
|
+
self._latest_check_runs_count = self._makeIntAttribute(attributes["latest_check_runs_count"])
|
|
302
|
+
if "node_id" in attributes: # pragma no branch
|
|
303
|
+
self._node_id = self._makeStringAttribute(attributes["node_id"])
|
|
304
|
+
if "pull_requests" in attributes: # pragma no branch
|
|
305
|
+
self._pull_requests = self._makeListOfClassesAttribute(
|
|
306
|
+
githubasyncio.PullRequest.PullRequest, attributes["pull_requests"]
|
|
307
|
+
)
|
|
308
|
+
if "repository" in attributes: # pragma no branch
|
|
309
|
+
self._repository = self._makeClassAttribute(githubasyncio.Repository.Repository, attributes["repository"])
|
|
310
|
+
if "rerequestable" in attributes: # pragma no branch
|
|
311
|
+
self._rerequestable = self._makeBoolAttribute(attributes["rerequestable"])
|
|
312
|
+
if "runs_rerequestable" in attributes: # pragma no branch
|
|
313
|
+
self._runs_rerequestable = self._makeBoolAttribute(attributes["runs_rerequestable"])
|
|
314
|
+
if "status" in attributes: # pragma no branch
|
|
315
|
+
self._status = self._makeStringAttribute(attributes["status"])
|
|
316
|
+
if "updated_at" in attributes: # pragma no branch
|
|
317
|
+
self._updated_at = self._makeDatetimeAttribute(attributes["updated_at"])
|
|
318
|
+
if "url" in attributes: # pragma no branch
|
|
319
|
+
self._url = self._makeStringAttribute(attributes["url"])
|
githubasyncio/Clones.py
ADDED
|
@@ -0,0 +1,97 @@
|
|
|
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 Justin Kufro <jkufro@andrew.cmu.edu> #
|
|
12
|
+
# Copyright 2018 Wan Liuyang <tsfdye@gmail.com> #
|
|
13
|
+
# Copyright 2018 sfdye <tsfdye@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 2021 Steve Kowalik <steven@wedontsleep.org> #
|
|
18
|
+
# Copyright 2023 Enrico Minack <github@enrico.minack.dev> #
|
|
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 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 typing import TYPE_CHECKING, Any
|
|
45
|
+
|
|
46
|
+
import githubasyncio.Traffic
|
|
47
|
+
from githubasyncio.GithubObject import Attribute, NonCompletableGithubObject, NotSet
|
|
48
|
+
|
|
49
|
+
if TYPE_CHECKING:
|
|
50
|
+
from githubasyncio.Traffic import Traffic
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
class Clones(NonCompletableGithubObject):
|
|
54
|
+
"""
|
|
55
|
+
This class represents the total number of clones and breakdown per day or week for a GitHub repository.
|
|
56
|
+
|
|
57
|
+
The reference can be found here
|
|
58
|
+
https://docs.github.com/en/rest/metrics/traffic#get-repository-clones
|
|
59
|
+
|
|
60
|
+
The OpenAPI schema can be found at
|
|
61
|
+
|
|
62
|
+
- /components/schemas/clone-traffic
|
|
63
|
+
|
|
64
|
+
"""
|
|
65
|
+
|
|
66
|
+
def _initAttributes(self) -> None:
|
|
67
|
+
self._clones: Attribute[list[Traffic]] = NotSet
|
|
68
|
+
self._count: Attribute[int] = NotSet
|
|
69
|
+
self._uniques: Attribute[int] = NotSet
|
|
70
|
+
|
|
71
|
+
def __repr__(self) -> str:
|
|
72
|
+
return self.get__repr__(
|
|
73
|
+
{
|
|
74
|
+
"count": self._count.value,
|
|
75
|
+
"uniques": self._uniques.value,
|
|
76
|
+
}
|
|
77
|
+
)
|
|
78
|
+
|
|
79
|
+
@property
|
|
80
|
+
def clones(self) -> list[Traffic]:
|
|
81
|
+
return self._clones.value
|
|
82
|
+
|
|
83
|
+
@property
|
|
84
|
+
def count(self) -> int:
|
|
85
|
+
return self._count.value
|
|
86
|
+
|
|
87
|
+
@property
|
|
88
|
+
def uniques(self) -> int:
|
|
89
|
+
return self._uniques.value
|
|
90
|
+
|
|
91
|
+
def _useAttributes(self, attributes: dict[str, Any]) -> None:
|
|
92
|
+
if "clones" in attributes: # pragma no branch
|
|
93
|
+
self._clones = self._makeListOfClassesAttribute(githubasyncio.Traffic.Traffic, attributes["clones"])
|
|
94
|
+
if "count" in attributes: # pragma no branch
|
|
95
|
+
self._count = self._makeIntAttribute(attributes["count"])
|
|
96
|
+
if "uniques" in attributes: # pragma no branch
|
|
97
|
+
self._uniques = self._makeIntAttribute(attributes["uniques"])
|
|
@@ -0,0 +1,215 @@
|
|
|
1
|
+
# FILE AUTO GENERATED DO NOT TOUCH
|
|
2
|
+
############################ Copyrights and license ############################
|
|
3
|
+
# #
|
|
4
|
+
# Copyright 2022 Eric Nieuwland <eric.nieuwland@gmail.com> #
|
|
5
|
+
# Copyright 2023 Enrico Minack <github@enrico.minack.dev> #
|
|
6
|
+
# Copyright 2023 Jirka Borovec <6035284+Borda@users.noreply.github.com> #
|
|
7
|
+
# Copyright 2023 Trim21 <trim21.me@gmail.com> #
|
|
8
|
+
# Copyright 2024 Enrico Minack <github@enrico.minack.dev> #
|
|
9
|
+
# Copyright 2024 Jirka Borovec <6035284+Borda@users.noreply.github.com> #
|
|
10
|
+
# Copyright 2025 Enrico Minack <github@enrico.minack.dev> #
|
|
11
|
+
# Copyright 2025 ReenigneArcher <42013603+ReenigneArcher@users.noreply.github.com>#
|
|
12
|
+
# Copyright 2026 Enrico Minack <github@enrico.minack.dev> #
|
|
13
|
+
# Copyright 2026 Matt Davis <35502728+matt-davis27@users.noreply.github.com> #
|
|
14
|
+
# #
|
|
15
|
+
# This file is part of PyGithub. #
|
|
16
|
+
# http://pygithub.readthedocs.io/ #
|
|
17
|
+
# #
|
|
18
|
+
# PyGithub is free software: you can redistribute it and/or modify it under #
|
|
19
|
+
# the terms of the GNU Lesser General Public License as published by the Free #
|
|
20
|
+
# Software Foundation, either version 3 of the License, or (at your option) #
|
|
21
|
+
# any later version. #
|
|
22
|
+
# #
|
|
23
|
+
# PyGithub is distributed in the hope that it will be useful, but WITHOUT ANY #
|
|
24
|
+
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS #
|
|
25
|
+
# FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more #
|
|
26
|
+
# details. #
|
|
27
|
+
# #
|
|
28
|
+
# You should have received a copy of the GNU Lesser General Public License #
|
|
29
|
+
# along with PyGithub. If not, see <http://www.gnu.org/licenses/>. #
|
|
30
|
+
# #
|
|
31
|
+
################################################################################
|
|
32
|
+
|
|
33
|
+
from __future__ import annotations
|
|
34
|
+
|
|
35
|
+
from datetime import datetime
|
|
36
|
+
from typing import TYPE_CHECKING, Any
|
|
37
|
+
|
|
38
|
+
import githubasyncio.CodeScanAlertInstance
|
|
39
|
+
import githubasyncio.CodeScanRule
|
|
40
|
+
import githubasyncio.CodeScanTool
|
|
41
|
+
import githubasyncio.GithubObject
|
|
42
|
+
import githubasyncio.NamedUser
|
|
43
|
+
import githubasyncio.Organization
|
|
44
|
+
from githubasyncio.GithubObject import Attribute, NonCompletableGithubObject, NotSet
|
|
45
|
+
from githubasyncio.PaginatedList import PaginatedList
|
|
46
|
+
|
|
47
|
+
if TYPE_CHECKING:
|
|
48
|
+
from githubasyncio.CodeScanAlertInstance import CodeScanAlertInstance
|
|
49
|
+
from githubasyncio.CodeScanRule import CodeScanRule
|
|
50
|
+
from githubasyncio.CodeScanTool import CodeScanTool
|
|
51
|
+
from githubasyncio.NamedUser import NamedUser
|
|
52
|
+
from githubasyncio.Organization import Organization
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
class CodeScanAlert(NonCompletableGithubObject):
|
|
56
|
+
"""
|
|
57
|
+
This class represents alerts from code scanning.
|
|
58
|
+
|
|
59
|
+
The reference can be found here
|
|
60
|
+
https://docs.github.com/en/rest/reference/code-scanning.
|
|
61
|
+
|
|
62
|
+
The OpenAPI schema can be found at
|
|
63
|
+
|
|
64
|
+
- /components/schemas/code-scanning-alert
|
|
65
|
+
- /components/schemas/code-scanning-alert-items
|
|
66
|
+
|
|
67
|
+
"""
|
|
68
|
+
|
|
69
|
+
def _initAttributes(self) -> None:
|
|
70
|
+
self._assignees: Attribute[list[NamedUser]] = NotSet
|
|
71
|
+
self._created_at: Attribute[datetime] = NotSet
|
|
72
|
+
self._dismissal_approved_by: Attribute[NamedUser | Organization] = NotSet
|
|
73
|
+
self._dismissed_at: Attribute[datetime | None] = NotSet
|
|
74
|
+
self._dismissed_by: Attribute[NamedUser | None] = NotSet
|
|
75
|
+
self._dismissed_comment: Attribute[str | None] = NotSet
|
|
76
|
+
self._dismissed_reason: Attribute[str | None] = NotSet
|
|
77
|
+
self._fixed_at: Attribute[datetime | None] = NotSet
|
|
78
|
+
self._html_url: Attribute[str] = NotSet
|
|
79
|
+
self._instances_url: Attribute[str] = NotSet
|
|
80
|
+
self._most_recent_instance: Attribute[CodeScanAlertInstance] = NotSet
|
|
81
|
+
self._number: Attribute[int] = NotSet
|
|
82
|
+
self._rule: Attribute[CodeScanRule] = NotSet
|
|
83
|
+
self._state: Attribute[str] = NotSet
|
|
84
|
+
self._tool: Attribute[CodeScanTool] = NotSet
|
|
85
|
+
self._updated_at: Attribute[datetime] = NotSet
|
|
86
|
+
self._url: Attribute[str] = NotSet
|
|
87
|
+
|
|
88
|
+
def __repr__(self) -> str:
|
|
89
|
+
return self.get__repr__({"number": self._number.value, "id": self.rule.id})
|
|
90
|
+
|
|
91
|
+
@property
|
|
92
|
+
def assignees(self) -> list[NamedUser]:
|
|
93
|
+
return self._assignees.value
|
|
94
|
+
|
|
95
|
+
@property
|
|
96
|
+
def created_at(self) -> datetime:
|
|
97
|
+
return self._created_at.value
|
|
98
|
+
|
|
99
|
+
@property
|
|
100
|
+
def dismissal_approved_by(self) -> NamedUser | Organization:
|
|
101
|
+
return self._dismissal_approved_by.value
|
|
102
|
+
|
|
103
|
+
@property
|
|
104
|
+
def dismissed_at(self) -> datetime | None:
|
|
105
|
+
return self._dismissed_at.value
|
|
106
|
+
|
|
107
|
+
@property
|
|
108
|
+
def dismissed_by(self) -> NamedUser | None:
|
|
109
|
+
return self._dismissed_by.value
|
|
110
|
+
|
|
111
|
+
@property
|
|
112
|
+
def dismissed_comment(self) -> str | None:
|
|
113
|
+
return self._dismissed_comment.value
|
|
114
|
+
|
|
115
|
+
@property
|
|
116
|
+
def dismissed_reason(self) -> str | None:
|
|
117
|
+
return self._dismissed_reason.value
|
|
118
|
+
|
|
119
|
+
@property
|
|
120
|
+
def fixed_at(self) -> datetime | None:
|
|
121
|
+
return self._fixed_at.value
|
|
122
|
+
|
|
123
|
+
@property
|
|
124
|
+
def html_url(self) -> str:
|
|
125
|
+
return self._html_url.value
|
|
126
|
+
|
|
127
|
+
@property
|
|
128
|
+
def instances_url(self) -> str:
|
|
129
|
+
return self._instances_url.value
|
|
130
|
+
|
|
131
|
+
@property
|
|
132
|
+
def most_recent_instance(self) -> CodeScanAlertInstance:
|
|
133
|
+
return self._most_recent_instance.value
|
|
134
|
+
|
|
135
|
+
@property
|
|
136
|
+
def number(self) -> int:
|
|
137
|
+
return self._number.value
|
|
138
|
+
|
|
139
|
+
@property
|
|
140
|
+
def rule(self) -> CodeScanRule:
|
|
141
|
+
return self._rule.value
|
|
142
|
+
|
|
143
|
+
@property
|
|
144
|
+
def state(self) -> str:
|
|
145
|
+
return self._state.value
|
|
146
|
+
|
|
147
|
+
@property
|
|
148
|
+
def tool(self) -> CodeScanTool:
|
|
149
|
+
return self._tool.value
|
|
150
|
+
|
|
151
|
+
@property
|
|
152
|
+
def updated_at(self) -> datetime:
|
|
153
|
+
return self._updated_at.value
|
|
154
|
+
|
|
155
|
+
@property
|
|
156
|
+
def url(self) -> str:
|
|
157
|
+
return self._url.value
|
|
158
|
+
|
|
159
|
+
def get_instances(self) -> PaginatedList[CodeScanAlertInstance]:
|
|
160
|
+
"""
|
|
161
|
+
:calls: `GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/instances <https://docs.github.com/en/rest/code-scanning/code-scanning#list-instances-of-a-code-scanning-alert>`_
|
|
162
|
+
"""
|
|
163
|
+
return PaginatedList(
|
|
164
|
+
githubasyncio.CodeScanAlertInstance.CodeScanAlertInstance,
|
|
165
|
+
self._requester,
|
|
166
|
+
self.instances_url,
|
|
167
|
+
None,
|
|
168
|
+
)
|
|
169
|
+
|
|
170
|
+
def _useAttributes(self, attributes: dict[str, Any]) -> None:
|
|
171
|
+
if "assignees" in attributes: # pragma no branch
|
|
172
|
+
self._assignees = self._makeListOfClassesAttribute(
|
|
173
|
+
githubasyncio.NamedUser.NamedUser, attributes["assignees"]
|
|
174
|
+
)
|
|
175
|
+
if "created_at" in attributes: # pragma no branch
|
|
176
|
+
self._created_at = self._makeDatetimeAttribute(attributes["created_at"])
|
|
177
|
+
if "dismissal_approved_by" in attributes: # pragma no branch
|
|
178
|
+
self._dismissal_approved_by = self._makeUnionClassAttributeFromTypeKey(
|
|
179
|
+
"type",
|
|
180
|
+
"User",
|
|
181
|
+
attributes["dismissal_approved_by"],
|
|
182
|
+
(githubasyncio.NamedUser.NamedUser, "User"),
|
|
183
|
+
(githubasyncio.Organization.Organization, "Organization"),
|
|
184
|
+
)
|
|
185
|
+
if "dismissed_at" in attributes: # pragma no branch
|
|
186
|
+
self._dismissed_at = self._makeDatetimeAttribute(attributes["dismissed_at"])
|
|
187
|
+
if "dismissed_by" in attributes: # pragma no branch
|
|
188
|
+
self._dismissed_by = self._makeClassAttribute(githubasyncio.NamedUser.NamedUser, attributes["dismissed_by"])
|
|
189
|
+
if "dismissed_comment" in attributes: # pragma no branch
|
|
190
|
+
self._dismissed_comment = self._makeStringAttribute(attributes["dismissed_comment"])
|
|
191
|
+
if "dismissed_reason" in attributes: # pragma no branch
|
|
192
|
+
self._dismissed_reason = self._makeStringAttribute(attributes["dismissed_reason"])
|
|
193
|
+
if "fixed_at" in attributes: # pragma no branch
|
|
194
|
+
self._fixed_at = self._makeDatetimeAttribute(attributes["fixed_at"])
|
|
195
|
+
if "html_url" in attributes: # pragma no branch
|
|
196
|
+
self._html_url = self._makeStringAttribute(attributes["html_url"])
|
|
197
|
+
if "instances_url" in attributes: # pragma no branch
|
|
198
|
+
self._instances_url = self._makeStringAttribute(attributes["instances_url"])
|
|
199
|
+
if "most_recent_instance" in attributes: # pragma no branch
|
|
200
|
+
self._most_recent_instance = self._makeClassAttribute(
|
|
201
|
+
githubasyncio.CodeScanAlertInstance.CodeScanAlertInstance,
|
|
202
|
+
attributes["most_recent_instance"],
|
|
203
|
+
)
|
|
204
|
+
if "number" in attributes: # pragma no branch
|
|
205
|
+
self._number = self._makeIntAttribute(attributes["number"])
|
|
206
|
+
if "rule" in attributes: # pragma no branch
|
|
207
|
+
self._rule = self._makeClassAttribute(githubasyncio.CodeScanRule.CodeScanRule, attributes["rule"])
|
|
208
|
+
if "state" in attributes: # pragma no branch
|
|
209
|
+
self._state = self._makeStringAttribute(attributes["state"])
|
|
210
|
+
if "tool" in attributes: # pragma no branch
|
|
211
|
+
self._tool = self._makeClassAttribute(githubasyncio.CodeScanTool.CodeScanTool, attributes["tool"])
|
|
212
|
+
if "updated_at" in attributes: # pragma no branch
|
|
213
|
+
self._updated_at = self._makeDatetimeAttribute(attributes["updated_at"])
|
|
214
|
+
if "url" in attributes: # pragma no branch
|
|
215
|
+
self._url = self._makeStringAttribute(attributes["url"])
|