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,476 @@
|
|
|
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 2015 Ed Holland <eholland@alertlogic.com> #
|
|
11
|
+
# Copyright 2016 Benjamin Whitney <benjamin.whitney@ironnetcybersecurity.com> #
|
|
12
|
+
# Copyright 2016 Jannis Gebauer <ja.geb@me.com> #
|
|
13
|
+
# Copyright 2016 Peter Buckley <dx-pbuckley@users.noreply.github.com> #
|
|
14
|
+
# Copyright 2017 Chris McBride <thehighlander@users.noreply.github.com> #
|
|
15
|
+
# Copyright 2017 Simon <spam@esemi.ru> #
|
|
16
|
+
# Copyright 2018 Daniel Kesler <kesler.daniel@gmail.com> #
|
|
17
|
+
# Copyright 2018 Ggicci <ggicci.t@gmail.com> #
|
|
18
|
+
# Copyright 2018 Kuba <jakub.glapa@adspired.com> #
|
|
19
|
+
# Copyright 2018 Maarten Fonville <mfonville@users.noreply.github.com> #
|
|
20
|
+
# Copyright 2018 Shinichi TAMURA <shnch.tmr@gmail.com> #
|
|
21
|
+
# Copyright 2018 Wan Liuyang <tsfdye@gmail.com> #
|
|
22
|
+
# Copyright 2018 edquist <edquist@users.noreply.github.com> #
|
|
23
|
+
# Copyright 2018 nurupo <nurupo.contributions@gmail.com> #
|
|
24
|
+
# Copyright 2018 sfdye <tsfdye@gmail.com> #
|
|
25
|
+
# Copyright 2019 Steve Kowalik <steven@wedontsleep.org> #
|
|
26
|
+
# Copyright 2019 Wan Liuyang <tsfdye@gmail.com> #
|
|
27
|
+
# Copyright 2020 Alice GIRARD <bouhahah@gmail.com> #
|
|
28
|
+
# Copyright 2020 Jesse Li <jesse.li2002@gmail.com> #
|
|
29
|
+
# Copyright 2020 Steve Kowalik <steven@wedontsleep.org> #
|
|
30
|
+
# Copyright 2021 Mark Walker <mark.walker@realbuzz.com> #
|
|
31
|
+
# Copyright 2021 Steve Kowalik <steven@wedontsleep.org> #
|
|
32
|
+
# Copyright 2023 Enrico Minack <github@enrico.minack.dev> #
|
|
33
|
+
# Copyright 2023 Jirka Borovec <6035284+Borda@users.noreply.github.com> #
|
|
34
|
+
# Copyright 2023 Mikhail f. Shiryaev <mr.felixoid@gmail.com> #
|
|
35
|
+
# Copyright 2023 Trim21 <trim21.me@gmail.com> #
|
|
36
|
+
# Copyright 2023 Wojciech Barczyński <104033489+WojciechBarczynski@users.noreply.github.com>#
|
|
37
|
+
# Copyright 2024 Benjamin K <53038537+treee111@users.noreply.github.com> #
|
|
38
|
+
# Copyright 2024 Enrico Minack <github@enrico.minack.dev> #
|
|
39
|
+
# Copyright 2024 Jirka Borovec <6035284+Borda@users.noreply.github.com> #
|
|
40
|
+
# Copyright 2025 Aidan McNay <acm289@cornell.edu> #
|
|
41
|
+
# Copyright 2025 Enrico Minack <github@enrico.minack.dev> #
|
|
42
|
+
# Copyright 2026 Enrico Minack <github@enrico.minack.dev> #
|
|
43
|
+
# Copyright 2026 Mathieu Parent <math.parent@etik.com> #
|
|
44
|
+
# #
|
|
45
|
+
# This file is part of PyGithub. #
|
|
46
|
+
# http://pygithub.readthedocs.io/ #
|
|
47
|
+
# #
|
|
48
|
+
# PyGithub is free software: you can redistribute it and/or modify it under #
|
|
49
|
+
# the terms of the GNU Lesser General Public License as published by the Free #
|
|
50
|
+
# Software Foundation, either version 3 of the License, or (at your option) #
|
|
51
|
+
# any later version. #
|
|
52
|
+
# #
|
|
53
|
+
# PyGithub is distributed in the hope that it will be useful, but WITHOUT ANY #
|
|
54
|
+
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS #
|
|
55
|
+
# FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more #
|
|
56
|
+
# details. #
|
|
57
|
+
# #
|
|
58
|
+
# You should have received a copy of the GNU Lesser General Public License #
|
|
59
|
+
# along with PyGithub. If not, see <http://www.gnu.org/licenses/>. #
|
|
60
|
+
# #
|
|
61
|
+
################################################################################
|
|
62
|
+
|
|
63
|
+
from __future__ import annotations
|
|
64
|
+
|
|
65
|
+
import urllib.parse
|
|
66
|
+
from datetime import datetime
|
|
67
|
+
from os.path import basename
|
|
68
|
+
from typing import TYPE_CHECKING, Any, BinaryIO
|
|
69
|
+
|
|
70
|
+
import githubasyncio.GitReleaseAsset
|
|
71
|
+
import githubasyncio.NamedUser
|
|
72
|
+
import githubasyncio.PaginatedList
|
|
73
|
+
from githubasyncio.compat import deprecated
|
|
74
|
+
from githubasyncio.GithubObject import (
|
|
75
|
+
Attribute,
|
|
76
|
+
CompletableGithubObject,
|
|
77
|
+
NotSet,
|
|
78
|
+
Opt,
|
|
79
|
+
is_defined,
|
|
80
|
+
is_optional,
|
|
81
|
+
is_undefined,
|
|
82
|
+
)
|
|
83
|
+
from githubasyncio.PaginatedList import PaginatedList
|
|
84
|
+
|
|
85
|
+
from . import Consts
|
|
86
|
+
|
|
87
|
+
if TYPE_CHECKING:
|
|
88
|
+
from githubasyncio.GitReleaseAsset import GitReleaseAsset
|
|
89
|
+
from githubasyncio.NamedUser import NamedUser
|
|
90
|
+
|
|
91
|
+
|
|
92
|
+
class GitRelease(CompletableGithubObject):
|
|
93
|
+
"""
|
|
94
|
+
This class represents GitReleases.
|
|
95
|
+
|
|
96
|
+
The reference can be found here
|
|
97
|
+
https://docs.github.com/en/rest/reference/repos#releases
|
|
98
|
+
|
|
99
|
+
The OpenAPI schema can be found at
|
|
100
|
+
|
|
101
|
+
- /components/schemas/release
|
|
102
|
+
|
|
103
|
+
"""
|
|
104
|
+
|
|
105
|
+
def _initAttributes(self) -> None:
|
|
106
|
+
self._assets: Attribute[list[GitReleaseAsset]] = NotSet
|
|
107
|
+
self._assets_url: Attribute[str] = NotSet
|
|
108
|
+
self._author: Attribute[NamedUser] = NotSet
|
|
109
|
+
self._body: Attribute[str] = NotSet
|
|
110
|
+
self._body_html: Attribute[str] = NotSet
|
|
111
|
+
self._body_text: Attribute[str] = NotSet
|
|
112
|
+
self._created_at: Attribute[datetime] = NotSet
|
|
113
|
+
self._discussion_url: Attribute[str] = NotSet
|
|
114
|
+
self._documentation_url: Attribute[str] = NotSet
|
|
115
|
+
self._draft: Attribute[bool] = NotSet
|
|
116
|
+
self._generate_release_notes: Attribute[bool] = NotSet
|
|
117
|
+
self._html_url: Attribute[str] = NotSet
|
|
118
|
+
self._id: Attribute[int] = NotSet
|
|
119
|
+
self._immutable: Attribute[bool] = NotSet
|
|
120
|
+
self._mentions_count: Attribute[int] = NotSet
|
|
121
|
+
self._message: Attribute[str] = NotSet
|
|
122
|
+
self._name: Attribute[str] = NotSet
|
|
123
|
+
self._node_id: Attribute[str] = NotSet
|
|
124
|
+
self._prerelease: Attribute[bool] = NotSet
|
|
125
|
+
self._published_at: Attribute[datetime] = NotSet
|
|
126
|
+
self._reactions: Attribute[dict[str, Any]] = NotSet
|
|
127
|
+
self._status: Attribute[str] = NotSet
|
|
128
|
+
self._tag_name: Attribute[str] = NotSet
|
|
129
|
+
self._tarball_url: Attribute[str] = NotSet
|
|
130
|
+
self._target_commitish: Attribute[str] = NotSet
|
|
131
|
+
self._updated_at: Attribute[datetime] = NotSet
|
|
132
|
+
self._upload_url: Attribute[str] = NotSet
|
|
133
|
+
self._url: Attribute[str] = NotSet
|
|
134
|
+
self._zipball_url: Attribute[str] = NotSet
|
|
135
|
+
|
|
136
|
+
def __repr__(self) -> str:
|
|
137
|
+
return self.get__repr__({"name": self._name.value})
|
|
138
|
+
|
|
139
|
+
@property
|
|
140
|
+
async def assets(self) -> list[GitReleaseAsset]:
|
|
141
|
+
await self._completeIfNotSet(self._assets)
|
|
142
|
+
return self._assets.value
|
|
143
|
+
|
|
144
|
+
@property
|
|
145
|
+
async def assets_url(self) -> str:
|
|
146
|
+
await self._completeIfNotSet(self._assets_url)
|
|
147
|
+
return self._assets_url.value
|
|
148
|
+
|
|
149
|
+
@property
|
|
150
|
+
async def author(self) -> NamedUser:
|
|
151
|
+
await self._completeIfNotSet(self._author)
|
|
152
|
+
return self._author.value
|
|
153
|
+
|
|
154
|
+
@property
|
|
155
|
+
async def body(self) -> str:
|
|
156
|
+
await self._completeIfNotSet(self._body)
|
|
157
|
+
return self._body.value
|
|
158
|
+
|
|
159
|
+
@property
|
|
160
|
+
async def body_html(self) -> str:
|
|
161
|
+
await self._completeIfNotSet(self._body_html)
|
|
162
|
+
return self._body_html.value
|
|
163
|
+
|
|
164
|
+
@property
|
|
165
|
+
async def body_text(self) -> str:
|
|
166
|
+
await self._completeIfNotSet(self._body_text)
|
|
167
|
+
return self._body_text.value
|
|
168
|
+
|
|
169
|
+
@property
|
|
170
|
+
async def created_at(self) -> datetime:
|
|
171
|
+
await self._completeIfNotSet(self._created_at)
|
|
172
|
+
return self._created_at.value
|
|
173
|
+
|
|
174
|
+
@property
|
|
175
|
+
async def discussion_url(self) -> str:
|
|
176
|
+
await self._completeIfNotSet(self._discussion_url)
|
|
177
|
+
return self._discussion_url.value
|
|
178
|
+
|
|
179
|
+
@property
|
|
180
|
+
async def documentation_url(self) -> str:
|
|
181
|
+
await self._completeIfNotSet(self._documentation_url)
|
|
182
|
+
return self._documentation_url.value
|
|
183
|
+
|
|
184
|
+
@property
|
|
185
|
+
async def draft(self) -> bool:
|
|
186
|
+
await self._completeIfNotSet(self._draft)
|
|
187
|
+
return self._draft.value
|
|
188
|
+
|
|
189
|
+
@property
|
|
190
|
+
async def html_url(self) -> str:
|
|
191
|
+
await self._completeIfNotSet(self._html_url)
|
|
192
|
+
return self._html_url.value
|
|
193
|
+
|
|
194
|
+
@property
|
|
195
|
+
async def id(self) -> int:
|
|
196
|
+
await self._completeIfNotSet(self._id)
|
|
197
|
+
return self._id.value
|
|
198
|
+
|
|
199
|
+
@property
|
|
200
|
+
async def immutable(self) -> bool:
|
|
201
|
+
await self._completeIfNotSet(self._immutable)
|
|
202
|
+
return self._immutable.value
|
|
203
|
+
|
|
204
|
+
@property
|
|
205
|
+
async def mentions_count(self) -> int:
|
|
206
|
+
await self._completeIfNotSet(self._mentions_count)
|
|
207
|
+
return self._mentions_count.value
|
|
208
|
+
|
|
209
|
+
@property
|
|
210
|
+
async def message(self) -> str:
|
|
211
|
+
await self._completeIfNotSet(self._message)
|
|
212
|
+
return self._message.value
|
|
213
|
+
|
|
214
|
+
@property
|
|
215
|
+
async def name(self) -> str:
|
|
216
|
+
await self._completeIfNotSet(self._name)
|
|
217
|
+
return self._name.value
|
|
218
|
+
|
|
219
|
+
@property
|
|
220
|
+
async def node_id(self) -> str:
|
|
221
|
+
await self._completeIfNotSet(self._node_id)
|
|
222
|
+
return self._node_id.value
|
|
223
|
+
|
|
224
|
+
@property
|
|
225
|
+
async def prerelease(self) -> bool:
|
|
226
|
+
await self._completeIfNotSet(self._prerelease)
|
|
227
|
+
return self._prerelease.value
|
|
228
|
+
|
|
229
|
+
@property
|
|
230
|
+
async def published_at(self) -> datetime:
|
|
231
|
+
await self._completeIfNotSet(self._published_at)
|
|
232
|
+
return self._published_at.value
|
|
233
|
+
|
|
234
|
+
@property
|
|
235
|
+
async def reactions(self) -> dict[str, Any]:
|
|
236
|
+
await self._completeIfNotSet(self._reactions)
|
|
237
|
+
return self._reactions.value
|
|
238
|
+
|
|
239
|
+
@property
|
|
240
|
+
async def status(self) -> str:
|
|
241
|
+
await self._completeIfNotSet(self._status)
|
|
242
|
+
return self._status.value
|
|
243
|
+
|
|
244
|
+
@property
|
|
245
|
+
async def tag_name(self) -> str:
|
|
246
|
+
await self._completeIfNotSet(self._tag_name)
|
|
247
|
+
return self._tag_name.value
|
|
248
|
+
|
|
249
|
+
@property
|
|
250
|
+
async def tarball_url(self) -> str:
|
|
251
|
+
await self._completeIfNotSet(self._tarball_url)
|
|
252
|
+
return self._tarball_url.value
|
|
253
|
+
|
|
254
|
+
@property
|
|
255
|
+
async def target_commitish(self) -> str:
|
|
256
|
+
await self._completeIfNotSet(self._target_commitish)
|
|
257
|
+
return self._target_commitish.value
|
|
258
|
+
|
|
259
|
+
@property
|
|
260
|
+
@deprecated("Use name instead")
|
|
261
|
+
async def title(self) -> str:
|
|
262
|
+
# alias for name
|
|
263
|
+
return await self.name
|
|
264
|
+
|
|
265
|
+
@property
|
|
266
|
+
async def updated_at(self) -> datetime:
|
|
267
|
+
await self._completeIfNotSet(self._updated_at)
|
|
268
|
+
return self._updated_at.value
|
|
269
|
+
|
|
270
|
+
@property
|
|
271
|
+
async def upload_url(self) -> str:
|
|
272
|
+
await self._completeIfNotSet(self._upload_url)
|
|
273
|
+
return self._upload_url.value
|
|
274
|
+
|
|
275
|
+
@property
|
|
276
|
+
async def url(self) -> str:
|
|
277
|
+
await self._completeIfNotSet(self._url)
|
|
278
|
+
return self._url.value
|
|
279
|
+
|
|
280
|
+
@property
|
|
281
|
+
async def zipball_url(self) -> str:
|
|
282
|
+
await self._completeIfNotSet(self._zipball_url)
|
|
283
|
+
return self._zipball_url.value
|
|
284
|
+
|
|
285
|
+
async def delete_release(self) -> None:
|
|
286
|
+
"""
|
|
287
|
+
:calls: `DELETE /repos/{owner}/{repo}/releases/{release_id} <https://docs.github.com/en/rest/releases/releases?apiVersion=2022-11-28#delete-a-release>`_
|
|
288
|
+
"""
|
|
289
|
+
headers, data = await self._requester.requestJsonAndCheck("DELETE", await self.url)
|
|
290
|
+
|
|
291
|
+
async def update_release(
|
|
292
|
+
self,
|
|
293
|
+
name: str,
|
|
294
|
+
message: str,
|
|
295
|
+
draft: bool = False,
|
|
296
|
+
prerelease: bool = False,
|
|
297
|
+
tag_name: Opt[str] = NotSet,
|
|
298
|
+
target_commitish: Opt[str] = NotSet,
|
|
299
|
+
make_latest: Opt[str] = NotSet,
|
|
300
|
+
discussion_category_name: Opt[str] = NotSet,
|
|
301
|
+
) -> GitRelease:
|
|
302
|
+
"""
|
|
303
|
+
:calls: `PATCH /repos/{owner}/{repo}/releases/{release_id} <https://docs.github.com/en/rest/releases/releases?apiVersion=2022-11-28#update-a-release>`_
|
|
304
|
+
"""
|
|
305
|
+
assert isinstance(name, str), name
|
|
306
|
+
assert isinstance(message, str), message
|
|
307
|
+
assert isinstance(draft, bool), draft
|
|
308
|
+
assert isinstance(prerelease, bool), prerelease
|
|
309
|
+
assert is_optional(tag_name, str), "tag_name must be a str/unicode object"
|
|
310
|
+
assert is_optional(target_commitish, str), "target_commitish must be a str/unicode object"
|
|
311
|
+
assert make_latest in ["true", "false", "legacy", NotSet], make_latest
|
|
312
|
+
assert is_optional(discussion_category_name, str), discussion_category_name
|
|
313
|
+
# default tag_name with instance attribute if not given to the method
|
|
314
|
+
if is_undefined(tag_name):
|
|
315
|
+
tag_name = await self.tag_name
|
|
316
|
+
post_parameters = {
|
|
317
|
+
"tag_name": tag_name,
|
|
318
|
+
"name": name,
|
|
319
|
+
"body": message,
|
|
320
|
+
"draft": draft,
|
|
321
|
+
"prerelease": prerelease,
|
|
322
|
+
}
|
|
323
|
+
# Do not set target_commitish to self.target_commitish when omitted, just don't send it
|
|
324
|
+
# altogether in that case, in order to match the Github API behaviour. Only send it when set.
|
|
325
|
+
if is_defined(target_commitish):
|
|
326
|
+
post_parameters["target_commitish"] = target_commitish
|
|
327
|
+
if is_defined(make_latest):
|
|
328
|
+
post_parameters["make_latest"] = make_latest
|
|
329
|
+
if is_defined(discussion_category_name):
|
|
330
|
+
post_parameters["discussion_category_name"] = discussion_category_name
|
|
331
|
+
headers, data = await self._requester.requestJsonAndCheck("PATCH", await self.url, input=post_parameters)
|
|
332
|
+
return GitRelease(self._requester, headers, data, completed=True)
|
|
333
|
+
|
|
334
|
+
async def upload_asset(
|
|
335
|
+
self, path: str, label: str = "", content_type: Opt[str] = NotSet, name: Opt[str] = NotSet
|
|
336
|
+
) -> GitReleaseAsset:
|
|
337
|
+
"""
|
|
338
|
+
:calls: `POST /repos/{owner}/{repo}/releases/{release_id}/assets <https://docs.github.com/en/rest/releases/assets?apiVersion=2022-11-28#upload-a-release-assett>`__
|
|
339
|
+
"""
|
|
340
|
+
assert isinstance(path, str), path
|
|
341
|
+
assert isinstance(label, str), label
|
|
342
|
+
assert is_undefined(name) or isinstance(name, str), name
|
|
343
|
+
|
|
344
|
+
post_parameters: dict[str, Any] = {"label": label}
|
|
345
|
+
if is_undefined(name):
|
|
346
|
+
post_parameters["name"] = basename(path)
|
|
347
|
+
else:
|
|
348
|
+
post_parameters["name"] = name
|
|
349
|
+
headers: dict[str, Any] = {}
|
|
350
|
+
if is_defined(content_type):
|
|
351
|
+
headers["Content-Type"] = content_type
|
|
352
|
+
resp_headers, data = await self._requester.requestBlobAndCheck(
|
|
353
|
+
"POST",
|
|
354
|
+
(await self.upload_url).split("{?")[0],
|
|
355
|
+
parameters=post_parameters,
|
|
356
|
+
headers=headers,
|
|
357
|
+
input=path,
|
|
358
|
+
)
|
|
359
|
+
return githubasyncio.GitReleaseAsset.GitReleaseAsset(self._requester, resp_headers, data, completed=True)
|
|
360
|
+
|
|
361
|
+
async def upload_asset_from_memory(
|
|
362
|
+
self,
|
|
363
|
+
file_like: BinaryIO,
|
|
364
|
+
file_size: int,
|
|
365
|
+
name: str,
|
|
366
|
+
content_type: Opt[str] = NotSet,
|
|
367
|
+
label: str = "",
|
|
368
|
+
) -> GitReleaseAsset:
|
|
369
|
+
"""
|
|
370
|
+
Uploads an asset.
|
|
371
|
+
|
|
372
|
+
Unlike ``upload_asset()`` this method allows you to pass in a file-like object to upload.
|
|
373
|
+
Note that this method is more strict and requires you to specify the ``name``, since there's no file name to infer these from.
|
|
374
|
+
:calls: `POST /repos/{owner}/{repo}/releases/{release_id}/assets <https://docs.github.com/en/rest/reference/repos#upload-a-release-asset>`__
|
|
375
|
+
:param file_like: binary file-like object, such as those returned by ``open("file_name", "rb")``. At the very minimum, this object must implement ``read()``.
|
|
376
|
+
:param file_size: int, size in bytes of ``file_like``
|
|
377
|
+
|
|
378
|
+
"""
|
|
379
|
+
assert isinstance(name, str), name
|
|
380
|
+
assert isinstance(file_size, int), file_size
|
|
381
|
+
assert isinstance(label, str), label
|
|
382
|
+
|
|
383
|
+
post_parameters = {"label": label, "name": name}
|
|
384
|
+
content_type = content_type if is_defined(content_type) else Consts.defaultMediaType
|
|
385
|
+
headers = {"Content-Type": content_type, "Content-Length": str(file_size)}
|
|
386
|
+
|
|
387
|
+
resp_headers, data = await self._requester.requestMemoryBlobAndCheck(
|
|
388
|
+
"POST",
|
|
389
|
+
(await self.upload_url).split("{?")[0],
|
|
390
|
+
parameters=post_parameters,
|
|
391
|
+
headers=headers,
|
|
392
|
+
file_like=file_like,
|
|
393
|
+
)
|
|
394
|
+
return githubasyncio.GitReleaseAsset.GitReleaseAsset(self._requester, resp_headers, data, completed=True)
|
|
395
|
+
|
|
396
|
+
async def get_assets(self) -> PaginatedList[GitReleaseAsset]:
|
|
397
|
+
"""
|
|
398
|
+
:calls: `GET /repos/{owner}/{repo}/releases/{release_id}/assets <https://docs.github.com/en/rest/releases/assets?apiVersion=2022-11-28#get-a-release-asset>`_
|
|
399
|
+
"""
|
|
400
|
+
return githubasyncio.PaginatedList.PaginatedList(
|
|
401
|
+
githubasyncio.GitReleaseAsset.GitReleaseAsset,
|
|
402
|
+
self._requester,
|
|
403
|
+
f"{await self.url}/assets",
|
|
404
|
+
None,
|
|
405
|
+
)
|
|
406
|
+
|
|
407
|
+
def _useAttributes(self, attributes: dict[str, Any]) -> None:
|
|
408
|
+
if "assets" in attributes:
|
|
409
|
+
self._assets = self._makeListOfClassesAttribute(
|
|
410
|
+
githubasyncio.GitReleaseAsset.GitReleaseAsset, attributes["assets"]
|
|
411
|
+
)
|
|
412
|
+
if "assets_url" in attributes: # pragma no branch
|
|
413
|
+
self._assets_url = self._makeStringAttribute(attributes["assets_url"])
|
|
414
|
+
if "author" in attributes:
|
|
415
|
+
self._author = self._makeClassAttribute(githubasyncio.NamedUser.NamedUser, attributes["author"])
|
|
416
|
+
if "body" in attributes:
|
|
417
|
+
self._body = self._makeStringAttribute(attributes["body"])
|
|
418
|
+
if "body_html" in attributes: # pragma no branch
|
|
419
|
+
self._body_html = self._makeStringAttribute(attributes["body_html"])
|
|
420
|
+
if "body_text" in attributes: # pragma no branch
|
|
421
|
+
self._body_text = self._makeStringAttribute(attributes["body_text"])
|
|
422
|
+
if "created_at" in attributes:
|
|
423
|
+
self._created_at = self._makeDatetimeAttribute(attributes["created_at"])
|
|
424
|
+
if "discussion_url" in attributes: # pragma no branch
|
|
425
|
+
self._discussion_url = self._makeStringAttribute(attributes["discussion_url"])
|
|
426
|
+
if "documentation_url" in attributes: # pragma no branch
|
|
427
|
+
self._documentation_url = self._makeStringAttribute(attributes["documentation_url"])
|
|
428
|
+
if "draft" in attributes:
|
|
429
|
+
self._draft = self._makeBoolAttribute(attributes["draft"])
|
|
430
|
+
if "generate_release_notes" in attributes:
|
|
431
|
+
self._generate_release_notes = self._makeBoolAttribute(attributes["generate_release_notes"])
|
|
432
|
+
if "html_url" in attributes:
|
|
433
|
+
self._html_url = self._makeStringAttribute(attributes["html_url"])
|
|
434
|
+
if "id" in attributes:
|
|
435
|
+
self._id = self._makeIntAttribute(attributes["id"])
|
|
436
|
+
elif "url" in attributes and attributes["url"]:
|
|
437
|
+
id = attributes["url"].split("/")[-1]
|
|
438
|
+
if id.isnumeric():
|
|
439
|
+
self._id = self._makeIntAttribute(int(id))
|
|
440
|
+
if "immutable" in attributes: # pragma no branch
|
|
441
|
+
self._immutable = self._makeBoolAttribute(attributes["immutable"])
|
|
442
|
+
if "mentions_count" in attributes: # pragma no branch
|
|
443
|
+
self._mentions_count = self._makeIntAttribute(attributes["mentions_count"])
|
|
444
|
+
if "message" in attributes: # pragma no branch
|
|
445
|
+
self._message = self._makeStringAttribute(attributes["message"])
|
|
446
|
+
if "name" in attributes:
|
|
447
|
+
self._name = self._makeStringAttribute(attributes["name"])
|
|
448
|
+
if "node_id" in attributes: # pragma no branch
|
|
449
|
+
self._node_id = self._makeStringAttribute(attributes["node_id"])
|
|
450
|
+
if "prerelease" in attributes:
|
|
451
|
+
self._prerelease = self._makeBoolAttribute(attributes["prerelease"])
|
|
452
|
+
if "published_at" in attributes:
|
|
453
|
+
self._published_at = self._makeDatetimeAttribute(attributes["published_at"])
|
|
454
|
+
if "reactions" in attributes: # pragma no branch
|
|
455
|
+
self._reactions = self._makeDictAttribute(attributes["reactions"])
|
|
456
|
+
if "status" in attributes: # pragma no branch
|
|
457
|
+
self._status = self._makeStringAttribute(attributes["status"])
|
|
458
|
+
if "tag_name" in attributes:
|
|
459
|
+
self._tag_name = self._makeStringAttribute(attributes["tag_name"])
|
|
460
|
+
elif "url" in attributes and attributes["url"] and isinstance(attributes["url"], str):
|
|
461
|
+
quoted_tag_name = attributes["url"].split("/")[-1]
|
|
462
|
+
tag_name = urllib.parse.unquote(quoted_tag_name)
|
|
463
|
+
if tag_name != "latest":
|
|
464
|
+
self._tag_name = self._makeStringAttribute(tag_name)
|
|
465
|
+
if "tarball_url" in attributes:
|
|
466
|
+
self._tarball_url = self._makeStringAttribute(attributes["tarball_url"])
|
|
467
|
+
if "target_commitish" in attributes:
|
|
468
|
+
self._target_commitish = self._makeStringAttribute(attributes["target_commitish"])
|
|
469
|
+
if "updated_at" in attributes: # pragma no branch
|
|
470
|
+
self._updated_at = self._makeDatetimeAttribute(attributes["updated_at"])
|
|
471
|
+
if "upload_url" in attributes:
|
|
472
|
+
self._upload_url = self._makeStringAttribute(attributes["upload_url"])
|
|
473
|
+
if "url" in attributes:
|
|
474
|
+
self._url = self._makeStringAttribute(attributes["url"])
|
|
475
|
+
if "zipball_url" in attributes:
|
|
476
|
+
self._zipball_url = self._makeStringAttribute(attributes["zipball_url"])
|