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,304 @@
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 Thialfihar <thi@thialfihar.org> #
9
+ # Copyright 2014 Vincent Jacques <vincent@vincent-jacques.net> #
10
+ # Copyright 2016 Jannis Gebauer <ja.geb@me.com> #
11
+ # Copyright 2016 Peter Buckley <dx-pbuckley@users.noreply.github.com> #
12
+ # Copyright 2018 Wan Liuyang <tsfdye@gmail.com> #
13
+ # Copyright 2018 h.shi <10385628+AnYeMoWang@users.noreply.github.com> #
14
+ # Copyright 2018 sfdye <tsfdye@gmail.com> #
15
+ # Copyright 2019 Adam Baratz <adam.baratz@gmail.com> #
16
+ # Copyright 2019 Steve Kowalik <steven@wedontsleep.org> #
17
+ # Copyright 2019 Wan Liuyang <tsfdye@gmail.com> #
18
+ # Copyright 2020 Alice GIRARD <bouhahah@gmail.com> #
19
+ # Copyright 2020 Steve Kowalik <steven@wedontsleep.org> #
20
+ # Copyright 2021 Steve Kowalik <steven@wedontsleep.org> #
21
+ # Copyright 2023 Enrico Minack <github@enrico.minack.dev> #
22
+ # Copyright 2023 Jirka Borovec <6035284+Borda@users.noreply.github.com> #
23
+ # Copyright 2023 Trim21 <trim21.me@gmail.com> #
24
+ # Copyright 2024 Enrico Minack <github@enrico.minack.dev> #
25
+ # Copyright 2024 Jirka Borovec <6035284+Borda@users.noreply.github.com> #
26
+ # Copyright 2025 Enrico Minack <github@enrico.minack.dev> #
27
+ # #
28
+ # This file is part of PyGithub. #
29
+ # http://pygithub.readthedocs.io/ #
30
+ # #
31
+ # PyGithub is free software: you can redistribute it and/or modify it under #
32
+ # the terms of the GNU Lesser General Public License as published by the Free #
33
+ # Software Foundation, either version 3 of the License, or (at your option) #
34
+ # any later version. #
35
+ # #
36
+ # PyGithub is distributed in the hope that it will be useful, but WITHOUT ANY #
37
+ # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS #
38
+ # FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more #
39
+ # details. #
40
+ # #
41
+ # You should have received a copy of the GNU Lesser General Public License #
42
+ # along with PyGithub. If not, see <http://www.gnu.org/licenses/>. #
43
+ # #
44
+ ################################################################################
45
+
46
+ from __future__ import annotations
47
+
48
+ import base64
49
+ from datetime import datetime
50
+ from typing import TYPE_CHECKING, Any
51
+
52
+ import githubasyncio.GitCommit
53
+ import githubasyncio.GithubObject
54
+ import githubasyncio.License
55
+ import githubasyncio.Repository
56
+ from githubasyncio.GithubObject import Attribute, CompletableGithubObject, NotSet, _ValuedAttribute, is_undefined
57
+
58
+ if TYPE_CHECKING:
59
+ from githubasyncio.GitCommit import GitCommit
60
+ from githubasyncio.License import License
61
+ from githubasyncio.Repository import Repository
62
+
63
+
64
+ class ContentFile(CompletableGithubObject):
65
+ """
66
+ This class represents ContentFiles.
67
+
68
+ The reference can be found here
69
+ https://docs.github.com/en/rest/reference/repos#contents
70
+
71
+ The OpenAPI schema can be found at
72
+
73
+ - /components/schemas/content-directory
74
+ - /components/schemas/content-file
75
+ - /components/schemas/content-submodule
76
+ - /components/schemas/content-symlink
77
+ - /components/schemas/file-commit
78
+ - /components/schemas/license-content
79
+
80
+ """
81
+
82
+ def _initAttributes(self) -> None:
83
+ self.__links: Attribute[dict[str, Any]] = NotSet
84
+ self._commit: Attribute[GitCommit] = NotSet
85
+ self._content: Attribute[str] = NotSet
86
+ self._download_url: Attribute[str] = NotSet
87
+ self._encoding: Attribute[str] = NotSet
88
+ self._file_size: Attribute[int] = NotSet
89
+ self._git_url: Attribute[str] = NotSet
90
+ self._html_url: Attribute[str] = NotSet
91
+ self._language: Attribute[str] = NotSet
92
+ self._last_modified_at: Attribute[datetime] = NotSet
93
+ self._license: Attribute[License] = NotSet
94
+ self._line_numbers: Attribute[list[str]] = NotSet
95
+ self._name: Attribute[str] = NotSet
96
+ self._path: Attribute[str] = NotSet
97
+ self._repository: Attribute[Repository] = NotSet
98
+ self._sha: Attribute[str] = NotSet
99
+ self._size: Attribute[int] = NotSet
100
+ self._submodule_git_url: Attribute[str] = NotSet
101
+ self._target: Attribute[str] = NotSet
102
+ self._text_matches: Attribute[str] = NotSet
103
+ self._type: Attribute[str] = NotSet
104
+ self._url: Attribute[str] = NotSet
105
+
106
+ def __repr__(self) -> str:
107
+ return self.get__repr__({"path": self._path.value})
108
+
109
+ @property
110
+ async def _links(self) -> dict[str, Any]:
111
+ await self._completeIfNotSet(self.__links)
112
+ return self.__links.value
113
+
114
+ @property
115
+ async def commit(self) -> GitCommit:
116
+ await self._completeIfNotSet(self._commit)
117
+ return self._commit.value
118
+
119
+ @property
120
+ async def content(self) -> str:
121
+ await self._completeIfNotSet(self._content)
122
+ return self._content.value
123
+
124
+ @property
125
+ async def decoded_content(self) -> bytes:
126
+ assert (await self.encoding) == "base64", f"unsupported encoding: {await self.encoding}"
127
+ return base64.b64decode(bytearray(await self.content, "utf-8"))
128
+
129
+ @property
130
+ async def download_url(self) -> str:
131
+ await self._completeIfNotSet(self._download_url)
132
+ return self._download_url.value
133
+
134
+ @property
135
+ async def encoding(self) -> str:
136
+ await self._completeIfNotSet(self._encoding)
137
+ return self._encoding.value
138
+
139
+ @property
140
+ async def file_size(self) -> int:
141
+ await self._completeIfNotSet(self._file_size)
142
+ return self._file_size.value
143
+
144
+ @property
145
+ async def git_url(self) -> str:
146
+ await self._completeIfNotSet(self._git_url)
147
+ return self._git_url.value
148
+
149
+ @property
150
+ async def html_url(self) -> str:
151
+ await self._completeIfNotSet(self._html_url)
152
+ return self._html_url.value
153
+
154
+ @property
155
+ async def language(self) -> str:
156
+ await self._completeIfNotSet(self._language)
157
+ return self._language.value
158
+
159
+ @property
160
+ async def last_modified_at(self) -> datetime:
161
+ await self._completeIfNotSet(self._last_modified_at)
162
+ return self._last_modified_at.value
163
+
164
+ @property
165
+ async def license(self) -> License:
166
+ await self._completeIfNotSet(self._license)
167
+ return self._license.value
168
+
169
+ @property
170
+ async def line_numbers(self) -> list[str]:
171
+ await self._completeIfNotSet(self._line_numbers)
172
+ return self._line_numbers.value
173
+
174
+ @property
175
+ async def name(self) -> str:
176
+ await self._completeIfNotSet(self._name)
177
+ return self._name.value
178
+
179
+ @property
180
+ async def path(self) -> str:
181
+ await self._completeIfNotSet(self._path)
182
+ return self._path.value
183
+
184
+ @property
185
+ async def repository(self) -> Repository:
186
+ if is_undefined(self._repository):
187
+ # The repository was not set automatically, so it must be looked up by url.
188
+ repo_url = "/".join((await self.url).split("/")[:6]) # pragma no cover (Should be covered)
189
+ self._repository = _ValuedAttribute(
190
+ githubasyncio.Repository.Repository(self._requester, self._headers, {"url": repo_url}, completed=False)
191
+ ) # pragma no cover (Should be covered)
192
+ return self._repository.value
193
+
194
+ @property
195
+ async def sha(self) -> str:
196
+ await self._completeIfNotSet(self._sha)
197
+ return self._sha.value
198
+
199
+ @property
200
+ async def size(self) -> int:
201
+ await self._completeIfNotSet(self._size)
202
+ return self._size.value
203
+
204
+ @property
205
+ async def submodule_git_url(self) -> str:
206
+ await self._completeIfNotSet(self._submodule_git_url)
207
+ return self._submodule_git_url.value
208
+
209
+ @property
210
+ async def target(self) -> str:
211
+ await self._completeIfNotSet(self._target)
212
+ return self._target.value
213
+
214
+ @property
215
+ async def text_matches(self) -> str:
216
+ await self._completeIfNotSet(self._text_matches)
217
+ return self._text_matches.value
218
+
219
+ @property
220
+ async def type(self) -> str:
221
+ await self._completeIfNotSet(self._type)
222
+ return self._type.value
223
+
224
+ @property
225
+ async def url(self) -> str:
226
+ await self._completeIfNotSet(self._url)
227
+ return self._url.value
228
+
229
+ def _useAttributes(self, attributes: dict[str, Any]) -> None:
230
+ if "_links" in attributes: # pragma no branch
231
+ self.__links = self._makeDictAttribute(attributes["_links"])
232
+ if "commit" in attributes: # pragma no branch
233
+ self._commit = self._makeClassAttribute(githubasyncio.GitCommit.GitCommit, attributes["commit"])
234
+ if "content" in attributes: # pragma no branch
235
+ self._content = self._makeStringAttribute(attributes["content"])
236
+ if "download_url" in attributes: # pragma no branch
237
+ self._download_url = self._makeStringAttribute(attributes["download_url"])
238
+ if "encoding" in attributes: # pragma no branch
239
+ self._encoding = self._makeStringAttribute(attributes["encoding"])
240
+ if "file_size" in attributes: # pragma no branch
241
+ self._file_size = self._makeIntAttribute(attributes["file_size"])
242
+ if "git_url" in attributes: # pragma no branch
243
+ self._git_url = self._makeStringAttribute(attributes["git_url"])
244
+ if "html_url" in attributes: # pragma no branch
245
+ self._html_url = self._makeStringAttribute(attributes["html_url"])
246
+ if "language" in attributes: # pragma no branch
247
+ self._language = self._makeStringAttribute(attributes["language"])
248
+ if "last_modified_at" in attributes: # pragma no branch
249
+ self._last_modified_at = self._makeDatetimeAttribute(attributes["last_modified_at"])
250
+ if "license" in attributes: # pragma no branch
251
+ self._license = self._makeClassAttribute(githubasyncio.License.License, attributes["license"])
252
+ if "line_numbers" in attributes: # pragma no branch
253
+ self._line_numbers = self._makeListOfStringsAttribute(attributes["line_numbers"])
254
+ if "name" in attributes: # pragma no branch
255
+ self._name = self._makeStringAttribute(attributes["name"])
256
+ if "path" in attributes: # pragma no branch
257
+ self._path = self._makeStringAttribute(attributes["path"])
258
+ if "repository" in attributes: # pragma no branch
259
+ self._repository = self._makeClassAttribute(githubasyncio.Repository.Repository, attributes["repository"])
260
+ if "sha" in attributes: # pragma no branch
261
+ self._sha = self._makeStringAttribute(attributes["sha"])
262
+ if "size" in attributes: # pragma no branch
263
+ self._size = self._makeIntAttribute(attributes["size"])
264
+ if "submodule_git_url" in attributes: # pragma no branch
265
+ self._submodule_git_url = self._makeStringAttribute(attributes["submodule_git_url"])
266
+ if "target" in attributes: # pragma no branch
267
+ self._target = self._makeStringAttribute(attributes["target"])
268
+ if "text_matches" in attributes: # pragma no branch
269
+ self._text_matches = self._makeListOfDictsAttribute(attributes["text_matches"])
270
+ if "type" in attributes: # pragma no branch
271
+ self._type = self._makeStringAttribute(attributes["type"])
272
+ if "url" in attributes: # pragma no branch
273
+ self._url = self._makeStringAttribute(attributes["url"])
274
+
275
+
276
+ class ContentFileSearchResult(ContentFile):
277
+ """
278
+ This class represents ContentFileSearchResult.
279
+
280
+ The reference can be found here
281
+ https://docs.github.com/en/rest/reference/search#search-code
282
+
283
+ The OpenAPI schema can be found at
284
+
285
+ - /components/schemas/code-search-result-item
286
+
287
+ """
288
+
289
+ def _initAttributes(self) -> None:
290
+ super()._initAttributes()
291
+ self._score: Attribute[float] = NotSet
292
+
293
+ def __repr__(self) -> str:
294
+ return self.get__repr__({"path": self._path.value})
295
+
296
+ @property
297
+ async def score(self) -> float:
298
+ await self._completeIfNotSet(self._score)
299
+ return self._score.value
300
+
301
+ def _useAttributes(self, attributes: dict[str, Any]) -> None:
302
+ super()._useAttributes(attributes)
303
+ if "score" in attributes: # pragma no branch
304
+ self._score = self._makeFloatAttribute(attributes["score"])
@@ -0,0 +1,97 @@
1
+ # FILE AUTO GENERATED DO NOT TOUCH
2
+ ############################ Copyrights and license ############################
3
+ # #
4
+ # Copyright 2024 Pasha Fateev <pasha@autokitteh.com> #
5
+ # Copyright 2025 Enrico Minack <github@enrico.minack.dev> #
6
+ # #
7
+ # This file is part of PyGithub. #
8
+ # http://pygithub.readthedocs.io/ #
9
+ # #
10
+ # PyGithub is free software: you can redistribute it and/or modify it under #
11
+ # the terms of the GNU Lesser General Public License as published by the Free #
12
+ # Software Foundation, either version 3 of the License, or (at your option) #
13
+ # any later version. #
14
+ # #
15
+ # PyGithub is distributed in the hope that it will be useful, but WITHOUT ANY #
16
+ # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS #
17
+ # FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more #
18
+ # details. #
19
+ # #
20
+ # You should have received a copy of the GNU Lesser General Public License #
21
+ # along with PyGithub. If not, see <http://www.gnu.org/licenses/>. #
22
+ # #
23
+ ################################################################################
24
+
25
+ from __future__ import annotations
26
+
27
+ from typing import TYPE_CHECKING, Any
28
+
29
+ import githubasyncio.CopilotSeat
30
+ from githubasyncio.GithubObject import Attribute, NonCompletableGithubObject, NotSet, is_defined
31
+ from githubasyncio.PaginatedList import PaginatedList
32
+
33
+ if TYPE_CHECKING:
34
+ from githubasyncio.CopilotSeat import CopilotSeat
35
+ from githubasyncio.Requester import Requester
36
+
37
+
38
+ class Copilot(NonCompletableGithubObject):
39
+ def __init__(self, requester: Requester, org_name: str) -> None:
40
+ super().__init__(requester, {}, {"org_name": org_name})
41
+
42
+ def _initAttributes(self) -> None:
43
+ self._org_name: Attribute[str] = NotSet
44
+
45
+ def __repr__(self) -> str:
46
+ return self.get__repr__({"org_name": self._org_name.value if is_defined(self._org_name) else NotSet})
47
+
48
+ @property
49
+ def org_name(self) -> str:
50
+ return self._org_name.value
51
+
52
+ def get_seats(self) -> PaginatedList[CopilotSeat]:
53
+ """
54
+ :calls: `GET /orgs/{org}/copilot/billing/seats <https://docs.github.com/en/rest/copilot/copilot-business>`_
55
+ """
56
+ url = f"/orgs/{self._org_name.value}/copilot/billing/seats"
57
+ return PaginatedList(
58
+ githubasyncio.CopilotSeat.CopilotSeat,
59
+ self._requester,
60
+ url,
61
+ None,
62
+ list_item="seats",
63
+ )
64
+
65
+ async def add_seats(self, selected_usernames: list[str]) -> int:
66
+ """
67
+ :calls: `POST /orgs/{org}/copilot/billing/selected_users <https://docs.github.com/en/rest/copilot/copilot-business>`_
68
+ :param selected_usernames: List of usernames to add Copilot seats for
69
+ :rtype: int
70
+ :return: Number of seats created
71
+ """
72
+ url = f"/orgs/{self._org_name.value}/copilot/billing/selected_users"
73
+ _, data = await self._requester.requestJsonAndCheck(
74
+ "POST",
75
+ url,
76
+ input={"selected_usernames": selected_usernames},
77
+ )
78
+ return data["seats_created"]
79
+
80
+ async def remove_seats(self, selected_usernames: list[str]) -> int:
81
+ """
82
+ :calls: `DELETE /orgs/{org}/copilot/billing/selected_users <https://docs.github.com/en/rest/copilot/copilot-business>`_
83
+ :param selected_usernames: List of usernames to remove Copilot seats for
84
+ :rtype: int
85
+ :return: Number of seats cancelled
86
+ """
87
+ url = f"/orgs/{self._org_name.value}/copilot/billing/selected_users"
88
+ _, data = await self._requester.requestJsonAndCheck(
89
+ "DELETE",
90
+ url,
91
+ input={"selected_usernames": selected_usernames},
92
+ )
93
+ return data["seats_cancelled"]
94
+
95
+ def _useAttributes(self, attributes: dict[str, Any]) -> None:
96
+ if "org_name" in attributes: # pragma no branch
97
+ self._org_name = self._makeStringAttribute(attributes["org_name"])
@@ -0,0 +1,132 @@
1
+ # FILE AUTO GENERATED DO NOT TOUCH
2
+ ############################ Copyrights and license ############################
3
+ # #
4
+ # Copyright 2024 Pasha Fateev <pasha@autokitteh.com> #
5
+ # Copyright 2025 Enrico Minack <github@enrico.minack.dev> #
6
+ # Copyright 2026 Enrico Minack <github@enrico.minack.dev> #
7
+ # #
8
+ # This file is part of PyGithub. #
9
+ # http://pygithub.readthedocs.io/ #
10
+ # #
11
+ # PyGithub is free software: you can redistribute it and/or modify it under #
12
+ # the terms of the GNU Lesser General Public License as published by the Free #
13
+ # Software Foundation, either version 3 of the License, or (at your option) #
14
+ # any later version. #
15
+ # #
16
+ # PyGithub is distributed in the hope that it will be useful, but WITHOUT ANY #
17
+ # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS #
18
+ # FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more #
19
+ # details. #
20
+ # #
21
+ # You should have received a copy of the GNU Lesser General Public License #
22
+ # along with PyGithub. If not, see <http://www.gnu.org/licenses/>. #
23
+ # #
24
+ ################################################################################
25
+
26
+ from __future__ import annotations
27
+
28
+ from datetime import datetime
29
+ from typing import TYPE_CHECKING, Any
30
+
31
+ import githubasyncio.NamedUser
32
+ import githubasyncio.Organization
33
+ import githubasyncio.Team
34
+ from githubasyncio.GithubObject import Attribute, NonCompletableGithubObject, NotSet, _NotSetType
35
+
36
+ if TYPE_CHECKING:
37
+ from githubasyncio.NamedUser import NamedUser
38
+ from githubasyncio.Organization import Organization
39
+ from githubasyncio.Team import Team
40
+
41
+
42
+ class CopilotSeat(NonCompletableGithubObject):
43
+ """
44
+ This class represents CopilotSeat.
45
+
46
+ The reference can be found here
47
+ https://docs.github.com/en/rest/copilot/copilot-user-management
48
+
49
+ The OpenAPI schema can be found at
50
+
51
+ - /components/schemas/copilot-seat-details
52
+
53
+ """
54
+
55
+ def _initAttributes(self) -> None:
56
+ self._assignee: Attribute[NamedUser] | _NotSetType = NotSet
57
+ self._assigning_team: Attribute[Team] | _NotSetType = NotSet
58
+ self._created_at: Attribute[datetime] | _NotSetType = NotSet
59
+ self._last_activity_at: Attribute[datetime] | _NotSetType = NotSet
60
+ self._last_activity_editor: Attribute[str] | _NotSetType = NotSet
61
+ self._last_authenticated_at: Attribute[datetime] = NotSet
62
+ self._organization: Attribute[Organization] = NotSet
63
+ self._pending_cancellation_date: Attribute[datetime] | _NotSetType = NotSet
64
+ self._plan_type: Attribute[str] | _NotSetType = NotSet
65
+ self._updated_at: Attribute[datetime] | _NotSetType = NotSet
66
+
67
+ def __repr__(self) -> str:
68
+ return self.get__repr__({"assignee": self._assignee.value})
69
+
70
+ @property
71
+ def assignee(self) -> NamedUser:
72
+ return self._assignee.value
73
+
74
+ @property
75
+ def assigning_team(self) -> Team:
76
+ return self._assigning_team.value
77
+
78
+ @property
79
+ def created_at(self) -> datetime:
80
+ return self._created_at.value
81
+
82
+ @property
83
+ def last_activity_at(self) -> datetime:
84
+ return self._last_activity_at.value
85
+
86
+ @property
87
+ def last_activity_editor(self) -> str:
88
+ return self._last_activity_editor.value
89
+
90
+ @property
91
+ def last_authenticated_at(self) -> datetime:
92
+ return self._last_authenticated_at.value
93
+
94
+ @property
95
+ def organization(self) -> Organization:
96
+ return self._organization.value
97
+
98
+ @property
99
+ def pending_cancellation_date(self) -> datetime:
100
+ return self._pending_cancellation_date.value
101
+
102
+ @property
103
+ def plan_type(self) -> str:
104
+ return self._plan_type.value
105
+
106
+ @property
107
+ def updated_at(self) -> datetime:
108
+ return self._updated_at.value
109
+
110
+ def _useAttributes(self, attributes: dict[str, Any]) -> None:
111
+ if "assignee" in attributes:
112
+ self._assignee = self._makeClassAttribute(githubasyncio.NamedUser.NamedUser, attributes["assignee"])
113
+ if "assigning_team" in attributes:
114
+ self._assigning_team = self._makeClassAttribute(githubasyncio.Team.Team, attributes["assigning_team"])
115
+ if "created_at" in attributes:
116
+ self._created_at = self._makeDatetimeAttribute(attributes["created_at"])
117
+ if "last_activity_at" in attributes:
118
+ self._last_activity_at = self._makeDatetimeAttribute(attributes["last_activity_at"])
119
+ if "last_activity_editor" in attributes:
120
+ self._last_activity_editor = self._makeStringAttribute(attributes["last_activity_editor"])
121
+ if "last_authenticated_at" in attributes: # pragma no branch
122
+ self._last_authenticated_at = self._makeDatetimeAttribute(attributes["last_authenticated_at"])
123
+ if "organization" in attributes: # pragma no branch
124
+ self._organization = self._makeClassAttribute(
125
+ githubasyncio.Organization.Organization, attributes["organization"]
126
+ )
127
+ if "pending_cancellation_date" in attributes:
128
+ self._pending_cancellation_date = self._makeDatetimeAttribute(attributes["pending_cancellation_date"])
129
+ if "plan_type" in attributes:
130
+ self._plan_type = self._makeStringAttribute(attributes["plan_type"])
131
+ if "updated_at" in attributes:
132
+ self._updated_at = self._makeDatetimeAttribute(attributes["updated_at"])
@@ -0,0 +1,93 @@
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 Bill Napier <napier@pobox.com> #
23
+ # Copyright 2025 Enrico Minack <github@enrico.minack.dev> #
24
+ # Copyright 2026 Enrico Minack <github@enrico.minack.dev> #
25
+ # #
26
+ # This file is part of PyGithub. #
27
+ # http://pygithub.readthedocs.io/ #
28
+ # #
29
+ # PyGithub is free software: you can redistribute it and/or modify it under #
30
+ # the terms of the GNU Lesser General Public License as published by the Free #
31
+ # Software Foundation, either version 3 of the License, or (at your option) #
32
+ # any later version. #
33
+ # #
34
+ # PyGithub is distributed in the hope that it will be useful, but WITHOUT ANY #
35
+ # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS #
36
+ # FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more #
37
+ # details. #
38
+ # #
39
+ # You should have received a copy of the GNU Lesser General Public License #
40
+ # along with PyGithub. If not, see <http://www.gnu.org/licenses/>. #
41
+ # #
42
+ ################################################################################
43
+
44
+ from __future__ import annotations
45
+
46
+ from typing import TYPE_CHECKING, Any
47
+
48
+ import githubasyncio.CodeSecurityConfig
49
+ from githubasyncio.GithubObject import Attribute, NonCompletableGithubObject, NotSet
50
+
51
+ if TYPE_CHECKING:
52
+ from githubasyncio.CodeSecurityConfig import CodeSecurityConfig
53
+
54
+
55
+ class DefaultCodeSecurityConfig(NonCompletableGithubObject):
56
+ """
57
+ This class represents a Default Configurations for Code Security.
58
+
59
+ The reference can be found here
60
+ https://docs.github.com/en/rest/code-security/configurations.
61
+
62
+ The OpenAPI schema can be found at
63
+
64
+ - /components/schemas/code-security-default-configurations
65
+
66
+ """
67
+
68
+ def _initAttributes(self) -> None:
69
+ self._configuration: Attribute[CodeSecurityConfig] = NotSet
70
+ self._default_for_new_repos: Attribute[str] = NotSet
71
+
72
+ def __repr__(self) -> str:
73
+ return self.get__repr__(
74
+ {
75
+ "default_for_new_repos": self.default_for_new_repos,
76
+ }
77
+ )
78
+
79
+ @property
80
+ def configuration(self) -> CodeSecurityConfig:
81
+ return self._configuration.value
82
+
83
+ @property
84
+ def default_for_new_repos(self) -> str:
85
+ return self._default_for_new_repos.value
86
+
87
+ def _useAttributes(self, attributes: dict[str, Any]) -> None:
88
+ if "configuration" in attributes: # pragma no branch
89
+ self._configuration = self._makeClassAttribute(
90
+ githubasyncio.CodeSecurityConfig.CodeSecurityConfig, attributes["configuration"]
91
+ )
92
+ if "default_for_new_repos" in attributes: # pragma no branch
93
+ self._default_for_new_repos = self._makeStringAttribute(attributes["default_for_new_repos"])