File indexing completed on 2024-05-12 05:22:27
0001 /* 0002 * SPDX-FileCopyrightText: 2021 Daniel Vrátil <dvratil@kde.org> 0003 * SPDX-FileCopyrightText: 2022 Claudio Cambra <claudio.cambra@kde.org> 0004 * 0005 * SPDX-License-Identifier: LGPL-2.1-only 0006 * SPDX-License-Identifier: LGPL-3.0-only 0007 * SPDX-License-Identifier: LicenseRef-KDE-Accepted-LGPL 0008 */ 0009 0010 #pragma once 0011 0012 #include <QSharedDataPointer> 0013 #include "kgapipeople_export.h" 0014 0015 #include <QString> 0016 0017 #include <optional> 0018 0019 class QJsonObject; 0020 class QJsonValue; 0021 class QJsonArray; 0022 0023 namespace KGAPI2::People 0024 { 0025 class FieldMetadata; 0026 0027 /** 0028 * A person's location. 0029 * 0030 * @see https://developers.google.com/people/api/rest/v1/people#location 0031 * @since 5.23.0 0032 **/ 0033 class KGAPIPEOPLE_EXPORT Location 0034 { 0035 public: 0036 /** Constructs a new Location **/ 0037 explicit Location(); 0038 Location(const Location &); 0039 Location(Location &&) noexcept; 0040 Location &operator=(const Location &); 0041 Location &operator=(Location &&) noexcept; 0042 /** Destructor. **/ 0043 ~Location(); 0044 0045 bool operator==(const Location &) const; 0046 bool operator!=(const Location &) const; 0047 0048 [[nodiscard]] static Location fromJSON(const QJsonObject &); 0049 [[nodiscard]] static QList<Location> fromJSONArray(const QJsonArray &data); 0050 [[nodiscard]] QJsonValue toJSON() const; 0051 0052 /** The individual desk location. **/ 0053 [[nodiscard]] QString deskCode() const; 0054 /** Sets value of the deskCode property. **/ 0055 void setDeskCode(const QString &value); 0056 0057 /** The floor name or number. **/ 0058 [[nodiscard]] QString floor() const; 0059 /** Sets value of the floor property. **/ 0060 void setFloor(const QString &value); 0061 0062 /** The building identifier. **/ 0063 [[nodiscard]] QString buildingId() const; 0064 /** Sets value of the buildingId property. **/ 0065 void setBuildingId(const QString &value); 0066 0067 /** The type of the location. The type can be custom or one of these predefined values: * `desk` * `grewUp` **/ 0068 [[nodiscard]] QString type() const; 0069 /** Sets value of the type property. **/ 0070 void setType(const QString &value); 0071 0072 /** Whether the location is the current location. **/ 0073 [[nodiscard]] bool current() const; 0074 /** Sets value of the current property. **/ 0075 void setCurrent(bool value); 0076 0077 /** The free-form value of the location. **/ 0078 [[nodiscard]] QString value() const; 0079 /** Sets value of the value property. **/ 0080 void setValue(const QString &value); 0081 0082 /** Metadata about the location. **/ 0083 [[nodiscard]] FieldMetadata metadata() const; 0084 /** Sets value of the metadata property. **/ 0085 void setMetadata(const FieldMetadata &value); 0086 0087 /** The floor section in `floor_name`. **/ 0088 [[nodiscard]] QString floorSection() const; 0089 /** Sets value of the floorSection property. **/ 0090 void setFloorSection(const QString &value); 0091 0092 private: 0093 class Private; 0094 QSharedDataPointer<Private> d; 0095 }; // Location 0096 0097 } // namespace KGAPI2::People