9#include "driveservice.h"
19static const QUrl GoogleApisUrl(QStringLiteral(
"https://www.googleapis.com"));
20static const QString AppsBasePath(QStringLiteral(
"/drive/v2/about"));
21static const QString FilesBasePath(QStringLiteral(
"/drive/v2/files"));
22static const QString ChangeBasePath(QStringLiteral(
"/drive/v2/changes"));
23static const QString DrivesBasePath(QStringLiteral(
"/drive/v2/drives"));
24static const QString TeamdriveBasePath(QStringLiteral(
"/drive/v2/teamdrives"));
30QUrl fetchAboutUrl(
bool includeSubscribed, qlonglong maxChangeIdCount, qlonglong startChangeId)
32 QUrl url(Private::GoogleApisUrl);
33 url.setPath(Private::AppsBasePath);
35 query.addQueryItem(QStringLiteral(
"includeSubscribed"), Utils::bool2Str(includeSubscribed));
36 if (maxChangeIdCount > 0) {
39 if (startChangeId > 0) {
47QUrl fetchAppUrl(
const QString &appId)
49 QUrl url(Private::GoogleApisUrl);
50 url.setPath(Private::AppsBasePath % QLatin1Char(
'/') % appId);
56 QUrl url(Private::GoogleApisUrl);
57 url.setPath(Private::AppsBasePath);
61QUrl fetchChildReference(
const QString &folderId,
const QString &referenceId)
63 QUrl url(Private::GoogleApisUrl);
64 url.setPath(Private::FilesBasePath % QLatin1Char(
'/') % folderId % QLatin1StringView(
"/children/") % referenceId);
68QUrl fetchChildReferences(
const QString &folderId)
70 QUrl url(Private::GoogleApisUrl);
71 url.setPath(Private::FilesBasePath % QLatin1Char(
'/') % folderId % QLatin1StringView(
"/children"));
75QUrl createChildReference(
const QString &folderId)
77 QUrl url(Private::GoogleApisUrl);
78 url.setPath(Private::FilesBasePath % QLatin1Char(
'/') % folderId % QLatin1StringView(
"/children"));
82QUrl deleteChildReference(
const QString &folderId,
const QString &referenceId)
84 QUrl url(Private::GoogleApisUrl);
85 url.setPath(Private::FilesBasePath % QLatin1Char(
'/') % folderId % QLatin1StringView(
"/children/") % referenceId);
89QUrl fetchChangeUrl(
const QString &changeId)
91 QUrl url(Private::GoogleApisUrl);
92 url.setPath(Private::ChangeBasePath % QLatin1Char(
'/') % changeId);
96QUrl copyFileUrl(
const QString &fileId)
98 QUrl url(Private::GoogleApisUrl);
99 url.setPath(Private::FilesBasePath % QLatin1Char(
'/') % fileId % QLatin1StringView(
"/copy"));
103QUrl deleteFileUrl(
const QString &fileId)
105 QUrl url(Private::GoogleApisUrl);
106 url.setPath(Private::FilesBasePath % QLatin1Char(
'/') % fileId);
110QUrl fetchFileUrl(
const QString &fileId)
112 QUrl url(Private::GoogleApisUrl);
113 url.setPath(Private::FilesBasePath % QLatin1Char(
'/') % fileId);
119 QUrl url(Private::GoogleApisUrl);
120 url.setPath(Private::FilesBasePath);
124QUrl fetchChangesUrl()
126 QUrl url(Private::GoogleApisUrl);
127 url.setPath(Private::ChangeBasePath);
131QUrl touchFileUrl(
const QString &fileId)
133 QUrl url(Private::GoogleApisUrl);
134 url.setPath(Private::FilesBasePath % QLatin1Char(
'/') % fileId % QLatin1StringView(
"/touch"));
138QUrl trashFileUrl(
const QString &fileId)
140 QUrl url(Private::GoogleApisUrl);
141 url.setPath(Private::FilesBasePath % QLatin1Char(
'/') % fileId % QLatin1StringView(
"/trash"));
145QUrl untrashFileUrl(
const QString &fileId)
147 QUrl url(Private::GoogleApisUrl);
148 url.setPath(Private::FilesBasePath % QLatin1Char(
'/') % fileId % QLatin1StringView(
"/untrash"));
152QUrl uploadMetadataFileUrl(
const QString &fileId)
154 QUrl url(Private::GoogleApisUrl);
156 url.setPath(Private::FilesBasePath % QLatin1Char(
'/') % fileId);
158 url.setPath(Private::FilesBasePath);
163QUrl uploadMediaFileUrl(
const QString &fileId)
165 QUrl url(Private::GoogleApisUrl);
167 url.setPath(QLatin1StringView(
"/upload") % Private::FilesBasePath % QLatin1Char(
'/') % fileId);
169 url.setPath(QLatin1StringView(
"/upload") % Private::FilesBasePath);
174QUrl uploadMultipartFileUrl(
const QString &fileId)
176 QUrl url(Private::GoogleApisUrl);
178 url.setPath(QLatin1StringView(
"/upload") % Private::FilesBasePath % QLatin1Char(
'/') % fileId);
180 url.setPath(QLatin1StringView(
"/upload") % Private::FilesBasePath);
185QUrl fetchParentReferenceUrl(
const QString &fileId,
const QString &referenceId)
187 QUrl url(Private::GoogleApisUrl);
188 url.setPath(Private::FilesBasePath % QLatin1Char(
'/') % fileId % QLatin1StringView(
"/parents/") % referenceId);
192QUrl fetchParentReferencesUrl(
const QString &fileId)
194 QUrl url(Private::GoogleApisUrl);
195 url.setPath(Private::FilesBasePath % QLatin1Char(
'/') % fileId % QLatin1StringView(
"/parents"));
200QUrl createParentReferenceUrl(
const QString &fileId)
202 QUrl url(Private::GoogleApisUrl);
203 url.setPath(Private::FilesBasePath % QLatin1Char(
'/') % fileId % QLatin1StringView(
"/parents"));
207QUrl deleteParentReferenceUrl(
const QString &fileId,
const QString &referenceId)
209 QUrl url(Private::GoogleApisUrl);
210 url.setPath(Private::FilesBasePath % QLatin1Char(
'/') % fileId % QLatin1StringView(
"/parents/") % referenceId);
214QUrl fetchPermissionsUrl(
const QString &fileId)
216 QUrl url(Private::GoogleApisUrl);
217 url.setPath(Private::FilesBasePath % QLatin1Char(
'/') % fileId % QLatin1StringView(
"/permissions"));
221QUrl fetchPermissionUrl(
const QString &fileId,
const QString &permissionId)
223 QUrl url(Private::GoogleApisUrl);
224 url.setPath(Private::FilesBasePath % QLatin1Char(
'/') % fileId % QLatin1StringView(
"/permissions/") % permissionId);
228QUrl createPermissionUrl(
const QString &fileId)
230 QUrl url(Private::GoogleApisUrl);
231 url.setPath(Private::FilesBasePath % QLatin1Char(
'/') % fileId % QLatin1StringView(
"/permissions"));
235QUrl deletePermissionUrl(
const QString &fileId,
const QString &permissionId)
237 QUrl url(Private::GoogleApisUrl);
238 url.setPath(Private::FilesBasePath % QLatin1Char(
'/') % fileId % QLatin1StringView(
"/permissions/") % permissionId);
242QUrl modifyPermissionUrl(
const QString &fileId,
const QString &permissionId)
244 QUrl url(Private::GoogleApisUrl);
245 url.setPath(Private::FilesBasePath % QLatin1Char(
'/') % fileId % QLatin1StringView(
"/permissions/") % permissionId);
249QUrl fetchRevisionUrl(
const QString &fileId,
const QString &revisionId)
251 QUrl url(Private::GoogleApisUrl);
252 url.setPath(Private::FilesBasePath % QLatin1Char(
'/') % fileId % QLatin1StringView(
"/revisions/") % revisionId);
256QUrl fetchRevisionsUrl(
const QString &fileId)
258 QUrl url(Private::GoogleApisUrl);
259 url.setPath(Private::FilesBasePath % QLatin1Char(
'/') % fileId % QLatin1StringView(
"/revisions"));
263QUrl deleteRevisionUrl(
const QString &fileId,
const QString &revisionId)
265 QUrl url(Private::GoogleApisUrl);
266 url.setPath(Private::FilesBasePath % QLatin1Char(
'/') % fileId % QLatin1StringView(
"/revisions/") % revisionId);
270QUrl modifyRevisionUrl(
const QString &fileId,
const QString &revisionId)
272 QUrl url(Private::GoogleApisUrl);
273 url.setPath(Private::FilesBasePath % QLatin1Char(
'/') % fileId % QLatin1StringView(
"/revisions/") % revisionId);
277QUrl fetchDrivesUrl(
const QString &drivesId)
279 QUrl url(Private::GoogleApisUrl);
280 url.setPath(Private::DrivesBasePath % QLatin1Char(
'/') % drivesId);
284QUrl hideDrivesUrl(
const QString &drivesId,
bool hide)
286 QUrl url(Private::GoogleApisUrl);
287 url.setPath(Private::DrivesBasePath % QLatin1Char(
'/') % drivesId % (hide ? QLatin1StringView(
"/hide") : QLatin1StringView(
"/unhide")));
293 QUrl url(Private::GoogleApisUrl);
294 url.setPath(Private::DrivesBasePath);
298QUrl fetchTeamdriveUrl(
const QString &teamdriveId)
300 QUrl url(Private::GoogleApisUrl);
301 url.setPath(Private::TeamdriveBasePath % QLatin1Char(
'/') % teamdriveId);
305QUrl fetchTeamdrivesUrl()
307 QUrl url(Private::GoogleApisUrl);
308 url.setPath(Private::TeamdriveBasePath);
std::optional< QSqlQuery > query(const QString &queryStatement)
A job to fetch a single map tile described by a StaticMapUrl.
bool isEmpty() const const
QString number(double n, char format, int precision)