13#include <QJsonDocument>
16using namespace KGAPI2::Drive;
20class Q_DECL_HIDDEN
About::Format::Private
24 Private(
const Private &other);
30About::Format::Private::Private()
34About::Format::Private::Private(
const Private &other)
35 : source(other.source)
36 , targets(other.targets)
40About::Format::Format()
46 : d(new Private(*(other.d)))
50About::Format::~Format()
55bool About::Format::operator==(
const About::Format &other)
const
74class Q_DECL_HIDDEN
About::AdditionalRoleInfo::RoleSet::Private
78 Private(
const Private &other);
84About::AdditionalRoleInfo::RoleSet::Private::Private()
88About::AdditionalRoleInfo::RoleSet::Private::Private(
const Private &other)
89 : primaryRole(other.primaryRole)
90 , additionalRoles(other.additionalRoles)
94About::AdditionalRoleInfo::RoleSet::RoleSet()
100 : d(new Private(*(other.d)))
104About::AdditionalRoleInfo::RoleSet::~RoleSet()
109bool About::AdditionalRoleInfo::RoleSet::operator==(
const RoleSet &other)
const
111 GAPI_COMPARE(primaryRole)
112 GAPI_COMPARE(additionalRoles)
118 return d->primaryRole;
123 return d->additionalRoles;
128class Q_DECL_HIDDEN
About::AdditionalRoleInfo::Private
132 Private(
const Private &other);
135 RoleSetsList roleSets;
138About::AdditionalRoleInfo::Private::Private()
142About::AdditionalRoleInfo::Private::Private(
const Private &other)
144 , roleSets(other.roleSets)
148About::AdditionalRoleInfo::AdditionalRoleInfo()
154 : d(new Private(*(other.d)))
158About::AdditionalRoleInfo::~AdditionalRoleInfo()
163bool About::AdditionalRoleInfo::operator==(
const AdditionalRoleInfo &other)
const
166 GAPI_COMPARE_CONTAINERS(roleSets)
182class Q_DECL_HIDDEN
About::Feature::Private
186 Private(
const Private &other);
192About::Feature::Private::Private()
197About::Feature::Private::Private(
const Private &other)
198 : featureName(other.featureName)
199 , featureRate(other.featureRate)
203About::Feature::Feature()
209 : d(new Private(*(other.d)))
213About::Feature::~Feature()
218bool About::Feature::operator==(
const Feature &other)
const
220 GAPI_COMPARE(featureName)
221 GAPI_COMPARE(featureRate)
227 return d->featureName;
232 return d->featureRate;
237class Q_DECL_HIDDEN
About::MaxUploadSize::Private
241 Private(
const Private &other);
247About::MaxUploadSize::Private::Private()
252About::MaxUploadSize::Private::Private(
const Private &other)
258About::MaxUploadSize::MaxUploadSize()
264 : d(new Private(*(other.d)))
268About::MaxUploadSize::~MaxUploadSize()
273bool About::MaxUploadSize::operator==(
const MaxUploadSize &other)
const
292class Q_DECL_HIDDEN
About::Private
296 Private(
const Private &other);
300 qlonglong quotaBytesTotal;
301 qlonglong quotaBytesUsed;
302 qlonglong quotaBytesUsedInTrash;
303 qlonglong quotaBytesUsedAggregate;
304 qlonglong largestChangeId;
305 qlonglong remainingChangeIds;
314 bool isCurrentAppInstalled;
315 bool canCreateDrives;
319About::Private::Private()
331About::Private::Private(
const About::Private &other)
354const QString About::Fields::AdditionalRoleInfo = QStringLiteral(
"additionalRoleInfo");
355const QString About::Fields::AdditionalRoles = QStringLiteral(
"additionalRoles");
356const QString About::Fields::BackgroundImageLink = QStringLiteral(
"backgroundImageLink");
357const QString About::Fields::BytesUsed = QStringLiteral(
"bytesUsed");
358const QString About::Fields::CanCreateDrives = QStringLiteral(
"canCreateDrives");
359const QString About::Fields::ColorRgb = QStringLiteral(
"colorRgb");
360const QString About::Fields::DisplayName = QStringLiteral(
"displayName");
361const QString About::Fields::DomainSharingPolicy = QStringLiteral(
"domainSharingPolicy");
362const QString About::Fields::EmailAddress = QStringLiteral(
"emailAddress");
363const QString About::Fields::Etag = QStringLiteral(
"etag");
364const QString About::Fields::ExportFormats = QStringLiteral(
"exportFormats");
365const QString About::Fields::FeatureName = QStringLiteral(
"featureName");
366const QString About::Fields::FeatureRate = QStringLiteral(
"featureRate");
367const QString About::Fields::Features = QStringLiteral(
"features");
368const QString About::Fields::FolderColorPalette = QStringLiteral(
"folderColorPalette");
369const QString About::Fields::Id = QStringLiteral(
"id");
370const QString About::Fields::ImportFormats = QStringLiteral(
"importFormats");
371const QString About::Fields::IsAuthenticatedUser = QStringLiteral(
"isAuthenticatedUser");
372const QString About::Fields::IsCurrentAppInstalled = QStringLiteral(
"isCurrentAppInstalled");
373const QString About::Fields::Kind = QStringLiteral(
"kind");
374const QString About::Fields::LanguageCode = QStringLiteral(
"languageCode");
375const QString About::Fields::LargestChangeId = QStringLiteral(
"largestChangeId");
376const QString About::Fields::MaxUploadSizes = QStringLiteral(
"maxUploadSizes");
377const QString About::Fields::Name = QStringLiteral(
"name");
378const QString About::Fields::PermissionId = QStringLiteral(
"permissionId");
379const QString About::Fields::Picture = QStringLiteral(
"picture");
380const QString About::Fields::PrimaryRole = QStringLiteral(
"primaryRole");
381const QString About::Fields::QuotaBytesByService = QStringLiteral(
"quotaBytesByService");
382const QString About::Fields::QuotaBytesTotal = QStringLiteral(
"quotaBytesTotal");
383const QString About::Fields::QuotaBytesUsedAggregate = QStringLiteral(
"quotaBytesUsedAggregate");
384const QString About::Fields::QuotaBytesUsedInTrash = QStringLiteral(
"quotaBytesUsedInTrash");
385const QString About::Fields::QuotaBytesUsed = QStringLiteral(
"quotaBytesUsed");
386const QString About::Fields::QuotaType = QStringLiteral(
"quotaType");
387const QString About::Fields::RemainingChangeIds = QStringLiteral(
"remainingChangeIds");
388const QString About::Fields::RoleSets = QStringLiteral(
"roleSets");
389const QString About::Fields::RootFolderId = QStringLiteral(
"rootFolderId");
390const QString About::Fields::SelfLink = QStringLiteral(
"selfLink");
391const QString About::Fields::ServiceName = QStringLiteral(
"serviceName");
392const QString About::Fields::Size = QStringLiteral(
"size");
393const QString About::Fields::Source = QStringLiteral(
"source");
394const QString About::Fields::Targets = QStringLiteral(
"targets");
395const QString About::Fields::TeamDriveThemes = QStringLiteral(
"teamDriveThemes");
396const QString About::Fields::Type = QStringLiteral(
"type");
397const QString About::Fields::Url = QStringLiteral(
"url");
398const QString About::Fields::User = QStringLiteral(
"user");
406About::About(
const About &other)
408 , d(new Private(*(other.d)))
412About::~About() =
default;
414bool About::operator==(
const About &other)
const
416 if (!Object::operator==(other)) {
438 GAPI_COMPARE_SHAREDPTRS(
user)
454 return d->quotaBytesTotal;
459 return d->quotaBytesUsed;
464 return d->quotaBytesUsedInTrash;
469 return d->quotaBytesUsedAggregate;
472#ifndef KGAPIDRIVE_NO_DEPRECATED
481 return d->largestChangeId;
485 return d->remainingChangeIds;
490 return d->rootFolderId;
495 return d->domainSharingPolicy;
500 return d->importFormats;
505 return d->exportFormats;
510 return d->additionalRoleInfo;
520 return d->maxUploadSizes;
525 return d->permissionId;
530 return d->isCurrentAppInstalled;
540 return d->canCreateDrives;
556 about->setEtag(
map.value(QStringLiteral(
"etag")).
toString());
557 about->d->selfLink =
map.value(QStringLiteral(
"selfLink")).toUrl();
558 about->d->name =
map.value(QStringLiteral(
"name")).toString();
559 about->d->quotaBytesTotal =
map.value(QStringLiteral(
"quotaBytesTotal")).toLongLong();
560 about->d->quotaBytesUsed =
map.value(QStringLiteral(
"quotaBytesUsed")).toLongLong();
561 about->d->quotaBytesUsedInTrash =
map.value(QStringLiteral(
"quotaBytesUsedInTrash")).toLongLong();
562 about->d->quotaBytesUsedAggregate =
map.value(QStringLiteral(
"quotaBytesUsedAggregate")).toLongLong();
563 about->d->largestChangeId =
map.value(QStringLiteral(
"largestChangeId")).toLongLong();
564 about->d->remainingChangeIds =
map.value(QStringLiteral(
"remainingChangeIds")).toLongLong();
565 about->d->rootFolderId =
map.value(QStringLiteral(
"rootFolderId")).toString();
566 about->d->domainSharingPolicy =
map.value(QStringLiteral(
"domainSharingPolicy")).toString();
567 about->d->permissionId =
map.value(QStringLiteral(
"permissionId")).toString();
568 about->d->isCurrentAppInstalled =
map.value(QStringLiteral(
"isCurrentAppInstalled")).toBool();
569 about->d->canCreateDrives =
map.value(QStringLiteral(
"canCreateDrives")).toBool();
571 const QVariantList
importFormats =
map.value(QStringLiteral(
"importFormats")).toList();
573 const QVariantMap importFormat = v.toMap();
574 FormatPtr format(
new Format());
575 format->d->source = importFormat.value(QStringLiteral(
"source")).toString();
576 format->d->targets = importFormat.value(QStringLiteral(
"targets")).toStringList();
578 about->d->importFormats << format;
581 const QVariantList
exportFormats =
map.value(QStringLiteral(
"exportFormats")).toList();
583 const QVariantMap exportFormat = v.toMap();
584 FormatPtr format(
new Format());
585 format->d->source = exportFormat.value(QStringLiteral(
"source")).toString();
586 format->d->targets = exportFormat.value(QStringLiteral(
"targets")).toStringList();
588 about->d->exportFormats << format;
591 const QVariantList additionalRoleInfos =
map.value(QStringLiteral(
"additionalRoleInfo")).toList();
592 for (
const QVariant &v : additionalRoleInfos) {
594 AdditionalRoleInfoPtr info(
new AdditionalRoleInfo());
598 for (
const QVariant &vv : roleSets) {
599 const QVariantMap roleSetData = vv.toMap();
600 AdditionalRoleInfo::RoleSetPtr roleSet(
new AdditionalRoleInfo::RoleSet());
601 roleSet->d->primaryRole = roleSetData.value(QStringLiteral(
"primaryRole")).toString();
602 roleSet->d->additionalRoles = roleSetData.value(QStringLiteral(
"additionalRoles")).toStringList();
604 info->d->roleSets << roleSet;
607 about->d->additionalRoleInfo << info;
610 const QVariantList
features =
map.value(QStringLiteral(
"features")).toList();
612 const QVariantMap featureData = v.toMap();
613 FeaturePtr feature(
new Feature());
614 feature->d->featureName = featureData.value(QStringLiteral(
"featureName")).toString();
615 feature->d->featureRate = featureData.value(QStringLiteral(
"featureRate")).toReal();
617 about->d->features << feature;
620 const QVariantList
maxUploadSizes =
map.value(QStringLiteral(
"maxUploadSizes")).toList();
622 const QVariantMap maxUploadSizeData = v.toMap();
623 MaxUploadSizePtr maxUploadSize(
new MaxUploadSize());
624 maxUploadSize->d->type = maxUploadSizeData.value(QStringLiteral(
"type")).toString();
625 maxUploadSize->d->size = maxUploadSizeData.value(QStringLiteral(
"size")).toLongLong();
627 about->d->maxUploadSizes << maxUploadSize;
630 about->d->user = User::fromJSON(
map.value(QStringLiteral(
"user")).
toMap());
DriveAbout::AdditionalRoleInfo::Role holds the structure used for additionalRoleInfo[]....
QStringList additionalRoles() const
Returns the supported additional roles with the primary role.
QString primaryRole() const
Returns the primary permission role.
DriveAbout::AdditionalRoleInfo holds the structure used for additionalRoleInfo[] property.
QString type() const
Returns the content type that this additional role info applies to.
RoleSetsList roleSets() const
Returns the supported additional roles per primary role.
DriveAbout::Feature holds the structure used for features[] property.
qreal featureRate() const
Returns the request limit rate for this feature, in queries per second.
QString featureName() const
Returns the name of the feature.
DriveAbout::MaxUploadSize holds the structure used for maxUploadSizes[] property.
qlonglong size() const
Returns the max upload size for this type.
QString type() const
Returns the file type.
DriveAbout contains information about the current user along with Google Drive API settings.
QString domainSharingPolicy() const
Returns the domain sharing policy for the current user.
KGAPIDRIVE_DEPRECATED qlonglong quotaBytesUserAggregate() const
returns the total number of quota bytes used by all Google apps (Drive, Picasa, etc....
FeaturesList features() const
Returns the list of additional features enabled on this account.
MaxUploadSizesList maxUploadSizes() const
Returns the list of max upload sizes for each file type.
FormatsList importFormats() const
Returns the allowable import formats.
qlonglong largestChangeId() const
Returns the largest change id.
static AboutPtr fromJSON(const QByteArray &jsonData)
Constructs a new DriveAbout object from given JSON data.
qlonglong remainingChangeIds() const
Returns the number of remaining change ids.
QString name() const
Returns the name of the current user.
qlonglong quotaBytesUsedAggregate() const
returns the total number of quota bytes used by all Google apps (Drive, Picasa, etc....
UserPtr user() const
Returns the authenticated user.
qlonglong quotaBytesTotal() const
Returns the total number of quota bytes.
AdditionalRoleInfosList additionalRoleInfo() const
Returns information about supported additional roles per file type.
qlonglong quotaBytesUsed() const
Returns the total number of quota bytes used.
QString rootFolderId() const
Returns the id of the root folder.
bool isCurrentAppInstalled() const
Returns whether the authenticated app is installed by the authenticated user.
QUrl selfLink() const
Returns the link back to this item.
bool canCreateDrives() const
Returns whether the user can create shared drives.
FormatsList exportFormats() const
Returns the allowable export formats.
QString permissionId() const
Returns the current user's ID as visible in the permissions collection.
qlonglong quotaBytesUsedInTrash() const
Returns the total number of quota bytes used by trashed items.
Base class for all objects.
Type type(const QSqlDatabase &db)
char * toString(const EngineQuery &query)
const QVariantMap toMap(const MODEL &model)
A job to fetch a single map tile described by a StaticMapUrl.
QJsonDocument fromJson(const QByteArray &json, QJsonParseError *error)
bool isNull() const const
QVariant toVariant() const const
T value(qsizetype i) const const
QFuture< void > map(Iterator begin, Iterator end, MapFunctor &&function)
QMap< QString, QVariant > toMap() const const