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,255 @@
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 2013 martinqt <m.ki2@laposte.net> #
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 Michell Stuttgart <michellstut@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 Jirka Borovec <6035284+Borda@users.noreply.github.com> #
21
+ # Copyright 2023 Trim21 <trim21.me@gmail.com> #
22
+ # Copyright 2024 Enrico Minack <github@enrico.minack.dev> #
23
+ # Copyright 2024 Jirka Borovec <6035284+Borda@users.noreply.github.com> #
24
+ # Copyright 2025 Enrico Minack <github@enrico.minack.dev> #
25
+ # Copyright 2026 Enrico Minack <github@enrico.minack.dev> #
26
+ # #
27
+ # This file is part of PyGithub. #
28
+ # http://pygithub.readthedocs.io/ #
29
+ # #
30
+ # PyGithub is free software: you can redistribute it and/or modify it under #
31
+ # the terms of the GNU Lesser General Public License as published by the Free #
32
+ # Software Foundation, either version 3 of the License, or (at your option) #
33
+ # any later version. #
34
+ # #
35
+ # PyGithub is distributed in the hope that it will be useful, but WITHOUT ANY #
36
+ # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS #
37
+ # FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more #
38
+ # details. #
39
+ # #
40
+ # You should have received a copy of the GNU Lesser General Public License #
41
+ # along with PyGithub. If not, see <http://www.gnu.org/licenses/>. #
42
+ # #
43
+ ################################################################################
44
+
45
+ from __future__ import annotations
46
+
47
+ from datetime import date, datetime
48
+ from typing import TYPE_CHECKING, Any
49
+
50
+ import githubasyncio.GithubObject
51
+ import githubasyncio.Label
52
+ import githubasyncio.NamedUser
53
+ import githubasyncio.Organization
54
+ import githubasyncio.PaginatedList
55
+ from githubasyncio.GithubObject import Attribute, CompletableGithubObject, NotSet, Opt, is_defined, is_undefined
56
+ from githubasyncio.PaginatedList import PaginatedList
57
+
58
+ if TYPE_CHECKING:
59
+ from githubasyncio.Label import Label
60
+ from githubasyncio.NamedUser import NamedUser
61
+
62
+
63
+ class Milestone(CompletableGithubObject):
64
+ """
65
+ This class represents Milestones.
66
+
67
+ The reference can be found here
68
+ https://docs.github.com/en/rest/reference/issues#milestones
69
+
70
+ The OpenAPI schema can be found at
71
+
72
+ - /components/schemas/issue-event-milestone
73
+ - /components/schemas/milestone
74
+ - /components/schemas/nullable-milestone
75
+
76
+ """
77
+
78
+ def _initAttributes(self) -> None:
79
+ self._closed_at: Attribute[datetime] = NotSet
80
+ self._closed_issues: Attribute[int] = NotSet
81
+ self._created_at: Attribute[datetime] = NotSet
82
+ self._creator: Attribute[NamedUser] = NotSet
83
+ self._description: Attribute[str] = NotSet
84
+ self._due_on: Attribute[datetime] = NotSet
85
+ self._html_url: Attribute[str] = NotSet
86
+ self._id: Attribute[int] = NotSet
87
+ self._labels_url: Attribute[str] = NotSet
88
+ self._node_id: Attribute[str] = NotSet
89
+ self._number: Attribute[int] = NotSet
90
+ self._open_issues: Attribute[int] = NotSet
91
+ self._state: Attribute[str] = NotSet
92
+ self._title: Attribute[str] = NotSet
93
+ self._updated_at: Attribute[datetime] = NotSet
94
+ self._url: Attribute[str] = NotSet
95
+
96
+ def __repr__(self) -> str:
97
+ return self.get__repr__({"number": self._number.value, "title": self._title.value})
98
+
99
+ @property
100
+ def _identity(self) -> int:
101
+ return self._number.value
102
+
103
+ @property
104
+ async def closed_at(self) -> datetime:
105
+ await self._completeIfNotSet(self._closed_at)
106
+ return self._closed_at.value
107
+
108
+ @property
109
+ async def closed_issues(self) -> int:
110
+ await self._completeIfNotSet(self._closed_issues)
111
+ return self._closed_issues.value
112
+
113
+ @property
114
+ async def created_at(self) -> datetime:
115
+ await self._completeIfNotSet(self._created_at)
116
+ return self._created_at.value
117
+
118
+ @property
119
+ async def creator(self) -> NamedUser:
120
+ await self._completeIfNotSet(self._creator)
121
+ return self._creator.value
122
+
123
+ @property
124
+ async def description(self) -> str:
125
+ await self._completeIfNotSet(self._description)
126
+ return self._description.value
127
+
128
+ @property
129
+ async def due_on(self) -> datetime | None:
130
+ await self._completeIfNotSet(self._due_on)
131
+ return self._due_on.value
132
+
133
+ @property
134
+ async def html_url(self) -> str:
135
+ await self._completeIfNotSet(self._html_url)
136
+ return self._html_url.value
137
+
138
+ @property
139
+ async def id(self) -> int:
140
+ await self._completeIfNotSet(self._id)
141
+ return self._id.value
142
+
143
+ @property
144
+ async def labels_url(self) -> str:
145
+ await self._completeIfNotSet(self._labels_url)
146
+ return self._labels_url.value
147
+
148
+ @property
149
+ async def node_id(self) -> str:
150
+ await self._completeIfNotSet(self._node_id)
151
+ return self._node_id.value
152
+
153
+ @property
154
+ async def number(self) -> int:
155
+ await self._completeIfNotSet(self._number)
156
+ return self._number.value
157
+
158
+ @property
159
+ async def open_issues(self) -> int:
160
+ await self._completeIfNotSet(self._open_issues)
161
+ return self._open_issues.value
162
+
163
+ @property
164
+ async def state(self) -> str:
165
+ await self._completeIfNotSet(self._state)
166
+ return self._state.value
167
+
168
+ @property
169
+ async def title(self) -> str:
170
+ await self._completeIfNotSet(self._title)
171
+ return self._title.value
172
+
173
+ @property
174
+ async def updated_at(self) -> datetime:
175
+ await self._completeIfNotSet(self._updated_at)
176
+ return self._updated_at.value
177
+
178
+ @property
179
+ async def url(self) -> str:
180
+ await self._completeIfNotSet(self._url)
181
+ return self._url.value
182
+
183
+ async def delete(self) -> None:
184
+ """
185
+ :calls: `DELETE /repos/{owner}/{repo}/milestones/{milestone_number} <https://docs.github.com/en/rest/reference/issues#milestones>`_
186
+ """
187
+ headers, data = await self._requester.requestJsonAndCheck("DELETE", await self.url)
188
+
189
+ async def edit(
190
+ self, title: str, state: Opt[str] = NotSet, description: Opt[str] = NotSet, due_on: Opt[date] = NotSet
191
+ ) -> None:
192
+ """
193
+ :calls: `PATCH /repos/{owner}/{repo}/milestones/{milestone_number} <https://docs.github.com/en/rest/reference/issues#milestones>`_
194
+ """
195
+ assert isinstance(title, str), title
196
+ assert is_undefined(state) or isinstance(state, str), state
197
+ assert is_undefined(description) or isinstance(description, str), description
198
+ assert is_undefined(due_on) or isinstance(due_on, date), due_on
199
+ post_parameters = NotSet.remove_unset_items(
200
+ {
201
+ "title": title,
202
+ "state": state,
203
+ "description": description,
204
+ }
205
+ )
206
+
207
+ if is_defined(due_on):
208
+ post_parameters["due_on"] = due_on.strftime("%Y-%m-%d")
209
+
210
+ headers, data = await self._requester.requestJsonAndCheck("PATCH", await self.url, input=post_parameters)
211
+ self._useAttributes(data)
212
+
213
+ async def get_labels(self) -> PaginatedList[Label]:
214
+ """
215
+ :calls: `GET /repos/{owner}/{repo}/milestones/{milestone_number}/labels <https://docs.github.com/en/rest/reference/issues#labels>`_
216
+ """
217
+ return PaginatedList(githubasyncio.Label.Label, self._requester, f"{await self.url}/labels", None)
218
+
219
+ def _useAttributes(self, attributes: dict[str, Any]) -> None:
220
+ if "closed_at" in attributes: # pragma no branch
221
+ self._closed_at = self._makeDatetimeAttribute(attributes["closed_at"])
222
+ if "closed_issues" in attributes: # pragma no branch
223
+ self._closed_issues = self._makeIntAttribute(attributes["closed_issues"])
224
+ if "created_at" in attributes: # pragma no branch
225
+ self._created_at = self._makeDatetimeAttribute(attributes["created_at"])
226
+ if "creator" in attributes: # pragma no branch
227
+ self._creator = self._makeClassAttribute(githubasyncio.NamedUser.NamedUser, attributes["creator"])
228
+ if "description" in attributes: # pragma no branch
229
+ self._description = self._makeStringAttribute(attributes["description"])
230
+ if "due_on" in attributes: # pragma no branch
231
+ self._due_on = self._makeDatetimeAttribute(attributes["due_on"])
232
+ if "html_url" in attributes: # pragma no branch
233
+ self._html_url = self._makeStringAttribute(attributes["html_url"])
234
+ if "id" in attributes: # pragma no branch
235
+ self._id = self._makeIntAttribute(attributes["id"])
236
+ if "labels_url" in attributes: # pragma no branch
237
+ self._labels_url = self._makeStringAttribute(attributes["labels_url"])
238
+ if "node_id" in attributes: # pragma no branch
239
+ self._node_id = self._makeStringAttribute(attributes["node_id"])
240
+ if "number" in attributes: # pragma no branch
241
+ self._number = self._makeIntAttribute(attributes["number"])
242
+ elif "url" in attributes and attributes["url"]:
243
+ number = attributes["url"].split("/")[-1]
244
+ if number.isnumeric():
245
+ self._number = self._makeIntAttribute(int(number))
246
+ if "open_issues" in attributes: # pragma no branch
247
+ self._open_issues = self._makeIntAttribute(attributes["open_issues"])
248
+ if "state" in attributes: # pragma no branch
249
+ self._state = self._makeStringAttribute(attributes["state"])
250
+ if "title" in attributes: # pragma no branch
251
+ self._title = self._makeStringAttribute(attributes["title"])
252
+ if "updated_at" in attributes: # pragma no branch
253
+ self._updated_at = self._makeDatetimeAttribute(attributes["updated_at"])
254
+ if "url" in attributes: # pragma no branch
255
+ self._url = self._makeStringAttribute(attributes["url"])
@@ -0,0 +1,207 @@
1
+ # FILE AUTO GENERATED DO NOT TOUCH
2
+ ############################ Copyrights and license ############################
3
+ # #
4
+ # Copyright 2023 Enrico Minack <github@enrico.minack.dev> #
5
+ # Copyright 2023 YugoHino <henom06@gmail.com> #
6
+ # Copyright 2024 Enrico Minack <github@enrico.minack.dev> #
7
+ # Copyright 2024 Jirka Borovec <6035284+Borda@users.noreply.github.com> #
8
+ # Copyright 2025 Enrico Minack <github@enrico.minack.dev> #
9
+ # #
10
+ # This file is part of PyGithub. #
11
+ # http://pygithub.readthedocs.io/ #
12
+ # #
13
+ # PyGithub is free software: you can redistribute it and/or modify it under #
14
+ # the terms of the GNU Lesser General Public License as published by the Free #
15
+ # Software Foundation, either version 3 of the License, or (at your option) #
16
+ # any later version. #
17
+ # #
18
+ # PyGithub is distributed in the hope that it will be useful, but WITHOUT ANY #
19
+ # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS #
20
+ # FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more #
21
+ # details. #
22
+ # #
23
+ # You should have received a copy of the GNU Lesser General Public License #
24
+ # along with PyGithub. If not, see <http://www.gnu.org/licenses/>. #
25
+ # #
26
+ ################################################################################
27
+
28
+ from __future__ import annotations
29
+
30
+ from typing import Any
31
+
32
+ from githubasyncio.GithubObject import Attribute, CompletableGithubObject, NotSet
33
+
34
+
35
+ class NamedEnterpriseUser(CompletableGithubObject):
36
+ """
37
+ This class represents NamedEnterpriseUsers.
38
+
39
+ The reference can be found here
40
+ https://docs.github.com/en/enterprise-cloud@latest/rest/enterprise-admin/license#list-enterprise-consumed-licenses
41
+
42
+ """
43
+
44
+ def _initAttributes(self) -> None:
45
+ self._enterprise_server_primary_emails: Attribute[list] = NotSet
46
+ self._enterprise_server_user: Attribute[bool] = NotSet
47
+ self._enterprise_server_user_ids: Attribute[list] = NotSet
48
+ self._github_com_enterprise_roles: Attribute[list] = NotSet
49
+ self._github_com_login: Attribute[str] = NotSet
50
+ self._github_com_member_roles: Attribute[list] = NotSet
51
+ self._github_com_name: Attribute[str] = NotSet
52
+ self._github_com_orgs_with_pending_invites: Attribute[list] = NotSet
53
+ self._github_com_profile: Attribute[str] = NotSet
54
+ self._github_com_saml_name_id: Attribute[str] = NotSet
55
+ self._github_com_two_factor_auth: Attribute[bool] = NotSet
56
+ self._github_com_user: Attribute[bool] = NotSet
57
+ self._github_com_verified_domain_emails: Attribute[list] = NotSet
58
+ self._license_type: Attribute[str] = NotSet
59
+ self._total_user_accounts: Attribute[int] = NotSet
60
+ self._visual_studio_license_status: Attribute[str] = NotSet
61
+ self._visual_studio_subscription_email: Attribute[str] = NotSet
62
+ self._visual_studio_subscription_user: Attribute[bool] = NotSet
63
+
64
+ def __repr__(self) -> str:
65
+ return self.get__repr__({"login": self._github_com_login.value})
66
+
67
+ @property
68
+ async def enterprise_server_primary_emails(self) -> list:
69
+ await self._completeIfNotSet(self._enterprise_server_primary_emails)
70
+ return self._enterprise_server_primary_emails.value
71
+
72
+ @property
73
+ async def enterprise_server_user(self) -> bool:
74
+ await self._completeIfNotSet(self._enterprise_server_user)
75
+ return self._enterprise_server_user.value
76
+
77
+ @property
78
+ async def enterprise_server_user_ids(self) -> list:
79
+ await self._completeIfNotSet(self._enterprise_server_user_ids)
80
+ return self._enterprise_server_user_ids.value
81
+
82
+ @property
83
+ async def github_com_enterprise_roles(self) -> list:
84
+ await self._completeIfNotSet(self._github_com_enterprise_roles)
85
+ return self._github_com_enterprise_roles.value
86
+
87
+ @property
88
+ async def github_com_login(self) -> str:
89
+ await self._completeIfNotSet(self._github_com_login)
90
+ return self._github_com_login.value
91
+
92
+ @property
93
+ async def github_com_member_roles(self) -> list:
94
+ await self._completeIfNotSet(self._github_com_member_roles)
95
+ return self._github_com_member_roles.value
96
+
97
+ @property
98
+ async def github_com_name(self) -> str:
99
+ await self._completeIfNotSet(self._github_com_name)
100
+ return self._github_com_name.value
101
+
102
+ @property
103
+ async def github_com_orgs_with_pending_invites(self) -> list:
104
+ await self._completeIfNotSet(self._github_com_orgs_with_pending_invites)
105
+ return self._github_com_orgs_with_pending_invites.value
106
+
107
+ @property
108
+ async def github_com_profile(self) -> str:
109
+ await self._completeIfNotSet(self._github_com_profile)
110
+ return self._github_com_profile.value
111
+
112
+ @property
113
+ async def github_com_saml_name_id(self) -> str:
114
+ await self._completeIfNotSet(self._github_com_saml_name_id)
115
+ return self._github_com_saml_name_id.value
116
+
117
+ @property
118
+ async def github_com_two_factor_auth(self) -> bool:
119
+ await self._completeIfNotSet(self._github_com_two_factor_auth)
120
+ return self._github_com_two_factor_auth.value
121
+
122
+ @property
123
+ async def github_com_user(self) -> bool:
124
+ await self._completeIfNotSet(self._github_com_user)
125
+ return self._github_com_user.value
126
+
127
+ @property
128
+ async def github_com_verified_domain_emails(self) -> list:
129
+ await self._completeIfNotSet(self._github_com_verified_domain_emails)
130
+ return self._github_com_verified_domain_emails.value
131
+
132
+ @property
133
+ async def license_type(self) -> str:
134
+ await self._completeIfNotSet(self._license_type)
135
+ return self._license_type.value
136
+
137
+ @property
138
+ async def total_user_accounts(self) -> int:
139
+ await self._completeIfNotSet(self._total_user_accounts)
140
+ return self._total_user_accounts.value
141
+
142
+ @property
143
+ async def visual_studio_license_status(self) -> str:
144
+ await self._completeIfNotSet(self._visual_studio_license_status)
145
+ return self._visual_studio_license_status.value
146
+
147
+ @property
148
+ async def visual_studio_subscription_email(self) -> str:
149
+ await self._completeIfNotSet(self._visual_studio_subscription_email)
150
+ return self._visual_studio_subscription_email.value
151
+
152
+ @property
153
+ async def visual_studio_subscription_user(self) -> bool:
154
+ await self._completeIfNotSet(self._visual_studio_subscription_user)
155
+ return self._visual_studio_subscription_user.value
156
+
157
+ def _useAttributes(self, attributes: dict[str, Any]) -> None:
158
+ if "enterprise_server_primary_emails" in attributes: # pragma no branch
159
+ self._enterprise_server_primary_emails = self._makeListOfStringsAttribute(
160
+ attributes["enterprise_server_primary_emails"]
161
+ )
162
+ if "enterprise_server_user" in attributes: # pragma no branch
163
+ self._enterprise_server_user = self._makeBoolAttribute(attributes["enterprise_server_user"])
164
+ if "enterprise_server_user_ids" in attributes: # pragma no branch
165
+ self._enterprise_server_user_ids = self._makeListOfStringsAttribute(
166
+ attributes["enterprise_server_user_ids"]
167
+ )
168
+ if "github_com_enterprise_roles" in attributes: # pragma no branch
169
+ self._github_com_enterprise_roles = self._makeListOfStringsAttribute(
170
+ attributes["github_com_enterprise_roles"]
171
+ )
172
+ if "github_com_login" in attributes: # pragma no branch
173
+ self._github_com_login = self._makeStringAttribute(attributes["github_com_login"])
174
+ if "github_com_member_roles" in attributes: # pragma no branch
175
+ self._github_com_member_roles = self._makeListOfStringsAttribute(attributes["github_com_member_roles"])
176
+ if "github_com_name" in attributes: # pragma no branch
177
+ self._github_com_name = self._makeStringAttribute(attributes["github_com_name"])
178
+ if "github_com_orgs_with_pending_invites" in attributes: # pragma no branch
179
+ self._github_com_orgs_with_pending_invites = self._makeListOfStringsAttribute(
180
+ attributes["github_com_orgs_with_pending_invites"]
181
+ )
182
+ if "github_com_profile" in attributes: # pragma no branch
183
+ self._github_com_profile = self._makeStringAttribute(attributes["github_com_profile"])
184
+ if "github_com_saml_name_id" in attributes: # pragma no branch
185
+ self._github_com_saml_name_id = self._makeStringAttribute(attributes["github_com_saml_name_id"])
186
+ if "github_com_two_factor_auth" in attributes: # pragma no branch
187
+ self._github_com_two_factor_auth = self._makeBoolAttribute(attributes["github_com_two_factor_auth"])
188
+ if "github_com_user" in attributes: # pragma no branch
189
+ self._github_com_user = self._makeBoolAttribute(attributes["github_com_user"])
190
+ if "github_com_verified_domain_emails" in attributes: # pragma no branch
191
+ self._github_com_verified_domain_emails = self._makeListOfStringsAttribute(
192
+ attributes["github_com_verified_domain_emails"]
193
+ )
194
+ if "license_type" in attributes: # pragma no branch
195
+ self._license_type = self._makeStringAttribute(attributes["license_type"])
196
+ if "total_user_accounts" in attributes: # pragma no branch
197
+ self._total_user_accounts = self._makeIntAttribute(attributes["total_user_accounts"])
198
+ if "visual_studio_license_status" in attributes: # pragma no branch
199
+ self._visual_studio_license_status = self._makeStringAttribute(attributes["visual_studio_license_status"])
200
+ if "visual_studio_subscription_email" in attributes: # pragma no branch
201
+ self._visual_studio_subscription_email = self._makeStringAttribute(
202
+ attributes["visual_studio_subscription_email"]
203
+ )
204
+ if "visual_studio_subscription_user" in attributes: # pragma no branch
205
+ self._visual_studio_subscription_user = self._makeBoolAttribute(
206
+ attributes["visual_studio_subscription_user"]
207
+ )