Kgapi

profilemetadata.h
1/*
2 * SPDX-FileCopyrightText: 2021 Daniel Vrátil <dvratil@kde.org>
3 * SPDX-FileCopyrightText: 2022 Claudio Cambra <claudio.cambra@kde.org>
4 *
5 * SPDX-License-Identifier: LGPL-2.1-only
6 * SPDX-License-Identifier: LGPL-3.0-only
7 * SPDX-License-Identifier: LicenseRef-KDE-Accepted-LGPL
8 */
9
10#pragma once
11
12#include <QSharedDataPointer>
13#include "kgapipeople_export.h"
14
15#include <QList>
16
17#include <optional>
18
19class QJsonObject;
20class QJsonValue;
21
22namespace KGAPI2::People
23{
24/**
25 * The metadata about a profile.
26 *
27 * @see https://developers.google.com/people/api/rest/v1/people#profilemetadata
28 * @since 5.23.0
29 **/
30class KGAPIPEOPLE_EXPORT ProfileMetadata
31{
32public:
33 enum class UserTypes {
34 USER_TYPE_UNKNOWN, ///< The user type is not known.
35 GOOGLE_USER, ///< The user is a Google user.
36 GPLUS_USER, ///< The user is a Currents user.
37 GOOGLE_APPS_USER, ///< The user is a Google Workspace user.
38 };
39 enum class ObjectType {
40 OBJECT_TYPE_UNSPECIFIED, ///< Unspecified.
41 PERSON, ///< Person.
42 PAGE, ///< [Currents Page.](https://workspace.google.com/products/currents/)
43 };
44
45 /** Constructs a new ProfileMetadata **/
46 explicit ProfileMetadata();
49 ProfileMetadata &operator=(const ProfileMetadata &);
50 ProfileMetadata &operator=(ProfileMetadata &&) noexcept;
51 /** Destructor. **/
53
54 bool operator==(const ProfileMetadata &) const;
55 bool operator!=(const ProfileMetadata &) const;
56
57 [[nodiscard]] static ProfileMetadata fromJSON(const QJsonObject &);
58 [[nodiscard]] QJsonValue toJSON() const;
59
60 /** Output only. The user types. **/
61 [[nodiscard]] QList<ProfileMetadata::UserTypes> userTypes() const;
62
63 /** Output only. The profile object type. **/
64 [[nodiscard]] ProfileMetadata::ObjectType objectType() const;
65
66private:
67 class Private;
68 QSharedDataPointer<Private> d;
69}; // ProfileMetadata
70
71} // namespace KGAPI2::People
The metadata about a profile.
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 18 2024 12:17:41 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.