PyGithub-asyncio 3.0.0b1__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- githubasyncio/AccessToken.py +159 -0
- githubasyncio/AdvisoryBase.py +163 -0
- githubasyncio/AdvisoryCredit.py +131 -0
- githubasyncio/AdvisoryCreditDetailed.py +110 -0
- githubasyncio/AdvisoryVulnerability.py +191 -0
- githubasyncio/AdvisoryVulnerabilityPackage.py +93 -0
- githubasyncio/AppAuthentication.py +58 -0
- githubasyncio/ApplicationOAuth.py +200 -0
- githubasyncio/Artifact.py +183 -0
- githubasyncio/Auth.py +560 -0
- githubasyncio/AuthenticatedUser.py +1251 -0
- githubasyncio/Authorization.py +192 -0
- githubasyncio/AuthorizationApplication.py +73 -0
- githubasyncio/Autolink.py +104 -0
- githubasyncio/Branch.py +689 -0
- githubasyncio/BranchProtection.py +224 -0
- githubasyncio/CVSS.py +83 -0
- githubasyncio/CWE.py +75 -0
- githubasyncio/CheckRun.py +315 -0
- githubasyncio/CheckRunAnnotation.py +134 -0
- githubasyncio/CheckRunOutput.py +108 -0
- githubasyncio/CheckSuite.py +319 -0
- githubasyncio/Clones.py +97 -0
- githubasyncio/CodeScanAlert.py +215 -0
- githubasyncio/CodeScanAlertInstance.py +134 -0
- githubasyncio/CodeScanAlertInstanceLocation.py +102 -0
- githubasyncio/CodeScanRule.py +134 -0
- githubasyncio/CodeScanTool.py +94 -0
- githubasyncio/CodeSecurityConfig.py +301 -0
- githubasyncio/CodeSecurityConfigRepository.py +70 -0
- githubasyncio/Commit.py +442 -0
- githubasyncio/CommitCombinedStatus.py +126 -0
- githubasyncio/CommitComment.py +270 -0
- githubasyncio/CommitStats.py +78 -0
- githubasyncio/CommitStatus.py +169 -0
- githubasyncio/Comparison.py +219 -0
- githubasyncio/Consts.py +197 -0
- githubasyncio/ContentFile.py +304 -0
- githubasyncio/Copilot.py +97 -0
- githubasyncio/CopilotSeat.py +132 -0
- githubasyncio/DefaultCodeSecurityConfig.py +93 -0
- githubasyncio/DependabotAlert.py +184 -0
- githubasyncio/DependabotAlertAdvisory.py +82 -0
- githubasyncio/DependabotAlertDependency.py +100 -0
- githubasyncio/DependabotAlertVulnerability.py +85 -0
- githubasyncio/Deployment.py +314 -0
- githubasyncio/DeploymentBranchPolicy.py +102 -0
- githubasyncio/DeploymentStatus.py +201 -0
- githubasyncio/DiscussionBase.py +140 -0
- githubasyncio/DiscussionCommentBase.py +140 -0
- githubasyncio/Download.py +256 -0
- githubasyncio/Enterprise.py +175 -0
- githubasyncio/EnterpriseConsumedLicenses.py +138 -0
- githubasyncio/Environment.py +354 -0
- githubasyncio/EnvironmentDeploymentBranchPolicy.py +87 -0
- githubasyncio/EnvironmentProtectionRule.py +117 -0
- githubasyncio/EnvironmentProtectionRuleReviewer.py +110 -0
- githubasyncio/Event.py +134 -0
- githubasyncio/File.py +142 -0
- githubasyncio/GeneratedReleaseNotes.py +68 -0
- githubasyncio/Gist.py +373 -0
- githubasyncio/GistComment.py +162 -0
- githubasyncio/GistFile.py +106 -0
- githubasyncio/GistHistoryState.py +245 -0
- githubasyncio/GitAuthor.py +94 -0
- githubasyncio/GitBlob.py +123 -0
- githubasyncio/GitCommit.py +208 -0
- githubasyncio/GitCommitVerification.py +103 -0
- githubasyncio/GitObject.py +84 -0
- githubasyncio/GitRef.py +122 -0
- githubasyncio/GitRelease.py +476 -0
- githubasyncio/GitReleaseAsset.py +232 -0
- githubasyncio/GitTag.py +143 -0
- githubasyncio/GitTree.py +113 -0
- githubasyncio/GitTreeElement.py +104 -0
- githubasyncio/GithubApp.py +236 -0
- githubasyncio/GithubException.py +226 -0
- githubasyncio/GithubIntegration.py +365 -0
- githubasyncio/GithubObject.py +910 -0
- githubasyncio/GithubRetry.py +253 -0
- githubasyncio/GitignoreTemplate.py +88 -0
- githubasyncio/GlobalAdvisory.py +141 -0
- githubasyncio/Hook.py +238 -0
- githubasyncio/HookDelivery.py +243 -0
- githubasyncio/HookDescription.py +85 -0
- githubasyncio/HookResponse.py +83 -0
- githubasyncio/InputFileContent.py +63 -0
- githubasyncio/InputGitAuthor.py +71 -0
- githubasyncio/InputGitTreeElement.py +79 -0
- githubasyncio/Installation.py +298 -0
- githubasyncio/InstallationAuthorization.py +138 -0
- githubasyncio/Invitation.py +171 -0
- githubasyncio/Issue.py +955 -0
- githubasyncio/IssueComment.py +309 -0
- githubasyncio/IssueDependenciesSummary.py +77 -0
- githubasyncio/IssueEvent.py +296 -0
- githubasyncio/IssuePullRequest.py +97 -0
- githubasyncio/IssueType.py +123 -0
- githubasyncio/Label.py +186 -0
- githubasyncio/License.py +169 -0
- githubasyncio/MainClass.py +1142 -0
- githubasyncio/Membership.py +154 -0
- githubasyncio/MergedUpstream.py +71 -0
- githubasyncio/Migration.py +281 -0
- githubasyncio/Milestone.py +255 -0
- githubasyncio/NamedEnterpriseUser.py +207 -0
- githubasyncio/NamedUser.py +841 -0
- githubasyncio/Notification.py +182 -0
- githubasyncio/NotificationSubject.py +96 -0
- githubasyncio/Organization.py +2462 -0
- githubasyncio/OrganizationCodeScanAlert.py +65 -0
- githubasyncio/OrganizationCustomProperty.py +215 -0
- githubasyncio/OrganizationDependabotAlert.py +75 -0
- githubasyncio/OrganizationSecret.py +191 -0
- githubasyncio/OrganizationSecretScanAlert.py +112 -0
- githubasyncio/OrganizationVariable.py +141 -0
- githubasyncio/PaginatedList.py +652 -0
- githubasyncio/Path.py +102 -0
- githubasyncio/Permissions.py +113 -0
- githubasyncio/Plan.py +108 -0
- githubasyncio/Project.py +286 -0
- githubasyncio/ProjectCard.py +257 -0
- githubasyncio/ProjectColumn.py +227 -0
- githubasyncio/PublicKey.py +138 -0
- githubasyncio/PullRequest.py +1202 -0
- githubasyncio/PullRequestComment.py +401 -0
- githubasyncio/PullRequestMergeStatus.py +89 -0
- githubasyncio/PullRequestPart.py +110 -0
- githubasyncio/PullRequestReview.py +214 -0
- githubasyncio/Rate.py +123 -0
- githubasyncio/RateLimit.py +210 -0
- githubasyncio/RateLimitOverview.py +104 -0
- githubasyncio/Reaction.py +128 -0
- githubasyncio/Referrer.py +94 -0
- githubasyncio/RepoCodeSecurityConfig.py +93 -0
- githubasyncio/Repository.py +5211 -0
- githubasyncio/RepositoryAdvisory.py +431 -0
- githubasyncio/RepositoryDiscussion.py +221 -0
- githubasyncio/RepositoryDiscussionCategory.py +150 -0
- githubasyncio/RepositoryDiscussionComment.py +159 -0
- githubasyncio/RepositoryKey.py +166 -0
- githubasyncio/RepositoryPreferences.py +82 -0
- githubasyncio/RepositoryRulesetBypassActor.py +75 -0
- githubasyncio/Requester.py +1518 -0
- githubasyncio/RequiredPullRequestReviews.py +269 -0
- githubasyncio/RequiredStatusChecks.py +153 -0
- githubasyncio/Rule.py +134 -0
- githubasyncio/Ruleset.py +292 -0
- githubasyncio/Secret.py +139 -0
- githubasyncio/SecretScanAlert.py +317 -0
- githubasyncio/SecretScanAlertInstance.py +128 -0
- githubasyncio/SecurityAndAnalysis.py +188 -0
- githubasyncio/SecurityAndAnalysisFeature.py +79 -0
- githubasyncio/SelfHostedActionsRunner.py +129 -0
- githubasyncio/SelfHostedActionsRunnerApplication.py +92 -0
- githubasyncio/SelfHostedActionsRunnerJitConfig.py +74 -0
- githubasyncio/SelfHostedActionsRunnerToken.py +118 -0
- githubasyncio/SourceImport.py +260 -0
- githubasyncio/Stargazer.py +88 -0
- githubasyncio/StatsCodeFrequency.py +81 -0
- githubasyncio/StatsCommitActivity.py +86 -0
- githubasyncio/StatsContributor.py +138 -0
- githubasyncio/StatsParticipation.py +78 -0
- githubasyncio/StatsPunchCard.py +76 -0
- githubasyncio/SubIssueSummary.py +70 -0
- githubasyncio/Tag.py +108 -0
- githubasyncio/Team.py +618 -0
- githubasyncio/TeamDiscussion.py +137 -0
- githubasyncio/TimelineEvent.py +164 -0
- githubasyncio/TimelineEventSource.py +81 -0
- githubasyncio/Topic.py +177 -0
- githubasyncio/Traffic.py +95 -0
- githubasyncio/UserKey.py +141 -0
- githubasyncio/Variable.py +155 -0
- githubasyncio/View.py +97 -0
- githubasyncio/Workflow.py +335 -0
- githubasyncio/WorkflowJob.py +253 -0
- githubasyncio/WorkflowRun.py +480 -0
- githubasyncio/WorkflowStep.py +118 -0
- githubasyncio/__init__.py +38 -0
- githubasyncio/compat/__init__.py +52 -0
- githubasyncio/requestlib/__init__.py +29 -0
- pygithub_asyncio-3.0.0b1.dist-info/METADATA +102 -0
- pygithub_asyncio-3.0.0b1.dist-info/RECORD +188 -0
- pygithub_asyncio-3.0.0b1.dist-info/WHEEL +5 -0
- pygithub_asyncio-3.0.0b1.dist-info/licenses/COPYING +674 -0
- pygithub_asyncio-3.0.0b1.dist-info/licenses/COPYING.LESSER +165 -0
- pygithub_asyncio-3.0.0b1.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,841 @@
|
|
|
1
|
+
# FILE AUTO GENERATED DO NOT TOUCH
|
|
2
|
+
############################ Copyrights and license ############################
|
|
3
|
+
# #
|
|
4
|
+
# Copyright 2012 Steve English <steve.english@navetas.com> #
|
|
5
|
+
# Copyright 2012 Vincent Jacques <vincent@vincent-jacques.net> #
|
|
6
|
+
# Copyright 2012 Zearin <zearin@gonk.net> #
|
|
7
|
+
# Copyright 2013 AKFish <akfish@gmail.com> #
|
|
8
|
+
# Copyright 2013 Vincent Jacques <vincent@vincent-jacques.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 2017 Simon <spam@esemi.ru> #
|
|
13
|
+
# Copyright 2018 Bruce Richardson <itsbruce@workshy.org> #
|
|
14
|
+
# Copyright 2018 Iraquitan Cordeiro Filho <iraquitanfilho@gmail.com> #
|
|
15
|
+
# Copyright 2018 Riccardo Pittau <elfosardo@users.noreply.github.com> #
|
|
16
|
+
# Copyright 2018 Steve Kowalik <steven@wedontsleep.org> #
|
|
17
|
+
# Copyright 2018 Victor Granic <vmg@boreal321.com> #
|
|
18
|
+
# Copyright 2018 Wan Liuyang <tsfdye@gmail.com> #
|
|
19
|
+
# Copyright 2018 namc <namratachaudhary@users.noreply.github.com> #
|
|
20
|
+
# Copyright 2018 sfdye <tsfdye@gmail.com> #
|
|
21
|
+
# Copyright 2019 Pavan Kunisetty <nagapavan@users.noreply.github.com> #
|
|
22
|
+
# Copyright 2019 Shibasis Patel <smartshibasish@gmail.com> #
|
|
23
|
+
# Copyright 2019 Steve Kowalik <steven@wedontsleep.org> #
|
|
24
|
+
# Copyright 2019 Surya Teja <94suryateja@gmail.com> #
|
|
25
|
+
# Copyright 2019 Wan Liuyang <tsfdye@gmail.com> #
|
|
26
|
+
# Copyright 2020 Anuj Bansal <bansalanuj1996@gmail.com> #
|
|
27
|
+
# Copyright 2020 Daniel Haas <thisisdhaas@gmail.com> #
|
|
28
|
+
# Copyright 2020 Steve Kowalik <steven@wedontsleep.org> #
|
|
29
|
+
# Copyright 2021 Mark Walker <mark.walker@realbuzz.com> #
|
|
30
|
+
# Copyright 2021 Steve Kowalik <steven@wedontsleep.org> #
|
|
31
|
+
# Copyright 2023 Enrico Minack <github@enrico.minack.dev> #
|
|
32
|
+
# Copyright 2023 Jirka Borovec <6035284+Borda@users.noreply.github.com> #
|
|
33
|
+
# Copyright 2023 Mark Amery <markamery@btinternet.com> #
|
|
34
|
+
# Copyright 2023 Trim21 <trim21.me@gmail.com> #
|
|
35
|
+
# Copyright 2024 Enrico Minack <github@enrico.minack.dev> #
|
|
36
|
+
# Copyright 2024 Jirka Borovec <6035284+Borda@users.noreply.github.com> #
|
|
37
|
+
# Copyright 2025 Enrico Minack <github@enrico.minack.dev> #
|
|
38
|
+
# #
|
|
39
|
+
# This file is part of PyGithub. #
|
|
40
|
+
# http://pygithub.readthedocs.io/ #
|
|
41
|
+
# #
|
|
42
|
+
# PyGithub is free software: you can redistribute it and/or modify it under #
|
|
43
|
+
# the terms of the GNU Lesser General Public License as published by the Free #
|
|
44
|
+
# Software Foundation, either version 3 of the License, or (at your option) #
|
|
45
|
+
# any later version. #
|
|
46
|
+
# #
|
|
47
|
+
# PyGithub is distributed in the hope that it will be useful, but WITHOUT ANY #
|
|
48
|
+
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS #
|
|
49
|
+
# FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more #
|
|
50
|
+
# details. #
|
|
51
|
+
# #
|
|
52
|
+
# You should have received a copy of the GNU Lesser General Public License #
|
|
53
|
+
# along with PyGithub. If not, see <http://www.gnu.org/licenses/>. #
|
|
54
|
+
# #
|
|
55
|
+
################################################################################
|
|
56
|
+
|
|
57
|
+
from __future__ import annotations
|
|
58
|
+
|
|
59
|
+
import urllib.parse
|
|
60
|
+
from datetime import datetime
|
|
61
|
+
from typing import TYPE_CHECKING, Any
|
|
62
|
+
|
|
63
|
+
import githubasyncio.Event
|
|
64
|
+
import githubasyncio.Gist
|
|
65
|
+
import githubasyncio.GithubObject
|
|
66
|
+
import githubasyncio.Membership
|
|
67
|
+
import githubasyncio.Organization
|
|
68
|
+
import githubasyncio.PaginatedList
|
|
69
|
+
import githubasyncio.Permissions
|
|
70
|
+
import githubasyncio.Plan
|
|
71
|
+
import githubasyncio.Project
|
|
72
|
+
import githubasyncio.Repository
|
|
73
|
+
import githubasyncio.UserKey
|
|
74
|
+
from githubasyncio import Consts
|
|
75
|
+
from githubasyncio.GithubObject import Attribute, NotSet, Opt, is_defined, is_undefined
|
|
76
|
+
from githubasyncio.PaginatedList import PaginatedList
|
|
77
|
+
|
|
78
|
+
if TYPE_CHECKING:
|
|
79
|
+
from githubasyncio.Event import Event
|
|
80
|
+
from githubasyncio.Gist import Gist
|
|
81
|
+
from githubasyncio.Membership import Membership
|
|
82
|
+
from githubasyncio.Organization import Organization
|
|
83
|
+
from githubasyncio.Permissions import Permissions
|
|
84
|
+
from githubasyncio.Plan import Plan
|
|
85
|
+
from githubasyncio.Project import Project
|
|
86
|
+
from githubasyncio.Repository import Repository
|
|
87
|
+
from githubasyncio.UserKey import UserKey
|
|
88
|
+
|
|
89
|
+
|
|
90
|
+
class NamedUser(githubasyncio.GithubObject.CompletableGithubObject):
|
|
91
|
+
"""
|
|
92
|
+
This class represents NamedUsers.
|
|
93
|
+
|
|
94
|
+
The reference can be found here
|
|
95
|
+
https://docs.github.com/en/rest/reference/users#get-a-user
|
|
96
|
+
|
|
97
|
+
The OpenAPI schema can be found at
|
|
98
|
+
|
|
99
|
+
- /components/schemas/actor
|
|
100
|
+
- /components/schemas/collaborator
|
|
101
|
+
- /components/schemas/contributor
|
|
102
|
+
- /components/schemas/nullable-simple-user
|
|
103
|
+
- /components/schemas/private-user
|
|
104
|
+
- /components/schemas/public-user
|
|
105
|
+
- /components/schemas/simple-user
|
|
106
|
+
- /components/schemas/team-member
|
|
107
|
+
|
|
108
|
+
"""
|
|
109
|
+
|
|
110
|
+
def _initAttributes(self) -> None:
|
|
111
|
+
self._avatar_url: Attribute[str] = NotSet
|
|
112
|
+
self._bio: Attribute[str | None] = NotSet
|
|
113
|
+
self._blog: Attribute[str | None] = NotSet
|
|
114
|
+
self._business_plus: Attribute[bool] = NotSet
|
|
115
|
+
self._collaborators: Attribute[int] = NotSet
|
|
116
|
+
self._company: Attribute[str | None] = NotSet
|
|
117
|
+
self._contributions: Attribute[int] = NotSet
|
|
118
|
+
self._created_at: Attribute[datetime] = NotSet
|
|
119
|
+
self._disk_usage: Attribute[int] = NotSet
|
|
120
|
+
self._display_login: Attribute[str] = NotSet
|
|
121
|
+
self._email: Attribute[str | None] = NotSet
|
|
122
|
+
self._events_url: Attribute[str] = NotSet
|
|
123
|
+
self._followers: Attribute[int] = NotSet
|
|
124
|
+
self._followers_url: Attribute[str] = NotSet
|
|
125
|
+
self._following: Attribute[int] = NotSet
|
|
126
|
+
self._following_url: Attribute[str] = NotSet
|
|
127
|
+
self._gists_url: Attribute[str] = NotSet
|
|
128
|
+
self._gravatar_id: Attribute[str | None] = NotSet
|
|
129
|
+
self._hireable: Attribute[bool | None] = NotSet
|
|
130
|
+
self._html_url: Attribute[str] = NotSet
|
|
131
|
+
self._id: Attribute[int] = NotSet
|
|
132
|
+
self._inherited: Attribute[bool] = NotSet
|
|
133
|
+
self._invitation_teams_url: Attribute[str] = NotSet
|
|
134
|
+
self._inviter: Attribute[NamedUser] = NotSet
|
|
135
|
+
self._ldap_dn: Attribute[str] = NotSet
|
|
136
|
+
self._location: Attribute[str | None] = NotSet
|
|
137
|
+
self._login: Attribute[str] = NotSet
|
|
138
|
+
self._name: Attribute[str] = NotSet
|
|
139
|
+
self._node_id: Attribute[str] = NotSet
|
|
140
|
+
self._notification_email: Attribute[str] = NotSet
|
|
141
|
+
self._organizations_url: Attribute[str] = NotSet
|
|
142
|
+
self._owned_private_repos: Attribute[int] = NotSet
|
|
143
|
+
self._permissions: Attribute[Permissions] = NotSet
|
|
144
|
+
self._plan: Attribute[Plan] = NotSet
|
|
145
|
+
self._private_gists: Attribute[int] = NotSet
|
|
146
|
+
self._public_gists: Attribute[int] = NotSet
|
|
147
|
+
self._public_repos: Attribute[int] = NotSet
|
|
148
|
+
self._received_events_url: Attribute[str] = NotSet
|
|
149
|
+
self._repos_url: Attribute[str] = NotSet
|
|
150
|
+
self._role: Attribute[str] = NotSet
|
|
151
|
+
self._role_name: Attribute[str] = NotSet
|
|
152
|
+
self._site_admin: Attribute[bool] = NotSet
|
|
153
|
+
self._starred_at: Attribute[str] = NotSet
|
|
154
|
+
self._starred_url: Attribute[str] = NotSet
|
|
155
|
+
self._subscriptions_url: Attribute[str] = NotSet
|
|
156
|
+
self._suspended_at: Attribute[datetime | None] = NotSet
|
|
157
|
+
self._team_count: Attribute[int] = NotSet
|
|
158
|
+
self._text_matches: Attribute[dict[str, Any]] = NotSet
|
|
159
|
+
self._total_private_repos: Attribute[int] = NotSet
|
|
160
|
+
self._twitter_username: Attribute[str | None] = NotSet
|
|
161
|
+
self._two_factor_authentication: Attribute[bool] = NotSet
|
|
162
|
+
self._type: Attribute[str] = NotSet
|
|
163
|
+
self._updated_at: Attribute[datetime] = NotSet
|
|
164
|
+
self._url: Attribute[str] = NotSet
|
|
165
|
+
self._user_view_type: Attribute[str] = NotSet
|
|
166
|
+
|
|
167
|
+
def __eq__(self, other: Any) -> bool:
|
|
168
|
+
return (
|
|
169
|
+
isinstance(other, type(self))
|
|
170
|
+
and self._login.value == other._login.value
|
|
171
|
+
and self._id.value == other._id.value
|
|
172
|
+
)
|
|
173
|
+
|
|
174
|
+
def __hash__(self) -> int:
|
|
175
|
+
return hash((self._id.value, self._login.value))
|
|
176
|
+
|
|
177
|
+
def __repr__(self) -> str:
|
|
178
|
+
return self.get__repr__({"login": self._login.value})
|
|
179
|
+
|
|
180
|
+
@property
|
|
181
|
+
async def _identity(self) -> str:
|
|
182
|
+
return await self.login
|
|
183
|
+
|
|
184
|
+
@property
|
|
185
|
+
async def avatar_url(self) -> str:
|
|
186
|
+
await self._completeIfNotSet(self._avatar_url)
|
|
187
|
+
return self._avatar_url.value
|
|
188
|
+
|
|
189
|
+
@property
|
|
190
|
+
async def bio(self) -> str | None:
|
|
191
|
+
await self._completeIfNotSet(self._bio)
|
|
192
|
+
return self._bio.value
|
|
193
|
+
|
|
194
|
+
@property
|
|
195
|
+
async def blog(self) -> str | None:
|
|
196
|
+
await self._completeIfNotSet(self._blog)
|
|
197
|
+
return self._blog.value
|
|
198
|
+
|
|
199
|
+
@property
|
|
200
|
+
def business_plus(self) -> bool:
|
|
201
|
+
return self._business_plus.value
|
|
202
|
+
|
|
203
|
+
@property
|
|
204
|
+
async def collaborators(self) -> int | None:
|
|
205
|
+
await self._completeIfNotSet(self._collaborators)
|
|
206
|
+
return self._collaborators.value
|
|
207
|
+
|
|
208
|
+
@property
|
|
209
|
+
async def company(self) -> str | None:
|
|
210
|
+
await self._completeIfNotSet(self._company)
|
|
211
|
+
return self._company.value
|
|
212
|
+
|
|
213
|
+
@property
|
|
214
|
+
async def contributions(self) -> int:
|
|
215
|
+
await self._completeIfNotSet(self._contributions)
|
|
216
|
+
return self._contributions.value
|
|
217
|
+
|
|
218
|
+
@property
|
|
219
|
+
async def created_at(self) -> datetime:
|
|
220
|
+
await self._completeIfNotSet(self._created_at)
|
|
221
|
+
return self._created_at.value
|
|
222
|
+
|
|
223
|
+
@property
|
|
224
|
+
async def disk_usage(self) -> int:
|
|
225
|
+
await self._completeIfNotSet(self._disk_usage)
|
|
226
|
+
return self._disk_usage.value
|
|
227
|
+
|
|
228
|
+
@property
|
|
229
|
+
def display_login(self) -> str:
|
|
230
|
+
return self._display_login.value
|
|
231
|
+
|
|
232
|
+
@property
|
|
233
|
+
async def email(self) -> str | None:
|
|
234
|
+
await self._completeIfNotSet(self._email)
|
|
235
|
+
return self._email.value
|
|
236
|
+
|
|
237
|
+
@property
|
|
238
|
+
async def events_url(self) -> str:
|
|
239
|
+
await self._completeIfNotSet(self._events_url)
|
|
240
|
+
return self._events_url.value
|
|
241
|
+
|
|
242
|
+
@property
|
|
243
|
+
async def followers(self) -> int:
|
|
244
|
+
await self._completeIfNotSet(self._followers)
|
|
245
|
+
return self._followers.value
|
|
246
|
+
|
|
247
|
+
@property
|
|
248
|
+
async def followers_url(self) -> str:
|
|
249
|
+
await self._completeIfNotSet(self._followers_url)
|
|
250
|
+
return self._followers_url.value
|
|
251
|
+
|
|
252
|
+
@property
|
|
253
|
+
async def following(self) -> int:
|
|
254
|
+
await self._completeIfNotSet(self._following)
|
|
255
|
+
return self._following.value
|
|
256
|
+
|
|
257
|
+
@property
|
|
258
|
+
async def following_url(self) -> str:
|
|
259
|
+
await self._completeIfNotSet(self._following_url)
|
|
260
|
+
return self._following_url.value
|
|
261
|
+
|
|
262
|
+
@property
|
|
263
|
+
async def gists_url(self) -> str:
|
|
264
|
+
await self._completeIfNotSet(self._gists_url)
|
|
265
|
+
return self._gists_url.value
|
|
266
|
+
|
|
267
|
+
@property
|
|
268
|
+
async def gravatar_id(self) -> str | None:
|
|
269
|
+
await self._completeIfNotSet(self._gravatar_id)
|
|
270
|
+
return self._gravatar_id.value
|
|
271
|
+
|
|
272
|
+
@property
|
|
273
|
+
async def hireable(self) -> bool | None:
|
|
274
|
+
await self._completeIfNotSet(self._hireable)
|
|
275
|
+
return self._hireable.value
|
|
276
|
+
|
|
277
|
+
@property
|
|
278
|
+
async def html_url(self) -> str:
|
|
279
|
+
await self._completeIfNotSet(self._html_url)
|
|
280
|
+
return self._html_url.value
|
|
281
|
+
|
|
282
|
+
@property
|
|
283
|
+
async def id(self) -> int:
|
|
284
|
+
await self._completeIfNotSet(self._id)
|
|
285
|
+
return self._id.value
|
|
286
|
+
|
|
287
|
+
@property
|
|
288
|
+
def inherited(self) -> bool:
|
|
289
|
+
return self._inherited.value
|
|
290
|
+
|
|
291
|
+
@property
|
|
292
|
+
async def invitation_teams_url(self) -> str:
|
|
293
|
+
await self._completeIfNotSet(self._invitation_teams_url)
|
|
294
|
+
return self._invitation_teams_url.value
|
|
295
|
+
|
|
296
|
+
@property
|
|
297
|
+
async def inviter(self) -> NamedUser:
|
|
298
|
+
await self._completeIfNotSet(self._inviter)
|
|
299
|
+
return self._inviter.value
|
|
300
|
+
|
|
301
|
+
@property
|
|
302
|
+
def ldap_dn(self) -> str:
|
|
303
|
+
return self._ldap_dn.value
|
|
304
|
+
|
|
305
|
+
@property
|
|
306
|
+
async def location(self) -> str | None:
|
|
307
|
+
await self._completeIfNotSet(self._location)
|
|
308
|
+
return self._location.value
|
|
309
|
+
|
|
310
|
+
@property
|
|
311
|
+
async def login(self) -> str:
|
|
312
|
+
await self._completeIfNotSet(self._login)
|
|
313
|
+
return self._login.value
|
|
314
|
+
|
|
315
|
+
@property
|
|
316
|
+
async def name(self) -> str | None:
|
|
317
|
+
await self._completeIfNotSet(self._name)
|
|
318
|
+
return self._name.value
|
|
319
|
+
|
|
320
|
+
@property
|
|
321
|
+
async def node_id(self) -> str:
|
|
322
|
+
await self._completeIfNotSet(self._node_id)
|
|
323
|
+
return self._node_id.value
|
|
324
|
+
|
|
325
|
+
@property
|
|
326
|
+
def notification_email(self) -> str:
|
|
327
|
+
return self._notification_email.value
|
|
328
|
+
|
|
329
|
+
@property
|
|
330
|
+
async def organizations_url(self) -> str:
|
|
331
|
+
await self._completeIfNotSet(self._organizations_url)
|
|
332
|
+
return self._organizations_url.value
|
|
333
|
+
|
|
334
|
+
@property
|
|
335
|
+
async def owned_private_repos(self) -> int | None:
|
|
336
|
+
await self._completeIfNotSet(self._owned_private_repos)
|
|
337
|
+
return self._owned_private_repos.value
|
|
338
|
+
|
|
339
|
+
@property
|
|
340
|
+
async def permissions(self) -> Permissions:
|
|
341
|
+
await self._completeIfNotSet(self._permissions)
|
|
342
|
+
return self._permissions.value
|
|
343
|
+
|
|
344
|
+
@property
|
|
345
|
+
async def plan(self) -> Plan | None:
|
|
346
|
+
await self._completeIfNotSet(self._plan)
|
|
347
|
+
return self._plan.value
|
|
348
|
+
|
|
349
|
+
@property
|
|
350
|
+
async def private_gists(self) -> int | None:
|
|
351
|
+
await self._completeIfNotSet(self._private_gists)
|
|
352
|
+
return self._private_gists.value
|
|
353
|
+
|
|
354
|
+
@property
|
|
355
|
+
async def public_gists(self) -> int:
|
|
356
|
+
await self._completeIfNotSet(self._public_gists)
|
|
357
|
+
return self._public_gists.value
|
|
358
|
+
|
|
359
|
+
@property
|
|
360
|
+
async def public_repos(self) -> int:
|
|
361
|
+
await self._completeIfNotSet(self._public_repos)
|
|
362
|
+
return self._public_repos.value
|
|
363
|
+
|
|
364
|
+
@property
|
|
365
|
+
async def received_events_url(self) -> str:
|
|
366
|
+
await self._completeIfNotSet(self._received_events_url)
|
|
367
|
+
return self._received_events_url.value
|
|
368
|
+
|
|
369
|
+
@property
|
|
370
|
+
async def repos_url(self) -> str:
|
|
371
|
+
await self._completeIfNotSet(self._repos_url)
|
|
372
|
+
return self._repos_url.value
|
|
373
|
+
|
|
374
|
+
@property
|
|
375
|
+
async def role(self) -> str:
|
|
376
|
+
await self._completeIfNotSet(self._role)
|
|
377
|
+
return self._role.value
|
|
378
|
+
|
|
379
|
+
@property
|
|
380
|
+
def role_name(self) -> str:
|
|
381
|
+
return self._role_name.value
|
|
382
|
+
|
|
383
|
+
@property
|
|
384
|
+
async def site_admin(self) -> bool:
|
|
385
|
+
await self._completeIfNotSet(self._site_admin)
|
|
386
|
+
return self._site_admin.value
|
|
387
|
+
|
|
388
|
+
@property
|
|
389
|
+
def starred_at(self) -> str:
|
|
390
|
+
return self._starred_at.value
|
|
391
|
+
|
|
392
|
+
@property
|
|
393
|
+
async def starred_url(self) -> str:
|
|
394
|
+
await self._completeIfNotSet(self._starred_url)
|
|
395
|
+
return self._starred_url.value
|
|
396
|
+
|
|
397
|
+
@property
|
|
398
|
+
async def subscriptions_url(self) -> str:
|
|
399
|
+
await self._completeIfNotSet(self._subscriptions_url)
|
|
400
|
+
return self._subscriptions_url.value
|
|
401
|
+
|
|
402
|
+
@property
|
|
403
|
+
async def suspended_at(self) -> datetime | None:
|
|
404
|
+
await self._completeIfNotSet(self._suspended_at)
|
|
405
|
+
return self._suspended_at.value
|
|
406
|
+
|
|
407
|
+
@property
|
|
408
|
+
async def team_count(self) -> int:
|
|
409
|
+
await self._completeIfNotSet(self._team_count)
|
|
410
|
+
return self._team_count.value
|
|
411
|
+
|
|
412
|
+
@property
|
|
413
|
+
def text_matches(self) -> dict[str, Any]:
|
|
414
|
+
return self._text_matches.value
|
|
415
|
+
|
|
416
|
+
@property
|
|
417
|
+
async def total_private_repos(self) -> int | None:
|
|
418
|
+
await self._completeIfNotSet(self._total_private_repos)
|
|
419
|
+
return self._total_private_repos.value
|
|
420
|
+
|
|
421
|
+
@property
|
|
422
|
+
async def twitter_username(self) -> str | None:
|
|
423
|
+
await self._completeIfNotSet(self._twitter_username)
|
|
424
|
+
return self._twitter_username.value
|
|
425
|
+
|
|
426
|
+
@property
|
|
427
|
+
def two_factor_authentication(self) -> bool:
|
|
428
|
+
return self._two_factor_authentication.value
|
|
429
|
+
|
|
430
|
+
@property
|
|
431
|
+
async def type(self) -> str:
|
|
432
|
+
await self._completeIfNotSet(self._type)
|
|
433
|
+
return self._type.value
|
|
434
|
+
|
|
435
|
+
@property
|
|
436
|
+
async def updated_at(self) -> datetime:
|
|
437
|
+
await self._completeIfNotSet(self._updated_at)
|
|
438
|
+
return self._updated_at.value
|
|
439
|
+
|
|
440
|
+
@property
|
|
441
|
+
async def url(self) -> str:
|
|
442
|
+
await self._completeIfNotSet(self._url)
|
|
443
|
+
return self._url.value
|
|
444
|
+
|
|
445
|
+
@property
|
|
446
|
+
def user_view_type(self) -> str:
|
|
447
|
+
return self._user_view_type.value
|
|
448
|
+
|
|
449
|
+
async def get_events(self) -> PaginatedList[Event]:
|
|
450
|
+
"""
|
|
451
|
+
:calls: `GET /users/{username}/events <https://docs.github.com/en/rest/reference/activity#events>`_
|
|
452
|
+
"""
|
|
453
|
+
return githubasyncio.PaginatedList.PaginatedList(
|
|
454
|
+
githubasyncio.Event.Event, self._requester, f"{await self.url}/events", None
|
|
455
|
+
)
|
|
456
|
+
|
|
457
|
+
async def get_followers(self) -> PaginatedList[NamedUser]:
|
|
458
|
+
"""
|
|
459
|
+
:calls: `GET /users/{username}/followers <https://docs.github.com/en/rest/reference/users#followers>`_
|
|
460
|
+
"""
|
|
461
|
+
return githubasyncio.PaginatedList.PaginatedList(
|
|
462
|
+
NamedUser, self._requester, f"{await self.url}/followers", None
|
|
463
|
+
)
|
|
464
|
+
|
|
465
|
+
async def get_following(self) -> PaginatedList[NamedUser]:
|
|
466
|
+
"""
|
|
467
|
+
:calls: `GET /users/{username}/following <https://docs.github.com/en/rest/reference/users#followers>`_
|
|
468
|
+
"""
|
|
469
|
+
return githubasyncio.PaginatedList.PaginatedList(
|
|
470
|
+
NamedUser, self._requester, f"{await self.url}/following", None
|
|
471
|
+
)
|
|
472
|
+
|
|
473
|
+
async def get_gists(self, since: Opt[datetime] = NotSet) -> PaginatedList[Gist]:
|
|
474
|
+
"""
|
|
475
|
+
:calls: `GET /users/{username}/gists <https://docs.github.com/en/rest/reference/gists>`_
|
|
476
|
+
"""
|
|
477
|
+
assert is_undefined(since) or isinstance(since, datetime), since
|
|
478
|
+
url_parameters = dict()
|
|
479
|
+
if is_defined(since):
|
|
480
|
+
url_parameters["since"] = since.strftime("%Y-%m-%dT%H:%M:%SZ")
|
|
481
|
+
return githubasyncio.PaginatedList.PaginatedList(
|
|
482
|
+
githubasyncio.Gist.Gist, self._requester, f"{await self.url}/gists", url_parameters
|
|
483
|
+
)
|
|
484
|
+
|
|
485
|
+
async def get_keys(self) -> PaginatedList[UserKey]:
|
|
486
|
+
"""
|
|
487
|
+
:calls: `GET /users/{username}/keys <https://docs.github.com/en/rest/reference/users#create-a-public-ssh-key-for-the-authenticated-user>`_
|
|
488
|
+
"""
|
|
489
|
+
return githubasyncio.PaginatedList.PaginatedList(
|
|
490
|
+
githubasyncio.UserKey.UserKey, self._requester, f"{await self.url}/keys", None
|
|
491
|
+
)
|
|
492
|
+
|
|
493
|
+
async def get_orgs(self) -> PaginatedList[Organization]:
|
|
494
|
+
"""
|
|
495
|
+
:calls: `GET /users/{username}/orgs <https://docs.github.com/en/rest/reference/orgs>`_
|
|
496
|
+
"""
|
|
497
|
+
return githubasyncio.PaginatedList.PaginatedList(
|
|
498
|
+
githubasyncio.Organization.Organization, self._requester, f"{await self.url}/orgs", None
|
|
499
|
+
)
|
|
500
|
+
|
|
501
|
+
async def get_projects(self, state: str = "open") -> PaginatedList[Project]:
|
|
502
|
+
"""
|
|
503
|
+
:calls: `GET /users/{username}/projects <https://docs.github.com/en/rest/reference/projects#list-user-projects>`_
|
|
504
|
+
"""
|
|
505
|
+
assert isinstance(state, str), state
|
|
506
|
+
url_parameters = {"state": state}
|
|
507
|
+
return githubasyncio.PaginatedList.PaginatedList(
|
|
508
|
+
githubasyncio.Project.Project,
|
|
509
|
+
self._requester,
|
|
510
|
+
f"{await self.url}/projects",
|
|
511
|
+
url_parameters,
|
|
512
|
+
headers={"Accept": Consts.mediaTypeProjectsPreview},
|
|
513
|
+
)
|
|
514
|
+
|
|
515
|
+
async def get_public_events(self) -> PaginatedList[Event]:
|
|
516
|
+
"""
|
|
517
|
+
:calls: `GET /users/{username}/events/public <https://docs.github.com/en/rest/reference/activity#events>`_
|
|
518
|
+
"""
|
|
519
|
+
return githubasyncio.PaginatedList.PaginatedList(
|
|
520
|
+
githubasyncio.Event.Event, self._requester, f"{await self.url}/events/public", None
|
|
521
|
+
)
|
|
522
|
+
|
|
523
|
+
async def get_public_received_events(self) -> PaginatedList[Event]:
|
|
524
|
+
"""
|
|
525
|
+
:calls: `GET /users/{username}/received_events/public <https://docs.github.com/en/rest/reference/activity#events>`_
|
|
526
|
+
"""
|
|
527
|
+
return githubasyncio.PaginatedList.PaginatedList(
|
|
528
|
+
githubasyncio.Event.Event,
|
|
529
|
+
self._requester,
|
|
530
|
+
f"{await self.url}/received_events/public",
|
|
531
|
+
None,
|
|
532
|
+
)
|
|
533
|
+
|
|
534
|
+
async def get_received_events(self) -> PaginatedList[Event]:
|
|
535
|
+
"""
|
|
536
|
+
:calls: `GET /users/{username}/received_events <https://docs.github.com/en/rest/reference/activity#events>`_
|
|
537
|
+
"""
|
|
538
|
+
return githubasyncio.PaginatedList.PaginatedList(
|
|
539
|
+
githubasyncio.Event.Event, self._requester, f"{await self.url}/received_events", None
|
|
540
|
+
)
|
|
541
|
+
|
|
542
|
+
async def get_repo(self, name: str) -> Repository:
|
|
543
|
+
"""
|
|
544
|
+
:calls: `GET /repos/{owner}/{repo} <https://docs.github.com/en/rest/reference/repos>`_
|
|
545
|
+
"""
|
|
546
|
+
assert isinstance(name, str), name
|
|
547
|
+
url = f"/repos/{await self.login}/{name}"
|
|
548
|
+
return githubasyncio.Repository.Repository(self._requester, url=url)
|
|
549
|
+
|
|
550
|
+
async def get_repos(
|
|
551
|
+
self,
|
|
552
|
+
type: Opt[str] = NotSet,
|
|
553
|
+
sort: Opt[str] = NotSet,
|
|
554
|
+
direction: Opt[str] = NotSet,
|
|
555
|
+
) -> PaginatedList[Repository]:
|
|
556
|
+
"""
|
|
557
|
+
:calls: `GET /users/{username}/repos <https://docs.github.com/en/rest/reference/repos>`_
|
|
558
|
+
"""
|
|
559
|
+
assert is_undefined(type) or isinstance(type, str), type
|
|
560
|
+
assert is_undefined(sort) or isinstance(sort, str), sort
|
|
561
|
+
assert is_undefined(direction) or isinstance(direction, str), direction
|
|
562
|
+
url_parameters = dict()
|
|
563
|
+
if is_defined(type):
|
|
564
|
+
url_parameters["type"] = type
|
|
565
|
+
if is_defined(sort):
|
|
566
|
+
url_parameters["sort"] = sort
|
|
567
|
+
if is_defined(direction):
|
|
568
|
+
url_parameters["direction"] = direction
|
|
569
|
+
return githubasyncio.PaginatedList.PaginatedList(
|
|
570
|
+
githubasyncio.Repository.Repository,
|
|
571
|
+
self._requester,
|
|
572
|
+
f"{await self.url}/repos",
|
|
573
|
+
url_parameters,
|
|
574
|
+
)
|
|
575
|
+
|
|
576
|
+
async def get_starred(self) -> PaginatedList[Repository]:
|
|
577
|
+
"""
|
|
578
|
+
:calls: `GET /users/{username}/starred <https://docs.github.com/en/rest/reference/activity#starring>`_
|
|
579
|
+
"""
|
|
580
|
+
return githubasyncio.PaginatedList.PaginatedList(
|
|
581
|
+
githubasyncio.Repository.Repository, self._requester, f"{await self.url}/starred", None
|
|
582
|
+
)
|
|
583
|
+
|
|
584
|
+
async def get_subscriptions(self) -> PaginatedList[Repository]:
|
|
585
|
+
"""
|
|
586
|
+
:calls: `GET /users/{username}/subscriptions <https://docs.github.com/en/rest/reference/activity#watching>`_
|
|
587
|
+
"""
|
|
588
|
+
return githubasyncio.PaginatedList.PaginatedList(
|
|
589
|
+
githubasyncio.Repository.Repository,
|
|
590
|
+
self._requester,
|
|
591
|
+
f"{await self.url}/subscriptions",
|
|
592
|
+
None,
|
|
593
|
+
)
|
|
594
|
+
|
|
595
|
+
async def get_watched(self) -> PaginatedList[Repository]:
|
|
596
|
+
"""
|
|
597
|
+
:calls: `GET /users/{username}/watched <https://docs.github.com/en/rest/reference/activity#starring>`_
|
|
598
|
+
"""
|
|
599
|
+
return githubasyncio.PaginatedList.PaginatedList(
|
|
600
|
+
githubasyncio.Repository.Repository, self._requester, f"{await self.url}/watched", None
|
|
601
|
+
)
|
|
602
|
+
|
|
603
|
+
async def has_in_following(self, following: NamedUser) -> bool:
|
|
604
|
+
"""
|
|
605
|
+
:calls: `GET /users/{username}/following/{target_user} <https://docs.github.com/en/rest/reference/users#check-if-a-user-follows-another-user>`_
|
|
606
|
+
"""
|
|
607
|
+
assert isinstance(following, NamedUser), following
|
|
608
|
+
status, headers, data = await self._requester.requestJson(
|
|
609
|
+
"GET", f"{await self.url}/following/{(await following._identity)}"
|
|
610
|
+
)
|
|
611
|
+
return status == 204
|
|
612
|
+
|
|
613
|
+
async def get_organization_membership(self, org: str | Organization) -> Membership:
|
|
614
|
+
"""
|
|
615
|
+
:calls: `GET /orgs/{org}/memberships/{username} <https://docs.github.com/en/rest/reference/orgs#check-organization-membership-for-a-user>`_
|
|
616
|
+
"""
|
|
617
|
+
assert isinstance(org, str) or isinstance(org, githubasyncio.Organization.Organization), org
|
|
618
|
+
if isinstance(org, githubasyncio.Organization.Organization):
|
|
619
|
+
org = await org.login # type: ignore
|
|
620
|
+
org = urllib.parse.quote(org, safe="")
|
|
621
|
+
headers, data = await self._requester.requestJsonAndCheck("GET", f"/orgs/{org}/memberships/{await self.login}")
|
|
622
|
+
return githubasyncio.Membership.Membership(self._requester, headers, data, completed=True)
|
|
623
|
+
|
|
624
|
+
def _useAttributes(self, attributes: dict[str, Any]) -> None:
|
|
625
|
+
if "avatar_url" in attributes: # pragma no branch
|
|
626
|
+
self._avatar_url = self._makeStringAttribute(attributes["avatar_url"])
|
|
627
|
+
if "bio" in attributes: # pragma no branch
|
|
628
|
+
self._bio = self._makeStringAttribute(attributes["bio"])
|
|
629
|
+
if "blog" in attributes: # pragma no branch
|
|
630
|
+
self._blog = self._makeStringAttribute(attributes["blog"])
|
|
631
|
+
if "business_plus" in attributes: # pragma no branch
|
|
632
|
+
self._business_plus = self._makeBoolAttribute(attributes["business_plus"])
|
|
633
|
+
if "collaborators" in attributes: # pragma no branch
|
|
634
|
+
self._collaborators = self._makeIntAttribute(attributes["collaborators"])
|
|
635
|
+
if "company" in attributes: # pragma no branch
|
|
636
|
+
self._company = self._makeStringAttribute(attributes["company"])
|
|
637
|
+
if "contributions" in attributes: # pragma no branch
|
|
638
|
+
self._contributions = self._makeIntAttribute(attributes["contributions"])
|
|
639
|
+
if "created_at" in attributes: # pragma no branch
|
|
640
|
+
self._created_at = self._makeDatetimeAttribute(attributes["created_at"])
|
|
641
|
+
if "disk_usage" in attributes: # pragma no branch
|
|
642
|
+
self._disk_usage = self._makeIntAttribute(attributes["disk_usage"])
|
|
643
|
+
if "display_login" in attributes: # pragma no branch
|
|
644
|
+
self._display_login = self._makeStringAttribute(attributes["display_login"])
|
|
645
|
+
if "email" in attributes: # pragma no branch
|
|
646
|
+
self._email = self._makeStringAttribute(attributes["email"])
|
|
647
|
+
if "events_url" in attributes: # pragma no branch
|
|
648
|
+
self._events_url = self._makeStringAttribute(attributes["events_url"])
|
|
649
|
+
if "followers" in attributes: # pragma no branch
|
|
650
|
+
self._followers = self._makeIntAttribute(attributes["followers"])
|
|
651
|
+
if "followers_url" in attributes: # pragma no branch
|
|
652
|
+
self._followers_url = self._makeStringAttribute(attributes["followers_url"])
|
|
653
|
+
if "following" in attributes: # pragma no branch
|
|
654
|
+
self._following = self._makeIntAttribute(attributes["following"])
|
|
655
|
+
if "following_url" in attributes: # pragma no branch
|
|
656
|
+
self._following_url = self._makeStringAttribute(attributes["following_url"])
|
|
657
|
+
if "gists_url" in attributes: # pragma no branch
|
|
658
|
+
self._gists_url = self._makeStringAttribute(attributes["gists_url"])
|
|
659
|
+
if "gravatar_id" in attributes: # pragma no branch
|
|
660
|
+
self._gravatar_id = self._makeStringAttribute(attributes["gravatar_id"])
|
|
661
|
+
if "hireable" in attributes: # pragma no branch
|
|
662
|
+
self._hireable = self._makeBoolAttribute(attributes["hireable"])
|
|
663
|
+
if "html_url" in attributes: # pragma no branch
|
|
664
|
+
self._html_url = self._makeStringAttribute(attributes["html_url"])
|
|
665
|
+
if "id" in attributes: # pragma no branch
|
|
666
|
+
self._id = self._makeIntAttribute(attributes["id"])
|
|
667
|
+
elif "url" in attributes and attributes["url"]:
|
|
668
|
+
id = attributes["url"].split("/")[-1]
|
|
669
|
+
# url could also reference user id (int): /users/login
|
|
670
|
+
# or some derived class like /orgs/{org}/invitations/{invitation_id}
|
|
671
|
+
if id.isnumeric() and attributes["url"].endswith(f"/user/{id}"):
|
|
672
|
+
self._id = self._makeIntAttribute(int(id))
|
|
673
|
+
if "inherited" in attributes: # pragma no branch
|
|
674
|
+
self._inherited = self._makeBoolAttribute(attributes["inherited"])
|
|
675
|
+
if "invitation_teams_url" in attributes: # pragma no branch
|
|
676
|
+
self._invitation_teams_url = self._makeStringAttribute(attributes["invitation_teams_url"])
|
|
677
|
+
if "inviter" in attributes: # pragma no branch
|
|
678
|
+
self._inviter = self._makeClassAttribute(NamedUser, attributes["inviter"])
|
|
679
|
+
if "ldap_dn" in attributes: # pragma no branch
|
|
680
|
+
self._ldap_dn = self._makeStringAttribute(attributes["ldap_dn"])
|
|
681
|
+
if "location" in attributes: # pragma no branch
|
|
682
|
+
self._location = self._makeStringAttribute(attributes["location"])
|
|
683
|
+
if "login" in attributes: # pragma no branch
|
|
684
|
+
self._login = self._makeStringAttribute(attributes["login"])
|
|
685
|
+
elif "url" in attributes and "/" in attributes["url"]:
|
|
686
|
+
login = attributes["url"].split("/")[-1]
|
|
687
|
+
# url could also reference user id (int): /user/id
|
|
688
|
+
# or some derived class like /orgs/{org}/invitations/{invitation_id}
|
|
689
|
+
if attributes["url"].endswith(f"/users/{login}"):
|
|
690
|
+
self._login = self._makeStringAttribute(login)
|
|
691
|
+
if "name" in attributes: # pragma no branch
|
|
692
|
+
self._name = self._makeStringAttribute(attributes["name"])
|
|
693
|
+
if "node_id" in attributes: # pragma no branch
|
|
694
|
+
self._node_id = self._makeStringAttribute(attributes["node_id"])
|
|
695
|
+
if "notification_email" in attributes: # pragma no branch
|
|
696
|
+
self._notification_email = self._makeStringAttribute(attributes["notification_email"])
|
|
697
|
+
if "organizations_url" in attributes: # pragma no branch
|
|
698
|
+
self._organizations_url = self._makeStringAttribute(attributes["organizations_url"])
|
|
699
|
+
if "owned_private_repos" in attributes: # pragma no branch
|
|
700
|
+
self._owned_private_repos = self._makeIntAttribute(attributes["owned_private_repos"])
|
|
701
|
+
if "permissions" in attributes: # pragma no branch
|
|
702
|
+
self._permissions = self._makeClassAttribute(
|
|
703
|
+
githubasyncio.Permissions.Permissions, attributes["permissions"]
|
|
704
|
+
)
|
|
705
|
+
if "plan" in attributes: # pragma no branch
|
|
706
|
+
self._plan = self._makeClassAttribute(githubasyncio.Plan.Plan, attributes["plan"])
|
|
707
|
+
if "private_gists" in attributes: # pragma no branch
|
|
708
|
+
self._private_gists = self._makeIntAttribute(attributes["private_gists"])
|
|
709
|
+
if "public_gists" in attributes: # pragma no branch
|
|
710
|
+
self._public_gists = self._makeIntAttribute(attributes["public_gists"])
|
|
711
|
+
if "public_repos" in attributes: # pragma no branch
|
|
712
|
+
self._public_repos = self._makeIntAttribute(attributes["public_repos"])
|
|
713
|
+
if "received_events_url" in attributes: # pragma no branch
|
|
714
|
+
self._received_events_url = self._makeStringAttribute(attributes["received_events_url"])
|
|
715
|
+
if "repos_url" in attributes: # pragma no branch
|
|
716
|
+
self._repos_url = self._makeStringAttribute(attributes["repos_url"])
|
|
717
|
+
if "role" in attributes: # pragma no branch
|
|
718
|
+
self._role = self._makeStringAttribute(attributes["role"])
|
|
719
|
+
if "role_name" in attributes: # pragma no branch
|
|
720
|
+
self._role_name = self._makeStringAttribute(attributes["role_name"])
|
|
721
|
+
if "site_admin" in attributes: # pragma no branch
|
|
722
|
+
self._site_admin = self._makeBoolAttribute(attributes["site_admin"])
|
|
723
|
+
if "starred_at" in attributes: # pragma no branch
|
|
724
|
+
self._starred_at = self._makeStringAttribute(attributes["starred_at"])
|
|
725
|
+
if "starred_url" in attributes: # pragma no branch
|
|
726
|
+
self._starred_url = self._makeStringAttribute(attributes["starred_url"])
|
|
727
|
+
if "subscriptions_url" in attributes: # pragma no branch
|
|
728
|
+
self._subscriptions_url = self._makeStringAttribute(attributes["subscriptions_url"])
|
|
729
|
+
if "suspended_at" in attributes: # pragma no branch
|
|
730
|
+
self._suspended_at = self._makeDatetimeAttribute(attributes["suspended_at"])
|
|
731
|
+
if "team_count" in attributes:
|
|
732
|
+
self._team_count = self._makeIntAttribute(attributes["team_count"])
|
|
733
|
+
if "text_matches" in attributes: # pragma no branch
|
|
734
|
+
self._text_matches = self._makeDictAttribute(attributes["text_matches"])
|
|
735
|
+
if "total_private_repos" in attributes: # pragma no branch
|
|
736
|
+
self._total_private_repos = self._makeIntAttribute(attributes["total_private_repos"])
|
|
737
|
+
if "twitter_username" in attributes: # pragma no branch
|
|
738
|
+
self._twitter_username = self._makeStringAttribute(attributes["twitter_username"])
|
|
739
|
+
if "two_factor_authentication" in attributes: # pragma no branch
|
|
740
|
+
self._two_factor_authentication = self._makeBoolAttribute(attributes["two_factor_authentication"])
|
|
741
|
+
if "type" in attributes: # pragma no branch
|
|
742
|
+
self._type = self._makeStringAttribute(attributes["type"])
|
|
743
|
+
if "updated_at" in attributes: # pragma no branch
|
|
744
|
+
self._updated_at = self._makeDatetimeAttribute(attributes["updated_at"])
|
|
745
|
+
if "url" in attributes: # pragma no branch
|
|
746
|
+
self._url = self._makeStringAttribute(attributes["url"])
|
|
747
|
+
elif type(self) in (NamedUser, NamedUserSearchResult):
|
|
748
|
+
# construct url only for NamedUser and NamedUserSearchResult (no OrganizationInvitation)
|
|
749
|
+
if "login" in attributes and attributes["login"]:
|
|
750
|
+
self._url = self._makeStringAttribute(f"/users/{attributes['login']}")
|
|
751
|
+
elif "id" in attributes and attributes["id"]:
|
|
752
|
+
self._url = self._makeStringAttribute(f"/user/{attributes['id']}")
|
|
753
|
+
if "user_view_type" in attributes: # pragma no branch
|
|
754
|
+
self._user_view_type = self._makeStringAttribute(attributes["user_view_type"])
|
|
755
|
+
|
|
756
|
+
|
|
757
|
+
class NamedUserSearchResult(NamedUser):
|
|
758
|
+
"""
|
|
759
|
+
This class represents NamedUserSearchResult.
|
|
760
|
+
|
|
761
|
+
The reference can be found here
|
|
762
|
+
https://docs.github.com/en/rest/reference/search#search-users
|
|
763
|
+
|
|
764
|
+
The OpenAPI schema can be found at
|
|
765
|
+
|
|
766
|
+
- /components/schemas/user-search-result-item
|
|
767
|
+
|
|
768
|
+
"""
|
|
769
|
+
|
|
770
|
+
def _initAttributes(self) -> None:
|
|
771
|
+
super()._initAttributes()
|
|
772
|
+
self._score: Attribute[float] = NotSet
|
|
773
|
+
|
|
774
|
+
def __repr__(self) -> str:
|
|
775
|
+
return self.get__repr__({"login": self._login.value, "score": self._score.value})
|
|
776
|
+
|
|
777
|
+
@property
|
|
778
|
+
def score(self) -> float:
|
|
779
|
+
return self._score.value
|
|
780
|
+
|
|
781
|
+
def _useAttributes(self, attributes: dict[str, Any]) -> None:
|
|
782
|
+
super()._useAttributes(attributes)
|
|
783
|
+
if "score" in attributes: # pragma no branch
|
|
784
|
+
self._score = self._makeFloatAttribute(attributes["score"])
|
|
785
|
+
|
|
786
|
+
|
|
787
|
+
# A better place would be github.OrganizationInvitation.OrganizationInvitation
|
|
788
|
+
# but that causes an import cycle. This is a specialization of NamedUser any way.
|
|
789
|
+
class OrganizationInvitation(NamedUser):
|
|
790
|
+
"""
|
|
791
|
+
This class represents OrganizationInvitation.
|
|
792
|
+
|
|
793
|
+
The reference can be found here
|
|
794
|
+
https://docs.github.com/en/rest/orgs/members
|
|
795
|
+
|
|
796
|
+
The OpenAPI schema can be found at
|
|
797
|
+
|
|
798
|
+
- /components/schemas/organization-invitation
|
|
799
|
+
|
|
800
|
+
"""
|
|
801
|
+
|
|
802
|
+
def _initAttributes(self) -> None:
|
|
803
|
+
super()._initAttributes()
|
|
804
|
+
self._failed_at: Attribute[str] = NotSet
|
|
805
|
+
self._failed_reason: Attribute[str] = NotSet
|
|
806
|
+
self._invitation_source: Attribute[str] = NotSet
|
|
807
|
+
|
|
808
|
+
def __repr__(self) -> str:
|
|
809
|
+
return self.get__repr__({"id": self._id.value})
|
|
810
|
+
|
|
811
|
+
@property
|
|
812
|
+
def failed_at(self) -> str:
|
|
813
|
+
return self._failed_at.value
|
|
814
|
+
|
|
815
|
+
@property
|
|
816
|
+
def failed_reason(self) -> str:
|
|
817
|
+
return self._failed_reason.value
|
|
818
|
+
|
|
819
|
+
@property
|
|
820
|
+
def invitation_source(self) -> str:
|
|
821
|
+
return self._invitation_source.value
|
|
822
|
+
|
|
823
|
+
async def cancel(self) -> bool:
|
|
824
|
+
"""
|
|
825
|
+
:calls: `DELETE /orgs/{org}/invitations/{invitation_id} <https://docs.github.com/en/rest/reference/orgs#cancel-an-organization-invitation>`_
|
|
826
|
+
:rtype: bool
|
|
827
|
+
"""
|
|
828
|
+
status, headers, data = await self._requester.requestJson("DELETE", await self.url)
|
|
829
|
+
return status == 204
|
|
830
|
+
|
|
831
|
+
def _useAttributes(self, attributes: dict[str, Any]) -> None:
|
|
832
|
+
super()._useAttributes(attributes)
|
|
833
|
+
if "failed_at" in attributes: # pragma no branch
|
|
834
|
+
self._failed_at = self._makeStringAttribute(attributes["failed_at"])
|
|
835
|
+
if "failed_reason" in attributes: # pragma no branch
|
|
836
|
+
self._failed_reason = self._makeStringAttribute(attributes["failed_reason"])
|
|
837
|
+
if "invitation_source" in attributes: # pragma no branch
|
|
838
|
+
self._invitation_source = self._makeStringAttribute(attributes["invitation_source"])
|
|
839
|
+
if "invitation_teams_url" in attributes and is_undefined(self._url): # pragma no branch
|
|
840
|
+
url = "/".join(attributes["invitation_teams_url"].split("/")[:-1])
|
|
841
|
+
self._url = self._makeStringAttribute(url)
|