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

0001 /*
0002  * SPDX-FileCopyrightText: 2021 Daniel Vrátil <dvratil@kde.org>
0003  *
0004  * SPDX-License-Identifier: LGPL-2.1-only
0005  * SPDX-License-Identifier: LGPL-3.0-only
0006  * SPDX-License-Identifier: LicenseRef-KDE-Accepted-LGPL
0007  */
0008 
0009 #pragma once
0010 
0011 #include <QSharedDataPointer>
0012 #include "kgapipeople_export.h"
0013 
0014 #include <QString>
0015 
0016 #include <optional>
0017 
0018 class QJsonObject;
0019 class QJsonValue;
0020 
0021 namespace KGAPI2::People
0022 {
0023 class FieldMetadata;
0024 
0025 /**
0026  * **DEPRECATED**: Please use `person.locations` instead. A person's past or
0027  * current residence.
0028  *
0029  * @see https://developers.google.com/people/api/rest/v1/people#residence
0030  * @since 5.23.0
0031  **/
0032 class KGAPIPEOPLE_EXPORT Residence
0033 {
0034 public:
0035     /** Constructs a new Residence **/
0036     explicit Residence();
0037     Residence(const Residence &);
0038     Residence(Residence &&) noexcept;
0039     Residence &operator=(const Residence &);
0040     Residence &operator=(Residence &&) noexcept;
0041     /** Destructor. **/
0042     ~Residence();
0043 
0044     bool operator==(const Residence &) const;
0045     bool operator!=(const Residence &) const;
0046 
0047     [[nodiscard]] static Residence fromJSON(const QJsonObject &);
0048     [[nodiscard]] QJsonValue toJSON() const;
0049 
0050     /** The address of the residence. **/
0051     [[nodiscard]] QString value() const;
0052     /** Sets value of the value property. **/
0053     void setValue(const QString &value);
0054 
0055     /** Metadata about the residence. **/
0056     [[nodiscard]] FieldMetadata metadata() const;
0057     /** Sets value of the metadata property. **/
0058     void setMetadata(const FieldMetadata &value);
0059 
0060     /** True if the residence is the person's current residence; false if the residence is a past residence. **/
0061     [[nodiscard]] bool current() const;
0062     /** Sets value of the current property. **/
0063     void setCurrent(bool value);
0064 
0065 private:
0066     class Private;
0067     QSharedDataPointer<Private> d;
0068 }; // Residence
0069 
0070 } // namespace KGAPI2::People