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,269 @@
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 2017 Jannis Gebauer <ja.geb@me.com> #
12
+ # Copyright 2017 Simon <spam@esemi.ru> #
13
+ # Copyright 2018 Steve Kowalik <steven@wedontsleep.org> #
14
+ # Copyright 2018 sfdye <tsfdye@gmail.com> #
15
+ # Copyright 2019 Steve Kowalik <steven@wedontsleep.org> #
16
+ # Copyright 2019 Wan Liuyang <tsfdye@gmail.com> #
17
+ # Copyright 2020 Steve Kowalik <steven@wedontsleep.org> #
18
+ # Copyright 2021 Mark Walker <mark.walker@realbuzz.com> #
19
+ # Copyright 2021 Steve Kowalik <steven@wedontsleep.org> #
20
+ # Copyright 2023 Enrico Minack <github@enrico.minack.dev> #
21
+ # Copyright 2023 Jirka Borovec <6035284+Borda@users.noreply.github.com> #
22
+ # Copyright 2023 Trim21 <trim21.me@gmail.com> #
23
+ # Copyright 2024 Benjamin K <53038537+treee111@users.noreply.github.com> #
24
+ # Copyright 2024 Enrico Minack <github@enrico.minack.dev> #
25
+ # Copyright 2024 Jirka Borovec <6035284+Borda@users.noreply.github.com> #
26
+ # Copyright 2025 Christoph Reiter <reiter.christoph@gmail.com> #
27
+ # Copyright 2025 Enrico Minack <github@enrico.minack.dev> #
28
+ # Copyright 2026 Enrico Minack <github@enrico.minack.dev> #
29
+ # #
30
+ # This file is part of PyGithub. #
31
+ # http://pygithub.readthedocs.io/ #
32
+ # #
33
+ # PyGithub is free software: you can redistribute it and/or modify it under #
34
+ # the terms of the GNU Lesser General Public License as published by the Free #
35
+ # Software Foundation, either version 3 of the License, or (at your option) #
36
+ # any later version. #
37
+ # #
38
+ # PyGithub is distributed in the hope that it will be useful, but WITHOUT ANY #
39
+ # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS #
40
+ # FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more #
41
+ # details. #
42
+ # #
43
+ # You should have received a copy of the GNU Lesser General Public License #
44
+ # along with PyGithub. If not, see <http://www.gnu.org/licenses/>. #
45
+ # #
46
+ ################################################################################
47
+
48
+ from __future__ import annotations
49
+
50
+ from typing import TYPE_CHECKING, Any
51
+
52
+ import githubasyncio.GithubApp
53
+ import githubasyncio.NamedUser
54
+ import githubasyncio.Team
55
+ from githubasyncio.compat import deprecated
56
+ from githubasyncio.GithubObject import Attribute, CompletableGithubObject, NonCompletableGithubObject, NotSet
57
+
58
+ if TYPE_CHECKING:
59
+ from githubasyncio.GithubApp import GithubApp
60
+ from githubasyncio.NamedUser import NamedUser
61
+ from githubasyncio.Team import Team
62
+
63
+
64
+ class BypassPullRequestAllowances(NonCompletableGithubObject):
65
+ """
66
+ This class represents BypassPullRequestAllowances.
67
+
68
+ The reference can be found here
69
+ https://docs.github.com/en/rest/reference/repos#get-pull-request-review-protection
70
+
71
+ The OpenAPI schema can be found at
72
+
73
+ - /components/schemas/protected-branch-pull-request-review/properties/bypass_pull_request_allowances
74
+ - /components/schemas/protected-branch/properties/required_pull_request_reviews/properties/bypass_pull_request_allowances
75
+
76
+ """
77
+
78
+ def _initAttributes(self) -> None:
79
+ self._apps: Attribute[list[GithubApp]] = NotSet
80
+ self._teams: Attribute[list[Team]] = NotSet
81
+ self._users: Attribute[list[NamedUser]] = NotSet
82
+
83
+ def __repr__(self) -> str:
84
+ return self.get__repr__({"apps": self._apps.value, "teams": self._teams.value, "users": self._users.value})
85
+
86
+ @property
87
+ def apps(self) -> list[GithubApp]:
88
+ return self._apps.value
89
+
90
+ @property
91
+ def teams(self) -> list[Team]:
92
+ return self._teams.value
93
+
94
+ @property
95
+ def users(self) -> list[NamedUser]:
96
+ return self._users.value
97
+
98
+ def _useAttributes(self, attributes: dict[str, Any]) -> None:
99
+ if "apps" in attributes: # pragma no branch
100
+ self._apps = self._makeListOfClassesAttribute(githubasyncio.GithubApp.GithubApp, attributes["apps"])
101
+ if "teams" in attributes: # pragma no branch
102
+ self._teams = self._makeListOfClassesAttribute(githubasyncio.Team.Team, attributes["teams"])
103
+ if "users" in attributes: # pragma no branch
104
+ self._users = self._makeListOfClassesAttribute(githubasyncio.NamedUser.NamedUser, attributes["users"])
105
+
106
+
107
+ class DismissalRestrictions(NonCompletableGithubObject):
108
+ """
109
+ This class represents DismissalRestrictions.
110
+
111
+ The reference can be found here
112
+ https://docs.github.com/en/rest/reference/repos#get-pull-request-review-protection
113
+
114
+ The OpenAPI schema can be found at
115
+
116
+ - /components/schemas/protected-branch-pull-request-review/properties/dismissal_restrictions
117
+ - /components/schemas/protected-branch/properties/required_pull_request_reviews/properties/dismissal_restrictions
118
+
119
+ """
120
+
121
+ def _initAttributes(self) -> None:
122
+ self._apps: Attribute[list[GithubApp]] = NotSet
123
+ self._teams: Attribute[list[Team]] = NotSet
124
+ self._teams_url: Attribute[str] = NotSet
125
+ self._url: Attribute[str] = NotSet
126
+ self._users: Attribute[list[NamedUser]] = NotSet
127
+ self._users_url: Attribute[str] = NotSet
128
+
129
+ def __repr__(self) -> str:
130
+ return self.get__repr__({"apps": self._apps.value, "teams": self._teams.value, "users": self._users.value})
131
+
132
+ @property
133
+ def apps(self) -> list[GithubApp]:
134
+ return self._apps.value
135
+
136
+ @property
137
+ def teams(self) -> list[Team]:
138
+ return self._teams.value
139
+
140
+ @property
141
+ def teams_url(self) -> str:
142
+ return self._teams_url.value
143
+
144
+ @property
145
+ async def url(self) -> str:
146
+ return self._url.value
147
+
148
+ @property
149
+ def users(self) -> list[NamedUser]:
150
+ return self._users.value
151
+
152
+ @property
153
+ def users_url(self) -> str:
154
+ return self._users_url.value
155
+
156
+ def _useAttributes(self, attributes: dict[str, Any]) -> None:
157
+ if "apps" in attributes: # pragma no branch
158
+ self._apps = self._makeListOfClassesAttribute(githubasyncio.GithubApp.GithubApp, attributes["apps"])
159
+ if "teams" in attributes: # pragma no branch
160
+ self._teams = self._makeListOfClassesAttribute(githubasyncio.Team.Team, attributes["teams"])
161
+ if "teams_url" in attributes: # pragma no branch
162
+ self._teams_url = self._makeStringAttribute(attributes["teams_url"])
163
+ if "url" in attributes: # pragma no branch
164
+ self._url = self._makeStringAttribute(attributes["url"])
165
+ if "users" in attributes: # pragma no branch
166
+ self._users = self._makeListOfClassesAttribute(githubasyncio.NamedUser.NamedUser, attributes["users"])
167
+ if "users_url" in attributes: # pragma no branch
168
+ self._users_url = self._makeStringAttribute(attributes["users_url"])
169
+
170
+
171
+ class RequiredPullRequestReviews(CompletableGithubObject):
172
+ """
173
+ This class represents Required Pull Request Reviews.
174
+
175
+ The reference can be found here
176
+ https://docs.github.com/en/rest/reference/repos#get-pull-request-review-protection
177
+
178
+ The OpenAPI schema can be found at
179
+
180
+ - /components/schemas/protected-branch-pull-request-review
181
+ - /components/schemas/protected-branch/properties/required_pull_request_reviews
182
+
183
+ """
184
+
185
+ def _initAttributes(self) -> None:
186
+ self._bypass_pull_request_allowances: Attribute[BypassPullRequestAllowances] = NotSet
187
+ self._dismiss_stale_reviews: Attribute[bool] = NotSet
188
+ self._dismissal_restrictions: Attribute[DismissalRestrictions] = NotSet
189
+ self._require_code_owner_reviews: Attribute[bool] = NotSet
190
+ self._require_last_push_approval: Attribute[bool] = NotSet
191
+ self._required_approving_review_count: Attribute[int] = NotSet
192
+ self._url: Attribute[str] = NotSet
193
+
194
+ def __repr__(self) -> str:
195
+ return self.get__repr__(
196
+ {
197
+ "url": self._url.value,
198
+ "dismiss_stale_reviews": self._dismiss_stale_reviews.value,
199
+ "require_code_owner_reviews": self._require_code_owner_reviews.value,
200
+ "require_last_push_approval": self._require_last_push_approval.value,
201
+ }
202
+ )
203
+
204
+ @property
205
+ async def bypass_pull_request_allowances(self) -> BypassPullRequestAllowances:
206
+ await self._completeIfNotSet(self._bypass_pull_request_allowances)
207
+ return self._bypass_pull_request_allowances.value
208
+
209
+ @property
210
+ async def dismiss_stale_reviews(self) -> bool:
211
+ await self._completeIfNotSet(self._dismiss_stale_reviews)
212
+ return self._dismiss_stale_reviews.value
213
+
214
+ @property
215
+ async def dismissal_restrictions(self) -> DismissalRestrictions:
216
+ await self._completeIfNotSet(self._dismissal_restrictions)
217
+ return self._dismissal_restrictions.value
218
+
219
+ @property
220
+ @deprecated("Use dismissal_restrictions.teams")
221
+ async def dismissal_teams(self) -> list[Team] | None:
222
+ return (await self.dismissal_restrictions).teams if (await self.dismissal_restrictions) is not None else None
223
+
224
+ @property
225
+ @deprecated("Use dismissal_restrictions.users")
226
+ async def dismissal_users(self) -> list[NamedUser] | None:
227
+ return (await self.dismissal_restrictions).users if (await self.dismissal_restrictions) is not None else None
228
+
229
+ @property
230
+ async def require_code_owner_reviews(self) -> bool:
231
+ await self._completeIfNotSet(self._require_code_owner_reviews)
232
+ return self._require_code_owner_reviews.value
233
+
234
+ @property
235
+ async def require_last_push_approval(self) -> bool:
236
+ await self._completeIfNotSet(self._require_last_push_approval)
237
+ return self._require_last_push_approval.value
238
+
239
+ @property
240
+ async def required_approving_review_count(self) -> int:
241
+ await self._completeIfNotSet(self._required_approving_review_count)
242
+ return self._required_approving_review_count.value
243
+
244
+ @property
245
+ async def url(self) -> str:
246
+ await self._completeIfNotSet(self._url)
247
+ return self._url.value
248
+
249
+ def _useAttributes(self, attributes: dict[str, Any]) -> None:
250
+ if "bypass_pull_request_allowances" in attributes: # pragma no branch
251
+ self._bypass_pull_request_allowances = self._makeClassAttribute(
252
+ BypassPullRequestAllowances, attributes["bypass_pull_request_allowances"]
253
+ )
254
+ if "dismiss_stale_reviews" in attributes: # pragma no branch
255
+ self._dismiss_stale_reviews = self._makeBoolAttribute(attributes["dismiss_stale_reviews"])
256
+ if "dismissal_restrictions" in attributes: # pragma no branch
257
+ self._dismissal_restrictions = self._makeClassAttribute(
258
+ DismissalRestrictions, attributes["dismissal_restrictions"]
259
+ )
260
+ if "require_code_owner_reviews" in attributes: # pragma no branch
261
+ self._require_code_owner_reviews = self._makeBoolAttribute(attributes["require_code_owner_reviews"])
262
+ if "require_last_push_approval" in attributes: # pragma no branch
263
+ self._require_last_push_approval = self._makeBoolAttribute(attributes["require_last_push_approval"])
264
+ if "required_approving_review_count" in attributes: # pragma no branch
265
+ self._required_approving_review_count = self._makeIntAttribute(
266
+ attributes["required_approving_review_count"]
267
+ )
268
+ if "url" in attributes: # pragma no branch
269
+ self._url = self._makeStringAttribute(attributes["url"])
@@ -0,0 +1,153 @@
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 Steve Kowalik <steven@wedontsleep.org> #
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 Mark Walker <mark.walker@realbuzz.com> #
18
+ # Copyright 2021 Steve Kowalik <steven@wedontsleep.org> #
19
+ # Copyright 2023 Enrico Minack <github@enrico.minack.dev> #
20
+ # Copyright 2023 Trim21 <trim21.me@gmail.com> #
21
+ # Copyright 2024 Enrico Minack <github@enrico.minack.dev> #
22
+ # Copyright 2024 Jirka Borovec <6035284+Borda@users.noreply.github.com> #
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, CompletableGithubObject, NonCompletableGithubObject, NotSet
48
+
49
+
50
+ class Check(NonCompletableGithubObject):
51
+ """
52
+ This class represents Check.
53
+
54
+ The reference can be found here
55
+ https://docs.github.com/en/rest/reference/repos#get-status-checks-protection
56
+
57
+ The OpenAPI schema can be found at
58
+
59
+ - /components/schemas/protected-branch-required-status-check/properties/checks/items
60
+ - /components/schemas/status-check-policy/properties/checks/items
61
+
62
+ """
63
+
64
+ def _initAttributes(self) -> None:
65
+ self._app_id: Attribute[int] = NotSet
66
+ self._context: Attribute[str] = NotSet
67
+
68
+ def __repr__(self) -> str:
69
+ return self.get__repr__({"app_id": self._app_id.value, "context": self._context.value})
70
+
71
+ @property
72
+ def app_id(self) -> int:
73
+ return self._app_id.value
74
+
75
+ @property
76
+ def context(self) -> str:
77
+ return self._context.value
78
+
79
+ def _useAttributes(self, attributes: dict[str, Any]) -> None:
80
+ if "app_id" in attributes: # pragma no branch
81
+ self._app_id = self._makeIntAttribute(attributes["app_id"])
82
+ if "context" in attributes: # pragma no branch
83
+ self._context = self._makeStringAttribute(attributes["context"])
84
+
85
+
86
+ class RequiredStatusChecks(CompletableGithubObject):
87
+ """
88
+ This class represents Required Status Checks.
89
+
90
+ The reference can be found here
91
+ https://docs.github.com/en/rest/reference/repos#get-status-checks-protection
92
+
93
+ The OpenAPI schema can be found at
94
+
95
+ - /components/schemas/protected-branch-required-status-check
96
+ - /components/schemas/status-check-policy
97
+
98
+ """
99
+
100
+ def _initAttributes(self) -> None:
101
+ self._checks: Attribute[list[Check]] = NotSet
102
+ self._contexts: Attribute[list[str]] = NotSet
103
+ self._contexts_url: Attribute[str] = NotSet
104
+ self._enforcement_level: Attribute[str] = NotSet
105
+ self._strict: Attribute[bool] = NotSet
106
+ self._url: Attribute[str] = NotSet
107
+
108
+ def __repr__(self) -> str:
109
+ return self.get__repr__({"strict": self._strict.value, "url": self._url.value})
110
+
111
+ @property
112
+ async def checks(self) -> list[Check]:
113
+ await self._completeIfNotSet(self._checks)
114
+ return self._checks.value
115
+
116
+ @property
117
+ async def contexts(self) -> list[str]:
118
+ await self._completeIfNotSet(self._contexts)
119
+ return self._contexts.value
120
+
121
+ @property
122
+ async def contexts_url(self) -> str:
123
+ await self._completeIfNotSet(self._contexts_url)
124
+ return self._contexts_url.value
125
+
126
+ @property
127
+ async def enforcement_level(self) -> str:
128
+ await self._completeIfNotSet(self._enforcement_level)
129
+ return self._enforcement_level.value
130
+
131
+ @property
132
+ async def strict(self) -> bool:
133
+ await self._completeIfNotSet(self._strict)
134
+ return self._strict.value
135
+
136
+ @property
137
+ async def url(self) -> str:
138
+ await self._completeIfNotSet(self._url)
139
+ return self._url.value
140
+
141
+ def _useAttributes(self, attributes: dict[str, Any]) -> None:
142
+ if "checks" in attributes: # pragma no branch
143
+ self._checks = self._makeListOfClassesAttribute(Check, attributes["checks"])
144
+ if "contexts" in attributes: # pragma no branch
145
+ self._contexts = self._makeListOfStringsAttribute(attributes["contexts"])
146
+ if "contexts_url" in attributes: # pragma no branch
147
+ self._contexts_url = self._makeStringAttribute(attributes["contexts_url"])
148
+ if "enforcement_level" in attributes: # pragma no branch
149
+ self._enforcement_level = self._makeStringAttribute(attributes["enforcement_level"])
150
+ if "strict" in attributes: # pragma no branch
151
+ self._strict = self._makeBoolAttribute(attributes["strict"])
152
+ if "url" in attributes: # pragma no branch
153
+ self._url = self._makeStringAttribute(attributes["url"])
githubasyncio/Rule.py ADDED
@@ -0,0 +1,134 @@
1
+ # FILE AUTO GENERATED DO NOT TOUCH
2
+ ############################ Copyrights and license ############################
3
+ # #
4
+ # Copyright 2025 Jens Keiner <jens.keiner@gmail.com> #
5
+ # #
6
+ # This file is part of PyGithub. #
7
+ # http://pygithub.readthedocs.io/ #
8
+ # #
9
+ # PyGithub is free software: you can redistribute it and/or modify it under #
10
+ # the terms of the GNU Lesser General Public License as published by the Free #
11
+ # Software Foundation, either version 3 of the License, or (at your option) #
12
+ # any later version. #
13
+ # #
14
+ # PyGithub is distributed in the hope that it will be useful, but WITHOUT ANY #
15
+ # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS #
16
+ # FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more #
17
+ # details. #
18
+ # #
19
+ # You should have received a copy of the GNU Lesser General Public License #
20
+ # along with PyGithub. If not, see <http://www.gnu.org/licenses/>. #
21
+ # #
22
+ ################################################################################
23
+
24
+ from __future__ import annotations
25
+
26
+ from typing import Any
27
+
28
+ from githubasyncio.GithubObject import Attribute, NonCompletableGithubObject, NotSet
29
+
30
+
31
+ class Rule(NonCompletableGithubObject):
32
+ """
33
+ This class represents Rules.
34
+
35
+ Rules control how people can interact with selected branches and
36
+ tags in a repository. They are grouped into Rulesets.
37
+
38
+ The reference can be found here
39
+ https://docs.github.com/en/rest/repos/rules
40
+
41
+ The OpenAPI schema can be found at
42
+
43
+ - /components/schemas/repository-rule
44
+ - /components/schemas/repository-rule-branch-name-pattern
45
+ - /components/schemas/repository-rule-code-coverage
46
+ - /components/schemas/repository-rule-code-quality
47
+ - /components/schemas/repository-rule-code-scanning
48
+ - /components/schemas/repository-rule-commit-author-email-pattern
49
+ - /components/schemas/repository-rule-commit-message-pattern
50
+ - /components/schemas/repository-rule-committer-email-pattern
51
+ - /components/schemas/repository-rule-copilot-code-review
52
+ - /components/schemas/repository-rule-creation
53
+ - /components/schemas/repository-rule-deletion
54
+ - /components/schemas/repository-rule-detailed
55
+ - /components/schemas/repository-rule-file-extension-restriction
56
+ - /components/schemas/repository-rule-file-path-restriction
57
+ - /components/schemas/repository-rule-license-compliance-scanning
58
+ - /components/schemas/repository-rule-max-file-path-length
59
+ - /components/schemas/repository-rule-max-file-size
60
+ - /components/schemas/repository-rule-merge-queue
61
+ - /components/schemas/repository-rule-non-fast-forward
62
+ - /components/schemas/repository-rule-pull-request
63
+ - /components/schemas/repository-rule-required-deployments
64
+ - /components/schemas/repository-rule-required-linear-history
65
+ - /components/schemas/repository-rule-required-signatures
66
+ - /components/schemas/repository-rule-required-status-checks
67
+ - /components/schemas/repository-rule-ruleset-info
68
+ - /components/schemas/repository-rule-tag-name-pattern
69
+ - /components/schemas/repository-rule-update
70
+ - /components/schemas/repository-rule-workflows
71
+
72
+ """
73
+
74
+ def _initAttributes(self) -> None:
75
+ self._parameters: Attribute[dict[str, Any]] = NotSet
76
+ self._ruleset_id: Attribute[int] = NotSet
77
+ self._ruleset_source: Attribute[str] = NotSet
78
+ self._ruleset_source_type: Attribute[str] = NotSet
79
+ self._type: Attribute[str] = NotSet
80
+
81
+ def __repr__(self) -> str:
82
+ return self.get__repr__({"type": self._type.value})
83
+
84
+ @property
85
+ def parameters(self) -> dict[str, Any]:
86
+ """
87
+ :type: dict
88
+ :return: The parameters specific to this rule type
89
+ """
90
+ return self._parameters.value
91
+
92
+ @property
93
+ def ruleset_id(self) -> int:
94
+ """
95
+ :type: integer
96
+ :return: The ID of the ruleset that includes this rule
97
+ """
98
+ return self._ruleset_id.value
99
+
100
+ @property
101
+ def ruleset_source(self) -> str:
102
+ """
103
+ :type: string
104
+ :return: The name of the source of the ruleset that includes this rule
105
+ """
106
+ return self._ruleset_source.value
107
+
108
+ @property
109
+ def ruleset_source_type(self) -> str:
110
+ """
111
+ :type: string
112
+ :return: The type of source for the ruleset that includes this rule (Repository or Organization)
113
+ """
114
+ return self._ruleset_source_type.value
115
+
116
+ @property
117
+ def type(self) -> str:
118
+ """
119
+ :type: string
120
+ :return: The type of the rule (e.g. creation, update, deletion, etc.)
121
+ """
122
+ return self._type.value
123
+
124
+ def _useAttributes(self, attributes: dict[str, Any]) -> None:
125
+ if "parameters" in attributes: # pragma no branch
126
+ self._parameters = self._makeDictAttribute(attributes["parameters"])
127
+ if "ruleset_id" in attributes: # pragma no branch
128
+ self._ruleset_id = self._makeIntAttribute(attributes["ruleset_id"])
129
+ if "ruleset_source" in attributes: # pragma no branch
130
+ self._ruleset_source = self._makeStringAttribute(attributes["ruleset_source"])
131
+ if "ruleset_source_type" in attributes: # pragma no branch
132
+ self._ruleset_source_type = self._makeStringAttribute(attributes["ruleset_source_type"])
133
+ if "type" in attributes: # pragma no branch
134
+ self._type = self._makeStringAttribute(attributes["type"])