File tree Expand file tree Collapse file tree 3 files changed +21
-0
lines changed Expand file tree Collapse file tree 3 files changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -170,6 +170,14 @@ def zipball_url(self):
170
170
self ._completeIfNotSet (self ._zipball_url )
171
171
return self ._zipball_url .value
172
172
173
+ @property
174
+ def assets (self ):
175
+ """
176
+ :type: list of :class:`github.GitReleaseAsset.GitReleaseAsset`
177
+ """
178
+ self ._completeIfNotSet (self ._assets )
179
+ return self ._assets .value
180
+
173
181
def delete_release (self ):
174
182
"""
175
183
:calls: `DELETE /repos/{owner}/{repo}/releases/{release_id} <https://docs.github.com/en/rest/reference/repos#delete-a-release>`_
@@ -333,6 +341,7 @@ def _initAttributes(self):
333
341
self ._published_at = github .GithubObject .NotSet
334
342
self ._tarball_url = github .GithubObject .NotSet
335
343
self ._zipball_url = github .GithubObject .NotSet
344
+ self ._assets = github .GithubObject .NotSet
336
345
337
346
def _useAttributes (self , attributes ):
338
347
if "id" in attributes :
@@ -369,3 +378,7 @@ def _useAttributes(self, attributes):
369
378
self ._tarball_url = self ._makeStringAttribute (attributes ["tarball_url" ])
370
379
if "zipball_url" in attributes :
371
380
self ._zipball_url = self ._makeStringAttribute (attributes ["zipball_url" ])
381
+ if "assets" in attributes :
382
+ self ._assets = self ._makeListOfClassesAttribute (
383
+ github .GitReleaseAsset .GitReleaseAsset , attributes ["assets" ]
384
+ )
Original file line number Diff line number Diff line change @@ -11,6 +11,8 @@ class GitRelease(CompletableGithubObject):
11
11
def _initAttributes (self ) -> None : ...
12
12
def _useAttributes (self , attributes : Dict [str , Any ]) -> None : ...
13
13
@property
14
+ def assets (self ) -> list [GitReleaseAsset ]: ...
15
+ @property
14
16
def author (self ) -> NamedUser : ...
15
17
@property
16
18
def body (self ) -> str : ...
Original file line number Diff line number Diff line change @@ -156,6 +156,12 @@ def testAttributes(self):
156
156
),
157
157
)
158
158
self .assertEqual (repr (release ), 'GitRelease(title="Test")' )
159
+ self .assertEqual (len (release .assets ), 1 )
160
+ self .assertEqual (
161
+ repr (release .assets [0 ]),
162
+ 'GitReleaseAsset(url="https://api.github.com/repos/'
163
+ f'{ user } /{ repo_name } /releases/assets/{ release .raw_data ["assets" ][0 ]["id" ]} ")' ,
164
+ )
159
165
160
166
def testGetRelease (self ):
161
167
release_by_id = self .release
You can’t perform that action at this time.
0 commit comments