File indexing completed on 2024-05-12 05:22:30

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 SIP address. Session Initial Protocol addresses are used for VoIP
0029  * communications to make voice or video calls over the internet.
0030  *
0031  * @see https://developers.google.com/people/api/rest/v1/people#sipaddress
0032  * @since 5.23.0
0033  **/
0034 class KGAPIPEOPLE_EXPORT SipAddress
0035 {
0036 public:
0037     /** Constructs a new SipAddress **/
0038     explicit SipAddress();
0039     SipAddress(const SipAddress &);
0040     SipAddress(SipAddress &&) noexcept;
0041     SipAddress &operator=(const SipAddress &);
0042     SipAddress &operator=(SipAddress &&) noexcept;
0043     /** Destructor. **/
0044     ~SipAddress();
0045 
0046     bool operator==(const SipAddress &) const;
0047     bool operator!=(const SipAddress &) const;
0048 
0049     [[nodiscard]] static SipAddress fromJSON(const QJsonObject &);
0050     [[nodiscard]] static QList<SipAddress> fromJSONArray(const QJsonArray &data);
0051     [[nodiscard]] QJsonValue toJSON() const;
0052 
0053     /** The SIP address in the [RFC 3261 19.1](https://tools.ietf.org/html/rfc3261#section-19.1) SIP URI format. **/
0054     [[nodiscard]] QString value() const;
0055     /** Sets value of the value property. **/
0056     void setValue(const QString &value);
0057 
0058     /** Metadata about the SIP address. **/
0059     [[nodiscard]] FieldMetadata metadata() const;
0060     /** Sets value of the metadata property. **/
0061     void setMetadata(const FieldMetadata &value);
0062 
0063     /** The type of the SIP address. The type can be custom or or one of these predefined values: * `home` * `work` * `mobile` * `other` **/
0064     [[nodiscard]] QString type() const;
0065     /** Sets value of the type property. **/
0066     void setType(const QString &value);
0067 
0068     /** Output only. The type of the SIP address translated and formatted in the viewer's account locale or the `Accept-Language` HTTP header locale. **/
0069     [[nodiscard]] QString formattedType() const;
0070 
0071 private:
0072     class Private;
0073     QSharedDataPointer<Private> d;
0074 }; // SipAddress
0075 
0076 } // namespace KGAPI2::People