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**: No data will be returned A person's relationship status.
0027  *
0028  * @see https://developers.google.com/people/api/rest/v1/people#relationshipstatus
0029  * @since 5.23.0
0030  **/
0031 class KGAPIPEOPLE_EXPORT RelationshipStatus
0032 {
0033 public:
0034     /** Constructs a new RelationshipStatus **/
0035     explicit RelationshipStatus();
0036     RelationshipStatus(const RelationshipStatus &);
0037     RelationshipStatus(RelationshipStatus &&) noexcept;
0038     RelationshipStatus &operator=(const RelationshipStatus &);
0039     RelationshipStatus &operator=(RelationshipStatus &&) noexcept;
0040     /** Destructor. **/
0041     ~RelationshipStatus();
0042 
0043     bool operator==(const RelationshipStatus &) const;
0044     bool operator!=(const RelationshipStatus &) const;
0045 
0046     [[nodiscard]] static RelationshipStatus fromJSON(const QJsonObject &);
0047     [[nodiscard]] QJsonValue toJSON() const;
0048 
0049     /** The relationship status. The value can be custom or one of these predefined values: * `single` * `inARelationship` * `engaged` * `married` *
0050      * `itsComplicated` * `openRelationship` * `widowed` * `inDomesticPartnership` * `inCivilUnion` **/
0051     [[nodiscard]] QString value() const;
0052     /** Sets value of the value property. **/
0053     void setValue(const QString &value);
0054 
0055     /** Output only. The value of the relationship status translated and formatted in the viewer's account locale or the `Accept-Language` HTTP header locale.
0056      * **/
0057     [[nodiscard]] QString formattedValue() const;
0058 
0059     /** Metadata about the relationship status. **/
0060     [[nodiscard]] FieldMetadata metadata() const;
0061     /** Sets value of the metadata property. **/
0062     void setMetadata(const FieldMetadata &value);
0063 
0064 private:
0065     class Private;
0066     QSharedDataPointer<Private> d;
0067 }; // RelationshipStatus
0068 
0069 } // namespace KGAPI2::People