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,219 @@
|
|
|
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 Peter Buckley <dx-pbuckley@users.noreply.github.com> #
|
|
10
|
+
# Copyright 2018 Wan Liuyang <tsfdye@gmail.com> #
|
|
11
|
+
# Copyright 2018 sfdye <tsfdye@gmail.com> #
|
|
12
|
+
# Copyright 2019 Steve Kowalik <steven@wedontsleep.org> #
|
|
13
|
+
# Copyright 2019 Wan Liuyang <tsfdye@gmail.com> #
|
|
14
|
+
# Copyright 2020 Steve Kowalik <steven@wedontsleep.org> #
|
|
15
|
+
# Copyright 2023 Enrico Minack <github@enrico.minack.dev> #
|
|
16
|
+
# Copyright 2023 Jirka Borovec <6035284+Borda@users.noreply.github.com> #
|
|
17
|
+
# Copyright 2023 Trim21 <trim21.me@gmail.com> #
|
|
18
|
+
# Copyright 2024 Enrico Minack <github@enrico.minack.dev> #
|
|
19
|
+
# Copyright 2024 Jirka Borovec <6035284+Borda@users.noreply.github.com> #
|
|
20
|
+
# Copyright 2025 Enrico Minack <github@enrico.minack.dev> #
|
|
21
|
+
# Copyright 2026 Enrico Minack <github@enrico.minack.dev> #
|
|
22
|
+
# #
|
|
23
|
+
# This file is part of PyGithub. #
|
|
24
|
+
# http://pygithub.readthedocs.io/ #
|
|
25
|
+
# #
|
|
26
|
+
# PyGithub is free software: you can redistribute it and/or modify it under #
|
|
27
|
+
# the terms of the GNU Lesser General Public License as published by the Free #
|
|
28
|
+
# Software Foundation, either version 3 of the License, or (at your option) #
|
|
29
|
+
# any later version. #
|
|
30
|
+
# #
|
|
31
|
+
# PyGithub is distributed in the hope that it will be useful, but WITHOUT ANY #
|
|
32
|
+
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS #
|
|
33
|
+
# FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more #
|
|
34
|
+
# details. #
|
|
35
|
+
# #
|
|
36
|
+
# You should have received a copy of the GNU Lesser General Public License #
|
|
37
|
+
# along with PyGithub. If not, see <http://www.gnu.org/licenses/>. #
|
|
38
|
+
# #
|
|
39
|
+
################################################################################
|
|
40
|
+
|
|
41
|
+
from __future__ import annotations
|
|
42
|
+
|
|
43
|
+
from typing import TYPE_CHECKING, Any
|
|
44
|
+
|
|
45
|
+
import githubasyncio.Commit
|
|
46
|
+
import githubasyncio.File
|
|
47
|
+
from githubasyncio.GithubObject import Attribute, CompletableGithubObjectWithPaginatedProperty, NotSet
|
|
48
|
+
from githubasyncio.PaginatedList import PaginatedList
|
|
49
|
+
|
|
50
|
+
if TYPE_CHECKING:
|
|
51
|
+
from githubasyncio.Commit import Commit
|
|
52
|
+
from githubasyncio.File import File
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
class Comparison(CompletableGithubObjectWithPaginatedProperty):
|
|
56
|
+
"""
|
|
57
|
+
This class represents Comparisons.
|
|
58
|
+
|
|
59
|
+
The reference can be found here
|
|
60
|
+
https://docs.github.com/en/rest/commits/commits#compare-two-commits
|
|
61
|
+
|
|
62
|
+
This class has a `paginated property <https://pygithub.readthedocs.io/en/stable/utilities.html#classes-with-paginated-properties>`_.
|
|
63
|
+
For details, see :meth:`Comparison.commits` or :meth:`Comparison.get_commits`.
|
|
64
|
+
|
|
65
|
+
The OpenAPI schema can be found at
|
|
66
|
+
|
|
67
|
+
- /components/schemas/commit-comparison
|
|
68
|
+
|
|
69
|
+
"""
|
|
70
|
+
|
|
71
|
+
def _initAttributes(self) -> None:
|
|
72
|
+
super()._initAttributes()
|
|
73
|
+
self._ahead_by: Attribute[int] = NotSet
|
|
74
|
+
self._base_commit: Attribute[Commit] = NotSet
|
|
75
|
+
self._behind_by: Attribute[int] = NotSet
|
|
76
|
+
self._commits: Attribute[list[Commit]] = NotSet
|
|
77
|
+
self._diff_url: Attribute[str] = NotSet
|
|
78
|
+
self._files: Attribute[list[File]] = NotSet
|
|
79
|
+
self._html_url: Attribute[str] = NotSet
|
|
80
|
+
self._merge_base_commit: Attribute[Commit] = NotSet
|
|
81
|
+
self._patch_url: Attribute[str] = NotSet
|
|
82
|
+
self._permalink_url: Attribute[str] = NotSet
|
|
83
|
+
self._status: Attribute[str] = NotSet
|
|
84
|
+
self._total_commits: Attribute[int] = NotSet
|
|
85
|
+
|
|
86
|
+
def __repr__(self) -> str:
|
|
87
|
+
return self.get__repr__({"url": self._url.value})
|
|
88
|
+
|
|
89
|
+
@property
|
|
90
|
+
async def ahead_by(self) -> int:
|
|
91
|
+
await self._completeIfNotSet(self._ahead_by)
|
|
92
|
+
return self._ahead_by.value
|
|
93
|
+
|
|
94
|
+
@property
|
|
95
|
+
async def base_commit(self) -> Commit:
|
|
96
|
+
await self._completeIfNotSet(self._base_commit)
|
|
97
|
+
return self._base_commit.value
|
|
98
|
+
|
|
99
|
+
@property
|
|
100
|
+
async def behind_by(self) -> int:
|
|
101
|
+
await self._completeIfNotSet(self._behind_by)
|
|
102
|
+
return self._behind_by.value
|
|
103
|
+
|
|
104
|
+
@property
|
|
105
|
+
async def commits(self) -> PaginatedList[Commit]:
|
|
106
|
+
"""
|
|
107
|
+
This is a `paginated property <https://pygithub.readthedocs.io/en/stable/utilities.html#classes-with-paginated-properties>`_.
|
|
108
|
+
|
|
109
|
+
Iterating over this paginated list may fetch multiple pages. The size of these pages can be controlled via
|
|
110
|
+
the ``…_per_page`` parameter of :meth:`githubasyncio.Repository.Repository.compare`,
|
|
111
|
+
:meth:`Comparison.get_commits`, or :meth:`github.Github`.
|
|
112
|
+
|
|
113
|
+
If no ``per_page`` is given, the default page size is 250. The maximum is 1000.
|
|
114
|
+
|
|
115
|
+
At most 10000 commits can be retrieved.
|
|
116
|
+
"""
|
|
117
|
+
return PaginatedList(
|
|
118
|
+
githubasyncio.Commit.Commit,
|
|
119
|
+
self._requester,
|
|
120
|
+
await self.url,
|
|
121
|
+
self._pagination_parameters,
|
|
122
|
+
list_item="commits",
|
|
123
|
+
total_count_item="total_commits",
|
|
124
|
+
firstData=(await self.raw_data) if self.completed else None,
|
|
125
|
+
firstHeaders=(await self.raw_headers) if self.completed else None,
|
|
126
|
+
)
|
|
127
|
+
|
|
128
|
+
@property
|
|
129
|
+
async def diff_url(self) -> str:
|
|
130
|
+
await self._completeIfNotSet(self._diff_url)
|
|
131
|
+
return self._diff_url.value
|
|
132
|
+
|
|
133
|
+
@property
|
|
134
|
+
async def files(self) -> list[File]:
|
|
135
|
+
"""
|
|
136
|
+
Only the first 300 changed files.
|
|
137
|
+
"""
|
|
138
|
+
await self._completeIfNotSet(self._files)
|
|
139
|
+
return self._files.value
|
|
140
|
+
|
|
141
|
+
@property
|
|
142
|
+
async def html_url(self) -> str:
|
|
143
|
+
await self._completeIfNotSet(self._html_url)
|
|
144
|
+
return self._html_url.value
|
|
145
|
+
|
|
146
|
+
@property
|
|
147
|
+
async def merge_base_commit(self) -> Commit:
|
|
148
|
+
await self._completeIfNotSet(self._merge_base_commit)
|
|
149
|
+
return self._merge_base_commit.value
|
|
150
|
+
|
|
151
|
+
@property
|
|
152
|
+
async def patch_url(self) -> str:
|
|
153
|
+
await self._completeIfNotSet(self._patch_url)
|
|
154
|
+
return self._patch_url.value
|
|
155
|
+
|
|
156
|
+
@property
|
|
157
|
+
async def permalink_url(self) -> str:
|
|
158
|
+
await self._completeIfNotSet(self._permalink_url)
|
|
159
|
+
return self._permalink_url.value
|
|
160
|
+
|
|
161
|
+
@property
|
|
162
|
+
async def status(self) -> str:
|
|
163
|
+
await self._completeIfNotSet(self._status)
|
|
164
|
+
return self._status.value
|
|
165
|
+
|
|
166
|
+
@property
|
|
167
|
+
async def total_commits(self) -> int:
|
|
168
|
+
await self._completeIfNotSet(self._total_commits)
|
|
169
|
+
return self._total_commits.value
|
|
170
|
+
|
|
171
|
+
async def get_commits(self, *, comparison_commits_per_page: int | None = None) -> PaginatedList[Commit]:
|
|
172
|
+
"""
|
|
173
|
+
:calls: `GET /repos/{owner}/{repo}/compare/{base...:head} <https://docs.github.com/en/rest/commits/commits#compare-two-commits>`_
|
|
174
|
+
|
|
175
|
+
Identical to calling :meth:`Comparison.commits`, except that this uses the given ``per_page`` value.
|
|
176
|
+
|
|
177
|
+
For more details, see :meth:`Comparison.commits`.
|
|
178
|
+
|
|
179
|
+
:param comparison_commits_per_page: int Number of commits retrieved per page.
|
|
180
|
+
Iterating over the commits will fetch pages of this size. The default page size is 250, the maximum is 1000.
|
|
181
|
+
At most 10000 commits can be retrieved.
|
|
182
|
+
"""
|
|
183
|
+
return PaginatedList(
|
|
184
|
+
githubasyncio.Commit.Commit,
|
|
185
|
+
self._requester,
|
|
186
|
+
await self.url,
|
|
187
|
+
self._pagination_parameters_with(page=1, per_page=comparison_commits_per_page),
|
|
188
|
+
headers=None,
|
|
189
|
+
list_item="commits",
|
|
190
|
+
)
|
|
191
|
+
|
|
192
|
+
def _useAttributes(self, attributes: dict[str, Any]) -> None:
|
|
193
|
+
super()._useAttributes(attributes)
|
|
194
|
+
if "ahead_by" in attributes: # pragma no branch
|
|
195
|
+
self._ahead_by = self._makeIntAttribute(attributes["ahead_by"])
|
|
196
|
+
if "base_commit" in attributes: # pragma no branch
|
|
197
|
+
self._base_commit = self._makeClassAttribute(githubasyncio.Commit.Commit, attributes["base_commit"])
|
|
198
|
+
if "behind_by" in attributes: # pragma no branch
|
|
199
|
+
self._behind_by = self._makeIntAttribute(attributes["behind_by"])
|
|
200
|
+
if "commits" in attributes: # pragma no branch
|
|
201
|
+
self._commits = self._makeListOfClassesAttribute(githubasyncio.Commit.Commit, attributes["commits"])
|
|
202
|
+
if "diff_url" in attributes: # pragma no branch
|
|
203
|
+
self._diff_url = self._makeStringAttribute(attributes["diff_url"])
|
|
204
|
+
if "files" in attributes: # pragma no branch
|
|
205
|
+
self._files = self._makeListOfClassesAttribute(githubasyncio.File.File, attributes["files"])
|
|
206
|
+
if "html_url" in attributes: # pragma no branch
|
|
207
|
+
self._html_url = self._makeStringAttribute(attributes["html_url"])
|
|
208
|
+
if "merge_base_commit" in attributes: # pragma no branch
|
|
209
|
+
self._merge_base_commit = self._makeClassAttribute(
|
|
210
|
+
githubasyncio.Commit.Commit, attributes["merge_base_commit"]
|
|
211
|
+
)
|
|
212
|
+
if "patch_url" in attributes: # pragma no branch
|
|
213
|
+
self._patch_url = self._makeStringAttribute(attributes["patch_url"])
|
|
214
|
+
if "permalink_url" in attributes: # pragma no branch
|
|
215
|
+
self._permalink_url = self._makeStringAttribute(attributes["permalink_url"])
|
|
216
|
+
if "status" in attributes: # pragma no branch
|
|
217
|
+
self._status = self._makeStringAttribute(attributes["status"])
|
|
218
|
+
if "total_commits" in attributes: # pragma no branch
|
|
219
|
+
self._total_commits = self._makeIntAttribute(attributes["total_commits"])
|
githubasyncio/Consts.py
ADDED
|
@@ -0,0 +1,197 @@
|
|
|
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 Jakub Wilk <jwilk@jwilk.net> #
|
|
10
|
+
# Copyright 2016 Peter Buckley <dx-pbuckley@users.noreply.github.com> #
|
|
11
|
+
# Copyright 2018 Aaron L. Levine <allevin@sandia.gov> #
|
|
12
|
+
# Copyright 2018 Alice GIRARD <bouhahah@gmail.com> #
|
|
13
|
+
# Copyright 2018 Maarten Fonville <mfonville@users.noreply.github.com> #
|
|
14
|
+
# Copyright 2018 Shubham Singh <41840111+singh811@users.noreply.github.com> #
|
|
15
|
+
# Copyright 2018 Steve Kowalik <steven@wedontsleep.org> #
|
|
16
|
+
# Copyright 2018 Wan Liuyang <tsfdye@gmail.com> #
|
|
17
|
+
# Copyright 2018 Yossarian King <yggy@blackbirdinteractive.com> #
|
|
18
|
+
# Copyright 2018 h.shi <10385628+AnYeMoWang@users.noreply.github.com> #
|
|
19
|
+
# Copyright 2018 sfdye <tsfdye@gmail.com> #
|
|
20
|
+
# Copyright 2019 Adam Baratz <adam.baratz@gmail.com> #
|
|
21
|
+
# Copyright 2019 Nick Campbell <nicholas.j.campbell@gmail.com> #
|
|
22
|
+
# Copyright 2019 Steve Kowalik <steven@wedontsleep.org> #
|
|
23
|
+
# Copyright 2019 Tim Gates <tim.gates@iress.com> #
|
|
24
|
+
# Copyright 2019 Wan Liuyang <tsfdye@gmail.com> #
|
|
25
|
+
# Copyright 2019 Will Li <cuichen.li94@gmail.com> #
|
|
26
|
+
# Copyright 2020 Adrian Bridgett <58699309+tl-adrian-bridgett@users.noreply.github.com>#
|
|
27
|
+
# Copyright 2020 Anuj Bansal <bansalanuj1996@gmail.com> #
|
|
28
|
+
# Copyright 2020 Colby Gallup <colbygallup@gmail.com> #
|
|
29
|
+
# Copyright 2020 Pascal Hofmann <mail@pascalhofmann.de> #
|
|
30
|
+
# Copyright 2020 Steve Kowalik <steven@wedontsleep.org> #
|
|
31
|
+
# Copyright 2021 Steve Kowalik <steven@wedontsleep.org> #
|
|
32
|
+
# Copyright 2021 Tanner <51724788+lightningboltemoji@users.noreply.github.com> #
|
|
33
|
+
# Copyright 2022 KimSia Sim <245021+simkimsia@users.noreply.github.com> #
|
|
34
|
+
# Copyright 2023 Denis Blanchette <dblanchette@coveo.com> #
|
|
35
|
+
# Copyright 2023 Enrico Minack <github@enrico.minack.dev> #
|
|
36
|
+
# Copyright 2023 Jirka Borovec <6035284+Borda@users.noreply.github.com> #
|
|
37
|
+
# Copyright 2024 Enrico Minack <github@enrico.minack.dev> #
|
|
38
|
+
# Copyright 2025 Changyong Um <e7217@naver.com> #
|
|
39
|
+
# Copyright 2025 Enrico Minack <github@enrico.minack.dev> #
|
|
40
|
+
# Copyright 2026 Enrico Minack <github@enrico.minack.dev> #
|
|
41
|
+
# #
|
|
42
|
+
# This file is part of PyGithub. #
|
|
43
|
+
# http://pygithub.readthedocs.io/ #
|
|
44
|
+
# #
|
|
45
|
+
# PyGithub is free software: you can redistribute it and/or modify it under #
|
|
46
|
+
# the terms of the GNU Lesser General Public License as published by the Free #
|
|
47
|
+
# Software Foundation, either version 3 of the License, or (at your option) #
|
|
48
|
+
# any later version. #
|
|
49
|
+
# #
|
|
50
|
+
# PyGithub is distributed in the hope that it will be useful, but WITHOUT ANY #
|
|
51
|
+
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS #
|
|
52
|
+
# FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more #
|
|
53
|
+
# details. #
|
|
54
|
+
# #
|
|
55
|
+
# You should have received a copy of the GNU Lesser General Public License #
|
|
56
|
+
# along with PyGithub. If not, see <http://www.gnu.org/licenses/>. #
|
|
57
|
+
# #
|
|
58
|
+
################################################################################
|
|
59
|
+
|
|
60
|
+
from __future__ import annotations
|
|
61
|
+
|
|
62
|
+
REQ_IF_NONE_MATCH = "If-None-Match"
|
|
63
|
+
REQ_IF_MODIFIED_SINCE = "If-Modified-Since"
|
|
64
|
+
PROCESSING_202_WAIT_TIME = 2
|
|
65
|
+
|
|
66
|
+
# ##############################################################################
|
|
67
|
+
# Response Header #
|
|
68
|
+
# (Lower Case) #
|
|
69
|
+
# ##############################################################################
|
|
70
|
+
RES_ETAG = "etag"
|
|
71
|
+
RES_LAST_MODIFIED = "last-modified"
|
|
72
|
+
|
|
73
|
+
# Inspired by https://github.com/google/go-github
|
|
74
|
+
|
|
75
|
+
# Headers
|
|
76
|
+
|
|
77
|
+
headerRateLimit = "x-ratelimit-limit"
|
|
78
|
+
headerRateRemaining = "x-ratelimit-remaining"
|
|
79
|
+
headerRateReset = "x-ratelimit-reset"
|
|
80
|
+
headerRateResource = "x-ratelimit-resource"
|
|
81
|
+
headerRateUsed = "x-ratelimit-used"
|
|
82
|
+
headerOAuthScopes = "x-oauth-scopes"
|
|
83
|
+
headerOTP = "x-github-otp"
|
|
84
|
+
|
|
85
|
+
# https://docs.github.com/en/rest/about-the-rest-api/api-versions
|
|
86
|
+
headerApiVersion = "X-GitHub-Api-Version"
|
|
87
|
+
headerApiVersionSelected = "x-github-api-version-selected"
|
|
88
|
+
API_VERSION_2022_11_28 = "2022-11-28"
|
|
89
|
+
API_VERSION_2026_03_10 = "2026-03-10"
|
|
90
|
+
|
|
91
|
+
defaultMediaType = "application/octet-stream"
|
|
92
|
+
|
|
93
|
+
# Custom media type for preview API
|
|
94
|
+
|
|
95
|
+
# https://developer.github.com/changes/2014-12-09-new-attributes-for-stars-api/
|
|
96
|
+
mediaTypeStarringPreview = "application/vnd.github.v3.star+json"
|
|
97
|
+
|
|
98
|
+
# https://developer.github.com/changes/2016-02-19-source-import-preview-api/
|
|
99
|
+
mediaTypeImportPreview = "application/vnd.github.barred-rock-preview"
|
|
100
|
+
|
|
101
|
+
# https://developer.github.com/changes/2016-05-12-reactions-api-preview/
|
|
102
|
+
mediaTypeReactionsPreview = "application/vnd.github.squirrel-girl-preview"
|
|
103
|
+
|
|
104
|
+
# https://developer.github.com/changes/2016-09-14-Integrations-Early-Access/
|
|
105
|
+
mediaTypeIntegrationPreview = "application/vnd.github.machine-man-preview+json"
|
|
106
|
+
|
|
107
|
+
# https://developer.github.com/changes/2016-09-14-projects-api/
|
|
108
|
+
mediaTypeProjectsPreview = "application/vnd.github.inertia-preview+json"
|
|
109
|
+
|
|
110
|
+
# https://developer.github.com/changes/2017-01-05-commit-search-api/
|
|
111
|
+
mediaTypeCommitSearchPreview = "application/vnd.github.cloak-preview"
|
|
112
|
+
|
|
113
|
+
# https://developer.github.com/changes/2017-02-28-user-blocking-apis-and-webhook/
|
|
114
|
+
mediaTypeBlockUsersPreview = "application/vnd.github.giant-sentry-fist-preview+json"
|
|
115
|
+
|
|
116
|
+
# https://developer.github.com/changes/2017-07-17-update-topics-on-repositories/
|
|
117
|
+
mediaTypeTopicsPreview = "application/vnd.github.mercy-preview+json"
|
|
118
|
+
|
|
119
|
+
# https://developer.github.com/changes/2018-02-22-label-description-search-preview/
|
|
120
|
+
mediaTypeLabelDescriptionSearchPreview = "application/vnd.github.symmetra-preview+json"
|
|
121
|
+
|
|
122
|
+
# https://developer.github.com/changes/2018-01-10-lock-reason-api-preview/
|
|
123
|
+
mediaTypeLockReasonPreview = "application/vnd.github.sailor-v-preview+json"
|
|
124
|
+
|
|
125
|
+
# https://developer.github.com/changes/2018-01-25-organization-invitation-api-preview/
|
|
126
|
+
mediaTypeOrganizationInvitationPreview = "application/vnd.github.dazzler-preview+json"
|
|
127
|
+
|
|
128
|
+
# https://developer.github.com/changes/2018-02-07-team-discussions-api
|
|
129
|
+
mediaTypeTeamDiscussionsPreview = "application/vnd.github.echo-preview+json"
|
|
130
|
+
|
|
131
|
+
# https://developer.github.com/changes/2018-03-16-protected-branches-required-approving-reviews/
|
|
132
|
+
mediaTypeRequireMultipleApprovingReviews = "application/vnd.github.luke-cage-preview+json"
|
|
133
|
+
|
|
134
|
+
# https://developer.github.com/changes/2018-05-24-user-migration-api/
|
|
135
|
+
mediaTypeMigrationPreview = "application/vnd.github.wyandotte-preview+json"
|
|
136
|
+
|
|
137
|
+
# https://developer.github.com/changes/2019-07-16-repository-templates-api/
|
|
138
|
+
mediaTypeTemplatesPreview = "application/vnd.github.baptiste-preview+json"
|
|
139
|
+
|
|
140
|
+
# https://docs.github.com/en/rest/reference/search#highlighting-code-search-results-1
|
|
141
|
+
highLightSearchPreview = "application/vnd.github.v3.text-match+json"
|
|
142
|
+
|
|
143
|
+
# https://developer.github.com/changes/2018-02-22-protected-branches-required-signatures/
|
|
144
|
+
signaturesProtectedBranchesPreview = "application/vnd.github.zzzax-preview+json"
|
|
145
|
+
|
|
146
|
+
# https://developer.github.com/changes/2019-04-24-vulnerability-alerts/
|
|
147
|
+
vulnerabilityAlertsPreview = "application/vnd.github.dorian-preview+json"
|
|
148
|
+
|
|
149
|
+
# https://developer.github.com/changes/2019-06-04-automated-security-fixes/
|
|
150
|
+
automatedSecurityFixes = "application/vnd.github.london-preview+json"
|
|
151
|
+
|
|
152
|
+
# https://developer.github.com/changes/2019-05-29-update-branch-api/
|
|
153
|
+
updateBranchPreview = "application/vnd.github.lydian-preview+json"
|
|
154
|
+
|
|
155
|
+
# https://developer.github.com/changes/2016-05-23-timeline-preview-api/
|
|
156
|
+
issueTimelineEventsPreview = "application/vnd.github.mockingbird-preview"
|
|
157
|
+
|
|
158
|
+
# https://docs.github.com/en/rest/reference/teams#check-if-a-team-manages-a-repository
|
|
159
|
+
teamRepositoryPermissions = "application/vnd.github.v3.repository+json"
|
|
160
|
+
|
|
161
|
+
# https://developer.github.com/changes/2016-04-06-deployment-and-deployment-status-enhancements/
|
|
162
|
+
deploymentEnhancementsPreview = "application/vnd.github.ant-man-preview+json"
|
|
163
|
+
|
|
164
|
+
# https://developer.github.com/changes/2018-10-16-deployments-environments-states-and-auto-inactive-updates/
|
|
165
|
+
deploymentStatusEnhancementsPreview = "application/vnd.github.flash-preview+json"
|
|
166
|
+
|
|
167
|
+
# https://developer.github.com/changes/2019-12-03-internal-visibility-changes/
|
|
168
|
+
repoVisibilityPreview = "application/vnd.github.nebula-preview+json"
|
|
169
|
+
|
|
170
|
+
# https://docs.github.com/en/rest/using-the-rest-api/getting-started-with-the-rest-api?apiVersion=2022-11-28#media-types
|
|
171
|
+
mediaType = "application/vnd.github+json"
|
|
172
|
+
|
|
173
|
+
DEFAULT_BASE_URL = "https://api.github.com"
|
|
174
|
+
DEFAULT_OAUTH_URL = "https://github.com/login/oauth"
|
|
175
|
+
DEFAULT_STATUS_URL = "https://status.github.com"
|
|
176
|
+
DEFAULT_USER_AGENT = "PyGithub/Python"
|
|
177
|
+
# As of 2018-05-17, Github imposes a 10s limit for completion of API requests.
|
|
178
|
+
# Thus, the timeout should be slightly > 10s to account for network/front-end
|
|
179
|
+
# latency.
|
|
180
|
+
DEFAULT_TIMEOUT = 15
|
|
181
|
+
DEFAULT_PER_PAGE = 30
|
|
182
|
+
|
|
183
|
+
# JWT expiry in seconds. Could be set for max 600 seconds (10 minutes).
|
|
184
|
+
# https://docs.github.com/en/developers/apps/building-github-apps/authenticating-with-github-apps#authenticating-as-a-github-app
|
|
185
|
+
DEFAULT_JWT_EXPIRY = 300
|
|
186
|
+
MIN_JWT_EXPIRY = 15
|
|
187
|
+
MAX_JWT_EXPIRY = 600
|
|
188
|
+
# https://docs.github.com/en/developers/apps/building-github-apps/authenticating-with-github-apps#generating-a-json-web-token-jwt
|
|
189
|
+
# "The time the JWT was created. To protect against clock drift, we recommend you set this 60 seconds in the past."
|
|
190
|
+
DEFAULT_JWT_ISSUED_AT = -60
|
|
191
|
+
# https://docs.github.com/en/apps/creating-github-apps/authenticating-with-a-github-app/generating-a-json-web-token-jwt-for-a-github-app
|
|
192
|
+
# "Your JWT must be signed using the RS256 algorithm"
|
|
193
|
+
DEFAULT_JWT_ALGORITHM = "RS256"
|
|
194
|
+
|
|
195
|
+
# https://docs.github.com/en/rest/guides/best-practices-for-integrators?apiVersion=2022-11-28#dealing-with-secondary-rate-limits
|
|
196
|
+
DEFAULT_SECONDS_BETWEEN_REQUESTS = 0.25
|
|
197
|
+
DEFAULT_SECONDS_BETWEEN_WRITES = 1.0
|