Kgapi

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

KDE's Doxygen guidelines are available online.