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
FieldMetadata()
Constructs a new FieldMetadata.
void setSourcePrimary(bool value)
Sets value of the sourcePrimary property.
bool verified() const
Output only.
void setSource(const Source &value)
Sets value of the source property.
bool sourcePrimary() const
True if the field is the primary field for the source.
bool primary() const
Output only.
Source source() const
The source of the field.
The source of a field.
Definition source.h:33
This file is part of the KDE documentation.
Documentation copyright © 1996-2025 The KDE developers.
Generated on Fri Jan 24 2025 11:57:31 by doxygen 1.13.2 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.