1
+ from typing import Any , cast , Union
2
+
1
3
from gitlab .base import RESTManager , RESTObject
2
- from gitlab .mixins import CreateMixin , DeleteMixin , ListMixin , ObjectDeleteMixin
4
+ from gitlab .mixins import CreateMixin , DeleteMixin , ObjectDeleteMixin , RetrieveMixin
3
5
from gitlab .types import ArrayAttribute , RequiredOptional
4
6
5
7
__all__ = [
@@ -12,11 +14,16 @@ class ProjectAccessToken(ObjectDeleteMixin, RESTObject):
12
14
pass
13
15
14
16
15
- class ProjectAccessTokenManager (ListMixin , CreateMixin , DeleteMixin , RESTManager ):
17
+ class ProjectAccessTokenManager (CreateMixin , DeleteMixin , RetrieveMixin , RESTManager ):
16
18
_path = "/projects/{project_id}/access_tokens"
17
19
_obj_cls = ProjectAccessToken
18
20
_from_parent_attrs = {"project_id" : "id" }
19
21
_create_attrs = RequiredOptional (
20
22
required = ("name" , "scopes" ), optional = ("access_level" , "expires_at" )
21
23
)
22
24
_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