Kgapi

address.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 <QJsonArray>
14#include <QJsonObject>
15#include "kgapipeople_export.h"
16
17#include <QString>
18
19#include <optional>
20
21class QJsonValue;
22
23namespace KGAPI2::People
24{
25class FieldMetadata;
26
27/**
28 * A person's physical address. May be a P.O. box or street address. All fields are
29 * optional.
30 *
31 * @see https://developers.google.com/people/api/rest/v1/people#address
32 * @since 5.23.0
33 **/
34class KGAPIPEOPLE_EXPORT Address
35{
36public:
37 /** Constructs a new Address **/
38 explicit Address();
39 Address(const Address &);
40 Address(Address &&) noexcept;
41 Address &operator=(const Address &);
42 Address &operator=(Address &&) noexcept;
43 /** Destructor. **/
45
46 bool operator==(const Address &) const;
47 bool operator!=(const Address &) const;
48
49 [[nodiscard]] static Address fromJSON(const QJsonObject &obj);
50 [[nodiscard]] static QList<Address> fromJSONArray(const QJsonArray &data);
51 [[nodiscard]] QJsonValue toJSON() const;
52
53 /** Output only. The type of the address translated and formatted in the viewer's account locale or the `Accept-Language` HTTP header locale. **/
54 [[nodiscard]] QString formattedType() const;
55
56 /** The city of the address. **/
57 [[nodiscard]] QString city() const;
58 /** Sets value of the city property. **/
59 void setCity(const QString &value);
60
61 /** Metadata about the address. **/
62 [[nodiscard]] FieldMetadata metadata() const;
63 /** Sets value of the metadata property. **/
64 void setMetadata(const FieldMetadata &value);
65
66 /** The [ISO 3166-1 alpha-2](http://www.iso.org/iso/country_codes.htm) country code of the address. **/
67 [[nodiscard]] QString countryCode() const;
68 /** Sets value of the countryCode property. **/
69 void setCountryCode(const QString &value);
70
71 /** The postal code of the address. **/
72 [[nodiscard]] QString postalCode() const;
73 /** Sets value of the postalCode property. **/
74 void setPostalCode(const QString &value);
75
76 /** The P.O. box of the address. **/
77 [[nodiscard]] QString poBox() const;
78 /** Sets value of the poBox property. **/
79 void setPoBox(const QString &value);
80
81 /** The type of the address. The type can be custom or one of these predefined values: * `home` * `work` * `other` **/
82 [[nodiscard]] QString type() const;
83 /** Sets value of the type property. **/
84 void setType(const QString &value);
85
86 /** The unstructured value of the address. If this is not set by the user it will be automatically constructed from structured values. **/
87 [[nodiscard]] QString formattedValue() const;
88 /** Sets value of the formattedValue property. **/
89 void setFormattedValue(const QString &value);
90
91 /** The extended address of the address; for example, the apartment number. **/
92 [[nodiscard]] QString extendedAddress() const;
93 /** Sets value of the extendedAddress property. **/
94 void setExtendedAddress(const QString &value);
95
96 /** The region of the address; for example, the state or province. **/
97 [[nodiscard]] QString region() const;
98 /** Sets value of the region property. **/
99 void setRegion(const QString &value);
100
101 /** The street address. **/
102 [[nodiscard]] QString streetAddress() const;
103 /** Sets value of the streetAddress property. **/
104 void setStreetAddress(const QString &value);
105
106 /** The country of the address. **/
107 [[nodiscard]] QString country() const;
108 /** Sets value of the country property. **/
109 void setCountry(const QString &value);
110
111private:
112 class Private;
114}; // Address
115
116} // namespace KGAPI2::People
A person's physical address.
Definition address.h:35
Metadata about a field.
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 18 2024 12:17:41 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.