Kgapi

url.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 associated URLs.
29 *
30 * @see https://developers.google.com/people/api/rest/v1/people#url
31 * @since 5.23.0
32 **/
33class KGAPIPEOPLE_EXPORT Url
34{
35public:
36 /** Constructs a new Url **/
37 explicit Url();
38 Url(const Url &);
39 Url(Url &&) noexcept;
40 Url &operator=(const Url &);
41 Url &operator=(Url &&) noexcept;
42 /** Destructor. **/
44
45 bool operator==(const Url &) const;
46 bool operator!=(const Url &) const;
47
48 [[nodiscard]] static Url fromJSON(const QJsonObject &);
49 [[nodiscard]] static QList<Url> fromJSONArray(const QJsonArray &data);
50 [[nodiscard]] QJsonValue toJSON() const;
51
52 /** The URL. **/
53 [[nodiscard]] QString value() const;
54 /** Sets value of the value property. **/
55 void setValue(const QString &value);
56
57 /**
58 * The type of the URL. The type can be custom or one of these predefined values:
59 * * `home`
60 * * `work`
61 * * `blog`
62 * * `profile`
63 * * `homePage`
64 * * `ftp`
65 * * `reservations`
66 * * `appInstallPage`: website for a Currents application.
67 * * `other`
68 **/
69 [[nodiscard]] QString type() const;
70 /** Sets value of the type property. **/
71 void setType(const QString &value);
72
73 /** Metadata about the URL. **/
74 [[nodiscard]] FieldMetadata metadata() const;
75 /** Sets value of the metadata property. **/
76 void setMetadata(const FieldMetadata &value);
77
78 /** Output only. The type of the URL translated and formatted in the viewer's account locale or the `Accept-Language` HTTP header locale. **/
79 [[nodiscard]] QString formattedType() const;
80
81private:
82 class Private;
84}; // Url
85
86} // namespace KGAPI2::People
Metadata about a field.
A person's associated URLs.
Definition url.h:34
~Url()
Destructor.
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Dec 20 2024 11:59:24 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.