File indexing completed on 2024-12-22 04:45:23
0001 /* 0002 SPDX-FileCopyrightText: 2023-2024 Laurent Montel <montel.org> 0003 0004 SPDX-License-Identifier: LGPL-2.0-or-later 0005 */ 0006 0007 #pragma once 0008 0009 #include "librocketchatrestapi-qt_export.h" 0010 #include "restapiabstractjob.h" 0011 0012 namespace RocketChatRestApi 0013 { 0014 class LIBROCKETCHATRESTAPI_QT_EXPORT ModerationReportsByUsersJob : public RestApiAbstractJob 0015 { 0016 Q_OBJECT 0017 public: 0018 struct LIBROCKETCHATRESTAPI_QT_EXPORT ModerationReportsByUsersInfo { 0019 QDateTime mLatest; 0020 QDateTime mOldest; 0021 QString mSelector; 0022 [[nodiscard]] bool isValid() const 0023 { 0024 return mLatest.isValid() && mOldest.isValid(); 0025 } 0026 }; 0027 0028 explicit ModerationReportsByUsersJob(QObject *parent = nullptr); 0029 ~ModerationReportsByUsersJob() override; 0030 0031 [[nodiscard]] bool requireHttpAuthentication() const override; 0032 0033 [[nodiscard]] bool start() override; 0034 0035 [[nodiscard]] QNetworkRequest request() const override; 0036 0037 [[nodiscard]] bool hasQueryParameterSupport() const override; 0038 0039 [[nodiscard]] ModerationReportsByUsersInfo moderationReportsByUsersInfo() const; 0040 void setModerationReportsByUsersInfo(const ModerationReportsByUsersInfo &newModerationReportsByUsersInfo); 0041 0042 Q_SIGNALS: 0043 void moderationReportByUserDone(const QJsonObject &obj); 0044 0045 private: 0046 Q_DISABLE_COPY(ModerationReportsByUsersJob) 0047 LIBROCKETCHATRESTAPI_QT_NO_EXPORT void onGetRequestResponse(const QString &replyErrorString, const QJsonDocument &replyJson) override; 0048 ModerationReportsByUsersInfo mModerationReportsByUsersInfo; 0049 }; 0050 }