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

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 <QDate>
0016 #include <QString>
0017 
0018 #include <optional>
0019 
0020 class QJsonObject;
0021 class QJsonValue;
0022 class QJsonArray;
0023 
0024 namespace KGAPI2::People
0025 {
0026 class FieldMetadata;
0027 
0028 /**
0029  * A person's past or current organization. Overlapping date ranges are permitted.
0030  *
0031  * @see https://developers.google.com/people/api/rest/v1/people#organization
0032  * @since 5.23.0
0033  **/
0034 class KGAPIPEOPLE_EXPORT Organization
0035 {
0036 public:
0037     /** Constructs a new Organization **/
0038     explicit Organization();
0039     Organization(const Organization &);
0040     Organization(Organization &&) noexcept;
0041     Organization &operator=(const Organization &);
0042     Organization &operator=(Organization &&) noexcept;
0043     /** Destructor. **/
0044     ~Organization();
0045 
0046     bool operator==(const Organization &) const;
0047     bool operator!=(const Organization &) const;
0048 
0049     [[nodiscard]] static Organization fromJSON(const QJsonObject &);
0050     [[nodiscard]] static QList<Organization> fromJSONArray(const QJsonArray &data);
0051     [[nodiscard]] QJsonValue toJSON() const;
0052 
0053     /** The location of the organization office the person works at. **/
0054     [[nodiscard]] QString location() const;
0055     /** Sets value of the location property. **/
0056     void setLocation(const QString &value);
0057 
0058     /** The person's job title at the organization. **/
0059     [[nodiscard]] QString title() const;
0060     /** Sets value of the title property. **/
0061     void setTitle(const QString &value);
0062 
0063     /** The type of the organization. The type can be custom or one of these predefined values: * `work` * `school` **/
0064     [[nodiscard]] QString type() const;
0065     /** Sets value of the type property. **/
0066     void setType(const QString &value);
0067 
0068     /** Metadata about the organization. **/
0069     [[nodiscard]] FieldMetadata metadata() const;
0070     /** Sets value of the metadata property. **/
0071     void setMetadata(const FieldMetadata &value);
0072 
0073     /** The symbol associated with the organization; for example, a stock ticker symbol, abbreviation, or acronym. **/
0074     [[nodiscard]] QString symbol() const;
0075     /** Sets value of the symbol property. **/
0076     void setSymbol(const QString &value);
0077 
0078     /** Output only. The type of the organization translated and formatted in the viewer's account locale or the `Accept-Language` HTTP header locale. **/
0079     [[nodiscard]] QString formattedType() const;
0080 
0081     /** The name of the organization. **/
0082     [[nodiscard]] QString name() const;
0083     /** Sets value of the name property. **/
0084     void setName(const QString &value);
0085 
0086     /** True if the organization is the person's current organization; false if the organization is a past organization. **/
0087     [[nodiscard]] bool current() const;
0088     /** Sets value of the current property. **/
0089     void setCurrent(bool value);
0090 
0091     [[nodiscard]] bool hasSetCurrent() const;
0092 
0093     /** The person's cost center at the organization. **/
0094     [[nodiscard]] QString costCenter() const;
0095     /** Sets value of the costCenter property. **/
0096     void setCostCenter(const QString &value);
0097 
0098     /** The person's department at the organization. **/
0099     [[nodiscard]] QString department() const;
0100     /** Sets value of the department property. **/
0101     void setDepartment(const QString &value);
0102 
0103     /** The domain name associated with the organization; for example, `google.com`. **/
0104     [[nodiscard]] QString domain() const;
0105     /** Sets value of the domain property. **/
0106     void setDomain(const QString &value);
0107 
0108     /** The start date when the person joined the organization. **/
0109     [[nodiscard]] QDate startDate() const;
0110     /** Sets value of the startDate property. **/
0111     void setStartDate(const QDate &value);
0112 
0113     /** The person's job description at the organization. **/
0114     [[nodiscard]] QString jobDescription() const;
0115     /** Sets value of the jobDescription property. **/
0116     void setJobDescription(const QString &value);
0117 
0118     /** The end date when the person left the organization. **/
0119     [[nodiscard]] QDate endDate() const;
0120     /** Sets value of the endDate property. **/
0121     void setEndDate(const QDate &value);
0122 
0123     /** The phonetic name of the organization. **/
0124     [[nodiscard]] QString phoneticName() const;
0125     /** Sets value of the phoneticName property. **/
0126     void setPhoneticName(const QString &value);
0127 
0128     /** The person's full-time equivalent millipercent within the organization (100000 = 100%). **/
0129     [[nodiscard]] int fullTimeEquivalentMillipercent() const;
0130     /** Sets value of the fullTimeEquivalentMillipercent property. **/
0131     void setFullTimeEquivalentMillipercent(int value);
0132 
0133     [[nodiscard]] bool hasSetFullTimeEquivalentMillipercent() const;
0134 
0135 private:
0136     class Private;
0137     QSharedDataPointer<Private> d;
0138 }; // Organization
0139 
0140 } // namespace KGAPI2::People