Kgapi

people/event.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 <QDate>
16#include <QString>
17
18#include <optional>
19
20class QJsonObject;
21class QJsonValue;
22class QJsonArray;
23
24namespace KGAPI2::People
25{
26class FieldMetadata;
27
28/**
29 * An event related to the person.
30 *
31 * @see https://developers.google.com/people/api/rest/v1/people#event
32 * @since 5.23.0
33 **/
34class KGAPIPEOPLE_EXPORT Event
35{
36public:
37 /** Constructs a new Event **/
38 explicit Event();
39 Event(const Event &);
40 Event(Event &&) noexcept;
41 Event &operator=(const Event &);
42 Event &operator=(Event &&) noexcept;
43 /** Destructor. **/
45
46 bool operator==(const Event &) const;
47 bool operator!=(const Event &) const;
48
49 [[nodiscard]] static Event fromJSON(const QJsonObject &obj);
50 [[nodiscard]] static QList<Event> fromJSONArray(const QJsonArray &data);
51 [[nodiscard]] QJsonValue toJSON() const;
52
53 /** Metadata about the event. **/
54 [[nodiscard]] FieldMetadata metadata() const;
55 /** Sets value of the metadata property. **/
56 void setMetadata(const FieldMetadata &value);
57
58 /** The date of the event. **/
59 [[nodiscard]] QDate date() const;
60 /** Sets value of the date property. **/
61 void setDate(const QDate &value);
62
63 /** The type of the event. The type can be custom or one of these predefined values: * `anniversary` * `other` **/
64 [[nodiscard]] QString type() const;
65 /** Sets value of the type property. **/
66 void setType(const QString &value);
67
68 /** Output only. The type of the event translated and formatted in the viewer's account locale or the `Accept-Language` HTTP header locale. **/
69 [[nodiscard]] QString formattedType() const;
70
71private:
72 class Private;
74}; // Event
75
76} // namespace KGAPI2::People
An event related to the person.
Metadata about a field.
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.