selfprivacy-rest-api/selfprivacy_api/graphql/common_types/user.py

31 lines
584 B
Python
Raw Normal View History

2022-07-21 00:23:59 +03:00
import typing
import strawberry
from selfprivacy_api.graphql.mutations.mutation_interface import (
MutationReturnInterface,
)
2022-07-22 13:33:32 +03:00
from enum import Enum
2022-07-21 00:23:59 +03:00
2022-07-22 13:36:11 +03:00
2022-07-22 13:33:32 +03:00
@strawberry.enum
class UserType(Enum):
NORMAL = "NORMAL"
PRIMARY = "PRIMARY"
ROOT = "ROOT"
2022-07-21 00:23:59 +03:00
2022-07-22 13:36:11 +03:00
2022-07-21 00:23:59 +03:00
@strawberry.type
class User:
"""Users management"""
2022-07-22 13:33:32 +03:00
user_type: UserType
2022-07-21 00:23:59 +03:00
username: str
# userHomeFolderspace: UserHomeFolderUsage
2022-07-22 13:33:32 +03:00
ssh_keys: typing.List[str] = []
2022-07-21 00:23:59 +03:00
@strawberry.type
class UserMutationReturn(MutationReturnInterface):
"""Return type for user mutation"""
user: typing.Optional[User]