Kgapi

people/location.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 * A person's location.
29 *
30 * @see https://developers.google.com/people/api/rest/v1/people#location
31 * @since 5.23.0
32 **/
33class KGAPIPEOPLE_EXPORT Location
34{
35public:
36 /** Constructs a new Location **/
37 explicit Location();
38 Location(const Location &);
39 Location(Location &&) noexcept;
40 Location &operator=(const Location &);
41 Location &operator=(Location &&) noexcept;
42 /** Destructor. **/
44
45 bool operator==(const Location &) const;
46 bool operator!=(const Location &) const;
47
48 [[nodiscard]] static Location fromJSON(const QJsonObject &);
49 [[nodiscard]] static QList<Location> fromJSONArray(const QJsonArray &data);
50 [[nodiscard]] QJsonValue toJSON() const;
51
52 /** The individual desk location. **/
53 [[nodiscard]] QString deskCode() const;
54 /** Sets value of the deskCode property. **/
55 void setDeskCode(const QString &value);
56
57 /** The floor name or number. **/
58 [[nodiscard]] QString floor() const;
59 /** Sets value of the floor property. **/
60 void setFloor(const QString &value);
61
62 /** The building identifier. **/
63 [[nodiscard]] QString buildingId() const;
64 /** Sets value of the buildingId property. **/
65 void setBuildingId(const QString &value);
66
67 /** The type of the location. The type can be custom or one of these predefined values: * `desk` * `grewUp` **/
68 [[nodiscard]] QString type() const;
69 /** Sets value of the type property. **/
70 void setType(const QString &value);
71
72 /** Whether the location is the current location. **/
73 [[nodiscard]] bool current() const;
74 /** Sets value of the current property. **/
75 void setCurrent(bool value);
76
77 /** The free-form value of the location. **/
78 [[nodiscard]] QString value() const;
79 /** Sets value of the value property. **/
80 void setValue(const QString &value);
81
82 /** Metadata about the location. **/
83 [[nodiscard]] FieldMetadata metadata() const;
84 /** Sets value of the metadata property. **/
85 void setMetadata(const FieldMetadata &value);
86
87 /** The floor section in `floor_name`. **/
88 [[nodiscard]] QString floorSection() const;
89 /** Sets value of the floorSection property. **/
90 void setFloorSection(const QString &value);
91
92private:
93 class Private;
95}; // Location
96
97} // namespace KGAPI2::People
Metadata about a field.
A person's location.
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 4 2024 16:36:13 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.