Kgapi

clientdata.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 <QString>
16
17#include <optional>
18
19class QJsonObject;
20class QJsonValue;
21class QJsonArray;
22
23namespace KGAPI2::People
24{
25class FieldMetadata;
26
27/**
28 * Arbitrary client data that is populated by clients. Duplicate keys and values
29 * are allowed.
30 *
31 * @see https://developers.google.com/people/api/rest/v1/people#clientdata
32 * @since 5.23.0
33 **/
34class KGAPIPEOPLE_EXPORT ClientData
35{
36public:
37 /** Constructs a new ClientData **/
38 explicit ClientData();
39 ClientData(const ClientData &);
40 ClientData(ClientData &&) noexcept;
41 ClientData &operator=(const ClientData &);
42 ClientData &operator=(ClientData &&) noexcept;
43 /** Destructor. **/
45
46 bool operator==(const ClientData &) const;
47 bool operator!=(const ClientData &) const;
48
49 [[nodiscard]] static ClientData fromJSON(const QJsonObject &obj);
50 [[nodiscard]] static QList<ClientData> fromJSONArray(const QJsonArray &data);
51 [[nodiscard]] QJsonValue toJSON() const;
52
53 /** Metadata about the client data. **/
54 [[nodiscard]] FieldMetadata metadata() const;
55 /** Sets value of the metadata property. **/
56 void setMetadata(const FieldMetadata &value);
57
58 /** The client specified key of the client data. **/
59 [[nodiscard]] QString key() const;
60 /** Sets value of the key property. **/
61 void setKey(const QString &value);
62
63 /** The client specified value of the client data. **/
64 [[nodiscard]] QString value() const;
65 /** Sets value of the value property. **/
66 void setValue(const QString &value);
67
68private:
69 class Private;
71}; // ClientData
72
73} // namespace KGAPI2::People
Arbitrary client data that is populated by clients.
Definition clientdata.h:35
Metadata about a field.
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 4 2024 16:36:13 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.