Kgapi

membership.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 <optional>
16
17class QJsonObject;
18class QJsonValue;
19class QJsonArray;
20
21namespace KGAPI2::People
22{
23class ContactGroupMembership;
24class DomainMembership;
25class FieldMetadata;
26struct MembershipDefinition;
27
28/**
29 * A person's membership in a group. Only contact group memberships can be
30 * modified.
31 *
32 * @see https://developers.google.com/people/api/rest/v1/people#membership
33 * @since 5.23.0
34 **/
35class KGAPIPEOPLE_EXPORT Membership
36{
37public:
38 /** Constructs a new Membership **/
39 explicit Membership();
40 Membership(const MembershipDefinition &definition);
41 Membership(const Membership &);
42 Membership(Membership &&) noexcept;
43 Membership &operator=(const Membership &);
44 Membership &operator=(Membership &&) noexcept;
45 /** Destructor. **/
47
48 bool operator==(const Membership &) const;
49 bool operator!=(const Membership &) const;
50
51 [[nodiscard]] static Membership fromJSON(const QJsonObject &obj);
52 [[nodiscard]] static QList<Membership> fromJSONArray(const QJsonArray &data);
53 [[nodiscard]] QJsonValue toJSON() const;
54
55 /** Output only. The domain membership. **/
56 [[nodiscard]] DomainMembership domainMembership() const;
57
58 /** The contact group membership. **/
59 [[nodiscard]] ContactGroupMembership contactGroupMembership() const;
60 /** Sets value of the contactGroupMembership property. **/
61 void setContactGroupMembership(const ContactGroupMembership &value);
62
63 /** Metadata about the membership. **/
64 [[nodiscard]] FieldMetadata metadata() const;
65 /** Sets value of the metadata property. **/
66 void setMetadata(const FieldMetadata &value);
67
68private:
69 class Private;
71}; // Membership
72
73} // namespace KGAPI2::People
A Google contact group membership.
A Google Workspace Domain membership.
Metadata about a field.
A person's membership in a group.
Definition membership.h:36
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 4 2024 16:36:13 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.