2015-11-02 00:23:22 +03:00
|
|
|
/*
|
|
|
|
* Copyright (C) by Roeland Jago Douma <roeland@owncloud.com>
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
2016-10-25 12:00:07 +03:00
|
|
|
* the Free Software Foundation; either version 2 of the License, or
|
|
|
|
* (at your option) any later version.
|
2015-11-02 00:23:22 +03:00
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful, but
|
|
|
|
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
|
|
|
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|
|
|
* for more details.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "ocsshareejob.h"
|
|
|
|
|
2018-04-06 18:13:29 +03:00
|
|
|
#include <QJsonDocument>
|
|
|
|
|
2015-11-02 00:23:22 +03:00
|
|
|
namespace OCC {
|
|
|
|
|
2015-11-11 15:28:20 +03:00
|
|
|
OcsShareeJob::OcsShareeJob(AccountPtr account)
|
2017-05-17 11:55:42 +03:00
|
|
|
: OcsJob(account)
|
2015-11-02 00:23:22 +03:00
|
|
|
{
|
2019-05-09 23:11:25 +03:00
|
|
|
setPath("ocs/v2.php/apps/files_sharing/api/v1/sharees");
|
2017-09-20 11:14:48 +03:00
|
|
|
connect(this, &OcsJob::jobFinished, this, &OcsShareeJob::jobDone);
|
2015-11-02 00:23:22 +03:00
|
|
|
}
|
|
|
|
|
2015-11-16 16:18:01 +03:00
|
|
|
void OcsShareeJob::getSharees(const QString &search,
|
2017-05-17 11:55:42 +03:00
|
|
|
const QString &itemType,
|
|
|
|
int page,
|
|
|
|
int perPage)
|
2015-11-02 00:23:22 +03:00
|
|
|
{
|
|
|
|
setVerb("GET");
|
|
|
|
|
|
|
|
addParam(QString::fromLatin1("search"), search);
|
|
|
|
addParam(QString::fromLatin1("itemType"), itemType);
|
|
|
|
addParam(QString::fromLatin1("page"), QString::number(page));
|
|
|
|
addParam(QString::fromLatin1("perPage"), QString::number(perPage));
|
|
|
|
|
|
|
|
start();
|
|
|
|
}
|
|
|
|
|
2017-04-26 12:38:10 +03:00
|
|
|
void OcsShareeJob::jobDone(const QJsonDocument &reply)
|
2015-11-02 00:23:22 +03:00
|
|
|
{
|
|
|
|
emit shareeJobFinished(reply);
|
|
|
|
}
|
|
|
|
}
|