@@ -1645,7 +1645,7 @@ class ProjectFork(RESTObject):
16451645 pass
16461646
16471647
1648- class ProjectForkManager (CreateMixin , RESTManager ):
1648+ class ProjectForkManager (CreateMixin , ListMixin , RESTManager ):
16491649 _path = '/projects/%(project_id)s/fork'
16501650 _obj_cls = ProjectFork
16511651 _from_parent_attrs = {'project_id' : 'id' }
@@ -1655,6 +1655,28 @@ class ProjectForkManager(CreateMixin, RESTManager):
16551655 'with_merge_requests_enabled' )
16561656 _create_attrs = (tuple (), ('namespace' , ))
16571657
1658+ def list (self , ** kwargs ):
1659+ """Retrieve a list of objects.
1660+
1661+ Args:
1662+ all (bool): If True, return all the items, without pagination
1663+ per_page (int): Number of items to retrieve per request
1664+ page (int): ID of the page to return (starts with page 1)
1665+ as_list (bool): If set to False and no pagination option is
1666+ defined, return a generator instead of a list
1667+ **kwargs: Extra options to send to the server (e.g. sudo)
1668+
1669+ Returns:
1670+ list: The list of objects, or a generator if `as_list` is False
1671+
1672+ Raises:
1673+ GitlabAuthenticationError: If authentication is not correct
1674+ GitlabListError: If the server cannot perform the request
1675+ """
1676+
1677+ path = self ._compute_path ('/projects/%(project_id)s/forks' )
1678+ return ListMixin .list (self , path = path , ** kwargs )
1679+
16581680
16591681class ProjectHook (SaveMixin , ObjectDeleteMixin , RESTObject ):
16601682 _short_print_attr = 'url'
0 commit comments