@exc.on_http_error(exc.GitlabListError)<EOL><INDENT>def list(self, **kwargs):<DEDENT>
<EOL>data = kwargs.copy()<EOL>if self.gitlab.per_page:<EOL><INDENT>data.setdefault('<STR_LIT>', self.gitlab.per_page)<EOL><DEDENT>types = getattr(self, '<STR_LIT>', {})<EOL>if types:<EOL><INDENT>for attr_name, type_cls in types.items():<EOL><INDENT>if attr_name in data.keys():<EOL><INDENT>type_obj = type_cls(data[attr_name])<EOL>data[attr_name] = type_obj.get_for_api()<EOL><DEDENT><DEDENT><DEDENT>path = data.pop('<STR_LIT:path>', self.path)<EOL>obj = self.gitlab.http_list(path, **data)<EOL>if isinstance(obj, list):<EOL><INDENT>return [self._obj_cls(self, item) for item in obj]<EOL><DEDENT>else:<EOL><INDENT>return base.RESTObjectList(self, self._obj_cls, obj)<EOL><DEDENT>
Retrieve a list of objects.

        Args:
            all (bool): If True, return all the items, without pagination
            per_page (int): Number of items to retrieve per request
            page (int): ID of the page to return (starts with page 1)
            as_list (bool): If set to False and no pagination option is
                defined, return a generator instead of a list
            **kwargs: Extra options to send to the server (e.g. sudo)

        Returns:
            list: The list of objects, or a generator if `as_list` is False

        Raises:
            GitlabAuthenticationError: If authentication is not correct
            GitlabListError: If the server cannot perform the request