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):
170170 self ._completeIfNotSet (self ._zipball_url )
171171 return self ._zipball_url .value
172172
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+
173181 def delete_release (self ):
174182 """
175183 :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):
333341 self ._published_at = github .GithubObject .NotSet
334342 self ._tarball_url = github .GithubObject .NotSet
335343 self ._zipball_url = github .GithubObject .NotSet
344+ self ._assets = github .GithubObject .NotSet
336345
337346 def _useAttributes (self , attributes ):
338347 if "id" in attributes :
@@ -369,3 +378,7 @@ def _useAttributes(self, attributes):
369378 self ._tarball_url = self ._makeStringAttribute (attributes ["tarball_url" ])
370379 if "zipball_url" in attributes :
371380 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):
1111 def _initAttributes (self ) -> None : ...
1212 def _useAttributes (self , attributes : Dict [str , Any ]) -> None : ...
1313 @property
14+ def assets (self ) -> list [GitReleaseAsset ]: ...
15+ @property
1416 def author (self ) -> NamedUser : ...
1517 @property
1618 def body (self ) -> str : ...
Original file line number Diff line number Diff line change @@ -156,6 +156,12 @@ def testAttributes(self):
156156 ),
157157 )
158158 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+ )
159165
160166 def testGetRelease (self ):
161167 release_by_id = self .release
You can’t perform that action at this time.
0 commit comments