Kgapi

fieldmetadata.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#include "source.h"
15
16#include <optional>
17
18class QJsonObject;
19class QJsonValue;
20
21namespace KGAPI2::People
22{
23/**
24 * Metadata about a field.
25 *
26 * @see https://developers.google.com/people/api/rest/v1/people#fieldmetadata
27 * @since 5.23.0
28 **/
29class KGAPIPEOPLE_EXPORT FieldMetadata
30{
31public:
32 /** Constructs a new FieldMetadata **/
33 explicit FieldMetadata();
35 FieldMetadata(FieldMetadata &&) noexcept;
36 FieldMetadata &operator=(const FieldMetadata &);
37 FieldMetadata &operator=(FieldMetadata &&) noexcept;
38 /** Destructor. **/
40
41 bool operator==(const FieldMetadata &) const;
42 bool operator!=(const FieldMetadata &) const;
43
44 [[nodiscard]] static FieldMetadata fromJSON(const QJsonObject &);
45 [[nodiscard]] QJsonValue toJSON() const;
46
47 /** The source of the field. **/
48 [[nodiscard]] Source source() const;
49 /** Sets value of the source property. **/
50 void setSource(const Source &value);
51
52 /** True if the field is the primary field for the source. Each source must have at most one field with `source_primary` set to true. **/
53 [[nodiscard]] bool sourcePrimary() const;
54 /** Sets value of the sourcePrimary property. **/
55 void setSourcePrimary(bool value);
56
57 /** Output only. True if the field is the primary field for all sources in the person. Each person will have at most one field with `primary` set to true.
58 * **/
59 [[nodiscard]] bool primary() const;
60
61 /** Output only. True if the field is verified; false if the field is unverified. A verified field is typically a name, email address, phone number, or
62 * website that has been confirmed to be owned by the person. **/
63 [[nodiscard]] bool verified() const;
64
65private:
66 class Private;
68}; // FieldMetadata
69
70} // namespace KGAPI2::People
Metadata about a field.
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 Fri Nov 29 2024 11:54:35 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.