Kgapi

fileas.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 * The name that should be used to sort the person in a list.
29 *
30 * @see https://developers.google.com/people/api/rest/v1/people#fileas
31 * @since 5.23.0
32 **/
33class KGAPIPEOPLE_EXPORT FileAs
34{
35public:
36 /** Constructs a new FileAs **/
37 explicit FileAs();
38 FileAs(const FileAs &);
39 FileAs(FileAs &&) noexcept;
40 FileAs &operator=(const FileAs &);
41 FileAs &operator=(FileAs &&) noexcept;
42 /** Destructor. **/
44
45 bool operator==(const FileAs &) const;
46 bool operator!=(const FileAs &) const;
47
48 [[nodiscard]] static FileAs fromJSON(const QJsonObject &obj);
49 [[nodiscard]] static QList<FileAs> fromJSONArray(const QJsonArray &data);
50 [[nodiscard]] QJsonValue toJSON() const;
51
52 /** Metadata about the file-as. **/
53 [[nodiscard]] FieldMetadata metadata() const;
54 /** Sets value of the metadata property. **/
55 void setMetadata(const FieldMetadata &value);
56
57 /** The file-as value **/
58 [[nodiscard]] QString value() const;
59 /** Sets value of the value property. **/
60 void setValue(const QString &value);
61
62private:
63 class Private;
65}; // FileAs
66
67} // namespace KGAPI2::People
Metadata about a field.
The name that should be used to sort the person in a list.
Definition fileas.h:34
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Sat Dec 21 2024 17:00:12 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.