File indexing completed on 2024-05-12 05:22:22

0001 /*
0002  * This file is part of LibKGAPI library
0003  *
0004  * SPDX-FileCopyrightText: 2013 Daniel Vrátil <dvratil@redhat.com>
0005  *
0006  * SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
0007  */
0008 
0009 #pragma once
0010 
0011 #include "fetchjob.h"
0012 #include "kgapidrive_export.h"
0013 
0014 namespace KGAPI2
0015 {
0016 
0017 namespace Drive
0018 {
0019 
0020 class KGAPIDRIVE_EXPORT PermissionFetchJob : public KGAPI2::FetchJob
0021 {
0022     Q_OBJECT
0023 
0024 public:
0025     explicit PermissionFetchJob(const QString &fileId, const AccountPtr &account, QObject *parent = nullptr);
0026     explicit PermissionFetchJob(const FilePtr &file, const AccountPtr &account, QObject *parent = nullptr);
0027     explicit PermissionFetchJob(const QString &fileId, const QString &permissionId, const AccountPtr &account, QObject *parent = nullptr);
0028     explicit PermissionFetchJob(const FilePtr &file, const QString &permissionId, const AccountPtr &account, QObject *parent = nullptr);
0029     ~PermissionFetchJob() override;
0030 
0031     /**
0032      * @brief Whether the request supports both My Drives and shared drives.
0033      *
0034      * Set to true by default as LibKGAPI supports Team Drives.
0035      *
0036      * @deprecated This parameter will only be effective until June 1, 2020. Afterwards all applications
0037      * are assumed to support shared drives.
0038      */
0039     KGAPIDRIVE_DEPRECATED bool supportsAllDrives() const;
0040 
0041     /**
0042      * @brief Sets whether the request supports both My Drives and shared drives.
0043      *
0044      * Set to true by default as LibKGAPI supports Team Drives.
0045      *
0046      * @deprecated This parameter will only be effective until June 1, 2020. Afterwards all applications
0047      * are assumed to support shared drives.
0048      */
0049     KGAPIDRIVE_DEPRECATED void setSupportsAllDrives(bool supportsAllDrives);
0050 
0051     /**
0052      * @brief Issue the request as a domain administrator; if set to true,
0053      * then the requester will be granted access if the file ID parameter refers
0054      * to a shared drive and the requester is an administrator of the domain to
0055      * which the shared drive belongs. (Default: false)
0056      */
0057     [[nodiscard]] bool useDomainAdminAccess() const;
0058 
0059     /**
0060      * @brief Sets to issue the request as a domain administrator; if set to true,
0061      * then the requester will be granted access if the file ID parameter refers
0062      * to a shared drive and the requester is an administrator of the domain to
0063      * which the shared drive belongs. (Default: false)
0064      */
0065     void setUseDomainAdminAccess(bool useDomainAdminAccess);
0066 
0067 protected:
0068     void start() override;
0069     KGAPI2::ObjectsList handleReplyWithItems(const QNetworkReply *reply, const QByteArray &rawData) override;
0070 
0071 private:
0072     class Private;
0073     QScopedPointer<Private> d;
0074     friend class Private;
0075 };
0076 
0077 } // namespace Drive
0078 
0079 } // namespace KGAPI2