File indexing completed on 2024-05-12 05:22:30
0001 /* 0002 * SPDX-FileCopyrightText: 2021 Daniel Vrátil <dvratil@kde.org> 0003 * SPDX-FileCopyrightText: 2022 Claudio Cambra <claudio.cambra@kde.org> 0004 * 0005 * SPDX-License-Identifier: LGPL-2.1-only 0006 * SPDX-License-Identifier: LGPL-3.0-only 0007 * SPDX-License-Identifier: LicenseRef-KDE-Accepted-LGPL 0008 */ 0009 0010 #pragma once 0011 0012 #include <QSharedDataPointer> 0013 #include "kgapipeople_export.h" 0014 0015 #include <QList> 0016 0017 #include <optional> 0018 0019 class QJsonObject; 0020 class QJsonValue; 0021 0022 namespace KGAPI2::People 0023 { 0024 /** 0025 * The metadata about a profile. 0026 * 0027 * @see https://developers.google.com/people/api/rest/v1/people#profilemetadata 0028 * @since 5.23.0 0029 **/ 0030 class KGAPIPEOPLE_EXPORT ProfileMetadata 0031 { 0032 public: 0033 enum class UserTypes { 0034 USER_TYPE_UNKNOWN, ///< The user type is not known. 0035 GOOGLE_USER, ///< The user is a Google user. 0036 GPLUS_USER, ///< The user is a Currents user. 0037 GOOGLE_APPS_USER, ///< The user is a Google Workspace user. 0038 }; 0039 enum class ObjectType { 0040 OBJECT_TYPE_UNSPECIFIED, ///< Unspecified. 0041 PERSON, ///< Person. 0042 PAGE, ///< [Currents Page.](https://workspace.google.com/products/currents/) 0043 }; 0044 0045 /** Constructs a new ProfileMetadata **/ 0046 explicit ProfileMetadata(); 0047 ProfileMetadata(const ProfileMetadata &); 0048 ProfileMetadata(ProfileMetadata &&) noexcept; 0049 ProfileMetadata &operator=(const ProfileMetadata &); 0050 ProfileMetadata &operator=(ProfileMetadata &&) noexcept; 0051 /** Destructor. **/ 0052 ~ProfileMetadata(); 0053 0054 bool operator==(const ProfileMetadata &) const; 0055 bool operator!=(const ProfileMetadata &) const; 0056 0057 [[nodiscard]] static ProfileMetadata fromJSON(const QJsonObject &); 0058 [[nodiscard]] QJsonValue toJSON() const; 0059 0060 /** Output only. The user types. **/ 0061 [[nodiscard]] QList<ProfileMetadata::UserTypes> userTypes() const; 0062 0063 /** Output only. The profile object type. **/ 0064 [[nodiscard]] ProfileMetadata::ObjectType objectType() const; 0065 0066 private: 0067 class Private; 0068 QSharedDataPointer<Private> d; 0069 }; // ProfileMetadata 0070 0071 } // namespace KGAPI2::People