Kgapi

sipaddress.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 SIP address. Session Initial Protocol addresses are used for VoIP
29 * communications to make voice or video calls over the internet.
30 *
31 * @see https://developers.google.com/people/api/rest/v1/people#sipaddress
32 * @since 5.23.0
33 **/
34class KGAPIPEOPLE_EXPORT SipAddress
35{
36public:
37 /** Constructs a new SipAddress **/
38 explicit SipAddress();
39 SipAddress(const SipAddress &);
40 SipAddress(SipAddress &&) noexcept;
41 SipAddress &operator=(const SipAddress &);
42 SipAddress &operator=(SipAddress &&) noexcept;
43 /** Destructor. **/
45
46 bool operator==(const SipAddress &) const;
47 bool operator!=(const SipAddress &) const;
48
49 [[nodiscard]] static SipAddress fromJSON(const QJsonObject &);
50 [[nodiscard]] static QList<SipAddress> fromJSONArray(const QJsonArray &data);
51 [[nodiscard]] QJsonValue toJSON() const;
52
53 /** The SIP address in the [RFC 3261 19.1](https://tools.ietf.org/html/rfc3261#section-19.1) SIP URI format. **/
54 [[nodiscard]] QString value() const;
55 /** Sets value of the value property. **/
56 void setValue(const QString &value);
57
58 /** Metadata about the SIP address. **/
59 [[nodiscard]] FieldMetadata metadata() const;
60 /** Sets value of the metadata property. **/
61 void setMetadata(const FieldMetadata &value);
62
63 /** The type of the SIP address. The type can be custom or or one of these predefined values: * `home` * `work` * `mobile` * `other` **/
64 [[nodiscard]] QString type() const;
65 /** Sets value of the type property. **/
66 void setType(const QString &value);
67
68 /** Output only. The type of the SIP address translated and formatted in the viewer's account locale or the `Accept-Language` HTTP header locale. **/
69 [[nodiscard]] QString formattedType() const;
70
71private:
72 class Private;
74}; // SipAddress
75
76} // namespace KGAPI2::People
Metadata about a field.
A person's SIP address.
Definition sipaddress.h:35
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri May 3 2024 11:50:41 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.