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

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 <QString>
0016 
0017 #include <optional>
0018 
0019 class QJsonArray;
0020 class QJsonObject;
0021 class QJsonValue;
0022 
0023 namespace KGAPI2::People
0024 {
0025 /**
0026  * Arbitrary client data that is populated by clients. Duplicate keys and values
0027  * are allowed.
0028  *
0029  * @see https://developers.google.com/people/api/rest/v1/people#groupclientdata
0030  * @since 5.23.0
0031  **/
0032 class KGAPIPEOPLE_EXPORT GroupClientData
0033 {
0034 public:
0035     /** Constructs a new GroupClientData **/
0036     explicit GroupClientData();
0037     GroupClientData(const GroupClientData &);
0038     GroupClientData(GroupClientData &&) noexcept;
0039     GroupClientData &operator=(const GroupClientData &);
0040     GroupClientData &operator=(GroupClientData &&) noexcept;
0041     /** Destructor. **/
0042     ~GroupClientData();
0043 
0044     bool operator==(const GroupClientData &) const;
0045     bool operator!=(const GroupClientData &) const;
0046 
0047     [[nodiscard]] static GroupClientData fromJSON(const QJsonObject &);
0048     [[nodiscard]] static QList<GroupClientData> fromJSONArray(const QJsonArray &data);
0049     [[nodiscard]] QJsonValue toJSON() const;
0050 
0051     /** The client specified key of the client data. **/
0052     [[nodiscard]] QString key() const;
0053     /** Sets value of the key property. **/
0054     void setKey(const QString &value);
0055 
0056     /** The client specified value of the client data. **/
0057     [[nodiscard]] QString value() const;
0058     /** Sets value of the value property. **/
0059     void setValue(const QString &value);
0060 
0061 private:
0062     class Private;
0063     QSharedDataPointer<Private> d;
0064 }; // GroupClientData
0065 
0066 } // namespace KGAPI2::People