Kgapi

source.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;
21
22namespace KGAPI2::People
23{
24class ProfileMetadata;
25
26/**
27 * The source of a field.
28 *
29 * @see https://developers.google.com/people/api/rest/v1/people#source
30 * @since 5.23.0
31 **/
32class KGAPIPEOPLE_EXPORT Source
33{
34public:
35 enum class Type {
36 SOURCE_TYPE_UNSPECIFIED, ///< Unspecified.
37 ACCOUNT, ///< [Google Account](https://accounts.google.com).
38 PROFILE, ///< [Google profile](https://profiles.google.com). You can view the profile at
39 ///< [https://profiles.google.com/](https://profiles.google.com/){id}, where {id} is the source id.
40 DOMAIN_PROFILE, ///< [Google Workspace domain profile](https://support.google.com/a/answer/1628008).
41 CONTACT, ///< [Google contact](https://contacts.google.com). You can view the contact at [https://contact.google.com/](https://contact.google.com/){id},
42 ///< where {id} is the source id.
43 OTHER_CONTACT, ///< [Google "Other contact"](https://contacts.google.com/other).
44 DOMAIN_CONTACT, ///< [Google Workspace domain shared contact](https://support.google.com/a/answer/9281635).
45 };
46
47 /** Constructs a new Source **/
48 explicit Source();
49 Source(const Source &);
50 Source(Source &&) noexcept;
51 Source &operator=(const Source &);
52 Source &operator=(Source &&) noexcept;
53 /** Destructor. **/
55
56 bool operator==(const Source &) const;
57 bool operator!=(const Source &) const;
58
59 [[nodiscard]] static Source fromJSON(const QJsonObject &);
60 [[nodiscard]] QJsonValue toJSON() const;
61
62 /** **Only populated in `person.metadata.sources`.** The [HTTP entity tag](https://en.wikipedia.org/wiki/HTTP_ETag) of the source. Used for web cache
63 * validation. **/
64 [[nodiscard]] QString etag() const;
65 /** Sets value of the etag property. **/
66 void setEtag(const QString &value);
67
68 /** Output only. **Only populated in `person.metadata.sources`.** Metadata about a source of type PROFILE. **/
69 [[nodiscard]] ProfileMetadata profileMetadata() const;
70
71 /** The unique identifier within the source type generated by the server. **/
72 [[nodiscard]] QString id() const;
73 /** Sets value of the id property. **/
74 void setId(const QString &value);
75
76 /** Output only. **Only populated in `person.metadata.sources`.** Last update timestamp of this source. **/
77 [[nodiscard]] QString updateTime() const;
78
79 /** The source type. **/
80 [[nodiscard]] Source::Type type() const;
81 /** Sets value of the type property. **/
82 void setType(Source::Type value);
83
84private:
85 class Private;
86 QSharedDataPointer<Private> d;
87}; // Source
88
89} // namespace KGAPI2::People
The metadata about a profile.
The source of a field.
Definition source.h:33
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 4 2024 16:36:14 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.