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

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 
0022 namespace KGAPI2::People
0023 {
0024 
0025 /**
0026  * A Google contact group membership.
0027  *
0028  * @see https://developers.google.com/people/api/rest/v1/people#contactgroupmembership
0029  * @since 5.23.0
0030  **/
0031 class KGAPIPEOPLE_EXPORT ContactGroupMembership
0032 {
0033 public:
0034     /** Constructs a new ContactGroupMembership **/
0035     explicit ContactGroupMembership();
0036     ContactGroupMembership(const ContactGroupMembership &);
0037     ContactGroupMembership(ContactGroupMembership &&) noexcept;
0038     ContactGroupMembership &operator=(const ContactGroupMembership &);
0039     ContactGroupMembership &operator=(ContactGroupMembership &&) noexcept;
0040     /** Destructor. **/
0041     ~ContactGroupMembership();
0042 
0043     bool operator==(const ContactGroupMembership &) const;
0044     bool operator!=(const ContactGroupMembership &) const;
0045 
0046     static ContactGroupMembership fromJSON(const QJsonObject &);
0047     QJsonValue toJSON() const;
0048 
0049     /** The resource name for the contact group, assigned by the server. An ASCII string, in the form of `contactGroups/{contact_group_id}`. Only
0050      * contact_group_resource_name can be used for modifying memberships. Any contact group membership can be removed, but only user group or "myContacts" or
0051      * "starred" system groups memberships can be added. A contact must always have at least one contact group membership. **/
0052     QString contactGroupResourceName() const;
0053     /** Sets value of the contactGroupResourceName property. **/
0054     void setContactGroupResourceName(const QString &value);
0055 
0056     /** Output only. The contact group ID for the contact group membership. **/
0057     QString contactGroupId() const;
0058 
0059 private:
0060     class Private;
0061     QSharedDataPointer<Private> d;
0062 }; // ContactGroupMembership
0063 
0064 } // namespace KGAPI2::People