1 /* 2 SPDX-FileCopyrightText: 2018-2021 Laurent Montel <montel@kde.org> 3 4 SPDX-License-Identifier: LGPL-2.0-or-later 5 */ 6 7 #pragma once 8 9 #include "librocketchatrestapi-qt5_export.h" 10 #include "userbasejob.h" 11 12 #include <QNetworkRequest> 13 namespace RocketChatRestApi 14 { 15 class LIBROCKETCHATRESTAPI_QT5_EXPORT UserInfoJob : public UserBaseJob 16 { 17 Q_OBJECT 18 public: 19 explicit UserInfoJob(QObject *parent = nullptr); 20 ~UserInfoJob() override; 21 22 Q_REQUIRED_RESULT bool requireHttpAuthentication() const override; 23 24 Q_REQUIRED_RESULT bool start() override; 25 26 Q_REQUIRED_RESULT bool canStart() const override; 27 28 Q_REQUIRED_RESULT QNetworkRequest request() const override; 29 Q_SIGNALS: 30 void userInfoDone(const QJsonObject &obj); 31 32 private: 33 Q_DISABLE_COPY(UserInfoJob) 34 void onGetRequestResponse(const QJsonDocument &replyJson) override; 35 }; 36 } 37