Código fonte para asgard.services.users

from typing import List, Optional

from asgard.backends.users import UsersBackend
from asgard.models.account import Account
from asgard.models.user import User


[documentos]class UsersService:
[documentos] @staticmethod async def get_alternate_accounts( user: User, current_account: Account, backend: UsersBackend ) -> List[Account]: return await backend.get_alternate_accounts(user, current_account)
[documentos] @staticmethod async def get_user_by_id( user_id: int, backend: UsersBackend ) -> Optional[User]: return await backend.get_user_by_id(user_id)
[documentos] @staticmethod async def get_users(backend: UsersBackend) -> List[User]: return await backend.get_users()
[documentos] @staticmethod async def create_user(user: User, backend: UsersBackend) -> User: return await backend.create_user(user)
[documentos] @staticmethod async def get_accounts_from_user( user: User, backend: UsersBackend ) -> List[Account]: return await backend.get_accounts_from_user(user)
[documentos] @staticmethod async def delete_user(user: User, backend: UsersBackend) -> User: return await backend.delete_user(user)
[documentos] @staticmethod async def update_user(user: User, backend: UsersBackend) -> User: return await backend.update_user(user)