Kgapi

drivesfetchjob.h
1/*
2 * This file is part of LibKGAPI library
3 *
4 * SPDX-FileCopyrightText: 2019 David Barchiesi <david@barchie.si>
5 *
6 * SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
7 */
8
9#pragma once
10
11#include "fetchjob.h"
12#include "kgapidrive_export.h"
13
14#include "drivessearchquery.h"
15
16namespace KGAPI2
17{
18
19namespace Drive
20{
21
22class KGAPIDRIVE_EXPORT DrivesFetchJob : public KGAPI2::FetchJob
23{
24 Q_OBJECT
25
26 /**
27 * Maximum number of shared drives to return. Acceptable
28 * values are 1 to 100, inclusive
29 *
30 * Default value if missing is 10.
31 *
32 * This property does not have any effect when fetching a specific event and
33 * can be modified only when the job is not running.
34 */
35 Q_PROPERTY(int maxResults READ maxResults WRITE setMaxResults)
36
37 /**
38 * Issue the request as a domain administrator; if set to true, then all
39 * shared Drives of the domain in which the requester is an administrator
40 * are returned.
41 *
42 * Default value if missing is false.
43 *
44 * This property does not have any effect when fetching a specific event and
45 * can be modified only when the job is not running.
46 */
47 Q_PROPERTY(bool useDomainAdminAccess READ useDomainAdminAccess WRITE setUseDomainAdminAccess)
48
49public:
50 DrivesFetchJob(const DrivesSearchQuery &query, const AccountPtr &account, QObject *parent = nullptr);
51 DrivesFetchJob(const AccountPtr &account, QObject *parent = nullptr);
52 DrivesFetchJob(const QString &drivesId, const AccountPtr &account, QObject *parent = nullptr);
53 ~DrivesFetchJob() override;
54
55 int maxResults() const;
56 void setMaxResults(int maxResults);
57
58 void setUseDomainAdminAccess(bool useDomainAdminAccess);
59 [[nodiscard]] bool useDomainAdminAccess() const;
60
61 void setFields(const QStringList &fields);
62 [[nodiscard]] QStringList fields() const;
63
64protected:
65 void start() override;
66 KGAPI2::ObjectsList handleReplyWithItems(const QNetworkReply *reply, const QByteArray &rawData) override;
67
68private:
69 class Private;
71 friend class Private;
72
73 void applyRequestParameters(QUrl &url);
74};
75
76} // namespace Drive
77
78} // namespace KGAPI2
Abstract superclass for all jobs that fetch resources from Google.
Definition fetchjob.h:25
Q_SCRIPTABLE Q_NOREPLY void start()
A job to fetch a single map tile described by a StaticMapUrl.
Definition blog.h:16
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Nov 22 2024 12:08:13 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.