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
githubasyncio/Path.py
ADDED
|
@@ -0,0 +1,102 @@
|
|
|
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 Enrico Minack <github@enrico.minack.dev> #
|
|
23
|
+
# #
|
|
24
|
+
# This file is part of PyGithub. #
|
|
25
|
+
# http://pygithub.readthedocs.io/ #
|
|
26
|
+
# #
|
|
27
|
+
# PyGithub is free software: you can redistribute it and/or modify it under #
|
|
28
|
+
# the terms of the GNU Lesser General Public License as published by the Free #
|
|
29
|
+
# Software Foundation, either version 3 of the License, or (at your option) #
|
|
30
|
+
# any later version. #
|
|
31
|
+
# #
|
|
32
|
+
# PyGithub is distributed in the hope that it will be useful, but WITHOUT ANY #
|
|
33
|
+
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS #
|
|
34
|
+
# FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more #
|
|
35
|
+
# details. #
|
|
36
|
+
# #
|
|
37
|
+
# You should have received a copy of the GNU Lesser General Public License #
|
|
38
|
+
# along with PyGithub. If not, see <http://www.gnu.org/licenses/>. #
|
|
39
|
+
# #
|
|
40
|
+
################################################################################
|
|
41
|
+
|
|
42
|
+
from __future__ import annotations
|
|
43
|
+
|
|
44
|
+
from typing import Any
|
|
45
|
+
|
|
46
|
+
from githubasyncio.GithubObject import Attribute, NonCompletableGithubObject, NotSet
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
class Path(NonCompletableGithubObject):
|
|
50
|
+
"""
|
|
51
|
+
This class represents a popular Path for a GitHub repository.
|
|
52
|
+
|
|
53
|
+
The reference can be found here
|
|
54
|
+
https://docs.github.com/en/rest/reference/repos#traffic
|
|
55
|
+
|
|
56
|
+
The OpenAPI schema can be found at
|
|
57
|
+
|
|
58
|
+
- /components/schemas/content-traffic
|
|
59
|
+
|
|
60
|
+
"""
|
|
61
|
+
|
|
62
|
+
def _initAttributes(self) -> None:
|
|
63
|
+
self._count: Attribute[int] = NotSet
|
|
64
|
+
self._path: Attribute[str] = NotSet
|
|
65
|
+
self._title: Attribute[str] = NotSet
|
|
66
|
+
self._uniques: Attribute[int] = NotSet
|
|
67
|
+
|
|
68
|
+
def __repr__(self) -> str:
|
|
69
|
+
return self.get__repr__(
|
|
70
|
+
{
|
|
71
|
+
"path": self._path.value,
|
|
72
|
+
"title": self._title.value,
|
|
73
|
+
"count": self._count.value,
|
|
74
|
+
"uniques": self._uniques.value,
|
|
75
|
+
}
|
|
76
|
+
)
|
|
77
|
+
|
|
78
|
+
@property
|
|
79
|
+
def count(self) -> int:
|
|
80
|
+
return self._count.value
|
|
81
|
+
|
|
82
|
+
@property
|
|
83
|
+
def path(self) -> str:
|
|
84
|
+
return self._path.value
|
|
85
|
+
|
|
86
|
+
@property
|
|
87
|
+
def title(self) -> str:
|
|
88
|
+
return self._title.value
|
|
89
|
+
|
|
90
|
+
@property
|
|
91
|
+
def uniques(self) -> int:
|
|
92
|
+
return self._uniques.value
|
|
93
|
+
|
|
94
|
+
def _useAttributes(self, attributes: dict[str, Any]) -> None:
|
|
95
|
+
if "count" in attributes: # pragma no branch
|
|
96
|
+
self._count = self._makeIntAttribute(attributes["count"])
|
|
97
|
+
if "path" in attributes: # pragma no branch
|
|
98
|
+
self._path = self._makeStringAttribute(attributes["path"])
|
|
99
|
+
if "title" in attributes: # pragma no branch
|
|
100
|
+
self._title = self._makeStringAttribute(attributes["title"])
|
|
101
|
+
if "uniques" in attributes: # pragma no branch
|
|
102
|
+
self._uniques = self._makeIntAttribute(attributes["uniques"])
|
|
@@ -0,0 +1,113 @@
|
|
|
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 Wan Liuyang <tsfdye@gmail.com> #
|
|
12
|
+
# Copyright 2018 sfdye <tsfdye@gmail.com> #
|
|
13
|
+
# Copyright 2019 Steve Kowalik <steven@wedontsleep.org> #
|
|
14
|
+
# Copyright 2019 Wan Liuyang <tsfdye@gmail.com> #
|
|
15
|
+
# Copyright 2020 Steve Kowalik <steven@wedontsleep.org> #
|
|
16
|
+
# Copyright 2021 karsten-wagner <39054096+karsten-wagner@users.noreply.github.com>#
|
|
17
|
+
# Copyright 2023 Enrico Minack <github@enrico.minack.dev> #
|
|
18
|
+
# Copyright 2023 Trim21 <trim21.me@gmail.com> #
|
|
19
|
+
# Copyright 2024 Enrico Minack <github@enrico.minack.dev> #
|
|
20
|
+
# Copyright 2024 Jirka Borovec <6035284+Borda@users.noreply.github.com> #
|
|
21
|
+
# Copyright 2025 Enrico Minack <github@enrico.minack.dev> #
|
|
22
|
+
# #
|
|
23
|
+
# This file is part of PyGithub. #
|
|
24
|
+
# http://pygithub.readthedocs.io/ #
|
|
25
|
+
# #
|
|
26
|
+
# PyGithub is free software: you can redistribute it and/or modify it under #
|
|
27
|
+
# the terms of the GNU Lesser General Public License as published by the Free #
|
|
28
|
+
# Software Foundation, either version 3 of the License, or (at your option) #
|
|
29
|
+
# any later version. #
|
|
30
|
+
# #
|
|
31
|
+
# PyGithub is distributed in the hope that it will be useful, but WITHOUT ANY #
|
|
32
|
+
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS #
|
|
33
|
+
# FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more #
|
|
34
|
+
# details. #
|
|
35
|
+
# #
|
|
36
|
+
# You should have received a copy of the GNU Lesser General Public License #
|
|
37
|
+
# along with PyGithub. If not, see <http://www.gnu.org/licenses/>. #
|
|
38
|
+
# #
|
|
39
|
+
################################################################################
|
|
40
|
+
|
|
41
|
+
from __future__ import annotations
|
|
42
|
+
|
|
43
|
+
from typing import Any
|
|
44
|
+
|
|
45
|
+
from githubasyncio.GithubObject import Attribute, NonCompletableGithubObject, NotSet
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
class Permissions(NonCompletableGithubObject):
|
|
49
|
+
"""
|
|
50
|
+
This class represents Permissions.
|
|
51
|
+
|
|
52
|
+
The OpenAPI schema can be found at
|
|
53
|
+
|
|
54
|
+
- /components/schemas/collaborator/properties/permissions
|
|
55
|
+
- /components/schemas/full-repository/properties/permissions
|
|
56
|
+
- /components/schemas/minimal-repository/properties/permissions
|
|
57
|
+
- /components/schemas/nullable-repository/properties/permissions
|
|
58
|
+
- /components/schemas/repo-search-result-item/properties/permissions
|
|
59
|
+
- /components/schemas/repository/properties/permissions
|
|
60
|
+
- /components/schemas/team-repository/properties/permissions
|
|
61
|
+
- /components/schemas/team/properties/permissions
|
|
62
|
+
|
|
63
|
+
"""
|
|
64
|
+
|
|
65
|
+
def _initAttributes(self) -> None:
|
|
66
|
+
self._admin: Attribute[bool] = NotSet
|
|
67
|
+
self._maintain: Attribute[bool] = NotSet
|
|
68
|
+
self._pull: Attribute[bool] = NotSet
|
|
69
|
+
self._push: Attribute[bool] = NotSet
|
|
70
|
+
self._triage: Attribute[bool] = NotSet
|
|
71
|
+
|
|
72
|
+
def __repr__(self) -> str:
|
|
73
|
+
return self.get__repr__(
|
|
74
|
+
{
|
|
75
|
+
"admin": self._admin.value,
|
|
76
|
+
"maintain": self._maintain.value,
|
|
77
|
+
"pull": self._pull.value,
|
|
78
|
+
"push": self._push.value,
|
|
79
|
+
"triage": self._triage.value,
|
|
80
|
+
}
|
|
81
|
+
)
|
|
82
|
+
|
|
83
|
+
@property
|
|
84
|
+
def admin(self) -> bool:
|
|
85
|
+
return self._admin.value
|
|
86
|
+
|
|
87
|
+
@property
|
|
88
|
+
def maintain(self) -> bool:
|
|
89
|
+
return self._maintain.value
|
|
90
|
+
|
|
91
|
+
@property
|
|
92
|
+
def pull(self) -> bool:
|
|
93
|
+
return self._pull.value
|
|
94
|
+
|
|
95
|
+
@property
|
|
96
|
+
def push(self) -> bool:
|
|
97
|
+
return self._push.value
|
|
98
|
+
|
|
99
|
+
@property
|
|
100
|
+
def triage(self) -> bool:
|
|
101
|
+
return self._triage.value
|
|
102
|
+
|
|
103
|
+
def _useAttributes(self, attributes: dict[str, Any]) -> None:
|
|
104
|
+
if "admin" in attributes: # pragma no branch
|
|
105
|
+
self._admin = self._makeBoolAttribute(attributes["admin"])
|
|
106
|
+
if "maintain" in attributes: # pragma no branch
|
|
107
|
+
self._maintain = self._makeBoolAttribute(attributes["maintain"])
|
|
108
|
+
if "pull" in attributes: # pragma no branch
|
|
109
|
+
self._pull = self._makeBoolAttribute(attributes["pull"])
|
|
110
|
+
if "push" in attributes: # pragma no branch
|
|
111
|
+
self._push = self._makeBoolAttribute(attributes["push"])
|
|
112
|
+
if "triage" in attributes: # pragma no branch
|
|
113
|
+
self._triage = self._makeBoolAttribute(attributes["triage"])
|
githubasyncio/Plan.py
ADDED
|
@@ -0,0 +1,108 @@
|
|
|
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 Wan Liuyang <tsfdye@gmail.com> #
|
|
12
|
+
# Copyright 2018 sfdye <tsfdye@gmail.com> #
|
|
13
|
+
# Copyright 2019 Steve Kowalik <steven@wedontsleep.org> #
|
|
14
|
+
# Copyright 2019 Wan Liuyang <tsfdye@gmail.com> #
|
|
15
|
+
# Copyright 2020 Geoff Low <glow@mdsol.com> #
|
|
16
|
+
# Copyright 2020 Steve Kowalik <steven@wedontsleep.org> #
|
|
17
|
+
# Copyright 2023 Enrico Minack <github@enrico.minack.dev> #
|
|
18
|
+
# Copyright 2023 Trim21 <trim21.me@gmail.com> #
|
|
19
|
+
# Copyright 2024 Enrico Minack <github@enrico.minack.dev> #
|
|
20
|
+
# Copyright 2024 Jirka Borovec <6035284+Borda@users.noreply.github.com> #
|
|
21
|
+
# Copyright 2025 Enrico Minack <github@enrico.minack.dev> #
|
|
22
|
+
# #
|
|
23
|
+
# This file is part of PyGithub. #
|
|
24
|
+
# http://pygithub.readthedocs.io/ #
|
|
25
|
+
# #
|
|
26
|
+
# PyGithub is free software: you can redistribute it and/or modify it under #
|
|
27
|
+
# the terms of the GNU Lesser General Public License as published by the Free #
|
|
28
|
+
# Software Foundation, either version 3 of the License, or (at your option) #
|
|
29
|
+
# any later version. #
|
|
30
|
+
# #
|
|
31
|
+
# PyGithub is distributed in the hope that it will be useful, but WITHOUT ANY #
|
|
32
|
+
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS #
|
|
33
|
+
# FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more #
|
|
34
|
+
# details. #
|
|
35
|
+
# #
|
|
36
|
+
# You should have received a copy of the GNU Lesser General Public License #
|
|
37
|
+
# along with PyGithub. If not, see <http://www.gnu.org/licenses/>. #
|
|
38
|
+
# #
|
|
39
|
+
################################################################################
|
|
40
|
+
|
|
41
|
+
from __future__ import annotations
|
|
42
|
+
|
|
43
|
+
from typing import Any
|
|
44
|
+
|
|
45
|
+
from githubasyncio.GithubObject import Attribute, NonCompletableGithubObject, NotSet
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
class Plan(NonCompletableGithubObject):
|
|
49
|
+
"""
|
|
50
|
+
This class represents Plans.
|
|
51
|
+
|
|
52
|
+
The OpenAPI schema can be found at
|
|
53
|
+
|
|
54
|
+
- /components/schemas/organization-full/properties/plan
|
|
55
|
+
- /components/schemas/private-user/properties/plan
|
|
56
|
+
- /components/schemas/public-user/properties/plan
|
|
57
|
+
- /components/schemas/team-organization/properties/plan
|
|
58
|
+
|
|
59
|
+
"""
|
|
60
|
+
|
|
61
|
+
def _initAttributes(self) -> None:
|
|
62
|
+
self._collaborators: Attribute[int] = NotSet
|
|
63
|
+
self._filled_seats: Attribute[int] = NotSet
|
|
64
|
+
self._name: Attribute[str] = NotSet
|
|
65
|
+
self._private_repos: Attribute[int] = NotSet
|
|
66
|
+
self._seats: Attribute[int] = NotSet
|
|
67
|
+
self._space: Attribute[int] = NotSet
|
|
68
|
+
|
|
69
|
+
def __repr__(self) -> str:
|
|
70
|
+
return self.get__repr__({"name": self._name.value})
|
|
71
|
+
|
|
72
|
+
@property
|
|
73
|
+
def collaborators(self) -> int:
|
|
74
|
+
return self._collaborators.value
|
|
75
|
+
|
|
76
|
+
@property
|
|
77
|
+
def filled_seats(self) -> int:
|
|
78
|
+
return self._filled_seats.value
|
|
79
|
+
|
|
80
|
+
@property
|
|
81
|
+
def name(self) -> str:
|
|
82
|
+
return self._name.value
|
|
83
|
+
|
|
84
|
+
@property
|
|
85
|
+
def private_repos(self) -> int:
|
|
86
|
+
return self._private_repos.value
|
|
87
|
+
|
|
88
|
+
@property
|
|
89
|
+
def seats(self) -> int:
|
|
90
|
+
return self._seats.value
|
|
91
|
+
|
|
92
|
+
@property
|
|
93
|
+
def space(self) -> int:
|
|
94
|
+
return self._space.value
|
|
95
|
+
|
|
96
|
+
def _useAttributes(self, attributes: dict[str, Any]) -> None:
|
|
97
|
+
if "collaborators" in attributes: # pragma no branch
|
|
98
|
+
self._collaborators = self._makeIntAttribute(attributes["collaborators"])
|
|
99
|
+
if "filled_seats" in attributes: # pragma no branch
|
|
100
|
+
self._filled_seats = self._makeIntAttribute(attributes["filled_seats"])
|
|
101
|
+
if "name" in attributes: # pragma no branch
|
|
102
|
+
self._name = self._makeStringAttribute(attributes["name"])
|
|
103
|
+
if "private_repos" in attributes: # pragma no branch
|
|
104
|
+
self._private_repos = self._makeIntAttribute(attributes["private_repos"])
|
|
105
|
+
if "seats" in attributes: # pragma no branch
|
|
106
|
+
self._seats = self._makeIntAttribute(attributes["seats"])
|
|
107
|
+
if "space" in attributes: # pragma no branch
|
|
108
|
+
self._space = self._makeIntAttribute(attributes["space"])
|
githubasyncio/Project.py
ADDED
|
@@ -0,0 +1,286 @@
|
|
|
1
|
+
# FILE AUTO GENERATED DO NOT TOUCH
|
|
2
|
+
############################ Copyrights and license ############################
|
|
3
|
+
# #
|
|
4
|
+
# Copyright 2012 Vincent Jacques <vincent@vincent-jacques.net> #
|
|
5
|
+
# Copyright 2012 Zearin <zearin@gonk.net> #
|
|
6
|
+
# Copyright 2013 AKFish <akfish@gmail.com> #
|
|
7
|
+
# Copyright 2013 Vincent Jacques <vincent@vincent-jacques.net> #
|
|
8
|
+
# Copyright 2014 Vincent Jacques <vincent@vincent-jacques.net> #
|
|
9
|
+
# Copyright 2016 Jannis Gebauer <ja.geb@me.com> #
|
|
10
|
+
# Copyright 2016 Peter Buckley <dx-pbuckley@users.noreply.github.com> #
|
|
11
|
+
# Copyright 2017 Chris McBride <thehighlander@users.noreply.github.com> #
|
|
12
|
+
# Copyright 2017 Simon <spam@esemi.ru> #
|
|
13
|
+
# Copyright 2018 Benoit Latinier <benoit@latinier.fr> #
|
|
14
|
+
# Copyright 2018 Wan Liuyang <tsfdye@gmail.com> #
|
|
15
|
+
# Copyright 2018 Yossarian King <yggy@blackbirdinteractive.com> #
|
|
16
|
+
# Copyright 2018 sfdye <tsfdye@gmail.com> #
|
|
17
|
+
# Copyright 2019 Steve Kowalik <steven@wedontsleep.org> #
|
|
18
|
+
# Copyright 2019 Wan Liuyang <tsfdye@gmail.com> #
|
|
19
|
+
# Copyright 2020 Anuj Bansal <bansalanuj1996@gmail.com> #
|
|
20
|
+
# Copyright 2020 Steve Kowalik <steven@wedontsleep.org> #
|
|
21
|
+
# Copyright 2021 Lars Kellogg-Stedman <lars@oddbit.com> #
|
|
22
|
+
# Copyright 2021 Mark Walker <mark.walker@realbuzz.com> #
|
|
23
|
+
# Copyright 2021 Steve Kowalik <steven@wedontsleep.org> #
|
|
24
|
+
# Copyright 2023 Enrico Minack <github@enrico.minack.dev> #
|
|
25
|
+
# Copyright 2023 Jirka Borovec <6035284+Borda@users.noreply.github.com> #
|
|
26
|
+
# Copyright 2023 Trim21 <trim21.me@gmail.com> #
|
|
27
|
+
# Copyright 2024 Enrico Minack <github@enrico.minack.dev> #
|
|
28
|
+
# Copyright 2024 Jirka Borovec <6035284+Borda@users.noreply.github.com> #
|
|
29
|
+
# Copyright 2025 Enrico Minack <github@enrico.minack.dev> #
|
|
30
|
+
# Copyright 2026 Enrico Minack <github@enrico.minack.dev> #
|
|
31
|
+
# #
|
|
32
|
+
# This file is part of PyGithub. #
|
|
33
|
+
# http://pygithub.readthedocs.io/ #
|
|
34
|
+
# #
|
|
35
|
+
# PyGithub is free software: you can redistribute it and/or modify it under #
|
|
36
|
+
# the terms of the GNU Lesser General Public License as published by the Free #
|
|
37
|
+
# Software Foundation, either version 3 of the License, or (at your option) #
|
|
38
|
+
# any later version. #
|
|
39
|
+
# #
|
|
40
|
+
# PyGithub is distributed in the hope that it will be useful, but WITHOUT ANY #
|
|
41
|
+
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS #
|
|
42
|
+
# FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more #
|
|
43
|
+
# details. #
|
|
44
|
+
# #
|
|
45
|
+
# You should have received a copy of the GNU Lesser General Public License #
|
|
46
|
+
# along with PyGithub. If not, see <http://www.gnu.org/licenses/>. #
|
|
47
|
+
# #
|
|
48
|
+
################################################################################
|
|
49
|
+
|
|
50
|
+
from __future__ import annotations
|
|
51
|
+
|
|
52
|
+
from datetime import datetime
|
|
53
|
+
from typing import TYPE_CHECKING, Any
|
|
54
|
+
|
|
55
|
+
import githubasyncio.GithubObject
|
|
56
|
+
import githubasyncio.NamedUser
|
|
57
|
+
import githubasyncio.Organization
|
|
58
|
+
import githubasyncio.ProjectColumn
|
|
59
|
+
from githubasyncio import Consts
|
|
60
|
+
from githubasyncio.GithubObject import Attribute, CompletableGithubObject, NotSet, Opt, is_undefined
|
|
61
|
+
from githubasyncio.PaginatedList import PaginatedList
|
|
62
|
+
|
|
63
|
+
if TYPE_CHECKING:
|
|
64
|
+
from githubasyncio.NamedUser import NamedUser
|
|
65
|
+
from githubasyncio.Organization import Organization
|
|
66
|
+
from githubasyncio.ProjectColumn import ProjectColumn
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
class Project(CompletableGithubObject):
|
|
70
|
+
"""
|
|
71
|
+
This class represents Projects.
|
|
72
|
+
|
|
73
|
+
The reference can be found here
|
|
74
|
+
https://docs.github.com/en/rest/reference/projects
|
|
75
|
+
|
|
76
|
+
The OpenAPI schema can be found at
|
|
77
|
+
|
|
78
|
+
- /components/schemas/project
|
|
79
|
+
|
|
80
|
+
"""
|
|
81
|
+
|
|
82
|
+
def _initAttributes(self) -> None:
|
|
83
|
+
self._body: Attribute[str] = NotSet
|
|
84
|
+
self._columns_url: Attribute[str] = NotSet
|
|
85
|
+
self._created_at: Attribute[datetime] = NotSet
|
|
86
|
+
self._creator: Attribute[NamedUser | Organization] = NotSet
|
|
87
|
+
self._html_url: Attribute[str] = NotSet
|
|
88
|
+
self._id: Attribute[int] = NotSet
|
|
89
|
+
self._name: Attribute[str] = NotSet
|
|
90
|
+
self._node_id: Attribute[str] = NotSet
|
|
91
|
+
self._number: Attribute[int] = NotSet
|
|
92
|
+
self._organization_permission: Attribute[str] = NotSet
|
|
93
|
+
self._owner_url: Attribute[str] = NotSet
|
|
94
|
+
self._private: Attribute[bool] = NotSet
|
|
95
|
+
self._state: Attribute[str] = NotSet
|
|
96
|
+
self._updated_at: Attribute[datetime] = NotSet
|
|
97
|
+
self._url: Attribute[str] = NotSet
|
|
98
|
+
|
|
99
|
+
def __repr__(self) -> str:
|
|
100
|
+
return self.get__repr__({"name": self._name.value})
|
|
101
|
+
|
|
102
|
+
@property
|
|
103
|
+
async def body(self) -> str:
|
|
104
|
+
await self._completeIfNotSet(self._body)
|
|
105
|
+
return self._body.value
|
|
106
|
+
|
|
107
|
+
@property
|
|
108
|
+
async def columns_url(self) -> str:
|
|
109
|
+
await self._completeIfNotSet(self._columns_url)
|
|
110
|
+
return self._columns_url.value
|
|
111
|
+
|
|
112
|
+
@property
|
|
113
|
+
async def created_at(self) -> datetime:
|
|
114
|
+
await self._completeIfNotSet(self._created_at)
|
|
115
|
+
return self._created_at.value
|
|
116
|
+
|
|
117
|
+
@property
|
|
118
|
+
async def creator(self) -> NamedUser | Organization:
|
|
119
|
+
await self._completeIfNotSet(self._creator)
|
|
120
|
+
return self._creator.value
|
|
121
|
+
|
|
122
|
+
@property
|
|
123
|
+
async def html_url(self) -> str:
|
|
124
|
+
await self._completeIfNotSet(self._html_url)
|
|
125
|
+
return self._html_url.value
|
|
126
|
+
|
|
127
|
+
@property
|
|
128
|
+
async def id(self) -> int:
|
|
129
|
+
await self._completeIfNotSet(self._id)
|
|
130
|
+
return self._id.value
|
|
131
|
+
|
|
132
|
+
@property
|
|
133
|
+
async def name(self) -> str:
|
|
134
|
+
await self._completeIfNotSet(self._name)
|
|
135
|
+
return self._name.value
|
|
136
|
+
|
|
137
|
+
@property
|
|
138
|
+
async def node_id(self) -> str:
|
|
139
|
+
await self._completeIfNotSet(self._node_id)
|
|
140
|
+
return self._node_id.value
|
|
141
|
+
|
|
142
|
+
@property
|
|
143
|
+
async def number(self) -> int:
|
|
144
|
+
await self._completeIfNotSet(self._number)
|
|
145
|
+
return self._number.value
|
|
146
|
+
|
|
147
|
+
@property
|
|
148
|
+
async def organization_permission(self) -> str:
|
|
149
|
+
await self._completeIfNotSet(self._organization_permission)
|
|
150
|
+
return self._organization_permission.value
|
|
151
|
+
|
|
152
|
+
@property
|
|
153
|
+
async def owner_url(self) -> str:
|
|
154
|
+
await self._completeIfNotSet(self._owner_url)
|
|
155
|
+
return self._owner_url.value
|
|
156
|
+
|
|
157
|
+
@property
|
|
158
|
+
async def private(self) -> bool:
|
|
159
|
+
await self._completeIfNotSet(self._private)
|
|
160
|
+
return self._private.value
|
|
161
|
+
|
|
162
|
+
@property
|
|
163
|
+
async def state(self) -> str:
|
|
164
|
+
await self._completeIfNotSet(self._state)
|
|
165
|
+
return self._state.value
|
|
166
|
+
|
|
167
|
+
@property
|
|
168
|
+
async def updated_at(self) -> datetime:
|
|
169
|
+
await self._completeIfNotSet(self._updated_at)
|
|
170
|
+
return self._updated_at.value
|
|
171
|
+
|
|
172
|
+
@property
|
|
173
|
+
async def url(self) -> str:
|
|
174
|
+
await self._completeIfNotSet(self._url)
|
|
175
|
+
return self._url.value
|
|
176
|
+
|
|
177
|
+
async def delete(self) -> None:
|
|
178
|
+
"""
|
|
179
|
+
:calls: `DELETE /projects/{project_id} <https://docs.github.com/en/rest/reference/projects#delete-a-project>`_
|
|
180
|
+
"""
|
|
181
|
+
headers, data = await self._requester.requestJsonAndCheck(
|
|
182
|
+
"DELETE", await self.url, headers={"Accept": Consts.mediaTypeProjectsPreview}
|
|
183
|
+
)
|
|
184
|
+
|
|
185
|
+
async def edit(
|
|
186
|
+
self,
|
|
187
|
+
name: Opt[str] = NotSet,
|
|
188
|
+
body: Opt[str] = NotSet,
|
|
189
|
+
state: Opt[str] = NotSet,
|
|
190
|
+
organization_permission: Opt[str] = NotSet,
|
|
191
|
+
private: Opt[bool] = NotSet,
|
|
192
|
+
) -> None:
|
|
193
|
+
"""
|
|
194
|
+
:calls: `PATCH /projects/{project_id} <https://docs.github.com/en/rest/reference/projects#update-a-project>`_
|
|
195
|
+
"""
|
|
196
|
+
assert is_undefined(name) or isinstance(name, str), name
|
|
197
|
+
assert is_undefined(body) or isinstance(body, str), body
|
|
198
|
+
assert is_undefined(state) or isinstance(state, str), state
|
|
199
|
+
assert is_undefined(organization_permission) or isinstance(organization_permission, str), (
|
|
200
|
+
organization_permission
|
|
201
|
+
)
|
|
202
|
+
assert is_undefined(private) or isinstance(private, bool), private
|
|
203
|
+
patch_parameters = NotSet.remove_unset_items(
|
|
204
|
+
{
|
|
205
|
+
"name": name,
|
|
206
|
+
"body": body,
|
|
207
|
+
"state": state,
|
|
208
|
+
"organization_permission": organization_permission,
|
|
209
|
+
"private": private,
|
|
210
|
+
}
|
|
211
|
+
)
|
|
212
|
+
|
|
213
|
+
headers, data = await self._requester.requestJsonAndCheck(
|
|
214
|
+
"PATCH",
|
|
215
|
+
await self.url,
|
|
216
|
+
input=patch_parameters,
|
|
217
|
+
headers={"Accept": Consts.mediaTypeProjectsPreview},
|
|
218
|
+
)
|
|
219
|
+
self._useAttributes(data)
|
|
220
|
+
self._set_complete()
|
|
221
|
+
|
|
222
|
+
async def get_columns(self) -> PaginatedList[ProjectColumn]:
|
|
223
|
+
"""
|
|
224
|
+
:calls: `GET /projects/{project_id}/columns <https://docs.github.com/en/rest/reference/projects#list-project-columns>`_
|
|
225
|
+
"""
|
|
226
|
+
return PaginatedList(
|
|
227
|
+
githubasyncio.ProjectColumn.ProjectColumn,
|
|
228
|
+
self._requester,
|
|
229
|
+
await self.columns_url,
|
|
230
|
+
None,
|
|
231
|
+
headers={"Accept": Consts.mediaTypeProjectsPreview},
|
|
232
|
+
)
|
|
233
|
+
|
|
234
|
+
async def create_column(self, name: str) -> ProjectColumn:
|
|
235
|
+
"""
|
|
236
|
+
calls: `POST /projects/{project_id}/columns <https://docs.github.com/en/rest/reference/projects#create-a-project-column>`_
|
|
237
|
+
"""
|
|
238
|
+
assert isinstance(name, str), name
|
|
239
|
+
post_parameters = {"name": name}
|
|
240
|
+
import_header = {"Accept": Consts.mediaTypeProjectsPreview}
|
|
241
|
+
headers, data = await self._requester.requestJsonAndCheck(
|
|
242
|
+
"POST", f"{await self.url}/columns", headers=import_header, input=post_parameters
|
|
243
|
+
)
|
|
244
|
+
return githubasyncio.ProjectColumn.ProjectColumn(self._requester, headers, data)
|
|
245
|
+
|
|
246
|
+
def _useAttributes(self, attributes: dict[str, Any]) -> None:
|
|
247
|
+
if "body" in attributes: # pragma no branch
|
|
248
|
+
self._body = self._makeStringAttribute(attributes["body"])
|
|
249
|
+
if "columns_url" in attributes: # pragma no branch
|
|
250
|
+
self._columns_url = self._makeStringAttribute(attributes["columns_url"])
|
|
251
|
+
if "created_at" in attributes: # pragma no branch
|
|
252
|
+
self._created_at = self._makeDatetimeAttribute(attributes["created_at"])
|
|
253
|
+
if "creator" in attributes: # pragma no branch
|
|
254
|
+
self._creator = self._makeUnionClassAttributeFromTypeKey(
|
|
255
|
+
"type",
|
|
256
|
+
"User",
|
|
257
|
+
attributes["creator"],
|
|
258
|
+
(githubasyncio.NamedUser.NamedUser, "User"),
|
|
259
|
+
(githubasyncio.Organization.Organization, "Organization"),
|
|
260
|
+
)
|
|
261
|
+
if "html_url" in attributes: # pragma no branch
|
|
262
|
+
self._html_url = self._makeStringAttribute(attributes["html_url"])
|
|
263
|
+
if "id" in attributes: # pragma no branch
|
|
264
|
+
self._id = self._makeIntAttribute(attributes["id"])
|
|
265
|
+
elif "url" in attributes and attributes["url"]:
|
|
266
|
+
id = attributes["url"].split("/")[-1]
|
|
267
|
+
if id.isnumeric():
|
|
268
|
+
self._id = self._makeIntAttribute(int(id))
|
|
269
|
+
if "name" in attributes: # pragma no branch
|
|
270
|
+
self._name = self._makeStringAttribute(attributes["name"])
|
|
271
|
+
if "node_id" in attributes: # pragma no branch
|
|
272
|
+
self._node_id = self._makeStringAttribute(attributes["node_id"])
|
|
273
|
+
if "number" in attributes: # pragma no branch
|
|
274
|
+
self._number = self._makeIntAttribute(attributes["number"])
|
|
275
|
+
if "organization_permission" in attributes: # pragma no branch
|
|
276
|
+
self._organization_permission = self._makeStringAttribute(attributes["organization_permission"])
|
|
277
|
+
if "owner_url" in attributes: # pragma no branch
|
|
278
|
+
self._owner_url = self._makeStringAttribute(attributes["owner_url"])
|
|
279
|
+
if "private" in attributes: # pragma no branch
|
|
280
|
+
self._private = self._makeBoolAttribute(attributes["private"])
|
|
281
|
+
if "state" in attributes: # pragma no branch
|
|
282
|
+
self._state = self._makeStringAttribute(attributes["state"])
|
|
283
|
+
if "updated_at" in attributes: # pragma no branch
|
|
284
|
+
self._updated_at = self._makeDatetimeAttribute(attributes["updated_at"])
|
|
285
|
+
if "url" in attributes: # pragma no branch
|
|
286
|
+
self._url = self._makeStringAttribute(attributes["url"])
|