File indexing completed on 2024-12-22 04:57:01

0001 /*
0002     SPDX-FileCopyrightText: 2015-2016 Krzysztof Nowicki <krissn@op.pl>
0003 
0004     SPDX-License-Identifier: LGPL-2.0-or-later
0005 */
0006 
0007 #include "ewsgeteventsrequest.h"
0008 #include "ewsclient_debug.h"
0009 
0010 EwsGetEventsRequest::EwsGetEventsRequest(EwsClient &client, QObject *parent)
0011     : EwsEventRequestBase(client, QStringLiteral("GetEvents"), parent)
0012 {
0013 }
0014 
0015 EwsGetEventsRequest::~EwsGetEventsRequest() = default;
0016 
0017 void EwsGetEventsRequest::start()
0018 {
0019     QString reqString;
0020     QXmlStreamWriter writer(&reqString);
0021 
0022     startSoapDocument(writer);
0023 
0024     writer.writeStartElement(ewsMsgNsUri, QStringLiteral("GetEvents"));
0025 
0026     writer.writeTextElement(ewsMsgNsUri, QStringLiteral("SubscriptionId"), mSubscriptionId);
0027 
0028     writer.writeTextElement(ewsMsgNsUri, QStringLiteral("Watermark"), mWatermark);
0029 
0030     writer.writeEndElement();
0031 
0032     endSoapDocument(writer);
0033 
0034     qCDebugNC(EWSCLI_REQUEST_LOG) << QStringLiteral("Starting GetEvents request (subId: %1, wmark: %2)").arg(mSubscriptionId, mWatermark);
0035 
0036     qCDebug(EWSCLI_PROTO_LOG) << reqString;
0037 
0038     prepare(reqString);
0039 
0040     doSend();
0041 }
0042 
0043 #include "moc_ewsgeteventsrequest.cpp"