async def create(self): create_user = resolve(CreateUserUseCase) user = await create_user(**self.user_data.dict()) return user
def retrieve(self, **kwargs): retrieve_users = resolve(RetrieveUsersUseCase) return retrieve_users(limit=self.limit, offset=self.offset, is_active=self.is_active)
def update(self, *args, **kwargs): activate_user = resolve(ActivateUserUseCase) user = activate_user(**self.activation_data.dict()) return prepare_object_to_response(user)
def create(self, **kwargs) -> Dict: create_user = resolve(CreateUserUseCase) create_user(**self.user_data.dict()) return {}
def create(self, **kwargs): refresh_tokens = resolve(RefreshTokenUseCase) return refresh_tokens(access_token=self.access_token, **self.refresh_token.dict())
def create(self, **kwargs): access_token = resolve(AuthenticateUserUseCase) return access_token(username=self.username, password=self.password)
def retrieve(self, **kwargs): retrieve_user = resolve(RetrieveUsersUseCase) return retrieve_user(pk=self.pk)
def update(self, *args, **kwargs): update_user = resolve(UpdateUserUseCase) return update_user(**self.user_payload.dict(exclude_unset=True), pk=self.pk)