1+ from typing import Any , cast , Union
2+
13from gitlab .base import RESTManager , RESTObject
2- from gitlab .mixins import CreateMixin , DeleteMixin , ListMixin , ObjectDeleteMixin
4+ from gitlab .mixins import CreateMixin , DeleteMixin , ObjectDeleteMixin , RetrieveMixin
35from gitlab .types import ArrayAttribute , RequiredOptional
46
57__all__ = [
@@ -12,11 +14,16 @@ class ProjectAccessToken(ObjectDeleteMixin, RESTObject):
1214 pass
1315
1416
15- class ProjectAccessTokenManager (ListMixin , CreateMixin , DeleteMixin , RESTManager ):
17+ class ProjectAccessTokenManager (CreateMixin , DeleteMixin , RetrieveMixin , RESTManager ):
1618 _path = "/projects/{project_id}/access_tokens"
1719 _obj_cls = ProjectAccessToken
1820 _from_parent_attrs = {"project_id" : "id" }
1921 _create_attrs = RequiredOptional (
2022 required = ("name" , "scopes" ), optional = ("access_level" , "expires_at" )
2123 )
2224 _types = {"scopes" : ArrayAttribute }
25+
26+ def get (
27+ self , id : Union [str , int ], lazy : bool = False , ** kwargs : Any
28+ ) -> ProjectAccessToken :
29+ return cast (ProjectAccessToken , super ().get (id = id , lazy = lazy , ** kwargs ))
0 commit comments